Author: thomas.diesler(a)jboss.com
Date: 2007-03-08 17:29:02 -0500 (Thu, 08 Mar 2007)
New Revision: 2557
Added:
branches/jbossws-1.2.0/jbossws-core/src/java/org/jboss/ws/core/client/
branches/jbossws-1.2.0/jbossws-core/src/java/org/jboss/ws/core/client/ServiceRefHandlerImpl.java
branches/jbossws-1.2.0/jbossws-core/src/java/org/jboss/ws/core/client/ServiceRefObjectFactory.java
branches/jbossws-1.2.0/jbossws-core/src/java/org/jboss/ws/integration/KernelLocator.java
branches/jbossws-1.2.0/jbossws-core/src/java/org/jboss/ws/integration/ServiceRefHandlerFactory.java
Removed:
branches/jbossws-1.2.0/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/WebServiceRefHandler.java
branches/jbossws-1.2.0/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/WebServiceRefHandlerMBean.java
branches/jbossws-1.2.0/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/serviceref/
branches/jbossws-1.2.0/jbossws-core/src/java/org/jboss/ws/core/server/KernelLocator.java
Modified:
branches/jbossws-1.2.0/build/ant-import/build-release.xml
branches/jbossws-1.2.0/build/version.properties
branches/jbossws-1.2.0/integration-jboss40/src/java/org/jboss/ws/integration/jboss40/DeployerInterceptor.java
branches/jbossws-1.2.0/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/DeployerInterceptor.java
branches/jbossws-1.2.0/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/AbstractDeployer.java
branches/jbossws-1.2.0/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/ServiceEndpointLifecycleDeployer.java
branches/jbossws-1.2.0/integration-jboss50/src/resources/jbossws.deployer/META-INF/jbossws-deployer-beans.xml
branches/jbossws-1.2.0/integration-tomcat/src/java/org/jboss/ws/integration/tomcat/KernelBootstrap.java
branches/jbossws-1.2.0/integration-tomcat/src/java/org/jboss/ws/integration/tomcat/TomcatServiceEndpointServlet.java
branches/jbossws-1.2.0/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/client/ServiceRefHandlerJAXRPC.java
branches/jbossws-1.2.0/jbossws-core/src/java/org/jboss/ws/core/jaxws/client/ServiceRefHandlerJAXWS.java
branches/jbossws-1.2.0/jbossws-core/src/java/org/jboss/ws/core/server/ServerConfigFactory.java
branches/jbossws-1.2.0/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointManagerFactory.java
branches/jbossws-1.2.0/jbossws-core/src/java/org/jboss/ws/extensions/eventing/mgmt/SubscriptionManagerFactory.java
branches/jbossws-1.2.0/jbossws-core/src/java/org/jboss/ws/integration/ServiceRefHandler.java
branches/jbossws-1.2.0/jbossws-core/src/java/org/jboss/ws/integration/ServiceRefMetaData.java
branches/jbossws-1.2.0/jbossws-core/src/java/org/jboss/ws/metadata/j2ee/serviceref/UnifiedHandlerMetaData.java
branches/jbossws-1.2.0/jbossws-core/src/java/org/jboss/ws/metadata/j2ee/serviceref/UnifiedPortComponentRefMetaData.java
branches/jbossws-1.2.0/jbossws-core/src/java/org/jboss/ws/metadata/j2ee/serviceref/UnifiedServiceRefMetaData.java
Log:
Provide general purpose ws integration
Modified: branches/jbossws-1.2.0/build/ant-import/build-release.xml
===================================================================
--- branches/jbossws-1.2.0/build/ant-import/build-release.xml 2007-03-08 17:07:55 UTC (rev
2556)
+++ branches/jbossws-1.2.0/build/ant-import/build-release.xml 2007-03-08 22:29:02 UTC (rev
2557)
@@ -50,6 +50,7 @@
</delete>
<copy todir="${jbossws.repository.dir}/lib"
overwrite="true">
<fileset dir="${core.output.lib.dir}">
+ <include name="jbossws-integration.jar"/>
<include name="jbossws-client.jar"/>
<include name="jbossws-core.jar"/>
<include name="jboss-jaxrpc.jar"/>
@@ -60,14 +61,12 @@
<include name="jbossws50.sar"/>
<include name="jbossws50-deployer.zip"/>
</fileset>
- <!--
<fileset dir="${jboss42.output.lib.dir}">
<include name="jbossws42.sar"/>
</fileset>
<fileset dir="${jboss40.output.lib.dir}">
<include name="jbossws40.sar"/>
</fileset>
- -->
</copy>
<copy tofile="${jbossws.repository.dir}/component-info.xml"
file="${etc.dir}/jbossws-component-info.xml" filtering="true"
overwrite="true">
<filterset>
@@ -75,7 +74,7 @@
</filterset>
</copy>
- <!-- jbossws14
+ <!-- jbossws14 -->
<property name="jbossws14.repository.dir"
value="${jboss.local.repository}/jboss/jbossws14/${repository.id}"/>
<mkdir dir="${jbossws14.repository.dir}/lib"/>
<delete>
@@ -97,7 +96,6 @@
<filtersfile file="${build.dir}/version.properties"/>
</filterset>
</copy>
- -->
</target>
Modified: branches/jbossws-1.2.0/build/version.properties
===================================================================
--- branches/jbossws-1.2.0/build/version.properties 2007-03-08 17:07:55 UTC (rev 2556)
+++ branches/jbossws-1.2.0/build/version.properties 2007-03-08 22:29:02 UTC (rev 2557)
@@ -5,8 +5,8 @@
specification.vendor=JBoss (
http://www.jboss.org)
specification.version=jbossws-1.2
-version.id=2.0.0.DEV
-repository.id=snapshot
+version.id=1.2.0.SP1
+repository.id=1.2.0.SP1
implementation.title=JBoss Web Services (JBossWS)
implementation.url=http://www.jboss.org/products/jbossws
Modified:
branches/jbossws-1.2.0/integration-jboss40/src/java/org/jboss/ws/integration/jboss40/DeployerInterceptor.java
===================================================================
---
branches/jbossws-1.2.0/integration-jboss40/src/java/org/jboss/ws/integration/jboss40/DeployerInterceptor.java 2007-03-08
17:07:55 UTC (rev 2556)
+++
branches/jbossws-1.2.0/integration-jboss40/src/java/org/jboss/ws/integration/jboss40/DeployerInterceptor.java 2007-03-08
22:29:02 UTC (rev 2557)
@@ -33,9 +33,9 @@
import org.jboss.mx.server.Invocation;
import org.jboss.mx.util.MBeanProxy;
import org.jboss.ws.core.server.AbstractServiceEndpointPublisher;
-import org.jboss.ws.core.server.KernelLocator;
import org.jboss.ws.core.server.ServiceEndpointDeployer;
import org.jboss.ws.core.server.UnifiedDeploymentInfo;
+import org.jboss.ws.integration.KernelLocator;
/**
* A deployer service that manages WS4EE compliant Web Services
Modified:
branches/jbossws-1.2.0/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/DeployerInterceptor.java
===================================================================
---
branches/jbossws-1.2.0/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/DeployerInterceptor.java 2007-03-08
17:07:55 UTC (rev 2556)
+++
branches/jbossws-1.2.0/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/DeployerInterceptor.java 2007-03-08
22:29:02 UTC (rev 2557)
@@ -33,9 +33,9 @@
import org.jboss.mx.server.Invocation;
import org.jboss.mx.util.MBeanProxy;
import org.jboss.ws.core.server.AbstractServiceEndpointPublisher;
-import org.jboss.ws.core.server.KernelLocator;
import org.jboss.ws.core.server.ServiceEndpointDeployer;
import org.jboss.ws.core.server.UnifiedDeploymentInfo;
+import org.jboss.ws.integration.KernelLocator;
/**
* A deployer service that manages WS4EE compliant Web Services
Deleted:
branches/jbossws-1.2.0/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/WebServiceRefHandler.java
===================================================================
---
branches/jbossws-1.2.0/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/WebServiceRefHandler.java 2007-03-08
17:07:55 UTC (rev 2556)
+++
branches/jbossws-1.2.0/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/WebServiceRefHandler.java 2007-03-08
22:29:02 UTC (rev 2557)
@@ -1,87 +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.io.ByteArrayOutputStream;
-import java.lang.reflect.AnnotatedElement;
-import java.net.URL;
-
-import javax.management.MBeanServer;
-import javax.naming.Context;
-import javax.naming.NamingException;
-import javax.xml.transform.Source;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.stream.StreamResult;
-
-import org.jboss.mx.util.MBeanServerLocator;
-import org.jboss.ws.core.jaxws.client.ServiceRefHandlerJAXWS;
-import org.jboss.ws.metadata.j2ee.serviceref.UnifiedServiceRefMetaData;
-import org.jboss.ws.metadata.j2ee.serviceref.ServiceRefObjectFactory;
-
-/**
- * Binds a JAXWS @WebServiceRef object in the client's ENC
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 17-Jan-2007
- */
-public class WebServiceRefHandler implements WebServiceRefHandlerMBean
-{
- public void setupWebServiceRef(Context encCtx, String encName, AnnotatedElement
anElement, URL rootURL, Source metadata) throws NamingException
- {
- String xmlFragment = null;
- try
- {
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- StreamResult result = new StreamResult(baos);
- TransformerFactory tf = TransformerFactory.newInstance();
- tf.newTransformer().transform(metadata, result);
- xmlFragment = new String(baos.toByteArray());
- }
- catch (Exception ex)
- {
- throw new IllegalStateException("Cannot transform <service-ref>
metadata", ex);
- }
-
- ServiceRefObjectFactory factory = ServiceRefObjectFactory.newInstance();
- UnifiedServiceRefMetaData serviceRef = factory.parse(xmlFragment);
- serviceRef.setVfsRoot(new URLLoaderAdapter(rootURL));
-
- ServiceRefHandlerJAXWS handler = new ServiceRefHandlerJAXWS();
- handler.setupServiceRef(encCtx, encName, anElement, serviceRef);
- }
-
- 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-jboss42/src/java/org/jboss/ws/integration/jboss42/WebServiceRefHandlerMBean.java
===================================================================
---
branches/jbossws-1.2.0/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/WebServiceRefHandlerMBean.java 2007-03-08
17:07:55 UTC (rev 2556)
+++
branches/jbossws-1.2.0/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/WebServiceRefHandlerMBean.java 2007-03-08
22:29:02 UTC (rev 2557)
@@ -1,46 +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 java.lang.reflect.AnnotatedElement;
-import java.net.URL;
-
-import javax.management.ObjectName;
-import javax.naming.Context;
-import javax.naming.NamingException;
-import javax.xml.transform.Source;
-
-import org.jboss.ws.core.utils.ObjectNameFactory;
-
-/**
- * MBean interface.
- */
-public interface WebServiceRefHandlerMBean
-{
- // default object name
- public static final ObjectName OBJECT_NAME =
ObjectNameFactory.create("jboss.ws:service=WebServiceRefHandler");
-
- /** Binds a JAXWS WebServiceRef into the callers ENC
- */
- void setupWebServiceRef(Context encCtx, String encName, AnnotatedElement enElement,
URL rootURL, Source metadata) throws NamingException;
-}
Modified:
branches/jbossws-1.2.0/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/AbstractDeployer.java
===================================================================
---
branches/jbossws-1.2.0/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/AbstractDeployer.java 2007-03-08
17:07:55 UTC (rev 2556)
+++
branches/jbossws-1.2.0/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/AbstractDeployer.java 2007-03-08
22:29:02 UTC (rev 2557)
@@ -29,10 +29,10 @@
import org.jboss.kernel.spi.registry.KernelRegistry;
import org.jboss.kernel.spi.registry.KernelRegistryEntry;
import org.jboss.ws.core.server.AbstractServiceEndpointPublisher;
-import org.jboss.ws.core.server.KernelLocator;
import org.jboss.ws.core.server.ServiceEndpointDeployer;
import org.jboss.ws.core.server.UnifiedDeploymentInfo;
import org.jboss.ws.core.server.UnifiedDeploymentInfo.DeploymentType;
+import org.jboss.ws.integration.KernelLocator;
/**
* An abstract web service deployer.
Modified:
branches/jbossws-1.2.0/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/ServiceEndpointLifecycleDeployer.java
===================================================================
---
branches/jbossws-1.2.0/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/ServiceEndpointLifecycleDeployer.java 2007-03-08
17:07:55 UTC (rev 2556)
+++
branches/jbossws-1.2.0/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/ServiceEndpointLifecycleDeployer.java 2007-03-08
22:29:02 UTC (rev 2557)
@@ -31,9 +31,9 @@
import org.jboss.kernel.spi.registry.KernelRegistry;
import org.jboss.kernel.spi.registry.KernelRegistryEntry;
import org.jboss.metadata.WebMetaData;
-import org.jboss.ws.core.server.KernelLocator;
import org.jboss.ws.core.server.ServiceEndpointDeployer;
import org.jboss.ws.core.server.UnifiedDeploymentInfo;
+import org.jboss.ws.integration.KernelLocator;
/**
* A deployer that starts and stops web service deployments
Modified:
branches/jbossws-1.2.0/integration-jboss50/src/resources/jbossws.deployer/META-INF/jbossws-deployer-beans.xml
===================================================================
---
branches/jbossws-1.2.0/integration-jboss50/src/resources/jbossws.deployer/META-INF/jbossws-deployer-beans.xml 2007-03-08
17:07:55 UTC (rev 2556)
+++
branches/jbossws-1.2.0/integration-jboss50/src/resources/jbossws.deployer/META-INF/jbossws-deployer-beans.xml 2007-03-08
22:29:02 UTC (rev 2557)
@@ -2,7 +2,7 @@
<deployment xmlns="urn:jboss:bean-deployer:2.0">
- <bean name="KernelLocator"
class="org.jboss.ws.core.server.KernelLocator">
+ <bean name="KernelLocator"
class="org.jboss.ws.integration.KernelLocator">
<property name="kernel"><inject
bean="jboss.kernel:service=Kernel"/></property>
</bean>
@@ -48,7 +48,7 @@
</bean>
<!-- Bind Service objects in client environment context -->
- <bean name="ServiceRefHandler"
class="org.jboss.ws.integration.jboss50.ServiceRefHandler"/>
+ <bean name="ServiceRefHandler"
class="org.jboss.ws.core.client.ServiceRefHandlerImpl"/>
<!-- A subscription manager for WS-Eventing -->
<bean name="SubscriptionManager"
class="org.jboss.ws.extensions.eventing.mgmt.SubscriptionManager"/>
Modified:
branches/jbossws-1.2.0/integration-tomcat/src/java/org/jboss/ws/integration/tomcat/KernelBootstrap.java
===================================================================
---
branches/jbossws-1.2.0/integration-tomcat/src/java/org/jboss/ws/integration/tomcat/KernelBootstrap.java 2007-03-08
17:07:55 UTC (rev 2556)
+++
branches/jbossws-1.2.0/integration-tomcat/src/java/org/jboss/ws/integration/tomcat/KernelBootstrap.java 2007-03-08
22:29:02 UTC (rev 2557)
@@ -28,7 +28,7 @@
import org.jboss.kernel.plugins.bootstrap.basic.BasicBootstrap;
import org.jboss.kernel.plugins.deployment.xml.BeanXMLDeployer;
import org.jboss.logging.Logger;
-import org.jboss.ws.core.server.KernelLocator;
+import org.jboss.ws.integration.KernelLocator;
/**
* Bootstrap the microkernel in Tomcat
Modified:
branches/jbossws-1.2.0/integration-tomcat/src/java/org/jboss/ws/integration/tomcat/TomcatServiceEndpointServlet.java
===================================================================
---
branches/jbossws-1.2.0/integration-tomcat/src/java/org/jboss/ws/integration/tomcat/TomcatServiceEndpointServlet.java 2007-03-08
17:07:55 UTC (rev 2556)
+++
branches/jbossws-1.2.0/integration-tomcat/src/java/org/jboss/ws/integration/tomcat/TomcatServiceEndpointServlet.java 2007-03-08
22:29:02 UTC (rev 2557)
@@ -39,9 +39,9 @@
import org.jboss.ws.WSException;
import org.jboss.ws.core.server.AbstractServiceEndpointServlet;
import org.jboss.ws.core.server.JAXWSDeployment;
-import org.jboss.ws.core.server.KernelLocator;
import org.jboss.ws.core.server.ServiceEndpointDeployer;
import org.jboss.ws.core.server.UnifiedDeploymentInfo;
+import org.jboss.ws.integration.KernelLocator;
import org.jboss.ws.integration.UnifiedVirtualFile;
import org.jboss.ws.metadata.builder.jaxrpc.JAXRPCDeployment;
import org.jboss.ws.metadata.umdm.ResourceLoaderAdapter;
Added:
branches/jbossws-1.2.0/jbossws-core/src/java/org/jboss/ws/core/client/ServiceRefHandlerImpl.java
===================================================================
---
branches/jbossws-1.2.0/jbossws-core/src/java/org/jboss/ws/core/client/ServiceRefHandlerImpl.java
(rev 0)
+++
branches/jbossws-1.2.0/jbossws-core/src/java/org/jboss/ws/core/client/ServiceRefHandlerImpl.java 2007-03-08
22:29:02 UTC (rev 2557)
@@ -0,0 +1,117 @@
+/*
+ * 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.core.client;
+
+// $Id$
+
+import java.lang.reflect.AnnotatedElement;
+import java.util.Collection;
+
+import javax.naming.Context;
+import javax.naming.NamingException;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.core.jaxrpc.client.ServiceRefHandlerJAXRPC;
+import org.jboss.ws.core.jaxws.client.ServiceRefHandlerJAXWS;
+import org.jboss.ws.integration.ServiceRefElement;
+import org.jboss.ws.integration.ServiceRefHandler;
+import org.jboss.ws.integration.ServiceRefMetaData;
+import org.jboss.ws.integration.UnifiedVirtualFile;
+import org.jboss.ws.metadata.j2ee.serviceref.UnifiedServiceRefMetaData;
+import org.jboss.xb.binding.UnmarshallingContext;
+import org.xml.sax.Attributes;
+
+/**
+ * Bind service refs 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 ServiceRefHandlerImpl implements ServiceRefHandler
+{
+ // logging support
+ private static Logger log = Logger.getLogger(ServiceRefHandlerImpl.class);
+
+ private ServiceRefObjectFactory objectFactory = new ServiceRefObjectFactory();
+
+ public ServiceRefMetaData newMetaData()
+ {
+ return new UnifiedServiceRefMetaData();
+ }
+
+ public void setupServiceRefs(Context envCtx, UnifiedVirtualFile vfsRoot,
Collection<ServiceRefMetaData> serviceRefs) throws NamingException
+ {
+ for (ServiceRefMetaData sref : serviceRefs)
+ {
+ String encName = sref.getServiceRefName();
+ setupServiceRef(envCtx, encName, vfsRoot, sref);
+ }
+ }
+
+ public void setupServiceRef(Context encCtx, String encName, UnifiedVirtualFile
vfsRoot, ServiceRefMetaData sref) throws NamingException
+ {
+ if (sref.isProcessed())
+ {
+ log.warn("Attempt to rebind service-ref: " + sref);
+ return;
+ }
+
+ UnifiedServiceRefMetaData serviceRef = (UnifiedServiceRefMetaData)sref;
+ serviceRef.setVfsRoot(vfsRoot);
+ try
+ {
+ if (isServiceRefJaxRpc(serviceRef))
+ {
+ ServiceRefHandlerJAXRPC handler = new ServiceRefHandlerJAXRPC();
+ handler.setupServiceRef(encCtx, encName, serviceRef);
+ }
+ else
+ {
+ AnnotatedElement anElement = sref.getAnnotatedElement();
+ ServiceRefHandlerJAXWS handler = new ServiceRefHandlerJAXWS();
+ handler.setupServiceRef(encCtx, encName, anElement, serviceRef);
+ }
+ }
+ finally
+ {
+ sref.setProcessed(true);
+ }
+ }
+
+ public Object newChild(ServiceRefElement ref, UnmarshallingContext navigator, String
namespaceURI, String localName, Attributes attrs)
+ {
+ return objectFactory.newChild(ref, navigator, namespaceURI, localName, attrs);
+ }
+
+ public void setValue(ServiceRefElement ref, UnmarshallingContext navigator, String
namespaceURI, String localName, String value)
+ {
+ objectFactory.setValue(ref, navigator, namespaceURI, localName, value);
+ }
+
+ private boolean isServiceRefJaxRpc(UnifiedServiceRefMetaData serviceRef)
+ {
+ // The <service-interface> is a required element
+ // for JAXRPC and not defined for JAXWS
+ return serviceRef.getServiceInterface() != null;
+ }
+}
Property changes on:
branches/jbossws-1.2.0/jbossws-core/src/java/org/jboss/ws/core/client/ServiceRefHandlerImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
branches/jbossws-1.2.0/jbossws-core/src/java/org/jboss/ws/core/client/ServiceRefObjectFactory.java
===================================================================
---
branches/jbossws-1.2.0/jbossws-core/src/java/org/jboss/ws/core/client/ServiceRefObjectFactory.java
(rev 0)
+++
branches/jbossws-1.2.0/jbossws-core/src/java/org/jboss/ws/core/client/ServiceRefObjectFactory.java 2007-03-08
22:29:02 UTC (rev 2557)
@@ -0,0 +1,298 @@
+/*
+ * 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.core.client;
+
+// $Id$
+
+import javax.xml.namespace.QName;
+
+import org.jboss.ws.integration.ServiceRefElement;
+import org.jboss.ws.metadata.j2ee.serviceref.UnifiedCallPropertyMetaData;
+import org.jboss.ws.metadata.j2ee.serviceref.UnifiedHandlerChainMetaData;
+import org.jboss.ws.metadata.j2ee.serviceref.UnifiedHandlerChainsMetaData;
+import org.jboss.ws.metadata.j2ee.serviceref.UnifiedHandlerMetaData;
+import org.jboss.ws.metadata.j2ee.serviceref.UnifiedInitParamMetaData;
+import org.jboss.ws.metadata.j2ee.serviceref.UnifiedPortComponentRefMetaData;
+import org.jboss.ws.metadata.j2ee.serviceref.UnifiedServiceRefMetaData;
+import org.jboss.ws.metadata.j2ee.serviceref.UnifiedStubPropertyMetaData;
+import org.jboss.xb.binding.UnmarshallingContext;
+import org.xml.sax.Attributes;
+
+/**
+ * A object model factory for <service-ref>
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ */
+public class ServiceRefObjectFactory
+{
+ public Object newChild(ServiceRefElement ref, UnmarshallingContext navigator, String
namespaceURI, String localName, Attributes attrs)
+ {
+ Object child = null;
+ if (ref instanceof UnifiedHandlerChainsMetaData)
+ child = newChild((UnifiedHandlerChainsMetaData)ref, navigator, namespaceURI,
localName, attrs);
+ else if (ref instanceof UnifiedHandlerMetaData)
+ child = newChild((UnifiedHandlerMetaData)ref, navigator, namespaceURI,
localName, attrs);
+ else if (ref instanceof UnifiedPortComponentRefMetaData)
+ child = newChild((UnifiedPortComponentRefMetaData)ref, navigator, namespaceURI,
localName, attrs);
+ else if (ref instanceof UnifiedServiceRefMetaData)
+ child = newChild((UnifiedServiceRefMetaData)ref, navigator, namespaceURI,
localName, attrs);
+ return child;
+ }
+
+ public void setValue(ServiceRefElement ref, UnmarshallingContext navigator, String
namespaceURI, String localName, String value)
+ {
+ if (ref instanceof UnifiedCallPropertyMetaData)
+ setValue((UnifiedCallPropertyMetaData)ref, navigator, namespaceURI, localName,
value);
+ else if (ref instanceof UnifiedHandlerChainMetaData)
+ setValue((UnifiedHandlerChainMetaData)ref, navigator, namespaceURI, localName,
value);
+ else if (ref instanceof UnifiedHandlerMetaData)
+ setValue((UnifiedHandlerMetaData)ref, navigator, namespaceURI, localName,
value);
+ else if (ref instanceof UnifiedInitParamMetaData)
+ setValue((UnifiedInitParamMetaData)ref, navigator, namespaceURI, localName,
value);
+ else if (ref instanceof UnifiedPortComponentRefMetaData)
+ setValue((UnifiedPortComponentRefMetaData)ref, navigator, namespaceURI,
localName, value);
+ else if (ref instanceof UnifiedServiceRefMetaData)
+ setValue((UnifiedServiceRefMetaData)ref, navigator, namespaceURI, localName,
value);
+ else if (ref instanceof UnifiedStubPropertyMetaData)
+ setValue((UnifiedStubPropertyMetaData)ref, navigator, namespaceURI, localName,
value);
+
+ }
+
+ private void setValue(UnifiedServiceRefMetaData ref, UnmarshallingContext navigator,
String namespaceURI, String localName, String value)
+ {
+ /* Standard properties */
+ if (localName.equals("service-ref-name"))
+ {
+ ref.setServiceRefName(value);
+ }
+ else if (localName.equals("service-interface"))
+ {
+ ref.setServiceInterface(value);
+ }
+ else if (localName.equals("service-ref-type"))
+ {
+ ref.setServiceRefType(value);
+ }
+ else if (localName.equals("wsdl-file"))
+ {
+ ref.setWsdlFile(value);
+ }
+ else if (localName.equals("jaxrpc-mapping-file"))
+ {
+ ref.setMappingFile(value);
+ }
+ else if (localName.equals("service-qname"))
+ {
+ ref.setServiceQName(QName.valueOf(value));
+ }
+
+ /* JBoss properties */
+ else if (localName.equals("service-impl-class"))
+ {
+ ref.setServiceImplClass(value);
+ }
+ else if (localName.equals("config-name"))
+ {
+ ref.setConfigName(value);
+ }
+ else if (localName.equals("config-file"))
+ {
+ ref.setConfigFile(value);
+ }
+ else if (localName.equals("wsdl-override"))
+ {
+ ref.setWsdlOverride(value);
+ }
+ else if (localName.equals("handler-chain"))
+ {
+ ref.setHandlerChain(value);
+ }
+ }
+
+ private Object newChild(UnifiedServiceRefMetaData ref, UnmarshallingContext navigator,
String namespaceURI, String localName, Attributes attrs)
+ {
+ Object child = null;
+ if (localName.equals("port-component-ref"))
+ {
+ child = new UnifiedPortComponentRefMetaData(ref);
+ ref.addPortComponentRef((UnifiedPortComponentRefMetaData)child);
+ }
+ else if (localName.equals("handler"))
+ {
+ child = new UnifiedHandlerMetaData();
+ ref.addHandler((UnifiedHandlerMetaData)child);
+ }
+ else if (localName.equals("handler-chains"))
+ {
+ child = new UnifiedHandlerChainsMetaData();
+ ref.setHandlerChains((UnifiedHandlerChainsMetaData)child);
+ }
+ else if (localName.equals("call-property"))
+ {
+ child = new UnifiedCallPropertyMetaData();
+ ref.addCallProperty((UnifiedCallPropertyMetaData)child);
+ }
+ return child;
+ }
+
+ private Object newChild(UnifiedHandlerChainsMetaData ref, UnmarshallingContext
navigator, String namespaceURI, String localName, Attributes attrs)
+ {
+ Object child = null;
+ if (localName.equals("handler-chain"))
+ {
+ child = new UnifiedHandlerChainMetaData();
+ ref.addHandlerChain((UnifiedHandlerChainMetaData)child);
+ }
+ return child;
+ }
+
+ private void setValue(UnifiedPortComponentRefMetaData ref, UnmarshallingContext
navigator, String namespaceURI, String localName, String value)
+ {
+ if (localName.equals("service-endpoint-interface"))
+ {
+ ref.setServiceEndpointInterface(value);
+ }
+ else if (localName.equals("enable-mtom"))
+ {
+ ref.setEnableMTOM(Boolean.valueOf(value));
+ }
+ else if (localName.equals("port-component-link"))
+ {
+ ref.setPortComponentLink(value);
+ }
+ else if (localName.equals("port-qname"))
+ {
+ ref.setPortQName(QName.valueOf(value));
+ }
+ else if (localName.equals("config-name"))
+ {
+ ref.setConfigName(value);
+ }
+ else if (localName.equals("config-file"))
+ {
+ ref.setConfigFile(value);
+ }
+ }
+
+ private Object newChild(UnifiedPortComponentRefMetaData ref, UnmarshallingContext
navigator, String namespaceURI, String localName, Attributes attrs)
+ {
+ Object child = null;
+ if (localName.equals("call-property"))
+ {
+ child = new UnifiedCallPropertyMetaData();
+ ref.addCallProperty((UnifiedCallPropertyMetaData)child);
+ }
+ if (localName.equals("stub-property"))
+ {
+ child = new UnifiedStubPropertyMetaData();
+ ref.addStubProperty((UnifiedStubPropertyMetaData)child);
+ }
+ return child;
+ }
+
+ private void setValue(UnifiedHandlerChainMetaData ref, UnmarshallingContext navigator,
String namespaceURI, String localName, String value)
+ {
+ if (localName.equals("service-name-pattern"))
+ {
+ ref.setServiceNamePattern(QName.valueOf(value));
+ }
+ else if (localName.equals("port-name-pattern"))
+ {
+ ref.setPortNamePattern(QName.valueOf(value));
+ }
+ else if (localName.equals("protocol-binding"))
+ {
+ ref.setProtocolBindings(value);
+ }
+ }
+
+ private void setValue(UnifiedHandlerMetaData ref, UnmarshallingContext navigator,
String namespaceURI, String localName, String value)
+ {
+ if (localName.equals("handler-name"))
+ {
+ ref.setHandlerName(value);
+ }
+ else if (localName.equals("handler-class"))
+ {
+ ref.setHandlerClass(value);
+ }
+ else if (localName.equals("soap-header"))
+ {
+ ref.addSoapHeader(navigator.resolveQName(value));
+ }
+ else if (localName.equals("soap-role"))
+ {
+ ref.addSoapRole(value);
+ }
+ else if (localName.equals("port-name"))
+ {
+ ref.addPortName(value);
+ }
+ }
+
+ private Object newChild(UnifiedHandlerMetaData ref, UnmarshallingContext navigator,
String namespaceURI, String localName, Attributes attrs)
+ {
+ Object child = null;
+ if (localName.equals("init-param"))
+ {
+ child = new UnifiedInitParamMetaData();
+ ref.addInitParam((UnifiedInitParamMetaData)child);
+ }
+ return child;
+ }
+
+ private void setValue(UnifiedInitParamMetaData ref, UnmarshallingContext navigator,
String namespaceURI, String localName, String value)
+ {
+ if (localName.equals("param-name"))
+ {
+ ref.setParamName(value);
+ }
+ else if (localName.equals("param-value"))
+ {
+ ref.setParamValue(value);
+ }
+ }
+
+ private void setValue(UnifiedCallPropertyMetaData ref, UnmarshallingContext navigator,
String namespaceURI, String localName, String value)
+ {
+ if (localName.equals("prop-name"))
+ {
+ ref.setPropName(value);
+ }
+ else if (localName.equals("prop-value"))
+ {
+ ref.setPropValue(value);
+ }
+ }
+
+ private void setValue(UnifiedStubPropertyMetaData ref, UnmarshallingContext navigator,
String namespaceURI, String localName, String value)
+ {
+ if (localName.equals("prop-name"))
+ {
+ ref.setPropName(value);
+ }
+ else if (localName.equals("prop-value"))
+ {
+ ref.setPropValue(value);
+ }
+ }
+}
Property changes on:
branches/jbossws-1.2.0/jbossws-core/src/java/org/jboss/ws/core/client/ServiceRefObjectFactory.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified:
branches/jbossws-1.2.0/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/client/ServiceRefHandlerJAXRPC.java
===================================================================
---
branches/jbossws-1.2.0/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/client/ServiceRefHandlerJAXRPC.java 2007-03-08
17:07:55 UTC (rev 2556)
+++
branches/jbossws-1.2.0/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/client/ServiceRefHandlerJAXRPC.java 2007-03-08
22:29:02 UTC (rev 2557)
@@ -47,12 +47,11 @@
*/
public void setupServiceRef(Context encCtx, String encName, UnifiedServiceRefMetaData
serviceRef) throws NamingException
{
- String serviceRefName = serviceRef.getServiceRefName();
- ServiceReferenceable ref = new ServiceReferenceable(serviceRef);
+ String externalName = encCtx.getNameInNamespace() + "/" + encName;
+ log.info("setupServiceRef [jndi=" + externalName + "]");
// Do not use rebind, the binding should be unique
+ ServiceReferenceable ref = new ServiceReferenceable(serviceRef);
Util.bind(encCtx, encName, ref);
-
- log.debug("<service-ref> bound to: java:comp/env/" +
serviceRefName);
}
}
Modified:
branches/jbossws-1.2.0/jbossws-core/src/java/org/jboss/ws/core/jaxws/client/ServiceRefHandlerJAXWS.java
===================================================================
---
branches/jbossws-1.2.0/jbossws-core/src/java/org/jboss/ws/core/jaxws/client/ServiceRefHandlerJAXWS.java 2007-03-08
17:07:55 UTC (rev 2556)
+++
branches/jbossws-1.2.0/jbossws-core/src/java/org/jboss/ws/core/jaxws/client/ServiceRefHandlerJAXWS.java 2007-03-08
22:29:02 UTC (rev 2557)
@@ -99,9 +99,9 @@
else if (anElement instanceof Method)
targetClass = ((Method)anElement).getParameterTypes()[0];
- String externalName = encCtx.getNameInNamespace() + "/" + encName;
String targetClassName = (targetClass != null ? targetClass.getName() : null);
- log.debug("setupWebServiceRef [jndi=" + externalName +
",target=" + targetClassName + "]");
+ String externalName = encCtx.getNameInNamespace() + "/" + encName;
+ log.info("setupServiceRef [jndi=" + externalName + ",target=" +
targetClassName + "]");
String serviceImplClass = null;
@@ -164,7 +164,5 @@
// Do not use rebind, the binding should be unique
// [JBWS-1499] - Revisit WebServiceRefHandler JNDI rebind
Util.rebind(encCtx, encName, new ServiceReferenceable(serviceImplClass,
targetClassName, serviceRef));
-
- log.debug("<service-ref> bound to: java:comp/env/" + encName);
}
}
Deleted:
branches/jbossws-1.2.0/jbossws-core/src/java/org/jboss/ws/core/server/KernelLocator.java
===================================================================
---
branches/jbossws-1.2.0/jbossws-core/src/java/org/jboss/ws/core/server/KernelLocator.java 2007-03-08
17:07:55 UTC (rev 2556)
+++
branches/jbossws-1.2.0/jbossws-core/src/java/org/jboss/ws/core/server/KernelLocator.java 2007-03-08
22:29:02 UTC (rev 2557)
@@ -1,47 +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.core.server;
-
-//$Id: WebServiceDeployer.java 312 2006-05-11 10:49:22Z thomas.diesler(a)jboss.com $
-
-import org.jboss.kernel.Kernel;
-
-/**
- * Locate the single instance of the kernel
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 12-May-2006
- */
-public class KernelLocator
-{
- private static Kernel kernel;
-
- public static Kernel getKernel()
- {
- return KernelLocator.kernel;
- }
-
- public void setKernel(Kernel kernel)
- {
- KernelLocator.kernel = kernel;
- }
-}
Modified:
branches/jbossws-1.2.0/jbossws-core/src/java/org/jboss/ws/core/server/ServerConfigFactory.java
===================================================================
---
branches/jbossws-1.2.0/jbossws-core/src/java/org/jboss/ws/core/server/ServerConfigFactory.java 2007-03-08
17:07:55 UTC (rev 2556)
+++
branches/jbossws-1.2.0/jbossws-core/src/java/org/jboss/ws/core/server/ServerConfigFactory.java 2007-03-08
22:29:02 UTC (rev 2557)
@@ -23,6 +23,7 @@
import org.jboss.kernel.spi.registry.KernelRegistry;
import org.jboss.logging.Logger;
+import org.jboss.ws.integration.KernelLocator;
// $Id: ServiceEndpointManagerFactory.java 293 2006-05-08 16:31:50Z
thomas.diesler(a)jboss.com $
Modified:
branches/jbossws-1.2.0/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointManagerFactory.java
===================================================================
---
branches/jbossws-1.2.0/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointManagerFactory.java 2007-03-08
17:07:55 UTC (rev 2556)
+++
branches/jbossws-1.2.0/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointManagerFactory.java 2007-03-08
22:29:02 UTC (rev 2557)
@@ -23,6 +23,7 @@
import org.jboss.kernel.spi.registry.KernelRegistry;
import org.jboss.kernel.spi.registry.KernelRegistryEntry;
+import org.jboss.ws.integration.KernelLocator;
// $Id$
Modified:
branches/jbossws-1.2.0/jbossws-core/src/java/org/jboss/ws/extensions/eventing/mgmt/SubscriptionManagerFactory.java
===================================================================
---
branches/jbossws-1.2.0/jbossws-core/src/java/org/jboss/ws/extensions/eventing/mgmt/SubscriptionManagerFactory.java 2007-03-08
17:07:55 UTC (rev 2556)
+++
branches/jbossws-1.2.0/jbossws-core/src/java/org/jboss/ws/extensions/eventing/mgmt/SubscriptionManagerFactory.java 2007-03-08
22:29:02 UTC (rev 2557)
@@ -2,7 +2,7 @@
import org.jboss.kernel.spi.registry.KernelRegistry;
import org.jboss.kernel.spi.registry.KernelRegistryEntry;
-import org.jboss.ws.core.server.KernelLocator;
+import org.jboss.ws.integration.KernelLocator;
/**
* @author Heiko Braun, <heiko(a)openj.net>
Copied:
branches/jbossws-1.2.0/jbossws-core/src/java/org/jboss/ws/integration/KernelLocator.java
(from rev 2555,
branches/jbossws-1.2.0/jbossws-core/src/java/org/jboss/ws/core/server/KernelLocator.java)
===================================================================
---
branches/jbossws-1.2.0/jbossws-core/src/java/org/jboss/ws/integration/KernelLocator.java
(rev 0)
+++
branches/jbossws-1.2.0/jbossws-core/src/java/org/jboss/ws/integration/KernelLocator.java 2007-03-08
22:29:02 UTC (rev 2557)
@@ -0,0 +1,47 @@
+/*
+ * 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;
+
+//$Id: WebServiceDeployer.java 312 2006-05-11 10:49:22Z thomas.diesler(a)jboss.com $
+
+import org.jboss.kernel.Kernel;
+
+/**
+ * Locate the single instance of the kernel
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 12-May-2006
+ */
+public class KernelLocator
+{
+ private static Kernel kernel;
+
+ public static Kernel getKernel()
+ {
+ return KernelLocator.kernel;
+ }
+
+ public void setKernel(Kernel kernel)
+ {
+ KernelLocator.kernel = kernel;
+ }
+}
Modified:
branches/jbossws-1.2.0/jbossws-core/src/java/org/jboss/ws/integration/ServiceRefHandler.java
===================================================================
---
branches/jbossws-1.2.0/jbossws-core/src/java/org/jboss/ws/integration/ServiceRefHandler.java 2007-03-08
17:07:55 UTC (rev 2556)
+++
branches/jbossws-1.2.0/jbossws-core/src/java/org/jboss/ws/integration/ServiceRefHandler.java 2007-03-08
22:29:02 UTC (rev 2557)
@@ -39,6 +39,8 @@
*/
public interface ServiceRefHandler
{
+ String BEAN_NAME = "ServiceRefHandler";
+
ServiceRefMetaData newMetaData();
Object newChild(ServiceRefElement ref, UnmarshallingContext navigator, String
namespaceURI, String localName, Attributes attrs);
Added:
branches/jbossws-1.2.0/jbossws-core/src/java/org/jboss/ws/integration/ServiceRefHandlerFactory.java
===================================================================
---
branches/jbossws-1.2.0/jbossws-core/src/java/org/jboss/ws/integration/ServiceRefHandlerFactory.java
(rev 0)
+++
branches/jbossws-1.2.0/jbossws-core/src/java/org/jboss/ws/integration/ServiceRefHandlerFactory.java 2007-03-08
22:29:02 UTC (rev 2557)
@@ -0,0 +1,56 @@
+/*
+ * 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;
+
+import org.jboss.kernel.spi.registry.KernelRegistry;
+import org.jboss.kernel.spi.registry.KernelRegistryEntry;
+import org.jboss.ws.integration.KernelLocator;
+
+// $Id$
+
+/**
+ * Factory to the singleton instance of the ServiceEndpointManager
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 08-May-2006
+ */
+public class ServiceRefHandlerFactory
+{
+ private static ServiceRefHandlerFactory instance = new ServiceRefHandlerFactory();
+
+ // Hide ctor
+ private ServiceRefHandlerFactory()
+ {
+ }
+
+ public static ServiceRefHandlerFactory getInstance()
+ {
+ return instance;
+ }
+
+ public ServiceRefHandler getServiceRefHandler()
+ {
+ KernelRegistry registry = KernelLocator.getKernel().getRegistry();
+ KernelRegistryEntry entry = registry.getEntry(ServiceRefHandler.BEAN_NAME);
+ return (ServiceRefHandler)entry.getTarget();
+ }
+}
Property changes on:
branches/jbossws-1.2.0/jbossws-core/src/java/org/jboss/ws/integration/ServiceRefHandlerFactory.java
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified:
branches/jbossws-1.2.0/jbossws-core/src/java/org/jboss/ws/integration/ServiceRefMetaData.java
===================================================================
---
branches/jbossws-1.2.0/jbossws-core/src/java/org/jboss/ws/integration/ServiceRefMetaData.java 2007-03-08
17:07:55 UTC (rev 2556)
+++
branches/jbossws-1.2.0/jbossws-core/src/java/org/jboss/ws/integration/ServiceRefMetaData.java 2007-03-08
22:29:02 UTC (rev 2557)
@@ -48,9 +48,11 @@
public abstract void setProcessed(boolean flag);
+ @Deprecated
public abstract void importStandardXml(Element element);
+ @Deprecated
public abstract void importJBossXml(Element element);
- public abstract void merge(Object targetRef);
+ public abstract void merge(ServiceRefMetaData serviceRef);
}
Modified:
branches/jbossws-1.2.0/jbossws-core/src/java/org/jboss/ws/metadata/j2ee/serviceref/UnifiedHandlerMetaData.java
===================================================================
---
branches/jbossws-1.2.0/jbossws-core/src/java/org/jboss/ws/metadata/j2ee/serviceref/UnifiedHandlerMetaData.java 2007-03-08
17:07:55 UTC (rev 2556)
+++
branches/jbossws-1.2.0/jbossws-core/src/java/org/jboss/ws/metadata/j2ee/serviceref/UnifiedHandlerMetaData.java 2007-03-08
22:29:02 UTC (rev 2557)
@@ -25,16 +25,20 @@
import java.util.ArrayList;
import java.util.HashSet;
+import java.util.Iterator;
import java.util.List;
import java.util.Set;
import javax.xml.namespace.QName;
+import org.jboss.ws.core.utils.DOMUtils;
import org.jboss.ws.integration.ServiceRefElement;
import org.jboss.ws.metadata.umdm.EndpointMetaData;
import org.jboss.ws.metadata.umdm.HandlerMetaDataJAXRPC;
import org.jboss.ws.metadata.umdm.HandlerMetaDataJAXWS;
import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
+import org.jboss.xb.QNameBuilder;
+import org.w3c.dom.Element;
/** The unified metdata data for a handler element
*
@@ -153,4 +157,55 @@
}
return hmd;
}
+
+ @Deprecated
+ public void importStandardXml(Element root)
+ {
+ Element child = DOMUtils.getFirstChildElement(root, "handler-name");
+ if (child != null)
+ handlerName = DOMUtils.getTextContent(child);
+
+ child = DOMUtils.getFirstChildElement(root, "handler-class");
+ if (child != null)
+ handlerClass = DOMUtils.getTextContent(child);
+
+ // Parse the init-param elements
+ Iterator iterator = DOMUtils.getChildElements(root, "init-param");
+ while (iterator.hasNext())
+ {
+ Element paramElement = (Element)iterator.next();
+ UnifiedInitParamMetaData param = new UnifiedInitParamMetaData();
+
param.setParamName(DOMUtils.getTextContent(DOMUtils.getFirstChildElement(paramElement,
"param-name")));
+
param.setParamValue(DOMUtils.getTextContent(DOMUtils.getFirstChildElement(paramElement,
"param-value")));
+ initParams.add(param);
+ }
+
+ // Parse the soap-header elements
+ iterator = DOMUtils.getChildElements(root, "soap-header");
+ while (iterator.hasNext())
+ {
+ Element headerElement = (Element)iterator.next();
+ String content = DOMUtils.getTextContent(headerElement);
+ QName qname = QNameBuilder.buildQName(headerElement, content);
+ soapHeaders.add(qname);
+ }
+
+ // Parse the soap-role elements
+ iterator = DOMUtils.getChildElements(root, "soap-role");
+ while (iterator.hasNext())
+ {
+ Element roleElement = (Element)iterator.next();
+ String content = DOMUtils.getTextContent(roleElement);
+ soapRoles.add(content);
+ }
+
+ // Parse the port-name elements
+ iterator = DOMUtils.getChildElements(root, "port-name");
+ while (iterator.hasNext())
+ {
+ Element portElement = (Element)iterator.next();
+ String content = DOMUtils.getTextContent(portElement);
+ portNames.add(content);
+ }
+ }
}
Modified:
branches/jbossws-1.2.0/jbossws-core/src/java/org/jboss/ws/metadata/j2ee/serviceref/UnifiedPortComponentRefMetaData.java
===================================================================
---
branches/jbossws-1.2.0/jbossws-core/src/java/org/jboss/ws/metadata/j2ee/serviceref/UnifiedPortComponentRefMetaData.java 2007-03-08
17:07:55 UTC (rev 2556)
+++
branches/jbossws-1.2.0/jbossws-core/src/java/org/jboss/ws/metadata/j2ee/serviceref/UnifiedPortComponentRefMetaData.java 2007-03-08
22:29:02 UTC (rev 2557)
@@ -24,11 +24,14 @@
// $Id$
import java.util.ArrayList;
+import java.util.Iterator;
import java.util.List;
import javax.xml.namespace.QName;
+import org.jboss.ws.core.utils.DOMUtils;
import org.jboss.ws.integration.ServiceRefElement;
+import org.w3c.dom.Element;
/** The metdata data from service-ref/port-component-ref element in web.xml, ejb-jar.xml,
and application-client.xml.
*
@@ -61,6 +64,15 @@
this.serviceRefMetaData = serviceRefMetaData;
}
+ public void merge(UnifiedPortComponentRefMetaData pcref)
+ {
+ portQName = pcref.portQName;
+ configName = pcref.configName;
+ configFile = pcref.configFile;
+ callProperties = pcref.callProperties;
+ stubProperties = pcref.stubProperties;
+ }
+
public UnifiedServiceRefMetaData getServiceRefMetaData()
{
return serviceRefMetaData;
@@ -166,4 +178,30 @@
{
this.configName = configName;
}
+
+ @Deprecated
+ public void importStandardXml(Element root)
+ {
+ Element child = DOMUtils.getFirstChildElement(root,
"service-endpoint-interface");
+ if (child != null)
+ serviceEndpointInterface = DOMUtils.getTextContent(child);
+
+ child = DOMUtils.getFirstChildElement(root, "port-component-link");
+ if (child != null)
+ portComponentLink = DOMUtils.getTextContent(child);
+ }
+
+ @Deprecated
+ public void importJBossXml(Element root)
+ {
+ // Look for call-property elements
+ Iterator iterator = DOMUtils.getChildElements(root, "call-property");
+ while (iterator.hasNext())
+ {
+ Element propElement = (Element)iterator.next();
+ String name = DOMUtils.getTextContent(DOMUtils.getFirstChildElement(propElement,
"prop-name"));
+ String value =
DOMUtils.getTextContent(DOMUtils.getFirstChildElement(propElement,
"prop-value"));
+ callProperties.add(new UnifiedCallPropertyMetaData(name, value));
+ }
+ }
}
Modified:
branches/jbossws-1.2.0/jbossws-core/src/java/org/jboss/ws/metadata/j2ee/serviceref/UnifiedServiceRefMetaData.java
===================================================================
---
branches/jbossws-1.2.0/jbossws-core/src/java/org/jboss/ws/metadata/j2ee/serviceref/UnifiedServiceRefMetaData.java 2007-03-08
17:07:55 UTC (rev 2556)
+++
branches/jbossws-1.2.0/jbossws-core/src/java/org/jboss/ws/metadata/j2ee/serviceref/UnifiedServiceRefMetaData.java 2007-03-08
22:29:02 UTC (rev 2557)
@@ -28,6 +28,7 @@
import java.net.URL;
import java.util.ArrayList;
import java.util.Collection;
+import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
@@ -36,8 +37,10 @@
import org.jboss.logging.Logger;
import org.jboss.ws.WSException;
+import org.jboss.ws.core.utils.DOMUtils;
import org.jboss.ws.integration.ServiceRefMetaData;
import org.jboss.ws.integration.UnifiedVirtualFile;
+import org.jboss.xb.QNameBuilder;
import org.w3c.dom.Element;
/**
@@ -89,6 +92,9 @@
// Arbitrary proxy properties given by <call-property>
private List<UnifiedCallPropertyMetaData> callProperties = new
ArrayList<UnifiedCallPropertyMetaData>();
+ private transient AnnotatedElement anElement;
+ private transient boolean processed;
+
public UnifiedServiceRefMetaData(UnifiedVirtualFile vfRoot)
{
this.vfsRoot = vfRoot;
@@ -98,6 +104,41 @@
{
}
+ @Override
+ public void merge(ServiceRefMetaData sref)
+ {
+ UnifiedServiceRefMetaData sourceRef = (UnifiedServiceRefMetaData)sref;
+ serviceImplClass = sourceRef.serviceImplClass;
+ configName = sourceRef.configName;
+ configFile = sourceRef.configFile;
+ wsdlOverride = sourceRef.wsdlOverride;
+ handlerChain = sourceRef.handlerChain;
+ callProperties = sourceRef.callProperties;
+
+ if (serviceQName == null && sourceRef.serviceQName != null)
+ serviceQName = sourceRef.serviceQName;
+
+ for (UnifiedPortComponentRefMetaData pcref : sourceRef.getPortComponentRefs())
+ {
+ String seiName = pcref.getServiceEndpointInterface();
+ if (seiName == null)
+ {
+ log.warn("Ignore <port-component-ref> with null
<service-endpoint-interface>");
+ continue;
+ }
+
+ UnifiedPortComponentRefMetaData targetPCRef = portComponentRefs.get(seiName);
+ if (targetPCRef == null)
+ {
+ log.warn("Cannot find port component ref with SEI name: " +
seiName);
+ addPortComponentRef(pcref);
+ targetPCRef = pcref;
+ }
+
+ targetPCRef.merge(pcref);
+ }
+ }
+
public UnifiedVirtualFile getVfsRoot()
{
return vfsRoot;
@@ -323,52 +364,115 @@
this.handlerChain = handlerChain;
}
- @Override
public AnnotatedElement getAnnotatedElement()
{
- // TODO Auto-generated method stub
- return null;
+ return anElement;
+
}
- @Override
- public void importJBossXml(Element element)
+ public boolean isProcessed()
{
- // TODO Auto-generated method stub
-
+ return processed;
}
- @Override
- public void importStandardXml(Element element)
+ public void setProcessed(boolean flag)
{
- // TODO Auto-generated method stub
-
+ this.processed = flag;
}
-
- @Override
- public boolean isProcessed()
+
+ public void setAnnotatedElement(AnnotatedElement anElement)
{
- // TODO Auto-generated method stub
- return false;
+ this.anElement = anElement;
}
@Override
- public void merge(Object targetRef)
+ public void importStandardXml(Element root)
{
- // TODO Auto-generated method stub
-
+ Element child = DOMUtils.getFirstChildElement(root, "service-ref-name");
+ if (child != null)
+ serviceRefName = DOMUtils.getTextContent(child);
+
+ child = DOMUtils.getFirstChildElement(root, "service-interface");
+ if (child != null)
+ serviceInterface = DOMUtils.getTextContent(child);
+
+ child = DOMUtils.getFirstChildElement(root, "wsdl-file");
+ if (child != null)
+ wsdlFile = DOMUtils.getTextContent(child);
+
+ child = DOMUtils.getFirstChildElement(root, "jaxrpc-mapping-file");
+ if (child != null)
+ mappingFile = DOMUtils.getTextContent(child);
+
+ child = DOMUtils.getFirstChildElement(root, "service-qname");
+ if (child != null)
+ serviceQName = QNameBuilder.buildQName(child, DOMUtils.getTextContent(child));
+
+ // Parse the port-component-ref elements
+ Iterator iterator = DOMUtils.getChildElements(root,
"port-component-ref");
+ while (iterator.hasNext())
+ {
+ Element pcrefElement = (Element)iterator.next();
+ UnifiedPortComponentRefMetaData pcrefMetaData = new
UnifiedPortComponentRefMetaData(this);
+ pcrefMetaData.importStandardXml(pcrefElement);
+ portComponentRefs.put(pcrefMetaData.getServiceEndpointInterface(),
pcrefMetaData);
+ }
+
+ // Parse the handler elements
+ iterator = DOMUtils.getChildElements(root, "handler");
+ while (iterator.hasNext())
+ {
+ Element handlerElement = (Element)iterator.next();
+ UnifiedHandlerMetaData handlerMetaData = new UnifiedHandlerMetaData();
+ handlerMetaData.importStandardXml(handlerElement);
+ handlers.add(handlerMetaData);
+ }
}
-
+
@Override
- public void setAnnotatedElement(AnnotatedElement anElement)
+ public void importJBossXml(Element root)
{
- // TODO Auto-generated method stub
+ Element child = DOMUtils.getFirstChildElement(root, "config-name");
+ if (child != null)
+ configName = DOMUtils.getTextContent(child);
- }
+ child = DOMUtils.getFirstChildElement(root, "config-file");
+ if (child != null)
+ configFile = DOMUtils.getTextContent(child);
- @Override
- public void setProcessed(boolean flag)
- {
- // TODO Auto-generated method stub
-
+ child = DOMUtils.getFirstChildElement(root, "wsdl-override");
+ if (child != null)
+ wsdlOverride = DOMUtils.getTextContent(child);
+
+ // Parse the port-component-ref elements
+ Iterator iterator = DOMUtils.getChildElements(root,
"port-component-ref");
+ while (iterator.hasNext())
+ {
+ Element pcrefElement = (Element)iterator.next();
+ Element seiElement = DOMUtils.getFirstChildElement(pcrefElement,
"service-endpoint-interface");
+ if (seiElement != null)
+ {
+ String seiName = DOMUtils.getTextContent(seiElement);
+ UnifiedPortComponentRefMetaData pcrefMetaData =
(UnifiedPortComponentRefMetaData)portComponentRefs.get(seiName);
+ if (pcrefMetaData == null)
+ {
+ // Its ok to only have the <port-component-ref> in jboss.xml and not
in ejb-jar.xml
+ pcrefMetaData = new UnifiedPortComponentRefMetaData(this);
+ pcrefMetaData.importStandardXml(pcrefElement);
+ portComponentRefs.put(pcrefMetaData.getServiceEndpointInterface(),
pcrefMetaData);
+ }
+ pcrefMetaData.importJBossXml(pcrefElement);
+ }
+ }
+
+ // Parse the call-property elements
+ iterator = DOMUtils.getChildElements(root, "call-property");
+ while (iterator.hasNext())
+ {
+ Element propElement = (Element)iterator.next();
+ String name = DOMUtils.getTextContent(DOMUtils.getFirstChildElement(propElement,
"prop-name"));
+ String value =
DOMUtils.getTextContent(DOMUtils.getFirstChildElement(propElement,
"prop-value"));
+ callProperties.add(new UnifiedCallPropertyMetaData(name, value));
+ }
}
}