JBossWS SVN: r13801 - stack/cxf/trunk.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2011-02-25 02:35:26 -0500 (Fri, 25 Feb 2011)
New Revision: 13801
Modified:
stack/cxf/trunk/pom.xml
Log:
[JBEE-75][JBWS-3223] Moving to jboss-jaxws-api 2.0.0.Alpha1
Modified: stack/cxf/trunk/pom.xml
===================================================================
--- stack/cxf/trunk/pom.xml 2011-02-24 18:03:49 UTC (rev 13800)
+++ stack/cxf/trunk/pom.xml 2011-02-25 07:35:26 UTC (rev 13801)
@@ -70,7 +70,7 @@
<jaxb.api.version>1.0.0.Final</jaxb.api.version>
<jaxb.impl.version>2.2</jaxb.impl.version>
<jaxrpc.api.version>1.0.0.Final</jaxrpc.api.version>
- <jaxws.api.version>1.0.0.Final</jaxws.api.version>
+ <jaxws.api.version>2.0.0.Alpha1</jaxws.api.version>
<jboss.jaxr.version>2.0.2</jboss.jaxr.version>
<jsr181.api.version>1.0-MR1</jsr181.api.version>
<apache.scout.version>1.1.1</apache.scout.version>
13 years, 10 months
JBossWS SVN: r13800 - in stack/native/branches/jbossws-native-2.0.1.SP2_CP08_JBPAPP-5990: ant-import-tests and 6 other directories.
by jbossws-commits@lists.jboss.org
Author: darran.lofthouse(a)jboss.com
Date: 2011-02-24 13:03:49 -0500 (Thu, 24 Feb 2011)
New Revision: 13800
Added:
stack/native/branches/jbossws-native-2.0.1.SP2_CP08_JBPAPP-5990/src/test/java/org/jboss/test/ws/jaxws/jbpapp5486/
stack/native/branches/jbossws-native-2.0.1.SP2_CP08_JBPAPP-5990/src/test/java/org/jboss/test/ws/jaxws/jbpapp5486/Endpoint.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP08_JBPAPP-5990/src/test/java/org/jboss/test/ws/jaxws/jbpapp5486/EndpointImpl.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP08_JBPAPP-5990/src/test/java/org/jboss/test/ws/jaxws/jbpapp5486/JBPAPP5486TestCase.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP08_JBPAPP-5990/src/test/resources/jaxws/jbpapp5486/
stack/native/branches/jbossws-native-2.0.1.SP2_CP08_JBPAPP-5990/src/test/resources/jaxws/jbpapp5486/WEB-INF/
stack/native/branches/jbossws-native-2.0.1.SP2_CP08_JBPAPP-5990/src/test/resources/jaxws/jbpapp5486/WEB-INF/jboss-web.xml
stack/native/branches/jbossws-native-2.0.1.SP2_CP08_JBPAPP-5990/src/test/resources/jaxws/jbpapp5486/WEB-INF/web.xml
Removed:
stack/native/branches/jbossws-native-2.0.1.SP2_CP08_JBPAPP-5990/src/test/java/org/jboss/test/ws/jaxws/jbpapp5486/Endpoint.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP08_JBPAPP-5990/src/test/java/org/jboss/test/ws/jaxws/jbpapp5486/EndpointImpl.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP08_JBPAPP-5990/src/test/java/org/jboss/test/ws/jaxws/jbpapp5486/JBPAPP5486TestCase.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP08_JBPAPP-5990/src/test/resources/jaxws/jbpapp5486/WEB-INF/
stack/native/branches/jbossws-native-2.0.1.SP2_CP08_JBPAPP-5990/src/test/resources/jaxws/jbpapp5486/WEB-INF/jboss-web.xml
stack/native/branches/jbossws-native-2.0.1.SP2_CP08_JBPAPP-5990/src/test/resources/jaxws/jbpapp5486/WEB-INF/web.xml
Modified:
stack/native/branches/jbossws-native-2.0.1.SP2_CP08_JBPAPP-5990/
stack/native/branches/jbossws-native-2.0.1.SP2_CP08_JBPAPP-5990/ant-import-tests/build-jars-jaxws.xml
stack/native/branches/jbossws-native-2.0.1.SP2_CP08_JBPAPP-5990/src/main/java/org/jboss/ws/core/client/RemotingConnectionImpl.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP08_JBPAPP-5990/version.properties
Log:
[JBPAPP-5990] Timeout value gets inserted into URLs.
Property changes on: stack/native/branches/jbossws-native-2.0.1.SP2_CP08_JBPAPP-5990
___________________________________________________________________
Added: svn:mergeinfo
+ /stack/native/branches/jbossws-native-2.0.1.SP2_CP:13470
Modified: stack/native/branches/jbossws-native-2.0.1.SP2_CP08_JBPAPP-5990/ant-import-tests/build-jars-jaxws.xml
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP08_JBPAPP-5990/ant-import-tests/build-jars-jaxws.xml 2011-02-24 17:27:04 UTC (rev 13799)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP08_JBPAPP-5990/ant-import-tests/build-jars-jaxws.xml 2011-02-24 18:03:49 UTC (rev 13800)
@@ -130,7 +130,18 @@
<include name="**/*.wsdl"/>
</webinf>
</war>
-
+
+ <!-- jaxws-jbpapp5486 -->
+ <war warfile="${tests.output.dir}/libs/jaxws-jbpapp5486.war" webxml="${tests.output.dir}/resources/jaxws/jbpapp5486/WEB-INF/web.xml">
+ <classes dir="${tests.output.dir}/classes">
+ <include name="org/jboss/test/ws/jaxws/jbpapp5486/*.class" />
+ <exclude name="org/jboss/test/ws/jaxws/jbpapp5486/*TestCase.class" />
+ </classes>
+ <webinf dir="${tests.output.dir}/resources/jaxws/jbpapp5486/WEB-INF">
+ <include name="jboss-web.xml" />
+ </webinf>
+ </war>
+
<!-- jaxws-jbws771 -->
<jar destfile="${tests.output.dir}/libs/jaxws-jbws771.jar">
<fileset dir="${tests.output.dir}/classes">
Modified: stack/native/branches/jbossws-native-2.0.1.SP2_CP08_JBPAPP-5990/src/main/java/org/jboss/ws/core/client/RemotingConnectionImpl.java
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP08_JBPAPP-5990/src/main/java/org/jboss/ws/core/client/RemotingConnectionImpl.java 2011-02-24 17:27:04 UTC (rev 13799)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP08_JBPAPP-5990/src/main/java/org/jboss/ws/core/client/RemotingConnectionImpl.java 2011-02-24 18:03:49 UTC (rev 13800)
@@ -153,7 +153,7 @@
if (callProps.containsKey(StubExt.PROPERTY_CLIENT_TIMEOUT))
{
timeout = callProps.get(StubExt.PROPERTY_CLIENT_TIMEOUT);
- targetAddress = addURLParameter(targetAddress, "timeout", timeout.toString());
+ clientConfig.put("timeout", timeout.toString());
}
}
Deleted: stack/native/branches/jbossws-native-2.0.1.SP2_CP08_JBPAPP-5990/src/test/java/org/jboss/test/ws/jaxws/jbpapp5486/Endpoint.java
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbpapp5486/Endpoint.java 2010-12-13 13:06:35 UTC (rev 13470)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP08_JBPAPP-5990/src/test/java/org/jboss/test/ws/jaxws/jbpapp5486/Endpoint.java 2011-02-24 18:03:49 UTC (rev 13800)
@@ -1,40 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2010, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.test.ws.jaxws.jbpapp5486;
-
-import javax.jws.WebService;
-
-/**
- * Test Endpoint.
- *
- * @author darran.lofthouse(a)jboss.com
- * @since 13th December 2010
- */
-@WebService(name = "Endpoint", targetNamespace = "http://ws.jboss.org/jbpap5486")
-public interface Endpoint
-{
-
- public String verifyNoTimeoutParameter(final String message);
-
- public String doSleep(final String message, final long timeout);
-
-}
Copied: stack/native/branches/jbossws-native-2.0.1.SP2_CP08_JBPAPP-5990/src/test/java/org/jboss/test/ws/jaxws/jbpapp5486/Endpoint.java (from rev 13470, stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbpapp5486/Endpoint.java)
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP08_JBPAPP-5990/src/test/java/org/jboss/test/ws/jaxws/jbpapp5486/Endpoint.java (rev 0)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP08_JBPAPP-5990/src/test/java/org/jboss/test/ws/jaxws/jbpapp5486/Endpoint.java 2011-02-24 18:03:49 UTC (rev 13800)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.test.ws.jaxws.jbpapp5486;
+
+import javax.jws.WebService;
+
+/**
+ * Test Endpoint.
+ *
+ * @author darran.lofthouse(a)jboss.com
+ * @since 13th December 2010
+ */
+@WebService(name = "Endpoint", targetNamespace = "http://ws.jboss.org/jbpap5486")
+public interface Endpoint
+{
+
+ public String verifyNoTimeoutParameter(final String message);
+
+ public String doSleep(final String message, final long timeout);
+
+}
Deleted: stack/native/branches/jbossws-native-2.0.1.SP2_CP08_JBPAPP-5990/src/test/java/org/jboss/test/ws/jaxws/jbpapp5486/EndpointImpl.java
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbpapp5486/EndpointImpl.java 2010-12-13 13:06:35 UTC (rev 13470)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP08_JBPAPP-5990/src/test/java/org/jboss/test/ws/jaxws/jbpapp5486/EndpointImpl.java 2011-02-24 18:03:49 UTC (rev 13800)
@@ -1,81 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2010, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.test.ws.jaxws.jbpapp5486;
-
-import java.util.Map;
-
-import javax.annotation.Resource;
-import javax.jws.WebService;
-import javax.servlet.http.HttpServletRequest;
-import javax.xml.ws.WebServiceContext;
-import javax.xml.ws.handler.MessageContext;
-
-/**
- * Test Endpoint implementation.
- *
- * @author darran.lofthouse(a)jboss.com
- * @since 13th December 2010
- */
-@WebService(name = "Endpoint", targetNamespace = "http://ws.jboss.org/jbpapp5486", endpointInterface = "org.jboss.test.ws.jaxws.jbpapp5486.Endpoint")
-public class EndpointImpl implements Endpoint
-{
-
- @Resource
- private WebServiceContext context;
-
- public String verifyNoTimeoutParameter(final String message)
- {
- if (getTimeout() != null)
- {
- throw new IllegalStateException("timeout parameter recieved.");
- }
-
- return message;
- }
-
- public String doSleep(final String message, final long timeout)
- {
- try
- {
- Thread.sleep(timeout);
- }
- catch (InterruptedException e)
- {
- throw new RuntimeException("We were interrupted!!", e);
- }
-
- return message;
- }
-
- private String getTimeout()
- {
- HttpServletRequest request = (HttpServletRequest)context.getMessageContext().get(MessageContext.SERVLET_REQUEST);
- String timeout = request.getParameter("timeout");
-
- return timeout;
- }
-
-
-
-
-
-}
Copied: stack/native/branches/jbossws-native-2.0.1.SP2_CP08_JBPAPP-5990/src/test/java/org/jboss/test/ws/jaxws/jbpapp5486/EndpointImpl.java (from rev 13470, stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbpapp5486/EndpointImpl.java)
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP08_JBPAPP-5990/src/test/java/org/jboss/test/ws/jaxws/jbpapp5486/EndpointImpl.java (rev 0)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP08_JBPAPP-5990/src/test/java/org/jboss/test/ws/jaxws/jbpapp5486/EndpointImpl.java 2011-02-24 18:03:49 UTC (rev 13800)
@@ -0,0 +1,81 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.test.ws.jaxws.jbpapp5486;
+
+import java.util.Map;
+
+import javax.annotation.Resource;
+import javax.jws.WebService;
+import javax.servlet.http.HttpServletRequest;
+import javax.xml.ws.WebServiceContext;
+import javax.xml.ws.handler.MessageContext;
+
+/**
+ * Test Endpoint implementation.
+ *
+ * @author darran.lofthouse(a)jboss.com
+ * @since 13th December 2010
+ */
+@WebService(name = "Endpoint", targetNamespace = "http://ws.jboss.org/jbpapp5486", endpointInterface = "org.jboss.test.ws.jaxws.jbpapp5486.Endpoint")
+public class EndpointImpl implements Endpoint
+{
+
+ @Resource
+ private WebServiceContext context;
+
+ public String verifyNoTimeoutParameter(final String message)
+ {
+ if (getTimeout() != null)
+ {
+ throw new IllegalStateException("timeout parameter recieved.");
+ }
+
+ return message;
+ }
+
+ public String doSleep(final String message, final long timeout)
+ {
+ try
+ {
+ Thread.sleep(timeout);
+ }
+ catch (InterruptedException e)
+ {
+ throw new RuntimeException("We were interrupted!!", e);
+ }
+
+ return message;
+ }
+
+ private String getTimeout()
+ {
+ HttpServletRequest request = (HttpServletRequest)context.getMessageContext().get(MessageContext.SERVLET_REQUEST);
+ String timeout = request.getParameter("timeout");
+
+ return timeout;
+ }
+
+
+
+
+
+}
Deleted: stack/native/branches/jbossws-native-2.0.1.SP2_CP08_JBPAPP-5990/src/test/java/org/jboss/test/ws/jaxws/jbpapp5486/JBPAPP5486TestCase.java
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbpapp5486/JBPAPP5486TestCase.java 2010-12-13 13:06:35 UTC (rev 13470)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP08_JBPAPP-5990/src/test/java/org/jboss/test/ws/jaxws/jbpapp5486/JBPAPP5486TestCase.java 2011-02-24 18:03:49 UTC (rev 13800)
@@ -1,106 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2010, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.test.ws.jaxws.jbpapp5486;
-
-import java.io.File;
-import java.net.URL;
-
-import javax.xml.namespace.QName;
-import javax.xml.ws.BindingProvider;
-import javax.xml.ws.Service;
-import javax.xml.ws.WebServiceException;
-
-import junit.framework.Test;
-
-import org.jboss.ws.core.StubExt;
-import org.jboss.ws.core.WSTimeoutException;
-import org.jboss.wsf.test.JBossWSTest;
-import org.jboss.wsf.test.JBossWSTestSetup;
-
-/**
- * [JBPAPP-5486] Timeout value gets inserted into URLs
- *
- * @author darran.lofthouse(a)jboss.com
- * @since 13th December 2010
- * @see https://jira.jboss.org/browse/JBPAPP-5486
- */
-public class JBPAPP5486TestCase extends JBossWSTest
-{
-
- public static Test suite() throws Exception
- {
- return new JBossWSTestSetup(JBPAPP5486TestCase.class, "jaxws-jbpapp5486.war");
- }
-
- public void testNoTimeout() throws Exception
- {
- Service service = getService();
- Endpoint port = service.getPort(Endpoint.class);
-
- String message = "Hello 1";
- String response = port.verifyNoTimeoutParameter(message);
- assertEquals("Response Message", message, response);
- }
-
- public void testTimeout() throws Exception
- {
- Service service = getService();
- Endpoint port = service.getPort(Endpoint.class);
-
- ((BindingProvider)port).getRequestContext().put(StubExt.PROPERTY_CLIENT_TIMEOUT, "10000");
-
- String message = "Hello 2";
- String response = port.verifyNoTimeoutParameter(message);
- assertEquals("Response Message", message, response);
- }
-
- public void testTimeoutWorks() throws Exception
- {
- Service service = getService();
- Endpoint port = service.getPort(Endpoint.class);
-
- ((BindingProvider)port).getRequestContext().put(StubExt.PROPERTY_CLIENT_TIMEOUT, "500");
-
- String message = "Hello 3";
- try
- {
- port.doSleep(message, 1000);
- fail("Expected WS exception not thrown.");
- }
- catch (WebServiceException ignored)
- {
- assertEquals("Expected Cause", WSTimeoutException.class.getName(), ignored.getCause().getClass().getName());
- }
-
- }
-
- Service getService() throws Exception
- {
- URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-jbpapp5486?wsdl");
- QName serviceName = new QName("http://ws.jboss.org/jbpapp5486", "EndpointImplService");
-
- Service service = Service.create(wsdlURL, serviceName);
-
- return service;
- }
-
-}
Copied: stack/native/branches/jbossws-native-2.0.1.SP2_CP08_JBPAPP-5990/src/test/java/org/jboss/test/ws/jaxws/jbpapp5486/JBPAPP5486TestCase.java (from rev 13470, stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbpapp5486/JBPAPP5486TestCase.java)
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP08_JBPAPP-5990/src/test/java/org/jboss/test/ws/jaxws/jbpapp5486/JBPAPP5486TestCase.java (rev 0)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP08_JBPAPP-5990/src/test/java/org/jboss/test/ws/jaxws/jbpapp5486/JBPAPP5486TestCase.java 2011-02-24 18:03:49 UTC (rev 13800)
@@ -0,0 +1,106 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.test.ws.jaxws.jbpapp5486;
+
+import java.io.File;
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.Service;
+import javax.xml.ws.WebServiceException;
+
+import junit.framework.Test;
+
+import org.jboss.ws.core.StubExt;
+import org.jboss.ws.core.WSTimeoutException;
+import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestSetup;
+
+/**
+ * [JBPAPP-5486] Timeout value gets inserted into URLs
+ *
+ * @author darran.lofthouse(a)jboss.com
+ * @since 13th December 2010
+ * @see https://jira.jboss.org/browse/JBPAPP-5486
+ */
+public class JBPAPP5486TestCase extends JBossWSTest
+{
+
+ public static Test suite() throws Exception
+ {
+ return new JBossWSTestSetup(JBPAPP5486TestCase.class, "jaxws-jbpapp5486.war");
+ }
+
+ public void testNoTimeout() throws Exception
+ {
+ Service service = getService();
+ Endpoint port = service.getPort(Endpoint.class);
+
+ String message = "Hello 1";
+ String response = port.verifyNoTimeoutParameter(message);
+ assertEquals("Response Message", message, response);
+ }
+
+ public void testTimeout() throws Exception
+ {
+ Service service = getService();
+ Endpoint port = service.getPort(Endpoint.class);
+
+ ((BindingProvider)port).getRequestContext().put(StubExt.PROPERTY_CLIENT_TIMEOUT, "10000");
+
+ String message = "Hello 2";
+ String response = port.verifyNoTimeoutParameter(message);
+ assertEquals("Response Message", message, response);
+ }
+
+ public void testTimeoutWorks() throws Exception
+ {
+ Service service = getService();
+ Endpoint port = service.getPort(Endpoint.class);
+
+ ((BindingProvider)port).getRequestContext().put(StubExt.PROPERTY_CLIENT_TIMEOUT, "500");
+
+ String message = "Hello 3";
+ try
+ {
+ port.doSleep(message, 1000);
+ fail("Expected WS exception not thrown.");
+ }
+ catch (WebServiceException ignored)
+ {
+ assertEquals("Expected Cause", WSTimeoutException.class.getName(), ignored.getCause().getClass().getName());
+ }
+
+ }
+
+ Service getService() throws Exception
+ {
+ URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-jbpapp5486?wsdl");
+ QName serviceName = new QName("http://ws.jboss.org/jbpapp5486", "EndpointImplService");
+
+ Service service = Service.create(wsdlURL, serviceName);
+
+ return service;
+ }
+
+}
Deleted: stack/native/branches/jbossws-native-2.0.1.SP2_CP08_JBPAPP-5990/src/test/resources/jaxws/jbpapp5486/WEB-INF/jboss-web.xml
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbpapp5486/WEB-INF/jboss-web.xml 2010-12-13 13:06:35 UTC (rev 13470)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP08_JBPAPP-5990/src/test/resources/jaxws/jbpapp5486/WEB-INF/jboss-web.xml 2011-02-24 18:03:49 UTC (rev 13800)
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 2.4//EN" "http://www.jboss.org/j2ee/dtd/jboss-web_4_0.dtd">
-
-<jboss-web>
- <context-root>/jaxws-jbpapp5486</context-root>
-</jboss-web>
\ No newline at end of file
Copied: stack/native/branches/jbossws-native-2.0.1.SP2_CP08_JBPAPP-5990/src/test/resources/jaxws/jbpapp5486/WEB-INF/jboss-web.xml (from rev 13470, stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbpapp5486/WEB-INF/jboss-web.xml)
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP08_JBPAPP-5990/src/test/resources/jaxws/jbpapp5486/WEB-INF/jboss-web.xml (rev 0)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP08_JBPAPP-5990/src/test/resources/jaxws/jbpapp5486/WEB-INF/jboss-web.xml 2011-02-24 18:03:49 UTC (rev 13800)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 2.4//EN" "http://www.jboss.org/j2ee/dtd/jboss-web_4_0.dtd">
+
+<jboss-web>
+ <context-root>/jaxws-jbpapp5486</context-root>
+</jboss-web>
\ No newline at end of file
Deleted: stack/native/branches/jbossws-native-2.0.1.SP2_CP08_JBPAPP-5990/src/test/resources/jaxws/jbpapp5486/WEB-INF/web.xml
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbpapp5486/WEB-INF/web.xml 2010-12-13 13:06:35 UTC (rev 13470)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP08_JBPAPP-5990/src/test/resources/jaxws/jbpapp5486/WEB-INF/web.xml 2011-02-24 18:03:49 UTC (rev 13800)
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<web-app version="2.4" 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">
-
- <servlet>
- <servlet-name>TestEndpoint</servlet-name>
- <servlet-class>org.jboss.test.ws.jaxws.jbpapp5486.EndpointImpl</servlet-class>
- </servlet>
-
- <servlet-mapping>
- <servlet-name>TestEndpoint</servlet-name>
- <url-pattern>/*</url-pattern>
- </servlet-mapping>
-
-</web-app>
\ No newline at end of file
Copied: stack/native/branches/jbossws-native-2.0.1.SP2_CP08_JBPAPP-5990/src/test/resources/jaxws/jbpapp5486/WEB-INF/web.xml (from rev 13470, stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbpapp5486/WEB-INF/web.xml)
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP08_JBPAPP-5990/src/test/resources/jaxws/jbpapp5486/WEB-INF/web.xml (rev 0)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP08_JBPAPP-5990/src/test/resources/jaxws/jbpapp5486/WEB-INF/web.xml 2011-02-24 18:03:49 UTC (rev 13800)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app version="2.4" 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">
+
+ <servlet>
+ <servlet-name>TestEndpoint</servlet-name>
+ <servlet-class>org.jboss.test.ws.jaxws.jbpapp5486.EndpointImpl</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>TestEndpoint</servlet-name>
+ <url-pattern>/*</url-pattern>
+ </servlet-mapping>
+
+</web-app>
\ No newline at end of file
Modified: stack/native/branches/jbossws-native-2.0.1.SP2_CP08_JBPAPP-5990/version.properties
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP08_JBPAPP-5990/version.properties 2011-02-24 17:27:04 UTC (rev 13799)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP08_JBPAPP-5990/version.properties 2011-02-24 18:03:49 UTC (rev 13800)
@@ -6,8 +6,8 @@
specification.vendor=JBoss (http://www.jboss.org)
specification.version=jbossws-2.0
-version.id=2.0.1.SP2_CP08
-repository.id=2.0.1.SP2_CP08
+version.id=2.0.1.SP2_CP08_JBPAPP-5990
+repository.id=2.0.1.SP2_CP08_JBPAPP-5990
implementation.title=JBoss Web Services - Native
implementation.url=http://www.jboss.org/products/jbossws
13 years, 10 months
JBossWS SVN: r13799 - stack/native/branches.
by jbossws-commits@lists.jboss.org
Author: darran.lofthouse(a)jboss.com
Date: 2011-02-24 12:27:04 -0500 (Thu, 24 Feb 2011)
New Revision: 13799
Added:
stack/native/branches/jbossws-native-2.0.1.SP2_CP08_JBPAPP-5990/
Log:
[JBPAPP-5990] Branch for patch.
13 years, 10 months
JBossWS SVN: r13798 - in common/trunk/src/main/java/org/jboss/wsf/common: integration and 1 other directories.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2011-02-24 10:49:48 -0500 (Thu, 24 Feb 2011)
New Revision: 13798
Added:
common/trunk/src/main/java/org/jboss/wsf/common/sort/
common/trunk/src/main/java/org/jboss/wsf/common/sort/DeploymentAspectSorter.java
Modified:
common/trunk/src/main/java/org/jboss/wsf/common/integration/AbstractDeploymentAspect.java
Log:
providing O(1) DA sorting algorithm
Modified: common/trunk/src/main/java/org/jboss/wsf/common/integration/AbstractDeploymentAspect.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/common/integration/AbstractDeploymentAspect.java 2011-02-24 15:48:16 UTC (rev 13797)
+++ common/trunk/src/main/java/org/jboss/wsf/common/integration/AbstractDeploymentAspect.java 2011-02-24 15:49:48 UTC (rev 13798)
@@ -117,6 +117,10 @@
while (st.hasMoreTokens())
condset.add(st.nextToken());
}
+ if (!isLast)
+ {
+ condset.add("WSObject");
+ }
return condset;
}
@@ -129,6 +133,10 @@
while (st.hasMoreTokens())
condset.add(st.nextToken());
}
+ if (isLast)
+ {
+ condset.add("WSObject");
+ }
return condset;
}
Added: common/trunk/src/main/java/org/jboss/wsf/common/sort/DeploymentAspectSorter.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/common/sort/DeploymentAspectSorter.java (rev 0)
+++ common/trunk/src/main/java/org/jboss/wsf/common/sort/DeploymentAspectSorter.java 2011-02-24 15:49:48 UTC (rev 13798)
@@ -0,0 +1,309 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright (c) 2010, 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.common.sort;
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.jboss.wsf.spi.deployment.DeploymentAspect;
+
+/**
+ * Implements <a href="http://en.wikipedia.org/wiki/Topological_sorting">topological sorting</a> for acyclic graphs.
+ * The algorithm complexity is <b>O(m+n)</b>, where <b>m</b> is count of vertices and <b>n</b> is count of edges.
+ *
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+public final class DeploymentAspectSorter
+{
+
+ private static final DeploymentAspectSorter INSTANCE = new DeploymentAspectSorter();
+
+ private DeploymentAspectSorter()
+ {
+ // forbidden inheritance
+ }
+
+ public static DeploymentAspectSorter getInstance()
+ {
+ return INSTANCE;
+ }
+
+ public List<DeploymentAspect> sort(final List<DeploymentAspect> aspects)
+ {
+ return this.createOrientedGraph(aspects).sort();
+ }
+
+ private Graph createOrientedGraph(final List<DeploymentAspect> aspects)
+ {
+ final Graph graph = new Graph();
+
+ for (final DeploymentAspect aspect : aspects)
+ {
+ graph.addVertex(aspect);
+ }
+
+ graph.createEdges();
+
+ return graph;
+ }
+
+ private static class Graph
+ {
+ private Map<String, Dependency> dependencies = new HashMap<String, Dependency>();
+ private Set<Vertex> vertices = new HashSet<Vertex>();
+
+ public void addVertex(final DeploymentAspect aspect)
+ {
+ // create disjunct sets
+ final Set<String> inputs = new HashSet<String>();
+ inputs.addAll(aspect.getRequiresAsSet());
+ final Set<String> outputs = new HashSet<String>();
+ outputs.addAll(aspect.getProvidesAsSet());
+ final Set<String> intersection = this.getIntersection(inputs, outputs);
+
+ // register vertex
+ final Vertex vertex = new Vertex(aspect);
+ this.vertices.add(vertex);
+
+ // register dependencies
+ Dependency dependency;
+ for (final String in : inputs)
+ {
+ dependency = this.getDependency(in);
+ dependency.consumers.add(vertex);
+ }
+
+ for (final String inOut : intersection)
+ {
+ dependency = this.getDependency(inOut);
+ dependency.modifiers.add(vertex);
+ }
+
+ for (final String out : outputs)
+ {
+ dependency = this.getDependency(out);
+ dependency.producers.add(vertex);
+ }
+ }
+
+ public List<DeploymentAspect> sort()
+ {
+ // L ← Empty list that will contain the sorted elements
+ List<DeploymentAspect> retVal = new LinkedList<DeploymentAspect>();
+ // S ← Set of all nodes with no incoming edges
+ List<Vertex> roots = this.getRoots();
+
+ // while S is non-empty do
+ Vertex root;
+ List<Vertex> nextLevel;
+ while(!roots.isEmpty())
+ {
+ // remove a node n from S
+ root = roots.remove(0);
+ // insert n into L
+ retVal.add(root.getAspect());
+
+ // for each node m with an edge e from n to m do
+ if (root.hasConsumers())
+ {
+ nextLevel = new LinkedList<Vertex>();
+ for(final Vertex consumer : root.consumers)
+ {
+ // remove edge e from the graph
+ consumer.decrementDegree();
+ // if m has no other incoming edges then insert m into S
+ if (!consumer.hasProducers())
+ {
+ this.remove(consumer);
+ nextLevel.add(consumer);
+ }
+ }
+
+ // append to the end of list in sorted order
+ roots.addAll(nextLevel);
+ }
+ }
+
+ if (this.vertices.size() > 0)
+ {
+ // if graph has edges then graph has at least one cycle
+ throw new IllegalStateException("Cycle detected in subgraph: " + this.vertices);
+ }
+ else
+ {
+ // topologically sorted order
+ return retVal;
+ }
+ }
+
+ private Set<String> getIntersection(final Set<String> inputs, final Set<String> outputs)
+ {
+ final Set<String> intersection = new HashSet<String>();
+
+ for (final String input : inputs)
+ for (final String output : outputs)
+ if (input.equals(output))
+ intersection.add(input);
+
+ inputs.removeAll(intersection);
+ outputs.removeAll(intersection);
+
+ return intersection;
+ }
+
+ private Dependency getDependency(final String name)
+ {
+ if (this.dependencies.containsKey(name))
+ {
+ return this.dependencies.get(name);
+ }
+ else
+ {
+ final Dependency newDependency = new Dependency();
+ this.dependencies.put(name, newDependency);
+ return newDependency;
+ }
+ }
+
+ private void createEdges()
+ {
+ Dependency dependency;
+ boolean hasModifiers;
+
+ for (final String dependencyName : this.dependencies.keySet())
+ {
+ dependency = this.dependencies.get(dependencyName);
+ hasModifiers = dependency.modifiers.size() > 0;
+
+ if (hasModifiers)
+ {
+ this.createEdges(dependency.producers, dependency.modifiers);
+ this.createEdges(dependency.modifiers, dependency.consumers);
+ }
+ else
+ {
+ this.createEdges(dependency.producers, dependency.consumers);
+ }
+ }
+ }
+
+ private void createEdges(final List<Vertex> producers, final List<Vertex> consumers)
+ {
+ for (final Vertex producer : producers)
+ for (final Vertex consumer : consumers)
+ {
+ producer.addConsumer(consumer);
+ consumer.incrementDegree();
+ }
+ }
+
+ private List<Vertex> getRoots()
+ {
+ final List<Vertex> retVal = new LinkedList<Vertex>();
+
+ Vertex current;
+ for (final Iterator<Vertex> i = this.vertices.iterator(); i.hasNext(); )
+ {
+ current = i.next();
+ if (!current.hasProducers())
+ {
+ retVal.add(current);
+ i.remove();
+ }
+ }
+
+ return retVal;
+ }
+
+ private void remove(final Vertex v)
+ {
+ this.vertices.remove(v);
+ }
+
+ private static class Vertex
+ {
+ // Wrapped aspect
+ private DeploymentAspect aspect;
+ // Incoming edges
+ private int inDegree;
+ // Outgoing edges
+ private List<Vertex> consumers = new LinkedList<Vertex>();
+
+ public Vertex(final DeploymentAspect aspect)
+ {
+ this.aspect = aspect;
+ }
+
+ public void incrementDegree()
+ {
+ this.inDegree++;
+ }
+
+ public void decrementDegree()
+ {
+ this.inDegree--;
+ }
+
+ public boolean hasProducers()
+ {
+ return this.inDegree > 0;
+ }
+
+ public void addConsumer(final Vertex v)
+ {
+ this.consumers.add(v);
+ }
+
+ public boolean hasConsumers()
+ {
+ return this.consumers.size() > 0;
+ }
+
+ public DeploymentAspect getAspect()
+ {
+ return this.aspect;
+ }
+
+ public String toString()
+ {
+ return this.aspect.toString();
+ }
+ }
+
+ private static class Dependency
+ {
+ // aspects creating this dependency
+ private List<Vertex> producers = new LinkedList<Vertex>();
+ // aspects modifying this dependency
+ private List<Vertex> modifiers = new LinkedList<Vertex>();
+ // aspects consuming this dependency
+ private List<Vertex> consumers = new LinkedList<Vertex>();
+ }
+
+ }
+
+}
13 years, 10 months
JBossWS SVN: r13797 - in common/trunk/src/main/java/org/jboss/wsf/framework: deployment and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2011-02-24 10:48:16 -0500 (Thu, 24 Feb 2011)
New Revision: 13797
Removed:
common/trunk/src/main/java/org/jboss/wsf/framework/deployment/DefaultDeploymentAspectManagerFactory.java
common/trunk/src/main/java/org/jboss/wsf/framework/deployment/DeploymentAspectInstaller.java
Modified:
common/trunk/src/main/java/org/jboss/wsf/framework/DefaultSPIProvider.java
Log:
removing obsolete/unused classes
Modified: common/trunk/src/main/java/org/jboss/wsf/framework/DefaultSPIProvider.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/framework/DefaultSPIProvider.java 2011-02-24 15:25:48 UTC (rev 13796)
+++ common/trunk/src/main/java/org/jboss/wsf/framework/DefaultSPIProvider.java 2011-02-24 15:48:16 UTC (rev 13797)
@@ -21,8 +21,6 @@
*/
package org.jboss.wsf.framework;
-import org.jboss.wsf.spi.deployer.Deployer;
-import org.jboss.wsf.framework.deployment.DefaultDeploymentAspectManagerFactory;
import org.jboss.wsf.framework.deployment.DefaultDeploymentModelFactory;
import org.jboss.wsf.framework.deployment.DefaultLifecycleHandlerFactory;
import org.jboss.wsf.framework.invocation.DefaultResourceInjectorFactory;
@@ -33,7 +31,7 @@
import org.jboss.wsf.framework.serviceref.DefaultServiceRefHandlerFactory;
import org.jboss.wsf.spi.SPIProvider;
import org.jboss.wsf.spi.WSFException;
-import org.jboss.wsf.spi.deployment.DeploymentAspectManagerFactory;
+import org.jboss.wsf.spi.deployer.Deployer;
import org.jboss.wsf.spi.deployment.DeploymentModelFactory;
import org.jboss.wsf.spi.deployment.LifecycleHandlerFactory;
import org.jboss.wsf.spi.invocation.ResourceInjectorFactory;
@@ -60,12 +58,8 @@
T returnType = null;
// SPIs provided by framework, defaults can be overridden
- if (DeploymentAspectManagerFactory.class.equals(spiType))
+ if (DeploymentModelFactory.class.equals(spiType))
{
- returnType = loadService(spiType, DefaultDeploymentAspectManagerFactory.class);
- }
- else if (DeploymentModelFactory.class.equals(spiType))
- {
returnType = loadService(spiType, DefaultDeploymentModelFactory.class);
}
else if (EndpointMetricsFactory.class.equals(spiType))
Deleted: common/trunk/src/main/java/org/jboss/wsf/framework/deployment/DefaultDeploymentAspectManagerFactory.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/framework/deployment/DefaultDeploymentAspectManagerFactory.java 2011-02-24 15:25:48 UTC (rev 13796)
+++ common/trunk/src/main/java/org/jboss/wsf/framework/deployment/DefaultDeploymentAspectManagerFactory.java 2011-02-24 15:48:16 UTC (rev 13797)
@@ -1,50 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.framework.deployment;
-
-import org.jboss.wsf.spi.deployment.Deployment;
-import org.jboss.wsf.spi.deployment.DeploymentAspectManager;
-import org.jboss.wsf.spi.deployment.DeploymentAspectManagerFactory;
-
-/**
- * A DeploymentAspectManagerFactory that retrieves a configured
- * {@link DeploymentAspectManager} from MC kernel.
- *
- * @see org.jboss.wsf.framework.deployment.DeploymentAspectInstaller
- *
- * @author Heiko.Braun(a)jboss.com
- */
-public class DefaultDeploymentAspectManagerFactory extends DeploymentAspectManagerFactory
-{
-
- // TODO: review this class methods, maybe only one method getDeploymentAspectManager() will be sufficient
- public DeploymentAspectManager getDeploymentAspectManager(Deployment.DeploymentType deploymentType)
- {
- throw new UnsupportedOperationException();
- }
-
- public DeploymentAspectManager getDeploymentAspectManager(String beanName)
- {
- throw new UnsupportedOperationException();
- }
-
-}
Deleted: common/trunk/src/main/java/org/jboss/wsf/framework/deployment/DeploymentAspectInstaller.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/framework/deployment/DeploymentAspectInstaller.java 2011-02-24 15:25:48 UTC (rev 13796)
+++ common/trunk/src/main/java/org/jboss/wsf/framework/deployment/DeploymentAspectInstaller.java 2011-02-24 15:48:16 UTC (rev 13797)
@@ -1,189 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.framework.deployment;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import org.jboss.logging.Logger;
-import org.jboss.wsf.spi.deployment.DeploymentAspect;
-import org.jboss.wsf.spi.deployment.DeploymentAspectManager;
-
-/**
- * A deployment aspect installer.
- *
- * @author Thomas.Diesler(a)jboss.com
- * @since 20-Apr-2007
- */
-public class DeploymentAspectInstaller
-{
- // provide logging
- private static final Logger log = Logger.getLogger(DeploymentAspectInstaller.class);
-
- private DeploymentAspectManager manager;
- private Set<DeploymentAspect> aspects;
- private boolean sortAspectsOnCreate;
- private Set<String> parentProvidedConditions = new HashSet<String>();
-
- public void setManager(DeploymentAspectManager manager)
- {
- this.manager = manager;
- }
-
- public void setAspects(Set<DeploymentAspect> aspects)
- {
- this.aspects = aspects;
- }
-
- public void setSortAspectsOnCreate(boolean sortAspectsOnCreate)
- {
- this.sortAspectsOnCreate = sortAspectsOnCreate;
- }
-
- public void create()
- {
- List<DeploymentAspect> unsortedAspects = new ArrayList<DeploymentAspect>();
-
- unsortedAspects.addAll(manager.getDeploymentAspects());
- unsortedAspects.addAll(aspects);
-
- List<DeploymentAspect> sortedAspects = unsortedAspects;
- if (sortAspectsOnCreate)
- {
- // get the conditions provided by the parent
- if (manager.getParent() != null)
- {
- Iterator<DeploymentAspect> it = manager.getParent().getDeploymentAspects().iterator();
- while (it.hasNext())
- {
- DeploymentAspect aspect = it.next();
- parentProvidedConditions.addAll(aspect.getProvidesAsSet());
- }
- }
-
- sortedAspects = new ArrayList<DeploymentAspect>();
- List<DeploymentAspect> allAspects = new ArrayList<DeploymentAspect>(unsortedAspects);
-
- // Add aspects with no requirements first
- Iterator<DeploymentAspect> itAll = allAspects.iterator();
- while (itAll.hasNext())
- {
- DeploymentAspect aspect = itAll.next();
- if (aspect.getRequires() == null || parentProvidedConditions.containsAll(aspect.getRequiresAsSet()))
- {
- sortedAspects.add(aspect);
- itAll.remove();
- }
- }
-
- // Add aspects that have requirements that already added aspects provide
- itAll = allAspects.iterator();
- while (itAll.hasNext())
- {
- DeploymentAspect aspect = itAll.next();
- int index = getAspectIndex(sortedAspects, aspect);
- if (index != -1)
- {
- sortedAspects.add(index, aspect);
- itAll.remove();
-
- itAll = allAspects.iterator(); // Hm,...
- }
- }
-
- // Add LAST_DEPLOYMENT_ASPECT
- itAll = allAspects.iterator();
- while (itAll.hasNext())
- {
- DeploymentAspect aspect = itAll.next();
- if (DeploymentAspect.LAST_DEPLOYMENT_ASPECT.equals(aspect.getRequires()))
- {
- sortedAspects.add(aspect);
- itAll.remove();
- }
- }
-
- if (allAspects.size() != 0)
- throwSortException(sortedAspects, allAspects);
- }
- manager.setDeploymentAspects(sortedAspects);
- }
-
- public void destroy()
- {
- List<DeploymentAspect> managerAspects = new ArrayList<DeploymentAspect>();
- managerAspects.addAll(manager.getDeploymentAspects());
- Iterator<DeploymentAspect> it = aspects.iterator();
- while (it.hasNext())
- {
- DeploymentAspect aspect = it.next();
- managerAspects.remove(aspect);
- }
- manager.setDeploymentAspects(managerAspects);
- }
-
- private void throwSortException(List<DeploymentAspect> sortedAspects, List<DeploymentAspect> allAspects)
- {
- Set<String> providedConditions = new HashSet<String>();
- for (int i = 0; i < sortedAspects.size(); i++)
- {
- DeploymentAspect sortedAspect = sortedAspects.get(i);
- providedConditions.addAll(sortedAspect.getProvidesAsSet());
- }
-
- String exmsg = "Cannot add deployment aspect(s)";
- StringBuilder str = new StringBuilder(exmsg);
-
- if (manager.getParent() != null)
- str.append("\n" + manager.getParent().getName() + " provides: " + parentProvidedConditions);
-
- str.append("\n" + manager.getName() + " provides: " + providedConditions);
-
- for (DeploymentAspect da : allAspects)
- {
- str.append("\n " + da.getClass().getName() + ", requires: " + da.getRequires());
- }
-
- log.error(str);
- throw new IllegalStateException(str.toString());
- }
-
- private int getAspectIndex(List<DeploymentAspect> sortedAspects, DeploymentAspect aspect)
- {
- int index = -1;
- Set<String> providedConditions = new HashSet<String>(parentProvidedConditions);
- for (int i = 0; i < sortedAspects.size(); i++)
- {
- DeploymentAspect sortedAspect = sortedAspects.get(i);
- providedConditions.addAll(sortedAspect.getProvidesAsSet());
- if (providedConditions.containsAll(aspect.getRequiresAsSet()))
- {
- index = i + 1;
- break;
- }
- }
- return index;
- }
-}
13 years, 10 months
JBossWS SVN: r13796 - shared-testsuite/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws3223.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2011-02-24 10:25:48 -0500 (Thu, 24 Feb 2011)
New Revision: 13796
Modified:
shared-testsuite/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws3223/Client.java
shared-testsuite/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws3223/EndpointTestCase.java
shared-testsuite/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws3223/TestServlet.java
Log:
[JBWS-3223] Verifying TCCL invariance and that the TCCL for basic servlets does not "see" jbossws impl classes on AS 7
Modified: shared-testsuite/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws3223/Client.java
===================================================================
--- shared-testsuite/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws3223/Client.java 2011-02-24 15:24:32 UTC (rev 13795)
+++ shared-testsuite/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws3223/Client.java 2011-02-24 15:25:48 UTC (rev 13796)
@@ -22,20 +22,127 @@
package org.jboss.test.ws.jaxws.jbws3223;
import java.net.URL;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
import javax.xml.namespace.QName;
-import javax.xml.ws.Endpoint;
import javax.xml.ws.Service;
+import javax.xml.ws.spi.Provider;
public class Client
{
+ private boolean checkClassLoader;
+
+ public Client(boolean checkClassLoader)
+ {
+ this.checkClassLoader = checkClassLoader;
+ }
+
public String run(String param, URL wsdlURL)
{
- // Create the port
- QName qname = new QName("http://org.jboss.ws/jaxws/jbws3223", "EndpointService");
- Service service = Service.create(wsdlURL, qname);
- EndpointInterface port = (EndpointInterface)service.getPort(EndpointInterface.class);
+ ClassLoader orig = getContextClassLoader();
+ try
+ {
+ // Create the port
+ QName qname = new QName("http://org.jboss.ws/jaxws/jbws3223", "EndpointService");
+ Service service = Service.create(wsdlURL, qname);
+ checkContextClassLoaderInvariance(orig);
+ EndpointInterface port = (EndpointInterface) service.getPort(EndpointInterface.class);
+ checkContextClassLoaderInvariance(orig);
+ String result = port.echo(param);
+ checkContextClassLoaderInvariance(orig);
+ if (checkClassLoader)
+ {
+ checkImplementationClassesAreNotVisible(orig);
+ }
+ return result;
+ }
+ finally
+ {
+ //set back the original TCCL: this is just a sanity fix to ensure a failure in this
+ //test does not influence other tests; the TCCL is not expected to be changed
+ setContextClassLoader(orig);
+ }
+ }
- return port.echo(param);
+ private static void checkContextClassLoaderInvariance(ClassLoader reference)
+ {
+ ClassLoader tccl = getContextClassLoader();
+ if (reference == null && tccl == null)
+ {
+ return;
+ }
+ if (reference == null || tccl == null || !tccl.equals(reference))
+ {
+ throw new RuntimeException("Thread context classloader changed from " + reference + " to " + tccl);
+ }
}
+
+ /**
+ * AS7 check on client TCCL
+ *
+ * @param cl
+ */
+ private void checkImplementationClassesAreNotVisible(ClassLoader cl)
+ {
+ //retrieve the stack specific Provider impl class name through the JAXWS API
+ //classloading mechanism (JBEE-75), which is able to "see" implementation classes
+ String providerImplClassName = Provider.provider().getClass().getName();
+ if (!providerImplClassName.contains("jboss"))
+ {
+ throw new RuntimeException("Expected a JBoss(WS) specific implementation for javax.xml.ws.spi.Provider: "
+ + providerImplClassName);
+ }
+ //then try loading the same class using the provided classloader
+ try
+ {
+ cl.loadClass(providerImplClassName);
+ throw new RuntimeException("ClassLoader " + cl + " should not be able to load " + providerImplClassName);
+ }
+ catch (ClassNotFoundException e)
+ {
+ //this is expected, just check the class that can't be found is our impl
+ if (!(e.getMessage().contains(providerImplClassName)))
+ {
+ throw new RuntimeException("Unexpected Provider implementation being looked up: " + e.getMessage());
+ }
+ }
+ }
+
+ static ClassLoader getContextClassLoader()
+ {
+ SecurityManager sm = System.getSecurityManager();
+ if (sm == null)
+ {
+ return Thread.currentThread().getContextClassLoader();
+ }
+ else
+ {
+ return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
+ public ClassLoader run()
+ {
+ return Thread.currentThread().getContextClassLoader();
+ }
+ });
+ }
+ }
+
+ static void setContextClassLoader(final ClassLoader classLoader)
+ {
+ if (System.getSecurityManager() == null)
+ {
+ Thread.currentThread().setContextClassLoader(classLoader);
+ }
+ else
+ {
+ AccessController.doPrivileged(new PrivilegedAction<Object>()
+ {
+ public Object run()
+ {
+ Thread.currentThread().setContextClassLoader(classLoader);
+ return null;
+ }
+ });
+ }
+ }
}
Modified: shared-testsuite/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws3223/EndpointTestCase.java
===================================================================
--- shared-testsuite/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws3223/EndpointTestCase.java 2011-02-24 15:24:32 UTC (rev 13795)
+++ shared-testsuite/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws3223/EndpointTestCase.java 2011-02-24 15:25:48 UTC (rev 13796)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2011, Red Hat Middleware LLC, and individual contributors
* as indicated by the @author tags. See the copyright.txt file in the
* distribution for a full listing of individual contributors.
*
@@ -28,8 +28,6 @@
import javax.wsdl.Definition;
import javax.wsdl.factory.WSDLFactory;
import javax.wsdl.xml.WSDLReader;
-import javax.xml.namespace.QName;
-import javax.xml.ws.Service;
import junit.extensions.TestSetup;
import junit.framework.Test;
@@ -59,14 +57,15 @@
public void testClientAccess() throws Exception
{
String helloWorld = "Hello world!";
- Client client = new Client();
+ Client client = new Client(false);
Object retObj = client.run(helloWorld, getResourceURL("jaxws/jbws3223/WEB-INF/wsdl/TestService.wsdl"));
assertEquals(helloWorld, retObj);
}
public void testServletAccess() throws Exception
{
- URL url = new URL("http://" + getServerHost() + ":8080/jaxws-jbws3223-servlet?param=hello-world");
+ boolean clCheck = !(isTargetJBoss5() || isTargetJBoss6());
+ URL url = new URL("http://" + getServerHost() + ":8080/jaxws-jbws3223-servlet?param=hello-world&clCheck=" + clCheck);
BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
assertEquals("hello-world", br.readLine());
}
Modified: shared-testsuite/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws3223/TestServlet.java
===================================================================
--- shared-testsuite/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws3223/TestServlet.java 2011-02-24 15:24:32 UTC (rev 13795)
+++ shared-testsuite/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws3223/TestServlet.java 2011-02-24 15:25:48 UTC (rev 13796)
@@ -25,6 +25,8 @@
import java.io.PrintWriter;
import java.net.URL;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
@@ -38,7 +40,8 @@
{
// Invoke the endpoint
String param = req.getParameter("param");
- Client client = new Client();
+ boolean clCheck = Boolean.parseBoolean(req.getParameter("clCheck"));
+ Client client = new Client(clCheck);
//URL wsdlURL = getServletContext().getResource("/WEB-INF/wsdl/TestService.wsdl");
URL wsdlURL = new URL("http://localhost:8080/jaxws-jbws3223?wsdl");
String retStr = client.run(param, wsdlURL);
@@ -48,4 +51,6 @@
pw.print(retStr);
pw.close();
}
+
+
}
13 years, 10 months
JBossWS SVN: r13795 - stack/cxf/trunk/modules/client/src/test/java/org/jboss/wsf/stack/cxf/client.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2011-02-24 10:24:32 -0500 (Thu, 24 Feb 2011)
New Revision: 13795
Modified:
stack/cxf/trunk/modules/client/src/test/java/org/jboss/wsf/stack/cxf/client/ProviderImplTest.java
Log:
[JBWS-3223] Additional unit test
Modified: stack/cxf/trunk/modules/client/src/test/java/org/jboss/wsf/stack/cxf/client/ProviderImplTest.java
===================================================================
--- stack/cxf/trunk/modules/client/src/test/java/org/jboss/wsf/stack/cxf/client/ProviderImplTest.java 2011-02-24 12:41:01 UTC (rev 13794)
+++ stack/cxf/trunk/modules/client/src/test/java/org/jboss/wsf/stack/cxf/client/ProviderImplTest.java 2011-02-24 15:24:32 UTC (rev 13795)
@@ -21,6 +21,7 @@
*/
package org.jboss.wsf.stack.cxf.client;
+import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.Executor;
@@ -53,6 +54,41 @@
assertTrue(providerImpl instanceof ProviderImpl);
}
+ public void testGetProviderWithCustomClassLoaderIsBackwardCompatibility()
+ {
+ ClassLoader tccl = Thread.currentThread().getContextClassLoader();
+ try
+ {
+ //overwrite the TCCL so that no Provider configuration is specified,
+ //hence the JAXWS RI default is tried (given this test is run
+ //out of container); this verifies the additions due to JBEE-75 and
+ //JBWS-3223 are backward compatible.
+ TestClassLoader cl = new TestClassLoader();
+ Thread.currentThread().setContextClassLoader(cl);
+ try
+ {
+ Provider.provider();
+ fail("Exception due to class not found expected!");
+ }
+ catch (Exception e)
+ {
+ //check the default ProviderImpl was being looked up given no configuration was provided
+ List<String> list = cl.getLoadClassRequests();
+ assertTrue(list.contains("com.sun.xml.internal.ws.spi.ProviderImpl"));
+ assertEquals(1, list.size());
+ }
+ }
+ finally
+ {
+ Thread.currentThread().setContextClassLoader(tccl);
+ }
+ }
+
+ /**
+ * This verifies that the ProviderImpl::checkAndFixContextClassLoader does not
+ * affect the current TCCL when the ProviderImpl class can be loaded and
+ * created an instance of by that classloader.
+ */
public void testCheckAndFixContextClassLoaderWithDefaultMavenClassLoader()
{
ClassLoader tccl = Thread.currentThread().getContextClassLoader();
@@ -69,6 +105,11 @@
}
}
+ /**
+ * This verifies that the ProviderImpl::checkAndFixContextClassLoader sets
+ * a new DelegateClassLoader (able to load ProviderImpl) as TCCL when the
+ * TCCL is not set.
+ */
public void testCheckAndFixContextClassLoaderWithNullClassLoader()
{
ClassLoader orig = Thread.currentThread().getContextClassLoader();
@@ -88,6 +129,11 @@
}
}
+ /**
+ * This verifies that the ProviderImpl::checkAndFixContextClassLoader sets
+ * a new DelegateClassLoader (able to load ProviderImpl) as TCCL when the
+ * ProviderImpl class can't be loaded and created an instance of by that TCCL
+ */
public void testCheckAndFixContextClassLoaderWithTestClassLoader()
{
ClassLoader orig = Thread.currentThread().getContextClassLoader();
@@ -108,6 +154,11 @@
}
}
+ /**
+ * This verifies that DelegateEndpointImpl delegates to the Apache
+ * CXF EndpointImpl after having properly setup the TCCL so that it
+ * can load and create instances of the ProviderImpl class.
+ */
public void testEndpointImplPublishCorrectlySetsTCCL()
{
ClassLoader orig = Thread.currentThread().getContextClassLoader();
@@ -151,6 +202,8 @@
private static final class TestClassLoader extends ClassLoader
{
+ private List<String> loadClassRequests = new LinkedList<String>();
+
public TestClassLoader()
{
super(null);
@@ -159,8 +212,14 @@
@Override
public Class<?> loadClass(final String className) throws ClassNotFoundException
{
+ loadClassRequests.add(className);
throw new ClassNotFoundException("TestClassLoader does not load anything!");
}
+
+ public List<String> getLoadClassRequests()
+ {
+ return this.loadClassRequests;
+ }
}
private static final class TestEndpoint extends Endpoint
13 years, 10 months
JBossWS SVN: r13794 - in stack/cxf/trunk/modules/client: src and 9 other directories.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2011-02-24 07:41:01 -0500 (Thu, 24 Feb 2011)
New Revision: 13794
Added:
stack/cxf/trunk/modules/client/src/test/
stack/cxf/trunk/modules/client/src/test/java/
stack/cxf/trunk/modules/client/src/test/java/org/
stack/cxf/trunk/modules/client/src/test/java/org/jboss/
stack/cxf/trunk/modules/client/src/test/java/org/jboss/wsf/
stack/cxf/trunk/modules/client/src/test/java/org/jboss/wsf/stack/
stack/cxf/trunk/modules/client/src/test/java/org/jboss/wsf/stack/cxf/
stack/cxf/trunk/modules/client/src/test/java/org/jboss/wsf/stack/cxf/client/
stack/cxf/trunk/modules/client/src/test/java/org/jboss/wsf/stack/cxf/client/ProviderImplTest.java
Modified:
stack/cxf/trunk/modules/client/pom.xml
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ProviderImpl.java
Log:
[JBWS-3223] Minor refactoring of ProviderImpl + addition of unit tests
Modified: stack/cxf/trunk/modules/client/pom.xml
===================================================================
--- stack/cxf/trunk/modules/client/pom.xml 2011-02-24 09:31:39 UTC (rev 13793)
+++ stack/cxf/trunk/modules/client/pom.xml 2011-02-24 12:41:01 UTC (rev 13794)
@@ -222,6 +222,13 @@
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging</artifactId>
</dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
@@ -280,6 +287,12 @@
</archive>
</configuration>
</plugin>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <failIfNoTests>false</failIfNoTests>
+ </configuration>
+ </plugin>
</plugins>
</build>
Modified: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ProviderImpl.java
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ProviderImpl.java 2011-02-24 09:31:39 UTC (rev 13793)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ProviderImpl.java 2011-02-24 12:41:01 UTC (rev 13794)
@@ -79,15 +79,16 @@
@Override
public Endpoint createEndpoint(String bindingId, Object implementor) {
- ClassLoader origClassLoader = null;
+ ClassLoader origClassLoader = getContextClassLoader();
+ boolean restoreTCCL = false;
try
{
- origClassLoader = checkAndFixContextClassLoader();
+ restoreTCCL = checkAndFixContextClassLoader(origClassLoader);
return new DelegateEndpointImpl(super.createEndpoint(bindingId, implementor));
}
finally
{
- if (origClassLoader != null)
+ if (restoreTCCL)
setContextClassLoader(origClassLoader);
}
}
@@ -96,15 +97,16 @@
public Endpoint createEndpoint(String bindingId,
Object implementor,
WebServiceFeature ... features) {
- ClassLoader origClassLoader = null;
+ ClassLoader origClassLoader = getContextClassLoader();
+ boolean restoreTCCL = false;
try
{
- origClassLoader = checkAndFixContextClassLoader();
+ restoreTCCL = checkAndFixContextClassLoader(origClassLoader);
return new DelegateEndpointImpl(super.createEndpoint(bindingId, implementor, features));
}
finally
{
- if (origClassLoader != null)
+ if (restoreTCCL)
setContextClassLoader(origClassLoader);
}
}
@@ -113,10 +115,11 @@
@Override
public ServiceDelegate createServiceDelegate(URL url, QName qname, Class cls)
{
- ClassLoader origClassLoader = null;
+ ClassLoader origClassLoader = getContextClassLoader();
+ boolean restoreTCCL = false;
try
{
- origClassLoader = checkAndFixContextClassLoader();
+ restoreTCCL = checkAndFixContextClassLoader(origClassLoader);
//we override this method to prevent using the default bus when the current
//thread is not already associated to a bus. In those situations we create
//a new bus from scratch instead and link that to the thread.
@@ -129,7 +132,7 @@
}
finally
{
- if (origClassLoader != null)
+ if (restoreTCCL)
setContextClassLoader(origClassLoader);
}
}
@@ -139,10 +142,11 @@
public ServiceDelegate createServiceDelegate(URL wsdlDocumentLocation, QName serviceName, Class serviceClass,
WebServiceFeature... features)
{
- ClassLoader origClassLoader = null;
+ ClassLoader origClassLoader = getContextClassLoader();
+ boolean restoreTCCL = false;
try
{
- origClassLoader = checkAndFixContextClassLoader();
+ restoreTCCL = checkAndFixContextClassLoader(origClassLoader);
//we override this method to prevent using the default bus when the current
//thread is not already associated to a bus. In those situations we create
//a new bus from scratch instead and link that to the thread.
@@ -155,7 +159,7 @@
}
finally
{
- if (origClassLoader != null)
+ if (restoreTCCL)
setContextClassLoader(origClassLoader);
}
}
@@ -163,11 +167,10 @@
/**
* Ensure the current context classloader can load this ProviderImpl class.
*
- * @return The original classloader or null if it's not been changed
+ * @return true if the TCCL has been changed, false otherwise
*/
- private static ClassLoader checkAndFixContextClassLoader()
+ static boolean checkAndFixContextClassLoader(ClassLoader origClassLoader)
{
- ClassLoader origClassLoader = getContextClassLoader();
try
{
origClassLoader.loadClass(ProviderImpl.class.getName());
@@ -189,9 +192,9 @@
//then setup a new TCCL having visibility over both the client path (JBossWS
//client module on AS7) and the the former TCCL (i.e. the deployment classloader)
setContextClassLoader(new DelegateClassLoader(clientClassLoader, origClassLoader));
- return origClassLoader;
+ return true;
}
- return null;
+ return false;
}
/**
@@ -247,7 +250,7 @@
* that sets the TCCL before doing publish.
*
*/
- private static final class DelegateEndpointImpl extends Endpoint
+ static final class DelegateEndpointImpl extends Endpoint
{
private Endpoint delegate;
@@ -271,15 +274,16 @@
@Override
public void publish(String address)
{
- ClassLoader origClassLoader = null;
+ ClassLoader origClassLoader = getContextClassLoader();
+ boolean restoreTCCL = false;
try
{
- origClassLoader = checkAndFixContextClassLoader();
+ restoreTCCL = checkAndFixContextClassLoader(origClassLoader);
delegate.publish(address);
}
finally
{
- if (origClassLoader != null)
+ if (restoreTCCL)
setContextClassLoader(origClassLoader);
}
}
@@ -287,15 +291,16 @@
@Override
public void publish(Object serverContext)
{
- ClassLoader origClassLoader = null;
+ ClassLoader origClassLoader = getContextClassLoader();
+ boolean restoreTCCL = false;
try
{
- origClassLoader = checkAndFixContextClassLoader();
+ restoreTCCL = checkAndFixContextClassLoader(origClassLoader);
delegate.publish(serverContext);
}
finally
{
- if (origClassLoader != null)
+ if (restoreTCCL)
setContextClassLoader(origClassLoader);
}
}
@@ -361,7 +366,7 @@
}
}
- private static final class DelegateClassLoader extends SecureClassLoader
+ static final class DelegateClassLoader extends SecureClassLoader
{
private ClassLoader delegate;
@@ -411,7 +416,10 @@
final ArrayList<Enumeration<URL>> foundResources = new ArrayList<Enumeration<URL>>();
foundResources.add(delegate.getResources(name));
- foundResources.add(parent.getResources(name));
+ if (parent != null)
+ {
+ foundResources.add(parent.getResources(name));
+ }
return new Enumeration<URL>()
{
Added: stack/cxf/trunk/modules/client/src/test/java/org/jboss/wsf/stack/cxf/client/ProviderImplTest.java
===================================================================
--- stack/cxf/trunk/modules/client/src/test/java/org/jboss/wsf/stack/cxf/client/ProviderImplTest.java (rev 0)
+++ stack/cxf/trunk/modules/client/src/test/java/org/jboss/wsf/stack/cxf/client/ProviderImplTest.java 2011-02-24 12:41:01 UTC (rev 13794)
@@ -0,0 +1,248 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.stack.cxf.client;
+
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.Executor;
+
+import javax.xml.transform.Source;
+import javax.xml.ws.Binding;
+import javax.xml.ws.Endpoint;
+import javax.xml.ws.EndpointReference;
+import javax.xml.ws.spi.Provider;
+
+import junit.framework.TestCase;
+
+import org.jboss.wsf.stack.cxf.client.ProviderImpl.DelegateClassLoader;
+import org.jboss.wsf.stack.cxf.client.ProviderImpl.DelegateEndpointImpl;
+import org.w3c.dom.Element;
+
+/**
+ * A test case for jbossws-cxf javax.xml.ws.spi.Provider implementation
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 24-Feb-2011
+ *
+ */
+public class ProviderImplTest extends TestCase
+{
+ public void testGetProvider()
+ {
+ //just check we get the jbossws-cxf provider impl when the default maven tccl is set
+ Provider providerImpl = Provider.provider();
+ assertTrue(providerImpl instanceof ProviderImpl);
+ }
+
+ public void testCheckAndFixContextClassLoaderWithDefaultMavenClassLoader()
+ {
+ ClassLoader tccl = Thread.currentThread().getContextClassLoader();
+ try
+ {
+ assertNotNull(tccl);
+ assertFalse(ProviderImpl.checkAndFixContextClassLoader(tccl));
+ verifyClassLoaderCanLoadProviderImpl(tccl);
+ assertEquals(tccl, Thread.currentThread().getContextClassLoader());
+ }
+ finally
+ {
+ Thread.currentThread().setContextClassLoader(tccl);
+ }
+ }
+
+ public void testCheckAndFixContextClassLoaderWithNullClassLoader()
+ {
+ ClassLoader orig = Thread.currentThread().getContextClassLoader();
+ try
+ {
+ Thread.currentThread().setContextClassLoader(null);
+ ClassLoader tccl = Thread.currentThread().getContextClassLoader();
+ assertTrue(ProviderImpl.checkAndFixContextClassLoader(tccl));
+ ClassLoader modifiedTccl = Thread.currentThread().getContextClassLoader();
+ assertNotNull(modifiedTccl);
+ assertTrue(modifiedTccl instanceof DelegateClassLoader);
+ verifyClassLoaderCanLoadProviderImpl(modifiedTccl);
+ }
+ finally
+ {
+ Thread.currentThread().setContextClassLoader(orig);
+ }
+ }
+
+ public void testCheckAndFixContextClassLoaderWithTestClassLoader()
+ {
+ ClassLoader orig = Thread.currentThread().getContextClassLoader();
+ try
+ {
+ ClassLoader testCl = new TestClassLoader();
+ assertFalse(canLoad(testCl, ProviderImpl.class.getName()));
+ Thread.currentThread().setContextClassLoader(testCl);
+ assertTrue(ProviderImpl.checkAndFixContextClassLoader(testCl));
+ ClassLoader modifiedTccl = Thread.currentThread().getContextClassLoader();
+ assertNotNull(modifiedTccl);
+ assertTrue(modifiedTccl instanceof DelegateClassLoader);
+ verifyClassLoaderCanLoadProviderImpl(modifiedTccl);
+ }
+ finally
+ {
+ Thread.currentThread().setContextClassLoader(orig);
+ }
+ }
+
+ public void testEndpointImplPublishCorrectlySetsTCCL()
+ {
+ ClassLoader orig = Thread.currentThread().getContextClassLoader();
+ try
+ {
+ Endpoint ep1 = new DelegateEndpointImpl(new TestEndpoint());
+ ep1.publish(new Integer(1)); //just to ensure the publish(Object arg) is used
+ ep1.publish("foo");
+ Thread.currentThread().setContextClassLoader(new TestClassLoader());
+ Endpoint ep2 = new DelegateEndpointImpl(new TestEndpoint());
+ ep2.publish(new Integer(1)); //just to ensure the publish(Object arg) is used
+ ep2.publish("foo");
+ }
+ finally
+ {
+ Thread.currentThread().setContextClassLoader(orig);
+ }
+ }
+
+ private static boolean canLoad(ClassLoader cl, String className)
+ {
+ try
+ {
+ cl.loadClass(className);
+ return true;
+ }
+ catch (Exception e)
+ {
+ return false;
+ }
+ }
+
+ private static void verifyClassLoaderCanLoadProviderImpl(ClassLoader cl)
+ {
+ final String impl = ProviderImpl.class.getName();
+ boolean canLoad = canLoad(cl, impl);
+ assertTrue("ClassLoader " + cl + " was not able to load " + impl + "!", canLoad);
+ }
+
+ //------ Test classes ------
+
+ private static final class TestClassLoader extends ClassLoader
+ {
+ public TestClassLoader()
+ {
+ super(null);
+ }
+
+ @Override
+ public Class<?> loadClass(final String className) throws ClassNotFoundException
+ {
+ throw new ClassNotFoundException("TestClassLoader does not load anything!");
+ }
+ }
+
+ private static final class TestEndpoint extends Endpoint
+ {
+ @Override
+ public Binding getBinding()
+ {
+ return null;
+ }
+
+ @Override
+ public Object getImplementor()
+ {
+ return null;
+ }
+
+ @Override
+ public void publish(String address)
+ {
+ verifyClassLoaderCanLoadProviderImpl(Thread.currentThread().getContextClassLoader());
+ }
+
+ @Override
+ public void publish(Object serverContext)
+ {
+ verifyClassLoaderCanLoadProviderImpl(Thread.currentThread().getContextClassLoader());
+ }
+
+ @Override
+ public void stop()
+ {
+ }
+
+ @Override
+ public boolean isPublished()
+ {
+ return false;
+ }
+
+ @Override
+ public List<Source> getMetadata()
+ {
+ return null;
+ }
+
+ @Override
+ public void setMetadata(List<Source> metadata)
+ {
+ }
+
+ @Override
+ public Executor getExecutor()
+ {
+ return null;
+ }
+
+ @Override
+ public void setExecutor(Executor executor)
+ {
+ }
+
+ @Override
+ public Map<String, Object> getProperties()
+ {
+ return null;
+ }
+
+ @Override
+ public void setProperties(Map<String, Object> properties)
+ {
+ }
+
+ @Override
+ public EndpointReference getEndpointReference(Element... referenceParameters)
+ {
+ return null;
+ }
+
+ @Override
+ public <T extends EndpointReference> T getEndpointReference(Class<T> clazz, Element... referenceParameters)
+ {
+ return null;
+ }
+ }
+}
13 years, 10 months
JBossWS SVN: r13793 - stack/cxf/tags/jbossws-cxf-3.4.1.GA/src/main/distro.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2011-02-24 04:31:39 -0500 (Thu, 24 Feb 2011)
New Revision: 13793
Modified:
stack/cxf/tags/jbossws-cxf-3.4.1.GA/src/main/distro/Install.txt
stack/cxf/tags/jbossws-cxf-3.4.1.GA/src/main/distro/ant.properties.example
Log:
Committing minor install instruction changes I forgot to commit at 3.4.1 release time (included in the released binaries though)
Modified: stack/cxf/tags/jbossws-cxf-3.4.1.GA/src/main/distro/Install.txt
===================================================================
--- stack/cxf/tags/jbossws-cxf-3.4.1.GA/src/main/distro/Install.txt 2011-02-23 18:26:45 UTC (rev 13792)
+++ stack/cxf/tags/jbossws-cxf-3.4.1.GA/src/main/distro/Install.txt 2011-02-24 09:31:39 UTC (rev 13793)
@@ -11,12 +11,9 @@
1.) Copy ant.properties.examples to ant.properties
2.) Modify the target container location in ant.properties
-3.) Execute one of the following
+3.) Execute
- ant deploy-jboss501
- ant deploy-jboss510
ant deploy-jboss600
- ant deploy-jboss601
By default the SOAP stack will be installed to 'default' configuration.
If users want to install SOAP stack to different JBossAS configuration then
Modified: stack/cxf/tags/jbossws-cxf-3.4.1.GA/src/main/distro/ant.properties.example
===================================================================
--- stack/cxf/tags/jbossws-cxf-3.4.1.GA/src/main/distro/ant.properties.example 2011-02-23 18:26:45 UTC (rev 13792)
+++ stack/cxf/tags/jbossws-cxf-3.4.1.GA/src/main/distro/ant.properties.example 2011-02-24 09:31:39 UTC (rev 13793)
@@ -3,13 +3,9 @@
#
# Optional JBoss Home
-jboss501.home=(a)jboss501.home@
-jboss510.home=(a)jboss510.home@
-jboss600.home=(a)jboss600.home@
-jboss601.home=(a)jboss601.home@
+jboss600.home=(a)jboss601.home@
-# The JBoss server under test. This can be [jboss501|jboss510|jboss600|jboss601]
-jbossws.integration.target=jboss510
+jbossws.integration.target=jboss600
# The JBoss settings
jboss.server.instance=default
13 years, 10 months
JBossWS SVN: r13792 - in stack/native/branches/jbossws-native-3.1.2.SP3_CP01_JBPAPP-5976: modules/core/src/main/java/org/jboss/ws/core/client and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: bmaxwell
Date: 2011-02-23 13:26:45 -0500 (Wed, 23 Feb 2011)
New Revision: 13792
Modified:
stack/native/branches/jbossws-native-3.1.2.SP3_CP01_JBPAPP-5976/
stack/native/branches/jbossws-native-3.1.2.SP3_CP01_JBPAPP-5976/modules/core/src/main/java/org/jboss/ws/core/client/HTTPRemotingConnection.java
Log:
[JBPAPP-5976] port Configure remoting to reuse SSL sessions JBPAPP-5826 for one off patch
Property changes on: stack/native/branches/jbossws-native-3.1.2.SP3_CP01_JBPAPP-5976
___________________________________________________________________
Added: svn:mergeinfo
+ /stack/native/branches/jbossws-native-3.1.2:13631
Modified: stack/native/branches/jbossws-native-3.1.2.SP3_CP01_JBPAPP-5976/modules/core/src/main/java/org/jboss/ws/core/client/HTTPRemotingConnection.java
===================================================================
--- stack/native/branches/jbossws-native-3.1.2.SP3_CP01_JBPAPP-5976/modules/core/src/main/java/org/jboss/ws/core/client/HTTPRemotingConnection.java 2011-02-23 17:35:27 UTC (rev 13791)
+++ stack/native/branches/jbossws-native-3.1.2.SP3_CP01_JBPAPP-5976/modules/core/src/main/java/org/jboss/ws/core/client/HTTPRemotingConnection.java 2011-02-23 18:26:45 UTC (rev 13792)
@@ -73,6 +73,8 @@
{
// provide logging
private static Logger log = Logger.getLogger(HTTPRemotingConnection.class);
+ private static final String REMOTING_DESTRUCTION_DELAY =
+ System.getProperty("org.jboss.ws.client.remoting.destruction.delay", "5000");
private Map<String, Object> clientConfig = new HashMap<String, Object>();
@@ -200,6 +202,7 @@
}
locator = new InvokerLocator(targetAddress);
+ locator.getParameters().put(Client.INVOKER_DESTRUCTION_DELAY, REMOTING_DESTRUCTION_DELAY); // [JBPAPP-5826] reuse SSL sessions
}
catch (MalformedURLException e)
{
13 years, 10 months