Author: thomas.diesler(a)jboss.com
Date: 2007-03-09 05:54:03 -0500 (Fri, 09 Mar 2007)
New Revision: 2565
Removed:
branches/jbossws-1.2.0/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/ServiceRefHandler.java
branches/jbossws-1.2.0/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/ServiceRefHandlerMBean.java
branches/jbossws-1.2.0/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/ServiceRefMetaDataAdaptor.java
Log:
Remove redundant jboss50 serviceref classes
Deleted:
branches/jbossws-1.2.0/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/ServiceRefHandler.java
===================================================================
---
branches/jbossws-1.2.0/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/ServiceRefHandler.java 2007-03-09
10:37:29 UTC (rev 2564)
+++
branches/jbossws-1.2.0/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/ServiceRefHandler.java 2007-03-09
10:54:03 UTC (rev 2565)
@@ -1,161 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.integration.jboss50;
-
-// $Id$
-
-import java.net.URL;
-import java.util.Iterator;
-
-import javax.management.MBeanServer;
-import javax.naming.Context;
-import javax.wsdl.Definition;
-import javax.wsdl.WSDLException;
-import javax.xml.rpc.JAXRPCException;
-
-import org.jboss.deployers.spi.deployer.DeploymentUnit;
-import org.jboss.logging.Logger;
-import org.jboss.mx.util.MBeanServerLocator;
-import org.jboss.util.naming.Util;
-import org.jboss.metadata.serviceref.ServiceRefMetaData;
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.jaxrpc.client.ServiceReferenceable;
-import org.jboss.ws.core.server.UnifiedDeploymentInfo;
-import org.jboss.ws.metadata.builder.jaxrpc.JAXRPCClientDeployment;
-import org.jboss.ws.metadata.j2ee.UnifiedServiceRefMetaData;
-import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
-import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMappingFactory;
-import org.jboss.ws.tools.wsdl.WSDL11DefinitionFactory;
-
-/**
- * Binds a JAXRPC Service object in the client's ENC for every service-ref element in
the
- * deployment descriptor.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 04-Nov-2006
- */
-public class ServiceRefHandler implements ServiceRefHandlerMBean
-{
- // logging support
- private static Logger log = Logger.getLogger(ServiceRefHandler.class);
-
- /**
- * This binds a jaxrpc Service into the callers ENC for every service-ref element
- *
- * @param envCtx ENC to bind the javax.rpc.xml.Service object to
- * @param serviceRefs An iterator of the service-ref elements in the client deployment
descriptor
- * @param unit The client deployment
- */
- public void bindServiceRefs(Context envCtx, Iterator serviceRefs, DeploymentUnit
unit)
- {
- try
- {
- while (serviceRefs.hasNext())
- {
- ServiceRefMetaData serviceRef = (ServiceRefMetaData)serviceRefs.next();
- String serviceRefName = serviceRef.getServiceRefName();
-
- // Build the container independent deployment info
- UnifiedDeploymentInfo udi = new
JAXRPCClientDeployment(UnifiedDeploymentInfo.DeploymentType.JAXRPC_Client);
- DeploymentInfoAdaptor.buildDeploymentInfo(udi, unit);
-
- UnifiedServiceRefMetaData wsServiceRef =
ServiceRefMetaDataAdaptor.buildUnifiedServiceRefMetaData(udi, serviceRef);
-
- JavaWsdlMapping javaWsdlMapping = getJavaWsdlMapping(wsServiceRef);
- wsServiceRef.setJavaWsdlMapping(javaWsdlMapping);
-
- Definition wsdlDefinition = getWsdlDefinition(wsServiceRef);
- wsServiceRef.setWsdlDefinition(wsdlDefinition);
-
- ServiceReferenceable ref = new ServiceReferenceable(wsServiceRef, udi);
-
- // Do not use rebind, the binding should be unique
- Util.bind(envCtx, serviceRefName, ref);
-
- log.debug("<service-ref> bound to: java:comp/env/" +
serviceRefName);
- }
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception ex)
- {
- throw new WSException("Cannot bind webservice to client environment",
ex);
- }
- }
-
- private JavaWsdlMapping getJavaWsdlMapping(UnifiedServiceRefMetaData serviceRef)
- {
- JavaWsdlMapping javaWsdlMapping = null;
- URL mappingURL = serviceRef.getMappingLocation();
- if (mappingURL != null)
- {
- try
- {
- JavaWsdlMappingFactory mappingFactory =
JavaWsdlMappingFactory.newInstance();
- javaWsdlMapping = mappingFactory.parse(mappingURL);
- }
- catch (Exception e)
- {
- throw new JAXRPCException("Cannot unmarshal jaxrpc-mapping-file: "
+ mappingURL, e);
- }
- }
- return javaWsdlMapping;
- }
-
- private Definition getWsdlDefinition(UnifiedServiceRefMetaData serviceRef)
- {
- Definition wsdlDefinition = null;
- {
- URL wsdlOverride = serviceRef.getWsdlOverride();
- URL wsdlURL = serviceRef.getWsdlLocation();
- if (wsdlOverride == null && wsdlURL != null)
- {
- try
- {
- WSDL11DefinitionFactory factory = WSDL11DefinitionFactory.newInstance();
- wsdlDefinition = factory.parse(wsdlURL);
- }
- catch (WSDLException e)
- {
- throw new WSException("Cannot unmarshall wsdl, cause: " +
e.toString());
- }
- }
- }
- return wsdlDefinition;
- }
-
- public void create() throws Exception
- {
- MBeanServer server = MBeanServerLocator.locateJBoss();
- if (server != null)
- server.registerMBean(this, OBJECT_NAME);
- }
-
- public void destroy() throws Exception
- {
- MBeanServer server = MBeanServerLocator.locateJBoss();
- if (server != null)
- server.unregisterMBean(OBJECT_NAME);
- }
-}
Deleted:
branches/jbossws-1.2.0/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/ServiceRefHandlerMBean.java
===================================================================
---
branches/jbossws-1.2.0/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/ServiceRefHandlerMBean.java 2007-03-09
10:37:29 UTC (rev 2564)
+++
branches/jbossws-1.2.0/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/ServiceRefHandlerMBean.java 2007-03-09
10:54:03 UTC (rev 2565)
@@ -1,50 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-package org.jboss.ws.integration.jboss50;
-
-import java.util.Iterator;
-
-import javax.management.ObjectName;
-import javax.naming.Context;
-
-import org.jboss.deployers.spi.DeploymentException;
-import org.jboss.deployers.spi.deployer.DeploymentUnit;
-import org.jboss.ws.core.utils.ObjectNameFactory;
-
-/**
- * MBean interface.
- */
-public interface ServiceRefHandlerMBean
-{
- // default object name
- public static final ObjectName OBJECT_NAME =
ObjectNameFactory.create("jboss.ws:service=ServiceRefHandler");
-
- /**
- * Binds a JAXRPC Service into the callers ENC for every service-ref element
- *
- * @param envCtx ENC to bind the javax.rpc.xml.Service object to
- * @param serviceRefs An iterator of the service-ref elements in the client deployment
descriptor
- * @param unit The client's deployment unit
- * @throws DeploymentException if it goes wrong
- */
- void bindServiceRefs(Context envCtx, Iterator serviceRefs, DeploymentUnit unit);
-}
Deleted:
branches/jbossws-1.2.0/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/ServiceRefMetaDataAdaptor.java
===================================================================
---
branches/jbossws-1.2.0/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/ServiceRefMetaDataAdaptor.java 2007-03-09
10:37:29 UTC (rev 2564)
+++
branches/jbossws-1.2.0/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/ServiceRefMetaDataAdaptor.java 2007-03-09
10:54:03 UTC (rev 2565)
@@ -1,112 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.integration.jboss50;
-
-// $Id$
-
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.LinkedHashMap;
-
-import javax.xml.namespace.QName;
-
-import org.jboss.metadata.serviceref.HandlerMetaData;
-import org.jboss.metadata.serviceref.InitParamMetaData;
-import org.jboss.metadata.serviceref.PortComponentRefMetaData;
-import org.jboss.metadata.serviceref.ServiceRefMetaData;
-import org.jboss.ws.core.server.UnifiedDeploymentInfo;
-import org.jboss.ws.metadata.j2ee.UnifiedHandlerMetaData;
-import org.jboss.ws.metadata.j2ee.UnifiedPortComponentRefMetaData;
-import org.jboss.ws.metadata.j2ee.UnifiedServiceRefMetaData;
-import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerInitParam;
-
-/**
- * Build container independent service ref meta data
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 05-May-2006
- */
-public class ServiceRefMetaDataAdaptor
-{
- public static UnifiedServiceRefMetaData
buildUnifiedServiceRefMetaData(UnifiedDeploymentInfo udi, ServiceRefMetaData srmd) throws
Exception
- {
- UnifiedServiceRefMetaData usrmd = new UnifiedServiceRefMetaData();
- usrmd.setServiceRefName(srmd.getServiceRefName());
- usrmd.setServiceInterface(srmd.getServiceInterface());
- usrmd.setWsdlLocation(getWsdlLocation(udi, srmd));
- usrmd.setMappingLocation(udi.getMetaDataFileURL(srmd.getMappingFile()));
- usrmd.setServiceQName(srmd.getServiceQName());
-
- LinkedHashMap<String, UnifiedPortComponentRefMetaData> pcrefs = new
LinkedHashMap<String, UnifiedPortComponentRefMetaData>();
- for (PortComponentRefMetaData pcmd : srmd.getPortComponentRefs())
- {
- UnifiedPortComponentRefMetaData upcmd = new UnifiedPortComponentRefMetaData();
- upcmd.setServiceEndpointInterface(pcmd.getServiceEndpointInterface());
- upcmd.setPortComponentLink(pcmd.getPortComponentLink());
- upcmd.setCallProperties(pcmd.getCallProperties());
- pcrefs.put(pcmd.getServiceEndpointInterface(), upcmd);
- }
- usrmd.setPortComponentRefs(pcrefs);
-
- ArrayList<UnifiedHandlerMetaData> handlers = new
ArrayList<UnifiedHandlerMetaData>();
- for (HandlerMetaData hmd : srmd.getHandlers())
- {
- UnifiedHandlerMetaData uhmd = new UnifiedHandlerMetaData(null);
- uhmd.setHandlerName(hmd.getHandlerName());
- uhmd.setHandlerClass(hmd.getHandlerClass());
- for(QName soapHeader : hmd.getSoapHeaders())
- {
- uhmd.addSoapHeader(soapHeader);
- }
- for(String portname : hmd.getPortNames())
- {
- uhmd.addPortName(portname);
- }
- for (InitParamMetaData ipmd : hmd.getInitParams())
- {
- HandlerInitParam ip = new HandlerInitParam();
- ip.setParamName(ipmd.getParamName());
- ip.setParamValue(ipmd.getParamValue());
- uhmd.addInitParam(ip);
- }
- handlers.add(uhmd);
- }
- usrmd.setHandlers(handlers);
-
- usrmd.setConfigName(srmd.getConfigName());
- usrmd.setConfigFile(srmd.getConfigFile());
- usrmd.setWsdlOverride(srmd.getWsdlOverride());
- usrmd.setCallProperties(srmd.getCallProperties());
-
- return usrmd;
- }
-
- private static URL getWsdlLocation(UnifiedDeploymentInfo udi, ServiceRefMetaData srmd)
throws Exception
- {
- URL wsdlLocation = srmd.getWsdlOverride();
- if (wsdlLocation == null && srmd.getWsdlFile() != null)
- {
- wsdlLocation = udi.getMetaDataFileURL(srmd.getWsdlFile());
- }
- return wsdlLocation;
- }
-}