JBossWS SVN: r3751 - branches/ropalka/testsuite/ant-import.
by jbossws-commits@lists.jboss.org
Author: richard_opalka
Date: 2007-06-27 17:18:36 -0400 (Wed, 27 Jun 2007)
New Revision: 3751
Modified:
branches/ropalka/testsuite/ant-import/build-jars-jaxws.xml
Log:
refactoring
Modified: branches/ropalka/testsuite/ant-import/build-jars-jaxws.xml
===================================================================
--- branches/ropalka/testsuite/ant-import/build-jars-jaxws.xml 2007-06-27 21:17:59 UTC (rev 3750)
+++ branches/ropalka/testsuite/ant-import/build-jars-jaxws.xml 2007-06-27 21:18:36 UTC (rev 3751)
@@ -296,13 +296,6 @@
</fileset>
</jar>
- <!-- jaxws-samples-wsrx-inorder-exactlyonce -->
- <war warfile="${tests.output.dir}/libs/jaxws-samples-wsrx-inorder-exactlyonce.war" webxml="${tests.output.dir}/resources/jaxws/samples/wsrx/inOrder_exactlyOnce/WEB-INF/web.xml">
- <classes dir="${tests.output.dir}/classes">
- <include name="org/jboss/test/ws/jaxws/samples/wsrx/ioeo/RXServiceImpl.class"/>
- </classes>
- </war>
-
<!-- jaxws-samples-xop-doclit -->
<war jarfile="${tests.output.dir}/libs/jaxws-samples-xop-doclit.war" webxml="${tests.output.dir}/resources/jaxws/samples/xop/doclit/WEB-INF/web.xml">
<classes dir="${tests.output.dir}/classes">
17 years, 6 months
JBossWS SVN: r3748 - branches/ropalka/jbossws-core/ant-import-tests.
by jbossws-commits@lists.jboss.org
Author: richard_opalka
Date: 2007-06-27 17:14:20 -0400 (Wed, 27 Jun 2007)
New Revision: 3748
Modified:
branches/ropalka/jbossws-core/ant-import-tests/build-samples-jaxws.xml
Log:
refactoring
Modified: branches/ropalka/jbossws-core/ant-import-tests/build-samples-jaxws.xml
===================================================================
--- branches/ropalka/jbossws-core/ant-import-tests/build-samples-jaxws.xml 2007-06-27 21:13:28 UTC (rev 3747)
+++ branches/ropalka/jbossws-core/ant-import-tests/build-samples-jaxws.xml 2007-06-27 21:14:20 UTC (rev 3748)
@@ -131,6 +131,13 @@
</webinf>
</war>
+ <!-- jaxws-samples-wsrx -->
+ <war warfile="${tests.output.dir}/libs/jaxws-samples-wsrx.war" webxml="${tests.output.dir}/resources/jaxws/samples/wsrx/WEB-INF/web.xml">
+ <classes dir="${tests.output.dir}/classes">
+ <include name="org/jboss/test/ws/jaxws/samples/wsrx/RXServiceImpl.class"/>
+ </classes>
+ </war>
+
<!-- jaxws-samples-wssecurity-encrypt -->
<war warfile="${tests.output.dir}/libs/jaxws-samples-wssecurity-encrypt.war" webxml="${tests.output.dir}/resources/jaxws/samples/wssecurity/WEB-INF/web.xml">
<classes dir="${tests.output.dir}/classes">
17 years, 6 months
JBossWS SVN: r3747 - in branches/ropalka/jbossws-core/src/test/resources/jaxws/samples: wsrx and 3 other directories.
by jbossws-commits@lists.jboss.org
Author: richard_opalka
Date: 2007-06-27 17:13:28 -0400 (Wed, 27 Jun 2007)
New Revision: 3747
Added:
branches/ropalka/jbossws-core/src/test/resources/jaxws/samples/wsrx/
branches/ropalka/jbossws-core/src/test/resources/jaxws/samples/wsrx/META-INF/
branches/ropalka/jbossws-core/src/test/resources/jaxws/samples/wsrx/META-INF/wsdl/
branches/ropalka/jbossws-core/src/test/resources/jaxws/samples/wsrx/META-INF/wsdl/rxservice.wsdl
branches/ropalka/jbossws-core/src/test/resources/jaxws/samples/wsrx/WEB-INF/
branches/ropalka/jbossws-core/src/test/resources/jaxws/samples/wsrx/WEB-INF/web.xml
Log:
refactoring
Added: branches/ropalka/jbossws-core/src/test/resources/jaxws/samples/wsrx/META-INF/wsdl/rxservice.wsdl
===================================================================
--- branches/ropalka/jbossws-core/src/test/resources/jaxws/samples/wsrx/META-INF/wsdl/rxservice.wsdl (rev 0)
+++ branches/ropalka/jbossws-core/src/test/resources/jaxws/samples/wsrx/META-INF/wsdl/rxservice.wsdl 2007-06-27 21:13:28 UTC (rev 3747)
@@ -0,0 +1,74 @@
+<?xml version='1.0' encoding='utf-8' ?>
+<definitions name='RXService' targetNamespace='http://www.jboss.org/wsrx/'
+ xmlns:tns='http://www.jboss.org/wsrx/'
+ xmlns:xsd='http://www.w3.org/2001/XMLSchema'
+ xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/'
+ xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
+ xmlns:wsrmp="http://docs.oasis-open.org/ws-rx/wsrmp/200702"
+ xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utilit..."
+ xmlns='http://schemas.xmlsoap.org/wsdl/'>
+
+ <!-- this policy version is commented out for now, because current JBossWS stack is unable to handle them -->
+ <!--wsp:UsingPolicy required="true"/>
+
+ <wsp:Policy wsu:Id="RMPolicy">
+ <wsrmp:RMAssertion>
+ <wsp:Policy>
+ <wsrmp:DeliveryAssurance>
+ <wsp:Policy>
+ <wsrmp:ExactlyOnce/>
+ <wsrmp:InOrder/>
+ </wsp:Policy>
+ </wsrmp:DeliveryAssurance>
+ </wsp:Policy>
+ </wsrmp:RMAssertion>
+ </wsp:Policy-->
+
+ <message name='RXService_oneWay_Request_Soap'>
+ <part name='p0' type='xsd:string'/>
+ </message>
+ <message name='RXService_oneWay_Response_Soap'/>
+ <message name='RXService_reqResp_Request_Soap'>
+ <part name='p0' type='xsd:string'/>
+ </message>
+ <message name='RXService_reqResp_Response_Soap'>
+ <part name='response' type='xsd:string'/>
+ </message>
+ <portType name='RXService'>
+ <operation name='oneWay' parameterOrder='p0'>
+ <input message='tns:RXService_oneWay_Request_Soap'/>
+ <output message='tns:RXService_oneWay_Response_Soap'/>
+ </operation>
+ <operation name='reqResp' parameterOrder='p0'>
+ <input message='tns:RXService_reqResp_Request_Soap'/>
+ <output message='tns:RXService_reqResp_Response_Soap'/>
+ </operation>
+ </portType>
+ <binding name='RXService' type='tns:RXService'>
+ <!--wsp:PolicyReference URI="#RMPolicy"/-->
+ <soap:binding transport='http://schemas.xmlsoap.org/soap/http' style='rpc'/>
+ <operation name='oneWay'>
+ <soap:operation soapAction='' style='rpc'/>
+ <input>
+ <soap:body parts='p0' use='literal' namespace='http://www.jboss.org/wsrx/RXService#oneWay?KExqYXZhL2xhbmcvU3RyaW5nOylW'/>
+ </input>
+ <output>
+ <soap:body use='literal' namespace='http://www.jboss.org/wsrx/RXService#oneWay?KExqYXZhL2xhbmcvU3RyaW5nOylW'/>
+ </output>
+ </operation>
+ <operation name='reqResp'>
+ <soap:operation soapAction='' style='rpc'/>
+ <input>
+ <soap:body parts='p0' use='literal' namespace='http://www.jboss.org/wsrx/RXService#reqResp?KExqYXZhL2xhbmcvU3RyaW5nOylMa...'/>
+ </input>
+ <output>
+ <soap:body parts='response' use='literal' namespace='http://www.jboss.org/wsrx/RXService#reqResp?KExqYXZhL2xhbmcvU3RyaW5nOylMa...'/>
+ </output>
+ </operation>
+ </binding>
+ <service name='RXService'>
+ <port name='RXService' binding='tns:RXService'>
+ <soap:address location='http://@jboss.bind.address@:8080/wsrx'/>
+ </port>
+ </service>
+</definitions>
Property changes on: branches/ropalka/jbossws-core/src/test/resources/jaxws/samples/wsrx/META-INF/wsdl/rxservice.wsdl
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/ropalka/jbossws-core/src/test/resources/jaxws/samples/wsrx/WEB-INF/web.xml
===================================================================
--- branches/ropalka/jbossws-core/src/test/resources/jaxws/samples/wsrx/WEB-INF/web.xml (rev 0)
+++ branches/ropalka/jbossws-core/src/test/resources/jaxws/samples/wsrx/WEB-INF/web.xml 2007-06-27 21:13:28 UTC (rev 3747)
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
+ version="2.4">
+
+ <servlet>
+ <servlet-name>TestService</servlet-name>
+ <servlet-class>org.jboss.test.ws.jaxws.samples.wsrx.RXServiceImpl</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>TestService</servlet-name>
+ <url-pattern>/*</url-pattern>
+ </servlet-mapping>
+
+</web-app>
+
Property changes on: branches/ropalka/jbossws-core/src/test/resources/jaxws/samples/wsrx/WEB-INF/web.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
17 years, 6 months
JBossWS SVN: r3746 - in branches/ropalka/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/samples: wsrx and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: richard_opalka
Date: 2007-06-27 17:12:33 -0400 (Wed, 27 Jun 2007)
New Revision: 3746
Added:
branches/ropalka/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/samples/wsrx/
branches/ropalka/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/samples/wsrx/RXService.java
branches/ropalka/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/samples/wsrx/RXServiceImpl.java
branches/ropalka/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/samples/wsrx/RXTestCase.java
Log:
refactoring
Added: branches/ropalka/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/samples/wsrx/RXService.java
===================================================================
--- branches/ropalka/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/samples/wsrx/RXService.java (rev 0)
+++ branches/ropalka/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/samples/wsrx/RXService.java 2007-06-27 21:12:33 UTC (rev 3746)
@@ -0,0 +1,42 @@
+package org.jboss.test.ws.jaxws.samples.wsrx;
+
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebResult;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+
+/**
+ * This class was generated by the JAX-WS RI.
+ * JAX-WS RI 2.1.1-b03-
+ * Generated source version: 2.1
+ *
+ */
+@WebService(name = "RXService", targetNamespace = "http://www.jboss.org/wsrx/")
+@SOAPBinding(style = SOAPBinding.Style.RPC)
+public interface RXService {
+
+
+ /**
+ *
+ * @param p0
+ */
+ @WebMethod
+ public void oneWay(
+ @WebParam(name = "p0", partName = "p0")
+ String p0);
+
+ /**
+ *
+ * @param p0
+ * @return
+ * returns java.lang.String
+ */
+ @WebMethod
+ @WebResult(name = "response", partName = "response")
+ public String reqResp(
+ @WebParam(name = "p0", partName = "p0")
+ String p0);
+
+}
Property changes on: branches/ropalka/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/samples/wsrx/RXService.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/ropalka/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/samples/wsrx/RXServiceImpl.java
===================================================================
--- branches/ropalka/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/samples/wsrx/RXServiceImpl.java (rev 0)
+++ branches/ropalka/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/samples/wsrx/RXServiceImpl.java 2007-06-27 21:12:33 UTC (rev 3746)
@@ -0,0 +1,39 @@
+package org.jboss.test.ws.jaxws.samples.wsrx;
+
+import javax.jws.Oneway;
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebResult;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+import org.jboss.logging.Logger;
+
+/**
+ * Simple WS RX service
+ *
+ * @author opalka_richard(a)gmail.com
+ * @since 26-Jun-2007
+ */
+@WebService(name = "RXService", targetNamespace = "http://www.jboss.org/wsrx/")
+@SOAPBinding(style = SOAPBinding.Style.RPC)
+public class RXServiceImpl
+{
+ // Provide logging
+ private static Logger log = Logger.getLogger(RXServiceImpl.class);
+
+ @WebMethod(operationName = "reqResp")
+ @WebResult(targetNamespace = "http://www.jboss.org/wsrx/", partName = "response")
+ public String reqResp(@WebParam(name = "p0") String p)
+ {
+ log.info("echo: " + p);
+ return p;
+ }
+
+ @Oneway
+ @WebMethod(operationName = "oneWay")
+ public void oneWay(@WebParam(name = "p0") String p)
+ {
+ log.info("ping: " + p);
+ }
+}
Property changes on: branches/ropalka/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/samples/wsrx/RXServiceImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/ropalka/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/samples/wsrx/RXTestCase.java
===================================================================
--- branches/ropalka/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/samples/wsrx/RXTestCase.java (rev 0)
+++ branches/ropalka/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/samples/wsrx/RXTestCase.java 2007-06-27 21:12:33 UTC (rev 3746)
@@ -0,0 +1,59 @@
+package org.jboss.test.ws.jaxws.samples.wsrx;
+
+import java.io.File;
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.Service;
+
+import junit.framework.Test;
+
+import org.jboss.wsf.spi.test.JBossWSTest;
+import org.jboss.wsf.spi.test.JBossWSTestSetup;
+
+/**
+ * Test the WS RX in order and exactly once sequence types
+ *
+ * @author opalka_richard(a)gmail.com
+ * @since 26-Jun-2007
+ */
+public class RXTestCase extends JBossWSTest
+{
+ private String targetNS = "http://www.jboss.org/wsrx/";
+
+ private static RXService port;
+
+ public static Test suite()
+ {
+ return JBossWSTestSetup.newTestSetup(RXTestCase.class, "jaxws-samples-wsrx.war");
+ }
+
+ public void setUp() throws Exception
+ {
+ if (port == null)
+ {
+ QName serviceName = new QName(targetNS, "RXService");
+ URL wsdlURL = new File("resources/jaxws/samples/wsrx/META-INF/wsdl/rxservice.wsdl").toURL();
+
+ Service service = Service.create(wsdlURL, serviceName);
+ port = service.getPort(RXService.class);
+
+ ((BindingProvider)port).getRequestContext().put(
+ BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
+ "http://"+getServerHost()+":8080/" // TODO: it seems that this URL is incorrect - debug it!
+ );
+ }
+ }
+
+ public void testOneWay() throws Exception {
+ System.out.println("FIXME: write RX one way usecase test");
+ //port.oneWay("Hello world!");
+ }
+
+ public void testReqResp() throws Exception {
+ System.out.println("FIXME: write RX req resp usecase test");
+ //System.out.println(port.reqResp("Hello world!"));
+ }
+
+}
Property changes on: branches/ropalka/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/samples/wsrx/RXTestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
17 years, 6 months
JBossWS SVN: r3745 - branches/jbossws-2.0/jbossws-core/src/test/java/org/jboss/test/ws/jaxrpc/jbws165.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-06-27 07:36:02 -0400 (Wed, 27 Jun 2007)
New Revision: 3745
Modified:
branches/jbossws-2.0/jbossws-core/src/test/java/org/jboss/test/ws/jaxrpc/jbws165/JBWS165TestCase.java
Log:
Install backward compatible context-root, url-pattern deployer
Modified: branches/jbossws-2.0/jbossws-core/src/test/java/org/jboss/test/ws/jaxrpc/jbws165/JBWS165TestCase.java
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/test/java/org/jboss/test/ws/jaxrpc/jbws165/JBWS165TestCase.java 2007-06-27 11:32:01 UTC (rev 3744)
+++ branches/jbossws-2.0/jbossws-core/src/test/java/org/jboss/test/ws/jaxrpc/jbws165/JBWS165TestCase.java 2007-06-27 11:36:02 UTC (rev 3745)
@@ -65,12 +65,8 @@
public void testPortComponentURIOne() throws Exception
{
- URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxrpc-jbws165-jaxrpc-jbws165-pcuri/Explicit/Path/HelloPCOne?wsdl");
+ URL wsdlURL = new URL("http://" + getServerHost() + ":8080/Explicit/Path/HelloPCOne?wsdl");
- // In JBoss40 the context-root is derived from the first token in port-component-uri
- if (isTargetJBoss40())
- wsdlURL = new URL("http://" + getServerHost() + ":8080/Explicit/Path/HelloPCOne?wsdl");
-
URL mappingURL = new File("resources/jaxrpc/jbws165/META-INF/jaxrpc-mapping.xml").toURL();
QName serviceName = new QName("http://org.jboss.test.webservice/jbws165", "HelloServicePcURI");
Service service = new ServiceFactoryImpl().createService(wsdlURL, serviceName, mappingURL);
@@ -82,12 +78,8 @@
public void testPortComponentURITwo() throws Exception
{
- URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxrpc-jbws165-jaxrpc-jbws165-pcuri/Explicit/Path/HelloPCTwo?wsdl");
+ URL wsdlURL = new URL("http://" + getServerHost() + ":8080/Explicit/Path/HelloPCTwo?wsdl");
- // In JBoss40 the context-root is derived from the first token in port-component-uri
- if (isTargetJBoss40())
- wsdlURL = new URL("http://" + getServerHost() + ":8080/Explicit/Path/HelloPCTwo?wsdl");
-
URL mappingURL = new File("resources/jaxrpc/jbws165/META-INF/jaxrpc-mapping.xml").toURL();
QName serviceName = new QName("http://org.jboss.test.webservice/jbws165", "HelloServicePcURI");
Service service = new ServiceFactoryImpl().createService(wsdlURL, serviceName, mappingURL);
17 years, 6 months
JBossWS SVN: r3744 - in branches/jbossws-2.0: jbossws-core/src/main/java/javax/xml/rpc/handler and 4 other directories.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-06-27 07:32:01 -0400 (Wed, 27 Jun 2007)
New Revision: 3744
Modified:
branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/metadata/j2ee/serviceref/UnifiedInitParamMetaData.java
branches/jbossws-2.0/jbossws-core/src/main/java/javax/xml/rpc/handler/HandlerInfo.java
branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/core/client/ServiceObjectFactory.java
branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/client/HandlerRegistryImpl.java
branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/client/ServiceImpl.java
branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/HandlerMetaData.java
branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/HandlerMetaDataJAXRPC.java
branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/HandlerMetaDataJAXWS.java
branches/jbossws-2.0/jbossws-core/src/test/java/org/jboss/test/ws/jaxrpc/samples/handler/ClientSideHandler.java
branches/jbossws-2.0/jbossws-core/src/test/java/org/jboss/test/ws/jaxrpc/samples/handler/ServerSideHandler.java
Log:
Fix jaxrpc handler init-param processing
Modified: branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/metadata/j2ee/serviceref/UnifiedInitParamMetaData.java
===================================================================
--- branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/metadata/j2ee/serviceref/UnifiedInitParamMetaData.java 2007-06-27 10:01:06 UTC (rev 3743)
+++ branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/metadata/j2ee/serviceref/UnifiedInitParamMetaData.java 2007-06-27 11:32:01 UTC (rev 3744)
@@ -36,6 +36,16 @@
// The required <param-value> element
private String paramValue;
+ public UnifiedInitParamMetaData(String paramName, String paramValue)
+ {
+ this.paramName = paramName;
+ this.paramValue = paramValue;
+ }
+
+ public UnifiedInitParamMetaData()
+ {
+ }
+
public String getParamName()
{
return paramName;
Modified: branches/jbossws-2.0/jbossws-core/src/main/java/javax/xml/rpc/handler/HandlerInfo.java
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/main/java/javax/xml/rpc/handler/HandlerInfo.java 2007-06-27 10:01:06 UTC (rev 3743)
+++ branches/jbossws-2.0/jbossws-core/src/main/java/javax/xml/rpc/handler/HandlerInfo.java 2007-06-27 11:32:01 UTC (rev 3744)
@@ -59,7 +59,7 @@
public HandlerInfo(Class handlerClass, Map config, QName[] headers)
{
this.handlerClass = handlerClass;
- this.configMap = config;
+ this.configMap.putAll(config);
this.headers = headers;
}
Modified: branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/core/client/ServiceObjectFactory.java
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/core/client/ServiceObjectFactory.java 2007-06-27 10:01:06 UTC (rev 3743)
+++ branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/core/client/ServiceObjectFactory.java 2007-06-27 11:32:01 UTC (rev 3744)
@@ -58,61 +58,63 @@
*/
protected void narrowPortSelection(UnifiedServiceRefMetaData serviceRef, ServiceMetaData serviceMetaData)
{
- Map<String, UnifiedPortComponentRefMetaData> pcrefs = new HashMap<String, UnifiedPortComponentRefMetaData>();
- for (UnifiedPortComponentRefMetaData pcref : serviceRef.getPortComponentRefs())
+ if (serviceMetaData.getEndpoints().size() > 1)
{
- String seiName = pcref.getServiceEndpointInterface();
+ Map<String, UnifiedPortComponentRefMetaData> pcrefs = new HashMap<String, UnifiedPortComponentRefMetaData>();
+ for (UnifiedPortComponentRefMetaData pcref : serviceRef.getPortComponentRefs())
+ {
+ String seiName = pcref.getServiceEndpointInterface();
- // Constraint#1: within a service-ref it's not allowed to use a SEI across different pcref's
- if (pcrefs.get(seiName) != null)
- throw new WSException("Within a <service-ref> it's not allowed to use a SEI across different <port-component-ref>'s: " + seiName);
-
- pcrefs.put(seiName, pcref);
- }
+ // Constraint#1: within a service-ref it's not allowed to use a SEI across different pcref's
+ if (pcrefs.get(seiName) != null)
+ throw new WSException("Within a <service-ref> it's not allowed to use a SEI across different <port-component-ref>'s: " + seiName);
+
+ pcrefs.put(seiName, pcref);
+ }
- // Constraint#2: A pcref may only match one EndpointMetaData
- for (String sei : pcrefs.keySet())
- {
- // Narrow available endpoints by port-component-ref declaration
- List<QName> narrowedEndpoints = new ArrayList<QName>();
+ // Constraint#2: A pcref may only match one EndpointMetaData
+ for (String sei : pcrefs.keySet())
+ {
+ // Narrow available endpoints by port-component-ref declaration
+ List<QName> narrowedEndpoints = new ArrayList<QName>();
- UnifiedPortComponentRefMetaData pcref = pcrefs.get(sei);
+ UnifiedPortComponentRefMetaData pcref = pcrefs.get(sei);
- // Constraint#3: Port selection only applies when both SEI and QName are given
- if (pcref.getServiceEndpointInterface() != null && pcref.getPortQName() != null)
- {
- List<QName> pcRef2EndpointMapping = new ArrayList<QName>();
- for (EndpointMetaData epMetaData : serviceMetaData.getEndpoints())
+ // Constraint#3: Port selection only applies when both SEI and QName are given
+ if (pcref.getServiceEndpointInterface() != null && pcref.getPortQName() != null)
{
- if (pcref.getServiceEndpointInterface().equals(epMetaData.getServiceEndpointInterfaceName()))
+ List<QName> pcRef2EndpointMapping = new ArrayList<QName>();
+ for (EndpointMetaData epMetaData : serviceMetaData.getEndpoints())
{
- pcRef2EndpointMapping.add(epMetaData.getPortName());
+ if (pcref.getServiceEndpointInterface().equals(epMetaData.getServiceEndpointInterfaceName()))
+ {
+ pcRef2EndpointMapping.add(epMetaData.getPortName());
+ }
}
- }
- for (QName q : pcRef2EndpointMapping)
- {
- EndpointMetaData mappedEndpoint = serviceMetaData.getEndpoint(q);
- if (!pcref.getPortQName().equals(mappedEndpoint.getPortName()))
- narrowedEndpoints.add(q);
- }
+ for (QName q : pcRef2EndpointMapping)
+ {
+ EndpointMetaData mappedEndpoint = serviceMetaData.getEndpoint(q);
+ if (!pcref.getPortQName().equals(mappedEndpoint.getPortName()))
+ narrowedEndpoints.add(q);
+ }
- // Constraint: Dont exclude all of them ;)
- if (pcRef2EndpointMapping.size() > 0 && (pcRef2EndpointMapping.size() == narrowedEndpoints.size()))
- throw new WSException("Failed to narrow available endpoints by <port-component-ref> declaration");
+ // Constraint: Dont exclude all of them ;)
+ if (pcRef2EndpointMapping.size() > 0 && (pcRef2EndpointMapping.size() == narrowedEndpoints.size()))
+ throw new WSException("Failed to narrow available endpoints by <port-component-ref> declaration");
- for (QName q : narrowedEndpoints)
+ for (QName q : narrowedEndpoints)
+ {
+ EndpointMetaData removed = serviceMetaData.removeEndpoint(q);
+ log.debug("Narrowed endpoint " + q + "(" + removed + ")");
+ }
+ }
+ else
{
- EndpointMetaData removed = serviceMetaData.removeEndpoint(q);
- log.debug("Narrowed endpoint " + q + "(" + removed + ")");
+ // TODO: In case there is more then one EMPD this should cause an exception
+ log.warn("Unable to narrow port selection for " + pcref);
}
}
- else
- {
- // TODO: In case there is more then one EMPD this should cause an exception
- log.warn("Unable to narrow port selection for " + pcref);
- }
-
}
}
}
Modified: branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/client/HandlerRegistryImpl.java
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/client/HandlerRegistryImpl.java 2007-06-27 10:01:06 UTC (rev 3743)
+++ branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/client/HandlerRegistryImpl.java 2007-06-27 11:32:01 UTC (rev 3744)
@@ -27,6 +27,7 @@
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
+import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -41,6 +42,7 @@
import org.jboss.ws.metadata.umdm.EndpointMetaData;
import org.jboss.ws.metadata.umdm.HandlerMetaDataJAXRPC;
import org.jboss.ws.metadata.umdm.ServiceMetaData;
+import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedInitParamMetaData;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerMetaData.HandlerType;
/**
@@ -115,13 +117,26 @@
handler.setEndpointMetaData(epMetaData);
handler.setHandlerClassName(info.getHandlerClass().getName());
handler.setSoapRoles(roles);
-
+
+ // copy headers
Set<QName> headers = new HashSet<QName>();
for (QName header : info.getHeaders())
headers.add(header);
-
handler.setSoapHeaders(headers);
+ // copy init params
+ List<UnifiedInitParamMetaData> initParams = new ArrayList<UnifiedInitParamMetaData>();
+ Iterator<Map.Entry> entries = info.getHandlerConfig().entrySet().iterator();
+ while (entries.hasNext())
+ {
+ Map.Entry entry = entries.next();
+ String key = (String)entry.getKey();
+ Object value = entry.getValue();
+ if (value instanceof String)
+ initParams.add(new UnifiedInitParamMetaData(key, (String)value));
+ }
+ handler.setInitParams(initParams);
+
epMetaData.addHandler(handler);
log.debug("Add handler to: " + portName + handler);
}
Modified: branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/client/ServiceImpl.java
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/client/ServiceImpl.java 2007-06-27 10:01:06 UTC (rev 3743)
+++ branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/client/ServiceImpl.java 2007-06-27 11:32:01 UTC (rev 3744)
@@ -519,12 +519,12 @@
log.debug("Adding client side handler to endpoint '" + portName + "': " + info);
handlerInfos.add(info);
-
- // register the handlers with the client engine
- if (handlerInfos.size() > 0)
- registerHandlerChain(portName, handlerInfos, handlerRoles);
}
+ // register the handlers with the client engine
+ if (handlerInfos.size() > 0)
+ registerHandlerChain(portName, handlerInfos, handlerRoles);
+
epMetaData.setHandlersInitialized(true);
}
}
Modified: branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/HandlerMetaData.java
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/HandlerMetaData.java 2007-06-27 10:01:06 UTC (rev 3743)
+++ branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/HandlerMetaData.java 2007-06-27 11:32:01 UTC (rev 3744)
@@ -140,7 +140,7 @@
return soapHeaders;
}
- public void seiInitParams(List<UnifiedInitParamMetaData> initParams)
+ public void setInitParams(List<UnifiedInitParamMetaData> initParams)
{
this.initParams = initParams;
}
Modified: branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/HandlerMetaDataJAXRPC.java
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/HandlerMetaDataJAXRPC.java 2007-06-27 10:01:06 UTC (rev 3743)
+++ branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/HandlerMetaDataJAXRPC.java 2007-06-27 11:32:01 UTC (rev 3744)
@@ -49,7 +49,7 @@
HandlerMetaDataJAXRPC hmd = new HandlerMetaDataJAXRPC(type);
hmd.setHandlerName(uhmd.getHandlerName());
hmd.setHandlerClassName(uhmd.getHandlerClass());
- hmd.seiInitParams(uhmd.getInitParams());
+ hmd.setInitParams(uhmd.getInitParams());
hmd.setSoapHeaders(uhmd.getSoapHeaders());
hmd.setSoapRoles(uhmd.getSoapRoles());
hmd.setPortNames(uhmd.getPortNames());
Modified: branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/HandlerMetaDataJAXWS.java
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/HandlerMetaDataJAXWS.java 2007-06-27 10:01:06 UTC (rev 3743)
+++ branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/HandlerMetaDataJAXWS.java 2007-06-27 11:32:01 UTC (rev 3744)
@@ -51,7 +51,7 @@
HandlerMetaDataJAXWS hmd = new HandlerMetaDataJAXWS(type);
hmd.setHandlerName(uhmd.getHandlerName());
hmd.setHandlerClassName(uhmd.getHandlerClass());
- hmd.seiInitParams(uhmd.getInitParams());
+ hmd.setInitParams(uhmd.getInitParams());
UnifiedHandlerChainMetaData handlerChain = uhmd.getHandlerChain();
if (handlerChain != null)
{
Modified: branches/jbossws-2.0/jbossws-core/src/test/java/org/jboss/test/ws/jaxrpc/samples/handler/ClientSideHandler.java
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/test/java/org/jboss/test/ws/jaxrpc/samples/handler/ClientSideHandler.java 2007-06-27 10:01:06 UTC (rev 3743)
+++ branches/jbossws-2.0/jbossws-core/src/test/java/org/jboss/test/ws/jaxrpc/samples/handler/ClientSideHandler.java 2007-06-27 11:32:01 UTC (rev 3744)
@@ -21,6 +21,8 @@
*/
package org.jboss.test.ws.jaxrpc.samples.handler;
+import java.util.Map;
+
import javax.xml.namespace.QName;
import javax.xml.rpc.JAXRPCException;
import javax.xml.rpc.handler.GenericHandler;
@@ -53,6 +55,12 @@
{
log.info("init: " + info);
headers = info.getHeaders();
+
+ Map configMap = info.getHandlerConfig();
+ String value1 = (String)configMap.get("ClientParam1");
+ String value2 = (String)configMap.get("ClientParam2");
+ if (!"value1".equals(value1) || !"value2".equals(value2))
+ throw new IllegalStateException("Invalid handler config: " + configMap);
}
public boolean handleRequest(MessageContext msgContext)
Modified: branches/jbossws-2.0/jbossws-core/src/test/java/org/jboss/test/ws/jaxrpc/samples/handler/ServerSideHandler.java
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/test/java/org/jboss/test/ws/jaxrpc/samples/handler/ServerSideHandler.java 2007-06-27 10:01:06 UTC (rev 3743)
+++ branches/jbossws-2.0/jbossws-core/src/test/java/org/jboss/test/ws/jaxrpc/samples/handler/ServerSideHandler.java 2007-06-27 11:32:01 UTC (rev 3744)
@@ -21,6 +21,8 @@
*/
package org.jboss.test.ws.jaxrpc.samples.handler;
+import java.util.Map;
+
import javax.xml.namespace.QName;
import javax.xml.rpc.JAXRPCException;
import javax.xml.rpc.handler.GenericHandler;
@@ -57,6 +59,11 @@
{
log.info("init: " + info);
headers = info.getHeaders();
+ Map configMap = info.getHandlerConfig();
+ String value1 = (String)configMap.get("ServerParam1");
+ String value2 = (String)configMap.get("ServerParam2");
+ if (!"value1".equals(value1) || !"value2".equals(value2))
+ throw new IllegalStateException("Invalid handler config: " + configMap);
}
public boolean handleRequest(MessageContext msgContext)
17 years, 6 months
JBossWS SVN: r3743 - in branches/jbossws-2.0/integration/native/src/main/resources: jbossws-native42.sar/jbossws.beans/META-INF and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-06-27 06:01:06 -0400 (Wed, 27 Jun 2007)
New Revision: 3743
Modified:
branches/jbossws-2.0/integration/native/src/main/resources/jbossws-native40.sar/jbossws.beans/META-INF/jboss-beans-no-ejb3.xml
branches/jbossws-2.0/integration/native/src/main/resources/jbossws-native40.sar/jbossws.beans/META-INF/jboss-beans.xml
branches/jbossws-2.0/integration/native/src/main/resources/jbossws-native42.sar/jbossws.beans/META-INF/jboss-beans.xml
Log:
Install backward compatible context-root, url-pattern deployer
Modified: branches/jbossws-2.0/integration/native/src/main/resources/jbossws-native40.sar/jbossws.beans/META-INF/jboss-beans-no-ejb3.xml
===================================================================
--- branches/jbossws-2.0/integration/native/src/main/resources/jbossws-native40.sar/jbossws.beans/META-INF/jboss-beans-no-ejb3.xml 2007-06-27 08:03:56 UTC (rev 3742)
+++ branches/jbossws-2.0/integration/native/src/main/resources/jbossws-native40.sar/jbossws.beans/META-INF/jboss-beans-no-ejb3.xml 2007-06-27 10:01:06 UTC (rev 3743)
@@ -121,7 +121,7 @@
Each handles a single aspect of web service deployment
-->
<bean name="WSClassLoaderInjectionDeployer" class="org.jboss.wsf.container.jboss42.ClassLoaderInjectionDeployer"/>
- <bean name="WSContextRootDeployer" class="org.jboss.wsf.spi.deployment.ContextRootDeployer"/>
+ <bean name="WSContextRootDeployer" class="org.jboss.ws.core.server.BackwardCompatibleContextRootDeployer"/>
<bean name="WSEagerInitializeDeployer" class="org.jboss.wsf.stack.jbws.EagerInitializeDeployer"/>
<bean name="WSEndpointHandlerDeployer" class="org.jboss.wsf.spi.deployment.EndpointHandlerDeployer">
<property name="requestHandler">org.jboss.wsf.stack.jbws.RequestHandlerImpl</property>
@@ -153,7 +153,7 @@
</bean>
<bean name="WSUnifiedMetaDataAssociationDeployer" class="org.jboss.wsf.stack.jbws.UnifiedMetaDataAssociationDeployer"/>
<bean name="WSUnifiedMetaDataDeployer" class="org.jboss.wsf.stack.jbws.UnifiedMetaDataDeployer"/>
- <bean name="WSURLPatternDeployer" class="org.jboss.wsf.spi.deployment.URLPatternDeployer"/>
+ <bean name="WSURLPatternDeployer" class="org.jboss.ws.core.server.BackwardCompatibleURLPatternDeployer"/>
<bean name="WSWebAppGeneratorDeployer" class="org.jboss.wsf.spi.deployment.WebAppGeneratorDeployer">
<property name="securityHandlerEJB21"><inject bean="WSSecurityHandlerEJB21"/></property>
</bean>
Modified: branches/jbossws-2.0/integration/native/src/main/resources/jbossws-native40.sar/jbossws.beans/META-INF/jboss-beans.xml
===================================================================
--- branches/jbossws-2.0/integration/native/src/main/resources/jbossws-native40.sar/jbossws.beans/META-INF/jboss-beans.xml 2007-06-27 08:03:56 UTC (rev 3742)
+++ branches/jbossws-2.0/integration/native/src/main/resources/jbossws-native40.sar/jbossws.beans/META-INF/jboss-beans.xml 2007-06-27 10:01:06 UTC (rev 3743)
@@ -121,7 +121,7 @@
Each handles a single aspect of web service deployment
-->
<bean name="WSClassLoaderInjectionDeployer" class="org.jboss.wsf.container.jboss42.ClassLoaderInjectionDeployer"/>
- <bean name="WSContextRootDeployer" class="org.jboss.wsf.spi.deployment.ContextRootDeployer"/>
+ <bean name="WSContextRootDeployer" class="org.jboss.ws.core.server.BackwardCompatibleContextRootDeployer"/>
<bean name="WSEagerInitializeDeployer" class="org.jboss.wsf.stack.jbws.EagerInitializeDeployer"/>
<bean name="WSEndpointHandlerDeployer" class="org.jboss.wsf.spi.deployment.EndpointHandlerDeployer">
<property name="requestHandler">org.jboss.wsf.stack.jbws.RequestHandlerImpl</property>
@@ -154,7 +154,7 @@
</bean>
<bean name="WSUnifiedMetaDataAssociationDeployer" class="org.jboss.wsf.stack.jbws.UnifiedMetaDataAssociationDeployer"/>
<bean name="WSUnifiedMetaDataDeployer" class="org.jboss.wsf.stack.jbws.UnifiedMetaDataDeployer"/>
- <bean name="WSURLPatternDeployer" class="org.jboss.wsf.spi.deployment.URLPatternDeployer"/>
+ <bean name="WSURLPatternDeployer" class="org.jboss.ws.core.server.BackwardCompatibleURLPatternDeployer"/>
<bean name="WSWebAppGeneratorDeployer" class="org.jboss.wsf.spi.deployment.WebAppGeneratorDeployer">
<property name="securityHandlerEJB21"><inject bean="WSSecurityHandlerEJB21"/></property>
<property name="securityHandlerEJB3"><inject bean="WSSecurityHandlerEJB3"/></property>
Modified: branches/jbossws-2.0/integration/native/src/main/resources/jbossws-native42.sar/jbossws.beans/META-INF/jboss-beans.xml
===================================================================
--- branches/jbossws-2.0/integration/native/src/main/resources/jbossws-native42.sar/jbossws.beans/META-INF/jboss-beans.xml 2007-06-27 08:03:56 UTC (rev 3742)
+++ branches/jbossws-2.0/integration/native/src/main/resources/jbossws-native42.sar/jbossws.beans/META-INF/jboss-beans.xml 2007-06-27 10:01:06 UTC (rev 3743)
@@ -125,7 +125,7 @@
Each handles a single aspect of web service deployment
-->
<bean name="WSClassLoaderInjectionDeployer" class="org.jboss.wsf.container.jboss42.ClassLoaderInjectionDeployer"/>
- <bean name="WSContextRootDeployer" class="org.jboss.wsf.spi.deployment.ContextRootDeployer"/>
+ <bean name="WSContextRootDeployer" class="org.jboss.ws.core.server.BackwardCompatibleContextRootDeployer"/>
<bean name="WSEagerInitializeDeployer" class="org.jboss.wsf.stack.jbws.EagerInitializeDeployer"/>
<bean name="WSEndpointHandlerDeployer" class="org.jboss.wsf.spi.deployment.EndpointHandlerDeployer">
<property name="requestHandler">org.jboss.wsf.stack.jbws.RequestHandlerImpl</property>
@@ -158,7 +158,7 @@
</bean>
<bean name="WSUnifiedMetaDataAssociationDeployer" class="org.jboss.wsf.stack.jbws.UnifiedMetaDataAssociationDeployer"/>
<bean name="WSUnifiedMetaDataDeployer" class="org.jboss.wsf.stack.jbws.UnifiedMetaDataDeployer"/>
- <bean name="WSURLPatternDeployer" class="org.jboss.wsf.spi.deployment.URLPatternDeployer"/>
+ <bean name="WSURLPatternDeployer" class="org.jboss.ws.core.server.BackwardCompatibleURLPatternDeployer"/>
<bean name="WSWebAppGeneratorDeployer" class="org.jboss.wsf.spi.deployment.WebAppGeneratorDeployer">
<property name="securityHandlerEJB21"><inject bean="WSSecurityHandlerEJB21"/></property>
<property name="securityHandlerEJB3"><inject bean="WSSecurityHandlerEJB3"/></property>
17 years, 6 months
JBossWS SVN: r3742 - in branches/jbossws-2.0: integration/native/src/main/resources/jbossws-native42.sar/jbossws.beans/META-INF and 6 other directories.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-06-27 04:03:56 -0400 (Wed, 27 Jun 2007)
New Revision: 3742
Added:
branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/binding/jaxb/BasicJAXBHandler.java
branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/binding/jaxb/JAXBContextCache.java
branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/binding/jaxb/JAXBHandler.java
Removed:
branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/binding/jaxb/CachingJAXBContextFactory.java
branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/binding/jaxb/JAXBContextFactory.java
Modified:
branches/jbossws-2.0/integration/native/src/main/resources/jbossws-native40.sar/jbossws.beans/META-INF/jboss-beans-no-ejb3.xml
branches/jbossws-2.0/integration/native/src/main/resources/jbossws-native40.sar/jbossws.beans/META-INF/jboss-beans.xml
branches/jbossws-2.0/integration/native/src/main/resources/jbossws-native42.sar/jbossws.beans/META-INF/jboss-beans.xml
branches/jbossws-2.0/integration/native/src/main/resources/jbossws-native50.sar/META-INF/jbossws-beans.xml
branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/BasicEndpoint.java
branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/Endpoint.java
branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/EndpointHandlerDeployer.java
branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/JAXBDeserializer.java
branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/JAXBSerializer.java
branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/SerializationContextJAXWS.java
branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/ClientEndpointMetaData.java
branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java
branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/ServerEndpointMetaData.java
branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/tools/metadata/ToolsEndpointMetaData.java
Log:
Externalize JAXBHandler
Modified: branches/jbossws-2.0/integration/native/src/main/resources/jbossws-native40.sar/jbossws.beans/META-INF/jboss-beans-no-ejb3.xml
===================================================================
--- branches/jbossws-2.0/integration/native/src/main/resources/jbossws-native40.sar/jbossws.beans/META-INF/jboss-beans-no-ejb3.xml 2007-06-27 07:27:56 UTC (rev 3741)
+++ branches/jbossws-2.0/integration/native/src/main/resources/jbossws-native40.sar/jbossws.beans/META-INF/jboss-beans-no-ejb3.xml 2007-06-27 08:03:56 UTC (rev 3742)
@@ -126,6 +126,7 @@
<bean name="WSEndpointHandlerDeployer" class="org.jboss.wsf.spi.deployment.EndpointHandlerDeployer">
<property name="requestHandler">org.jboss.wsf.stack.jbws.RequestHandlerImpl</property>
<property name="lifecycleHandler">org.jboss.wsf.stack.jbws.LifecycleHandlerImpl</property>
+ <property name="jaxbHandler">org.jboss.wsf.spi.binding.jaxb.JAXBContextCache</property>
<property name="invocationHandler">
<map keyClass="java.lang.String" valueClass="java.lang.String">
<entry><key>JAXRPC_JSE</key><value>org.jboss.wsf.stack.jbws.ServiceLifecycleInvocationHandler</value></entry>
Modified: branches/jbossws-2.0/integration/native/src/main/resources/jbossws-native40.sar/jbossws.beans/META-INF/jboss-beans.xml
===================================================================
--- branches/jbossws-2.0/integration/native/src/main/resources/jbossws-native40.sar/jbossws.beans/META-INF/jboss-beans.xml 2007-06-27 07:27:56 UTC (rev 3741)
+++ branches/jbossws-2.0/integration/native/src/main/resources/jbossws-native40.sar/jbossws.beans/META-INF/jboss-beans.xml 2007-06-27 08:03:56 UTC (rev 3742)
@@ -126,6 +126,7 @@
<bean name="WSEndpointHandlerDeployer" class="org.jboss.wsf.spi.deployment.EndpointHandlerDeployer">
<property name="requestHandler">org.jboss.wsf.stack.jbws.RequestHandlerImpl</property>
<property name="lifecycleHandler">org.jboss.wsf.stack.jbws.LifecycleHandlerImpl</property>
+ <property name="jaxbHandler">org.jboss.wsf.spi.binding.jaxb.JAXBContextCache</property>
<property name="invocationHandler">
<map keyClass="java.lang.String" valueClass="java.lang.String">
<entry><key>JAXRPC_JSE</key><value>org.jboss.wsf.stack.jbws.ServiceLifecycleInvocationHandler</value></entry>
Modified: branches/jbossws-2.0/integration/native/src/main/resources/jbossws-native42.sar/jbossws.beans/META-INF/jboss-beans.xml
===================================================================
--- branches/jbossws-2.0/integration/native/src/main/resources/jbossws-native42.sar/jbossws.beans/META-INF/jboss-beans.xml 2007-06-27 07:27:56 UTC (rev 3741)
+++ branches/jbossws-2.0/integration/native/src/main/resources/jbossws-native42.sar/jbossws.beans/META-INF/jboss-beans.xml 2007-06-27 08:03:56 UTC (rev 3742)
@@ -130,6 +130,7 @@
<bean name="WSEndpointHandlerDeployer" class="org.jboss.wsf.spi.deployment.EndpointHandlerDeployer">
<property name="requestHandler">org.jboss.wsf.stack.jbws.RequestHandlerImpl</property>
<property name="lifecycleHandler">org.jboss.wsf.stack.jbws.LifecycleHandlerImpl</property>
+ <property name="jaxbHandler">org.jboss.wsf.spi.binding.jaxb.JAXBContextCache</property>
<property name="invocationHandler">
<map keyClass="java.lang.String" valueClass="java.lang.String">
<entry><key>JAXRPC_JSE</key><value>org.jboss.wsf.stack.jbws.ServiceLifecycleInvocationHandler</value></entry>
Modified: branches/jbossws-2.0/integration/native/src/main/resources/jbossws-native50.sar/META-INF/jbossws-beans.xml
===================================================================
--- branches/jbossws-2.0/integration/native/src/main/resources/jbossws-native50.sar/META-INF/jbossws-beans.xml 2007-06-27 07:27:56 UTC (rev 3741)
+++ branches/jbossws-2.0/integration/native/src/main/resources/jbossws-native50.sar/META-INF/jbossws-beans.xml 2007-06-27 08:03:56 UTC (rev 3742)
@@ -141,6 +141,7 @@
<bean name="WSEndpointHandlerDeployer" class="org.jboss.wsf.spi.deployment.EndpointHandlerDeployer">
<property name="requestHandler">org.jboss.wsf.stack.jbws.RequestHandlerImpl</property>
<property name="lifecycleHandler">org.jboss.wsf.stack.jbws.LifecycleHandlerImpl</property>
+ <property name="jaxbHandler">org.jboss.wsf.spi.binding.jaxb.JAXBContextCache</property>
<property name="invocationHandler">
<map keyClass="java.lang.String" valueClass="java.lang.String">
<entry><key>JAXRPC_JSE</key><value>org.jboss.wsf.stack.jbws.ServiceLifecycleInvocationHandler</value></entry>
Added: branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/binding/jaxb/BasicJAXBHandler.java
===================================================================
--- branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/binding/jaxb/BasicJAXBHandler.java (rev 0)
+++ branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/binding/jaxb/BasicJAXBHandler.java 2007-06-27 08:03:56 UTC (rev 3742)
@@ -0,0 +1,42 @@
+/*
+ * 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.wsf.spi.binding.jaxb;
+
+// $Id: $
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBException;
+
+/**
+ * A basic JAXBHandler.
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 26-Jun-2007
+ */
+public class BasicJAXBHandler implements JAXBHandler
+{
+ public JAXBContext getJAXBContext(Class[] javaTypes) throws JAXBException
+ {
+ JAXBContext ctx = JAXBContext.newInstance(javaTypes);
+ return ctx;
+ }
+}
Deleted: branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/binding/jaxb/CachingJAXBContextFactory.java
===================================================================
--- branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/binding/jaxb/CachingJAXBContextFactory.java 2007-06-27 07:27:56 UTC (rev 3741)
+++ branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/binding/jaxb/CachingJAXBContextFactory.java 2007-06-27 08:03:56 UTC (rev 3742)
@@ -1,85 +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.wsf.spi.binding.jaxb;
-
-// $Id: $
-
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.JAXBException;
-
-import org.jboss.wsf.spi.utils.HashCodeUtil;
-
-/**
- * Cache JAXBContext's.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 26-Jun-2007
- */
-public class CachingJAXBContextFactory implements JAXBContextFactory
-{
- private Map<Integer, JAXBContext> cache = new ConcurrentHashMap<Integer, JAXBContext>();
-
- private JAXBContext get(Integer id)
- {
- return cache.get(id);
- }
-
- private void add(Integer id, JAXBContext context)
- {
- cache.put(id, context);
- }
-
- /**
- * Retrieve a cached JAXBContext instance.
- * If no instance is cached a new one will be created and registered.
- */
- public JAXBContext getInstance(Class[] classes) throws JAXBException
- {
- Integer id = buildId(classes);
- JAXBContext ctx = get(id);
- if (null == ctx)
- {
- ctx = JAXBContext.newInstance(classes);
- add(id, ctx);
- }
-
- return ctx;
- }
-
- private Integer buildId(Class[] classes)
- {
- int sum = HashCodeUtil.SEED;
- for (Class cls : classes)
- {
- sum = HashCodeUtil.hash(sum, cls.getName());
- }
- return new Integer(sum);
- }
-
- private Integer buildId(Class clazz)
- {
- return buildId(new Class[] { clazz });
- }
-}
Added: branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/binding/jaxb/JAXBContextCache.java
===================================================================
--- branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/binding/jaxb/JAXBContextCache.java (rev 0)
+++ branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/binding/jaxb/JAXBContextCache.java 2007-06-27 08:03:56 UTC (rev 3742)
@@ -0,0 +1,81 @@
+/*
+ * 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.wsf.spi.binding.jaxb;
+
+// $Id: $
+
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBException;
+
+import org.jboss.wsf.spi.utils.HashCodeUtil;
+
+/**
+ * Cache JAXBContext's.
+ *
+ * @author Heiko.Braun(a)jboss.com
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 26-Jun-2007
+ */
+public class JAXBContextCache implements JAXBHandler
+{
+ private Map<Integer, JAXBContext> cache = new ConcurrentHashMap<Integer, JAXBContext>();
+
+ private JAXBContext get(Integer id)
+ {
+ return cache.get(id);
+ }
+
+ private void add(Integer id, JAXBContext context)
+ {
+ cache.put(id, context);
+ }
+
+ /**
+ * Retrieve a cached JAXBContext instance.
+ * If no instance is cached a new one will be created and registered.
+ */
+ public JAXBContext getJAXBContext(Class[] javaTypes) throws JAXBException
+ {
+ Integer id = buildId(javaTypes);
+ JAXBContext ctx = get(id);
+ if (null == ctx)
+ {
+ ctx = JAXBContext.newInstance(javaTypes);
+ add(id, ctx);
+ }
+
+ return ctx;
+ }
+
+ private Integer buildId(Class[] classes)
+ {
+ int sum = HashCodeUtil.SEED;
+ for (Class cls : classes)
+ {
+ sum = HashCodeUtil.hash(sum, cls.getName());
+ }
+ return new Integer(sum);
+ }
+}
Deleted: branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/binding/jaxb/JAXBContextFactory.java
===================================================================
--- branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/binding/jaxb/JAXBContextFactory.java 2007-06-27 07:27:56 UTC (rev 3741)
+++ branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/binding/jaxb/JAXBContextFactory.java 2007-06-27 08:03:56 UTC (rev 3742)
@@ -1,42 +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.wsf.spi.binding.jaxb;
-
-// $Id: $
-
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.JAXBException;
-
-/**
- * A factory for JAXBContext
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 26-Jun-2007
- */
-public interface JAXBContextFactory
-{
- /**
- * Retrieve a cached JAXBContext instance.
- * If no instance is cached a new one will be created and registered.
- */
- JAXBContext getInstance(Class[] classes) throws JAXBException;
-}
Copied: branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/binding/jaxb/JAXBHandler.java (from rev 3740, branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/binding/jaxb/JAXBContextFactory.java)
===================================================================
--- branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/binding/jaxb/JAXBHandler.java (rev 0)
+++ branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/binding/jaxb/JAXBHandler.java 2007-06-27 08:03:56 UTC (rev 3742)
@@ -0,0 +1,40 @@
+/*
+ * 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.wsf.spi.binding.jaxb;
+
+// $Id: $
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBException;
+
+/**
+ * A factory for JAXBContext
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 26-Jun-2007
+ */
+public interface JAXBHandler
+{
+ /** Get a JAXBContext instance.
+ */
+ JAXBContext getJAXBContext(Class[] javaTypes) throws JAXBException;
+}
Modified: branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/BasicEndpoint.java
===================================================================
--- branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/BasicEndpoint.java 2007-06-27 07:27:56 UTC (rev 3741)
+++ branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/BasicEndpoint.java 2007-06-27 08:03:56 UTC (rev 3742)
@@ -27,6 +27,7 @@
import javax.management.ObjectName;
+import org.jboss.wsf.spi.binding.jaxb.JAXBHandler;
import org.jboss.wsf.spi.invocation.InvocationHandler;
import org.jboss.wsf.spi.invocation.RequestHandler;
import org.jboss.wsf.spi.management.EndpointMetrics;
@@ -48,6 +49,7 @@
private RequestHandler requestHandler;
private InvocationHandler invocationHandler;
private LifecycleHandler lifecycleHandler;
+ private JAXBHandler jaxbHandler;
private Map<Class, Object> attachments = new HashMap<Class, Object>();
private Map<String, Object> properties = new HashMap<String, Object>();
private EndpointMetrics metrics;
@@ -167,6 +169,16 @@
this.invocationHandler = handler;
}
+ public JAXBHandler getJAXBHandler()
+ {
+ return jaxbHandler;
+ }
+
+ public void setJAXBHandler(JAXBHandler jaxbHandler)
+ {
+ this.jaxbHandler = jaxbHandler;
+ }
+
public <T> T addAttachment(Class<T> key, Object value)
{
return (T)attachments.put(key, value);
Modified: branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/Endpoint.java
===================================================================
--- branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/Endpoint.java 2007-06-27 07:27:56 UTC (rev 3741)
+++ branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/Endpoint.java 2007-06-27 08:03:56 UTC (rev 3742)
@@ -27,6 +27,7 @@
import javax.management.ObjectName;
+import org.jboss.wsf.spi.binding.jaxb.JAXBHandler;
import org.jboss.wsf.spi.invocation.InvocationHandler;
import org.jboss.wsf.spi.invocation.RequestHandler;
import org.jboss.wsf.spi.management.EndpointMetrics;
@@ -107,6 +108,12 @@
/** Set the endpoint bean invoker */
void setInvocationHandler(InvocationHandler invoker);
+ /** Get the JAXBHandler for this endpoint */
+ JAXBHandler getJAXBHandler();
+
+ /** Set the JAXBHandler for this endpoint */
+ void setJAXBHandler(JAXBHandler handler);
+
/** Get the endpoint metrics for this endpoint */
EndpointMetrics getEndpointMetrics();
Modified: branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/EndpointHandlerDeployer.java
===================================================================
--- branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/EndpointHandlerDeployer.java 2007-06-27 07:27:56 UTC (rev 3741)
+++ branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/EndpointHandlerDeployer.java 2007-06-27 08:03:56 UTC (rev 3742)
@@ -25,6 +25,7 @@
import java.util.Map;
+import org.jboss.wsf.spi.binding.jaxb.JAXBHandler;
import org.jboss.wsf.spi.invocation.InvocationHandler;
import org.jboss.wsf.spi.invocation.RequestHandler;
import org.jboss.wsf.spi.metadata.j2ee.UnifiedApplicationMetaData;
@@ -41,6 +42,7 @@
{
private String requestHandler;
private String lifecycleHandler;
+ private String jaxbHandler;
private Map<String,String> invocationHandler;
public void setLifecycleHandler(String handler)
@@ -58,6 +60,11 @@
this.invocationHandler = handlers;
}
+ public void setJaxbHandler(String jaxbHandler)
+ {
+ this.jaxbHandler = jaxbHandler;
+ }
+
@Override
public void create(Deployment dep)
{
@@ -66,6 +73,7 @@
ep.setRequestHandler(getRequestHandler(dep));
ep.setLifecycleHandler(getLifecycleHandler(dep));
ep.setInvocationHandler(getInvocationHandler(ep));
+ ep.setJAXBHandler(getJAXBHandler(dep));
}
}
@@ -95,6 +103,19 @@
}
}
+ private JAXBHandler getJAXBHandler(Deployment dep)
+ {
+ try
+ {
+ Class<?> handlerClass = dep.getClassLoader().loadClass(jaxbHandler);
+ return (JAXBHandler)handlerClass.newInstance();
+ }
+ catch (Exception e)
+ {
+ throw new IllegalStateException("Cannot load jaxb handler: " + jaxbHandler);
+ }
+ }
+
private InvocationHandler getInvocationHandler(Endpoint ep)
{
Deployment dep = ep.getService().getDeployment();
Modified: branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/JAXBDeserializer.java
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/JAXBDeserializer.java 2007-06-27 07:27:56 UTC (rev 3741)
+++ branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/JAXBDeserializer.java 2007-06-27 08:03:56 UTC (rev 3742)
@@ -37,7 +37,7 @@
import org.jboss.ws.core.binding.SerializationContext;
import org.jboss.ws.core.binding.TypeMappingImpl;
import org.jboss.ws.extensions.xop.jaxws.AttachmentUnmarshallerImpl;
-import org.jboss.wsf.spi.binding.jaxb.JAXBContextFactory;
+import org.jboss.wsf.spi.binding.jaxb.JAXBHandler;
/**
* A Deserializer that can handle complex types by delegating to JAXB.
@@ -66,8 +66,7 @@
TypeMappingImpl typeMapping = serContext.getTypeMapping();
Class javaType = typeMapping.getJavaType(xmlType);
- JAXBContextFactory jaxbFactory = ((SerializationContextJAXWS)serContext).getJAXBContextFactory();
- JAXBContext jaxbContext = jaxbFactory.getInstance(javaTypes);
+ JAXBContext jaxbContext = ((SerializationContextJAXWS)serContext).getJAXBContext(javaTypes);
Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
unmarshaller.setAttachmentUnmarshaller( new AttachmentUnmarshallerImpl());
Modified: branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/JAXBSerializer.java
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/JAXBSerializer.java 2007-06-27 07:27:56 UTC (rev 3741)
+++ branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/JAXBSerializer.java 2007-06-27 08:03:56 UTC (rev 3742)
@@ -37,7 +37,7 @@
import org.jboss.ws.core.binding.ComplexTypeSerializer;
import org.jboss.ws.core.binding.SerializationContext;
import org.jboss.ws.extensions.xop.jaxws.AttachmentMarshallerImpl;
-import org.jboss.wsf.spi.binding.jaxb.JAXBContextFactory;
+import org.jboss.wsf.spi.binding.jaxb.JAXBHandler;
import org.w3c.dom.NamedNodeMap;
/**
@@ -69,8 +69,7 @@
Class actualType = value.getClass();
Class[] javaTypes = shouldFilter(actualType) ? new Class[]{expectedType} : new Class[]{expectedType, actualType};
- JAXBContextFactory jaxbFactory = ((SerializationContextJAXWS)serContext).getJAXBContextFactory();
- JAXBContext jaxbContext = jaxbFactory.getInstance(javaTypes);
+ JAXBContext jaxbContext = ((SerializationContextJAXWS)serContext).getJAXBContext(javaTypes);
Marshaller marshaller = jaxbContext.createMarshaller();
Modified: branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/SerializationContextJAXWS.java
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/SerializationContextJAXWS.java 2007-06-27 07:27:56 UTC (rev 3741)
+++ branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/SerializationContextJAXWS.java 2007-06-27 08:03:56 UTC (rev 3742)
@@ -1,34 +1,35 @@
/*
-* 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.
-*/
+ * 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.jaxws;
// $Id$
-import org.jboss.logging.Logger;
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBException;
+
import org.jboss.ws.core.CommonMessageContext;
import org.jboss.ws.core.binding.SerializationContext;
import org.jboss.ws.core.soap.MessageContextAssociation;
import org.jboss.ws.metadata.umdm.EndpointMetaData;
-import org.jboss.wsf.spi.binding.jaxb.JAXBContextFactory;
/**
* The serialization context for JAXWS endpoints/clients
@@ -38,19 +39,16 @@
*/
public class SerializationContextJAXWS extends SerializationContext
{
- // provide logging
- private static final Logger log = Logger.getLogger(SerializationContextJAXWS.class);
-
public static final String JAXB_CONTEXT_TYPES = "org.jboss.ws.jaxb.context.types";
/**
- * Access the JAXBContextFactory through the message context.
+ * Access the JAXBContext through the message context.
* The actual instance is assiciated with the EndpointMetaData.
*/
- public static JAXBContextFactory getJAXBContextFactory()
+ public static JAXBContext getJAXBContext(Class[] javaTypes) throws JAXBException
{
CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
EndpointMetaData epMetaData = msgContext.getEndpointMetaData();
- return epMetaData.getJAXBContextFactory();
+ return epMetaData.getJAXBContext(javaTypes);
}
}
Modified: branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/ClientEndpointMetaData.java
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/ClientEndpointMetaData.java 2007-06-27 07:27:56 UTC (rev 3741)
+++ branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/ClientEndpointMetaData.java 2007-06-27 08:03:56 UTC (rev 3742)
@@ -23,10 +23,13 @@
// $Id$
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBException;
import javax.xml.namespace.QName;
import org.jboss.ws.metadata.config.ConfigurationProvider;
-import org.jboss.wsf.spi.binding.jaxb.CachingJAXBContextFactory;
+import org.jboss.wsf.spi.binding.jaxb.JAXBContextCache;
+import org.jboss.wsf.spi.binding.jaxb.JAXBHandler;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerMetaData.HandlerType;
/**
@@ -37,6 +40,8 @@
*/
public class ClientEndpointMetaData extends EndpointMetaData
{
+ private JAXBHandler jaxbHandler = new JAXBContextCache();
+
public ClientEndpointMetaData(ServiceMetaData service, QName qname, QName portTypeName, Type type)
{
super(service, qname, portTypeName, type);
@@ -48,6 +53,12 @@
configFile = ConfigurationProvider.DEFAULT_JAXWS_CLIENT_CONFIG_FILE;
}
+ @Override
+ public JAXBContext getJAXBContext(Class[] javaTypes) throws JAXBException
+ {
+ return jaxbHandler.getJAXBContext(javaTypes);
+ }
+
public String toString()
{
StringBuilder buffer = new StringBuilder("\nClientEndpointMetaData:");
Modified: branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java 2007-06-27 07:27:56 UTC (rev 3741)
+++ branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java 2007-06-27 08:03:56 UTC (rev 3742)
@@ -36,6 +36,8 @@
import java.util.Set;
import javax.jws.soap.SOAPBinding.ParameterStyle;
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBException;
import javax.xml.namespace.QName;
import javax.xml.rpc.ParameterMode;
import javax.xml.ws.Service.Mode;
@@ -61,8 +63,6 @@
import org.jboss.ws.metadata.config.ConfigurationProvider;
import org.jboss.ws.metadata.config.EndpointFeature;
import org.jboss.ws.metadata.config.JBossWSConfigFactory;
-import org.jboss.wsf.spi.binding.jaxb.CachingJAXBContextFactory;
-import org.jboss.wsf.spi.binding.jaxb.JAXBContextFactory;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedPortComponentRefMetaData;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerMetaData.HandlerType;
import org.jboss.wsf.spi.utils.JavaUtils;
@@ -142,8 +142,6 @@
private ConfigObservable configObservable = new ConfigObservable();
- protected JAXBContextFactory jaxbContextFactory = new CachingJAXBContextFactory();
-
private List<UnifiedPortComponentRefMetaData> serviceRefContrib = new ArrayList<UnifiedPortComponentRefMetaData>();
public EndpointMetaData(ServiceMetaData service, QName portName, QName portTypeName, Type type)
@@ -326,10 +324,7 @@
return type;
}
- public JAXBContextFactory getJAXBContextFactory()
- {
- return jaxbContextFactory;
- }
+ public abstract JAXBContext getJAXBContext(Class[] javaTypes) throws JAXBException;
public String getAuthMethod()
{
Modified: branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/ServerEndpointMetaData.java
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/ServerEndpointMetaData.java 2007-06-27 07:27:56 UTC (rev 3741)
+++ branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/ServerEndpointMetaData.java 2007-06-27 08:03:56 UTC (rev 3742)
@@ -24,11 +24,13 @@
// $Id$
import javax.management.ObjectName;
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBException;
import javax.xml.namespace.QName;
import org.jboss.logging.Logger;
import org.jboss.ws.metadata.config.ConfigurationProvider;
-import org.jboss.wsf.spi.binding.jaxb.JAXBContextFactory;
+import org.jboss.wsf.spi.binding.jaxb.JAXBHandler;
import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerMetaData.HandlerType;
@@ -185,6 +187,12 @@
{
this.secureWSDLAccess = secureWSDLAccess;
}
+
+ @Override
+ public JAXBContext getJAXBContext(Class[] javaTypes) throws JAXBException
+ {
+ return endpoint.getJAXBHandler().getJAXBContext(javaTypes);
+ }
public String toString()
{
Modified: branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/tools/metadata/ToolsEndpointMetaData.java
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/tools/metadata/ToolsEndpointMetaData.java 2007-06-27 07:27:56 UTC (rev 3741)
+++ branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/tools/metadata/ToolsEndpointMetaData.java 2007-06-27 08:03:56 UTC (rev 3742)
@@ -23,10 +23,13 @@
// $Id$
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBException;
import javax.xml.namespace.QName;
import org.jboss.ws.metadata.umdm.EndpointMetaData;
import org.jboss.ws.metadata.umdm.ServiceMetaData;
+import org.jboss.wsf.spi.binding.jaxb.BasicJAXBHandler;
/**
* Tools Endpoint Metadata
@@ -41,4 +44,10 @@
{
super(service, portName, portTypeName, Type.JAXRPC);
}
+
+ @Override
+ public JAXBContext getJAXBContext(Class[] javaTypes) throws JAXBException
+ {
+ return new BasicJAXBHandler().getJAXBContext(javaTypes);
+ }
}
\ No newline at end of file
17 years, 6 months