Author: jason.greene(a)jboss.com
Date: 2007-02-21 13:48:09 -0500 (Wed, 21 Feb 2007)
New Revision: 2431
Added:
tags/jbossws-2.0.0.CR3/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/ServiceRefHandler.java
tags/jbossws-2.0.0.CR3/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/ServiceRefHandlerMBean.java
Removed:
tags/jbossws-2.0.0.CR3/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/WebServiceClientDeployer.java
tags/jbossws-2.0.0.CR3/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/WebServiceClientDeployerMBean.java
Modified:
tags/jbossws-2.0.0.CR3/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/ServiceRefMetaDataAdaptor.java
tags/jbossws-2.0.0.CR3/integration-jboss42/src/main/resources/jbossws.sar/META-INF/jboss-service-no-ejb3.xml
tags/jbossws-2.0.0.CR3/integration-jboss42/src/main/resources/jbossws.sar/META-INF/jboss-service.xml
Log:
Merge 2421 from jbossws-1.2.0 (fixes 4.2 integration)
Copied:
tags/jbossws-2.0.0.CR3/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/ServiceRefHandler.java
(from rev 2421,
branches/jbossws-1.2.0/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/ServiceRefHandler.java)
===================================================================
---
tags/jbossws-2.0.0.CR3/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/ServiceRefHandler.java
(rev 0)
+++
tags/jbossws-2.0.0.CR3/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/ServiceRefHandler.java 2007-02-21
18:48:09 UTC (rev 2431)
@@ -0,0 +1,139 @@
+/*
+ * 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.jboss42;
+
+// $Id$
+
+import java.net.URL;
+import java.util.Iterator;
+
+import javax.naming.Context;
+import javax.wsdl.Definition;
+import javax.wsdl.WSDLException;
+import javax.xml.rpc.JAXRPCException;
+
+import org.jboss.deployment.DeploymentException;
+import org.jboss.deployment.DeploymentInfo;
+import org.jboss.metadata.serviceref.ServiceRefMetaData;
+import org.jboss.system.ServiceMBeanSupport;
+import org.jboss.util.naming.Util;
+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 15-Jan-2005
+ */
+public class ServiceRefHandler extends ServiceMBeanSupport implements
ServiceRefHandlerMBean
+{
+ /**
+ * 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 di The client's deployment info
+ * @throws org.jboss.deployment.DeploymentException if it goes wrong
+ */
+ public void bindServiceRefs(Context envCtx, Iterator serviceRefs, DeploymentInfo di)
throws DeploymentException
+ {
+ 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, di);
+
+ 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);
+ Util.bind(envCtx, serviceRefName, ref);
+
+ log.debug("Webservice binding: java:comp/env/" + serviceRefName);
+ }
+ }
+ catch (Exception e)
+ {
+ throw new DeploymentException("Cannot bind webservice to client
environment", e);
+ }
+ }
+
+ private JavaWsdlMapping getJavaWsdlMapping(UnifiedServiceRefMetaData serviceRef)
+ {
+ JavaWsdlMapping javaWsdlMapping = null;
+ URL mappingURL = serviceRef.getMappingLocation();
+ if (mappingURL != null)
+ {
+ try
+ {
+ // setup the XML binding Unmarshaller
+ 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;
+ }
+}
Copied:
tags/jbossws-2.0.0.CR3/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/ServiceRefHandlerMBean.java
(from rev 2421,
branches/jbossws-1.2.0/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/ServiceRefHandlerMBean.java)
===================================================================
---
tags/jbossws-2.0.0.CR3/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/ServiceRefHandlerMBean.java
(rev 0)
+++
tags/jbossws-2.0.0.CR3/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/ServiceRefHandlerMBean.java 2007-02-21
18:48:09 UTC (rev 2431)
@@ -0,0 +1,38 @@
+/*
+* 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.jboss42;
+
+import javax.management.ObjectName;
+
+import org.jboss.system.ServiceMBean;
+import org.jboss.metadata.serviceref.ServiceRefHandler;
+import org.jboss.ws.core.utils.ObjectNameFactory;
+
+/**
+ * MBean interface.
+ * @since 19-Jan-2005
+ */
+public interface ServiceRefHandlerMBean extends ServiceRefHandler, ServiceMBean
+{
+ // default object name
+ public static final ObjectName OBJECT_NAME =
ObjectNameFactory.create("jboss.ws:service=ServiceRefHandler");
+}
Modified:
tags/jbossws-2.0.0.CR3/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/ServiceRefMetaDataAdaptor.java
===================================================================
---
tags/jbossws-2.0.0.CR3/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/ServiceRefMetaDataAdaptor.java 2007-02-21
18:28:03 UTC (rev 2430)
+++
tags/jbossws-2.0.0.CR3/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/ServiceRefMetaDataAdaptor.java 2007-02-21
18:48:09 UTC (rev 2431)
@@ -29,10 +29,10 @@
import javax.xml.namespace.QName;
-import org.jboss.webservice.metadata.serviceref.HandlerMetaData;
-import org.jboss.webservice.metadata.serviceref.InitParamMetaData;
-import org.jboss.webservice.metadata.serviceref.PortComponentRefMetaData;
-import org.jboss.webservice.metadata.serviceref.ServiceRefMetaData;
+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;
Deleted:
tags/jbossws-2.0.0.CR3/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/WebServiceClientDeployer.java
===================================================================
---
tags/jbossws-2.0.0.CR3/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/WebServiceClientDeployer.java 2007-02-21
18:28:03 UTC (rev 2430)
+++
tags/jbossws-2.0.0.CR3/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/WebServiceClientDeployer.java 2007-02-21
18:48:09 UTC (rev 2431)
@@ -1,139 +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.jboss42;
-
-// $Id$
-
-import java.net.URL;
-import java.util.Iterator;
-
-import javax.naming.Context;
-import javax.wsdl.Definition;
-import javax.wsdl.WSDLException;
-import javax.xml.rpc.JAXRPCException;
-
-import org.jboss.deployment.DeploymentException;
-import org.jboss.deployment.DeploymentInfo;
-import org.jboss.system.ServiceMBeanSupport;
-import org.jboss.util.naming.Util;
-import org.jboss.webservice.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 15-Jan-2005
- */
-public class WebServiceClientDeployer extends ServiceMBeanSupport implements
WebServiceClientDeployerMBean
-{
- /**
- * 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 di The client's deployment info
- * @throws org.jboss.deployment.DeploymentException if it goes wrong
- */
- public void setupServiceRefEnvironment(Context envCtx, Iterator serviceRefs,
DeploymentInfo di) throws DeploymentException
- {
- 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, di);
-
- 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);
- Util.bind(envCtx, serviceRefName, ref);
-
- log.debug("Webservice binding: java:comp/env/" + serviceRefName);
- }
- }
- catch (Exception e)
- {
- throw new DeploymentException("Cannot bind webservice to client
environment", e);
- }
- }
-
- private JavaWsdlMapping getJavaWsdlMapping(UnifiedServiceRefMetaData serviceRef)
- {
- JavaWsdlMapping javaWsdlMapping = null;
- URL mappingURL = serviceRef.getMappingLocation();
- if (mappingURL != null)
- {
- try
- {
- // setup the XML binding Unmarshaller
- 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;
- }
-}
Deleted:
tags/jbossws-2.0.0.CR3/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/WebServiceClientDeployerMBean.java
===================================================================
---
tags/jbossws-2.0.0.CR3/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/WebServiceClientDeployerMBean.java 2007-02-21
18:28:03 UTC (rev 2430)
+++
tags/jbossws-2.0.0.CR3/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/WebServiceClientDeployerMBean.java 2007-02-21
18:48:09 UTC (rev 2431)
@@ -1,38 +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.jboss42;
-
-import javax.management.ObjectName;
-
-import org.jboss.system.ServiceMBean;
-import org.jboss.webservice.WebServiceClientDeployment;
-import org.jboss.ws.core.utils.ObjectNameFactory;
-
-/**
- * MBean interface.
- * @since 19-Jan-2005
- */
-public interface WebServiceClientDeployerMBean extends WebServiceClientDeployment,
ServiceMBean
-{
- // default object name
- public static final ObjectName OBJECT_NAME =
ObjectNameFactory.create("jboss.ws:service=WebServiceClientDeployer");
-}
Modified:
tags/jbossws-2.0.0.CR3/integration-jboss42/src/main/resources/jbossws.sar/META-INF/jboss-service-no-ejb3.xml
===================================================================
---
tags/jbossws-2.0.0.CR3/integration-jboss42/src/main/resources/jbossws.sar/META-INF/jboss-service-no-ejb3.xml 2007-02-21
18:28:03 UTC (rev 2430)
+++
tags/jbossws-2.0.0.CR3/integration-jboss42/src/main/resources/jbossws.sar/META-INF/jboss-service-no-ejb3.xml 2007-02-21
18:48:09 UTC (rev 2431)
@@ -5,9 +5,9 @@
<server>
<!--
- A deployer service for WS clients.
+ Bind JAXRPC ServiceRefs
-->
- <mbean name="jboss.ws:service=WebServiceClientDeployer"
code="org.jboss.ws.integration.jboss42.WebServiceClientDeployer">
+ <mbean name="jboss.ws:service=ServiceRefHandler"
code="org.jboss.ws.integration.jboss42.ServiceRefHandler">
<depends>jboss:service=Naming</depends>
</mbean>
Modified:
tags/jbossws-2.0.0.CR3/integration-jboss42/src/main/resources/jbossws.sar/META-INF/jboss-service.xml
===================================================================
---
tags/jbossws-2.0.0.CR3/integration-jboss42/src/main/resources/jbossws.sar/META-INF/jboss-service.xml 2007-02-21
18:28:03 UTC (rev 2430)
+++
tags/jbossws-2.0.0.CR3/integration-jboss42/src/main/resources/jbossws.sar/META-INF/jboss-service.xml 2007-02-21
18:48:09 UTC (rev 2431)
@@ -5,9 +5,9 @@
<server>
<!--
- A deployer service for WS clients.
+ Bind JAXRPC ServiceRefs
-->
- <mbean name="jboss.ws:service=WebServiceClientDeployer"
code="org.jboss.ws.integration.jboss42.WebServiceClientDeployer">
+ <mbean name="jboss.ws:service=ServiceRefHandler"
code="org.jboss.ws.integration.jboss42.ServiceRefHandler">
<depends>jboss:service=Naming</depends>
</mbean>