JBossWS SVN: r18126 - framework/branches/jbossws-framework-3.1.2/src/main/java/org/jboss/wsf/framework/deployment.
by jbossws-commits@lists.jboss.org
Author: rsearls
Date: 2013-12-04 08:12:24 -0500 (Wed, 04 Dec 2013)
New Revision: 18126
Modified:
framework/branches/jbossws-framework-3.1.2/src/main/java/org/jboss/wsf/framework/deployment/ResourceResolverImpl.java
Log:
JBPAPP-10903: check server classloader when wsdl location starts with classpath:.
Modified: framework/branches/jbossws-framework-3.1.2/src/main/java/org/jboss/wsf/framework/deployment/ResourceResolverImpl.java
===================================================================
--- framework/branches/jbossws-framework-3.1.2/src/main/java/org/jboss/wsf/framework/deployment/ResourceResolverImpl.java 2013-12-04 01:15:17 UTC (rev 18125)
+++ framework/branches/jbossws-framework-3.1.2/src/main/java/org/jboss/wsf/framework/deployment/ResourceResolverImpl.java 2013-12-04 13:12:24 UTC (rev 18126)
@@ -117,10 +117,23 @@
}
}
}
- if (vfResource == null)
- throw new IOException("Could not find " + resourcePath + " in the additional metadatafiles!");
-
- resourceURL = vfResource.toURL();
+
+ if (resourceURL == null && resourcePath.startsWith("classpath:")) {
+
+ resourcePath = resourcePath.substring("classpath:".length());
+ ClassLoader cl = this.getClass().getClassLoader();
+ resourceURL = cl.getResource(resourcePath);
+
+ if (resourceURL == null)
+ throw new IOException("Could not find " + resourcePath + " in the server classpath!");
+
+ } else {
+
+ if (vfResource == null)
+ throw new IOException("Could not find " + resourcePath + " in the additional metadatafiles!");
+
+ resourceURL = vfResource.toURL();
+ }
}
}
return resourceURL;
11 years
JBossWS SVN: r18125 - common/branches.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2013-12-03 20:15:17 -0500 (Tue, 03 Dec 2013)
New Revision: 18125
Added:
common/branches/JBWS-3739/
Log:
Branching for working on 3739 and 3708
11 years
JBossWS SVN: r18124 - in stack/cxf/branches/JBWS-3739/modules/testsuite: cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/schemavalidation and 1 other directories.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2013-12-03 18:54:04 -0500 (Tue, 03 Dec 2013)
New Revision: 18124
Modified:
stack/cxf/branches/JBWS-3739/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/clientConfig/CXFClientConfigurationTestCase.java
stack/cxf/branches/JBWS-3739/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/clientConfig/Helper.java
stack/cxf/branches/JBWS-3739/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/clientConfig/TestUtils.java
stack/cxf/branches/JBWS-3739/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/schemavalidation/DefaultSchemaValidationTestCaseForked.java
stack/cxf/branches/JBWS-3739/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/schemavalidation/Helper.java
stack/cxf/branches/JBWS-3739/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/ClientConfigurationTestCase.java
stack/cxf/branches/JBWS-3739/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/Helper.java
stack/cxf/branches/JBWS-3739/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/TestUtils.java
Log:
[JBWS-3708] Make the testsuite compile with new spi; excluding few tests that requires refactoring as the client/endpoint default confs are now not editable
Modified: stack/cxf/branches/JBWS-3739/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/clientConfig/CXFClientConfigurationTestCase.java
===================================================================
--- stack/cxf/branches/JBWS-3739/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/clientConfig/CXFClientConfigurationTestCase.java 2013-12-03 23:52:54 UTC (rev 18123)
+++ stack/cxf/branches/JBWS-3739/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/clientConfig/CXFClientConfigurationTestCase.java 2013-12-03 23:54:04 UTC (rev 18124)
@@ -107,12 +107,20 @@
* @throws Exception
*/
public void testDefaultClientConfigurationInContainer() throws Exception {
+ if (true) {
+ System.out.println("[JBWS-3708] FIXME: refactor testcase");
+ return;
+ }
if (!isTargetJBoss71()) {
assertEquals("1", runTestInContainer("testDefaultClientConfiguration"));
}
}
public void testDefaultClientConfigurationOnDispatchInContainer() throws Exception {
+ if (true) {
+ System.out.println("[JBWS-3708] FIXME: refactor testcase");
+ return;
+ }
if (!isTargetJBoss71()) {
assertEquals("1", runTestInContainer("testDefaultClientConfigurationOnDispatch"));
}
Modified: stack/cxf/branches/JBWS-3739/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/clientConfig/Helper.java
===================================================================
--- stack/cxf/branches/JBWS-3739/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/clientConfig/Helper.java 2013-12-03 23:52:54 UTC (rev 18123)
+++ stack/cxf/branches/JBWS-3739/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/clientConfig/Helper.java 2013-12-03 23:54:04 UTC (rev 18124)
@@ -138,48 +138,50 @@
*/
public boolean testDefaultClientConfiguration() throws Exception
{
- final URL wsdlURL = new URL(address + "?wsdl");
-
- // -- modify default conf --
- try
- {
- TestUtils.getAndVerifyDefaultClientConfiguration().setProperty("propA", "valueA");
- // --
-
- Service service = Service.create(wsdlURL, serviceName);
- Endpoint port = (Endpoint)service.getPort(Endpoint.class);
-
- return (ClientProxy.getClient(port).getEndpoint().get("propA").equals("valueA"));
- }
- finally
- {
- // -- restore default conf --
- TestUtils.cleanupClientConfig();
- // --
- }
+ return false; //TODO
+// final URL wsdlURL = new URL(address + "?wsdl");
+//
+// // -- modify default conf --
+// try
+// {
+// TestUtils.getAndVerifyDefaultClientConfiguration().setProperty("propA", "valueA");
+// // --
+//
+// Service service = Service.create(wsdlURL, serviceName);
+// Endpoint port = (Endpoint)service.getPort(Endpoint.class);
+//
+// return (ClientProxy.getClient(port).getEndpoint().get("propA").equals("valueA"));
+// }
+// finally
+// {
+// // -- restore default conf --
+// TestUtils.cleanupClientConfig();
+// // --
+// }
}
public boolean testDefaultClientConfigurationOnDispatch() throws Exception
{
- final URL wsdlURL = new URL(address + "?wsdl");
-
- // -- modify default conf --
- try
- {
- TestUtils.getAndVerifyDefaultClientConfiguration().setProperty("propA", "valueA");
- // --
-
- Service service = Service.create(wsdlURL, serviceName);
- Dispatch<SOAPMessage> dispatch = service.createDispatch(portName, SOAPMessage.class, Mode.MESSAGE);
-
- return (((DispatchImpl<SOAPMessage>)dispatch).getClient().getEndpoint().get("propA").equals("valueA"));
- }
- finally
- {
- // -- restore default conf --
- TestUtils.cleanupClientConfig();
- // --
- }
+ return false; //TODO
+// final URL wsdlURL = new URL(address + "?wsdl");
+//
+// // -- modify default conf --
+// try
+// {
+// TestUtils.getAndVerifyDefaultClientConfiguration().setProperty("propA", "valueA");
+// // --
+//
+// Service service = Service.create(wsdlURL, serviceName);
+// Dispatch<SOAPMessage> dispatch = service.createDispatch(portName, SOAPMessage.class, Mode.MESSAGE);
+//
+// return (((DispatchImpl<SOAPMessage>)dispatch).getClient().getEndpoint().get("propA").equals("valueA"));
+// }
+// finally
+// {
+// // -- restore default conf --
+// TestUtils.cleanupClientConfig();
+// // --
+// }
}
/**
Modified: stack/cxf/branches/JBWS-3739/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/clientConfig/TestUtils.java
===================================================================
--- stack/cxf/branches/JBWS-3739/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/clientConfig/TestUtils.java 2013-12-03 23:52:54 UTC (rev 18123)
+++ stack/cxf/branches/JBWS-3739/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/clientConfig/TestUtils.java 2013-12-03 23:54:04 UTC (rev 18124)
@@ -21,6 +21,7 @@
*/
package org.jboss.test.ws.jaxws.cxf.clientConfig;
+import java.util.Collections;
import java.util.Iterator;
import java.util.Map;
@@ -76,9 +77,7 @@
}
public static void addTestCaseClientConfiguration(String testConfigName) {
- ClientConfig config = new ClientConfig();
- config.setConfigName(testConfigName);
- config.setProperty("propT", "valueT");
+ ClientConfig config = new ClientConfig(testConfigName, null, null, Collections.singletonMap("propT", "valueT"), null);
getServerConfig().addClientConfig(config);
}
Modified: stack/cxf/branches/JBWS-3739/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/schemavalidation/DefaultSchemaValidationTestCaseForked.java
===================================================================
--- stack/cxf/branches/JBWS-3739/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/schemavalidation/DefaultSchemaValidationTestCaseForked.java 2013-12-03 23:52:54 UTC (rev 18123)
+++ stack/cxf/branches/JBWS-3739/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/schemavalidation/DefaultSchemaValidationTestCaseForked.java 2013-12-03 23:54:04 UTC (rev 18124)
@@ -35,6 +35,7 @@
import org.jboss.wsf.test.JBossWSCXFTestSetup;
import org.jboss.wsf.test.JBossWSTest;
import org.jboss.wsf.test.JBossWSTestHelper;
+import org.junit.Ignore;
/**
* A testcase for verifying default schema validation configured
@@ -42,6 +43,7 @@
*
* @author alessio.soldano(a)jboss.com
*/
+@Ignore(value = "[JBWS-3708] FIXME: refactor testcase")
public class DefaultSchemaValidationTestCaseForked extends JBossWSTest
{
public static Test suite()
Modified: stack/cxf/branches/JBWS-3739/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/schemavalidation/Helper.java
===================================================================
--- stack/cxf/branches/JBWS-3739/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/schemavalidation/Helper.java 2013-12-03 23:52:54 UTC (rev 18123)
+++ stack/cxf/branches/JBWS-3739/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/schemavalidation/Helper.java 2013-12-03 23:54:04 UTC (rev 18124)
@@ -137,7 +137,8 @@
}
protected static void modifyDefaultClientConfiguration(AbstractCommonConfig defaultConfig) {
- defaultConfig.setProperty("schema-validation-enabled", "true");
+ //TODO
+// defaultConfig.setProperty("schema-validation-enabled", "true");
}
protected static void cleanupConfig(boolean client) throws Exception {
Modified: stack/cxf/branches/JBWS-3739/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/ClientConfigurationTestCase.java
===================================================================
--- stack/cxf/branches/JBWS-3739/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/ClientConfigurationTestCase.java 2013-12-03 23:52:54 UTC (rev 18123)
+++ stack/cxf/branches/JBWS-3739/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/ClientConfigurationTestCase.java 2013-12-03 23:54:04 UTC (rev 18124)
@@ -122,12 +122,20 @@
* @throws Exception
*/
public void testDefaultClientConfigurationInContainer() throws Exception {
+ if (true) {
+ System.out.println("[JBWS-3708] FIXME: refactor testcase");
+ return;
+ }
if (!isTargetJBoss71()) {
assertEquals("1", runTestInContainer("testDefaultClientConfiguration"));
}
}
public void testDefaultClientConfigurationOnDispatchInContainer() throws Exception {
+ if (true) {
+ System.out.println("[JBWS-3708] FIXME: refactor testcase");
+ return;
+ }
if (!isTargetJBoss71()) {
assertEquals("1", runTestInContainer("testDefaultClientConfigurationOnDispatch"));
}
Modified: stack/cxf/branches/JBWS-3739/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/Helper.java
===================================================================
--- stack/cxf/branches/JBWS-3739/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/Helper.java 2013-12-03 23:52:54 UTC (rev 18123)
+++ stack/cxf/branches/JBWS-3739/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/Helper.java 2013-12-03 23:54:04 UTC (rev 18124)
@@ -211,67 +211,69 @@
*/
public boolean testDefaultClientConfiguration() throws Exception
{
- QName serviceName = new QName("http://clientConfig.jaxws.ws.test.jboss.org/", "EndpointImplService");
- URL wsdlURL = new URL(address + "?wsdl");
-
- // -- modify default conf --
- try
- {
- TestUtils.modifyDefaultClientConfiguration(TestUtils.getAndVerifyDefaultClientConfiguration());
- // --
-
- Service service = Service.create(wsdlURL, serviceName);
- Endpoint port = (Endpoint)service.getPort(Endpoint.class);
-
- BindingProvider bp = (BindingProvider)port;
- @SuppressWarnings("rawtypes")
- List<Handler> hc = bp.getBinding().getHandlerChain();
- hc.add(new UserHandler());
- bp.getBinding().setHandlerChain(hc);
-
- String resStr = port.echo("Kermit");
- return ("Kermit|UserOut|LogOut|endpoint|LogIn|UserIn".equals(resStr));
- }
- finally
- {
- // -- restore default conf --
- TestUtils.cleanupClientConfig();
- // --
- }
+ return false;
+// QName serviceName = new QName("http://clientConfig.jaxws.ws.test.jboss.org/", "EndpointImplService");
+// URL wsdlURL = new URL(address + "?wsdl");
+//
+// // -- modify default conf --
+// try
+// {
+// TestUtils.modifyDefaultClientConfiguration(TestUtils.getAndVerifyDefaultClientConfiguration());
+// // --
+//
+// Service service = Service.create(wsdlURL, serviceName);
+// Endpoint port = (Endpoint)service.getPort(Endpoint.class);
+//
+// BindingProvider bp = (BindingProvider)port;
+// @SuppressWarnings("rawtypes")
+// List<Handler> hc = bp.getBinding().getHandlerChain();
+// hc.add(new UserHandler());
+// bp.getBinding().setHandlerChain(hc);
+//
+// String resStr = port.echo("Kermit");
+// return ("Kermit|UserOut|LogOut|endpoint|LogIn|UserIn".equals(resStr));
+// }
+// finally
+// {
+// // -- restore default conf --
+// TestUtils.cleanupClientConfig();
+// // --
+// }
}
public boolean testDefaultClientConfigurationOnDispatch() throws Exception
{
- final String reqString = "<ns1:echo xmlns:ns1=\"http://clientConfig.jaxws.ws.test.jboss.org/\"><arg0>Kermit</arg0></ns1:echo>";
- QName serviceName = new QName("http://clientConfig.jaxws.ws.test.jboss.org/", "EndpointImplService");
- QName portName = new QName("http://clientConfig.jaxws.ws.test.jboss.org/", "EndpointPort");
- URL wsdlURL = new URL(address + "?wsdl");
-
- // -- modify default conf --
- try
- {
- TestUtils.modifyDefaultClientConfiguration(TestUtils.getAndVerifyDefaultClientConfiguration());
- // --
-
- Service service = Service.create(wsdlURL, serviceName);
- Dispatch<Source> dispatch = service.createDispatch(portName, Source.class, Mode.PAYLOAD);
-
- BindingProvider bp = (BindingProvider)dispatch;
- @SuppressWarnings("rawtypes")
- List<Handler> hc = bp.getBinding().getHandlerChain();
- hc.add(new UserHandler());
- bp.getBinding().setHandlerChain(hc);
-
- Source resSource = dispatch.invoke(new DOMSource(DOMUtils.parse(reqString)));
- String resStr = DOMUtils.getTextContent(DOMUtils.sourceToElement(resSource).getElementsByTagName("return").item(0));
- return ("Kermit|UserOut|LogOut|endpoint|LogIn|UserIn".equals(resStr));
- }
- finally
- {
- // -- restore default conf --
- TestUtils.cleanupClientConfig();
- // --
- }
+ return false;
+// final String reqString = "<ns1:echo xmlns:ns1=\"http://clientConfig.jaxws.ws.test.jboss.org/\"><arg0>Kermit</arg0></ns1:echo>";
+// QName serviceName = new QName("http://clientConfig.jaxws.ws.test.jboss.org/", "EndpointImplService");
+// QName portName = new QName("http://clientConfig.jaxws.ws.test.jboss.org/", "EndpointPort");
+// URL wsdlURL = new URL(address + "?wsdl");
+//
+// // -- modify default conf --
+// try
+// {
+// TestUtils.modifyDefaultClientConfiguration(TestUtils.getAndVerifyDefaultClientConfiguration());
+// // --
+//
+// Service service = Service.create(wsdlURL, serviceName);
+// Dispatch<Source> dispatch = service.createDispatch(portName, Source.class, Mode.PAYLOAD);
+//
+// BindingProvider bp = (BindingProvider)dispatch;
+// @SuppressWarnings("rawtypes")
+// List<Handler> hc = bp.getBinding().getHandlerChain();
+// hc.add(new UserHandler());
+// bp.getBinding().setHandlerChain(hc);
+//
+// Source resSource = dispatch.invoke(new DOMSource(DOMUtils.parse(reqString)));
+// String resStr = DOMUtils.getTextContent(DOMUtils.sourceToElement(resSource).getElementsByTagName("return").item(0));
+// return ("Kermit|UserOut|LogOut|endpoint|LogIn|UserIn".equals(resStr));
+// }
+// finally
+// {
+// // -- restore default conf --
+// TestUtils.cleanupClientConfig();
+// // --
+// }
}
/**
Modified: stack/cxf/branches/JBWS-3739/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/TestUtils.java
===================================================================
--- stack/cxf/branches/JBWS-3739/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/TestUtils.java 2013-12-03 23:52:54 UTC (rev 18123)
+++ stack/cxf/branches/JBWS-3739/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/TestUtils.java 2013-12-03 23:54:04 UTC (rev 18124)
@@ -64,43 +64,40 @@
return defaultConfig;
}
- public static void modifyDefaultClientConfiguration(ClientConfig defaultConfig) {
- UnifiedHandlerMetaData handler = new UnifiedHandlerMetaData("org.jboss.test.ws.jaxws.clientConfig.LogHandler", "Log Handler", null, null, null, null);
- UnifiedHandlerChainMetaData uhcmd = new UnifiedHandlerChainMetaData(null, null, null, Collections.singletonList(handler), false, null);
- List<UnifiedHandlerChainMetaData> postHC = new LinkedList<UnifiedHandlerChainMetaData>();
- postHC.add(uhcmd);
- defaultConfig.setPostHandlerChains(postHC);
- }
+// public static void modifyDefaultClientConfiguration(ClientConfig defaultConfig) {
+// UnifiedHandlerMetaData handler = new UnifiedHandlerMetaData("org.jboss.test.ws.jaxws.clientConfig.LogHandler", "Log Handler", null, null, null, null);
+// UnifiedHandlerChainMetaData uhcmd = new UnifiedHandlerChainMetaData(null, null, null, Collections.singletonList(handler), false, null);
+// List<UnifiedHandlerChainMetaData> postHC = new LinkedList<UnifiedHandlerChainMetaData>();
+// postHC.add(uhcmd);
+// defaultConfig.setPostHandlerChains(postHC);
+// }
+//
+// public static void cleanupClientConfig() throws Exception {
+// ServerConfig sc = getServerConfig();
+// ClientConfig defaultConfig = null;
+// for (ClientConfig c : sc.getClientConfigs()) {
+// if (ClientConfig.STANDARD_CLIENT_CONFIG.equals(c.getConfigName())) {
+// defaultConfig = c;
+// }
+// }
+// if (defaultConfig == null) {
+// throw new Exception("Missing AS client config '" + ClientConfig.STANDARD_CLIENT_CONFIG + "'!");
+// }
+// List<UnifiedHandlerChainMetaData> preHC = defaultConfig.getPreHandlerChains();
+// List<UnifiedHandlerChainMetaData> postHC = defaultConfig.getPostHandlerChains();
+// if ((preHC == null || preHC.isEmpty()) && (postHC == null || postHC.isEmpty())) {
+// throw new Exception("'" + ClientConfig.STANDARD_CLIENT_CONFIG + "' is already empty!");
+// }
+// defaultConfig.setPostHandlerChains(null);
+// defaultConfig.setPreHandlerChains(null);
+// }
- public static void cleanupClientConfig() throws Exception {
- ServerConfig sc = getServerConfig();
- ClientConfig defaultConfig = null;
- for (ClientConfig c : sc.getClientConfigs()) {
- if (ClientConfig.STANDARD_CLIENT_CONFIG.equals(c.getConfigName())) {
- defaultConfig = c;
- }
- }
- if (defaultConfig == null) {
- throw new Exception("Missing AS client config '" + ClientConfig.STANDARD_CLIENT_CONFIG + "'!");
- }
- List<UnifiedHandlerChainMetaData> preHC = defaultConfig.getPreHandlerChains();
- List<UnifiedHandlerChainMetaData> postHC = defaultConfig.getPostHandlerChains();
- if ((preHC == null || preHC.isEmpty()) && (postHC == null || postHC.isEmpty())) {
- throw new Exception("'" + ClientConfig.STANDARD_CLIENT_CONFIG + "' is already empty!");
- }
- defaultConfig.setPostHandlerChains(null);
- defaultConfig.setPreHandlerChains(null);
- }
-
public static void addTestCaseClientConfiguration(String testConfigName) {
UnifiedHandlerMetaData handler = new UnifiedHandlerMetaData("org.jboss.test.ws.jaxws.clientConfig.RoutingHandler", "Routing Handler", null, null, null, null);
UnifiedHandlerChainMetaData uhcmd = new UnifiedHandlerChainMetaData(null, null, null, Collections.singletonList(handler), false, null);
- ClientConfig config = new ClientConfig();
- config.setConfigName(testConfigName);
List<UnifiedHandlerChainMetaData> preHC = new LinkedList<UnifiedHandlerChainMetaData>();
preHC.add(uhcmd);
- config.setPreHandlerChains(preHC);
- getServerConfig().addClientConfig(config);
+ getServerConfig().addClientConfig(new ClientConfig(testConfigName, preHC, null, null, null));
}
public static void removeTestCaseClientConfiguration(String testConfigName) {
11 years
JBossWS SVN: r18123 - stack/cxf/branches/JBWS-3739.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2013-12-03 18:52:54 -0500 (Tue, 03 Dec 2013)
New Revision: 18123
Modified:
stack/cxf/branches/JBWS-3739/pom.xml
Log:
Update spi/asil720 versions
Modified: stack/cxf/branches/JBWS-3739/pom.xml
===================================================================
--- stack/cxf/branches/JBWS-3739/pom.xml 2013-12-03 23:49:41 UTC (rev 18122)
+++ stack/cxf/branches/JBWS-3739/pom.xml 2013-12-03 23:52:54 UTC (rev 18123)
@@ -60,12 +60,12 @@
<!-- Properties -->
<properties>
<jbossws.api.version>1.0.2.Final</jbossws.api.version>
- <jbossws.spi.version>2.3.0-SNAPSHOT</jbossws.spi.version>
+ <jbossws.spi.version>2.3.0.Alpha1-SNAPSHOT</jbossws.spi.version>
<jbossws.common.version>2.3.0-SNAPSHOT</jbossws.common.version>
<jbossws.common.tools.version>1.2.0.Final</jbossws.common.tools.version>
<jbossws.jboss712.version>4.2.1.Final</jbossws.jboss712.version>
<jbossws.jboss713.version>4.2.1.Final</jbossws.jboss713.version>
- <jbossws.jboss720.version>4.2.2.Final</jbossws.jboss720.version>
+ <jbossws.jboss720.version>4.3.0.Alpha1-SNAPSHOT</jbossws.jboss720.version>
<jbossws.native.version>4.1.2.Final</jbossws.native.version>
<jboss712.version>7.1.2.Final</jboss712.version>
<jboss713.version>7.1.3.Final</jboss713.version>
11 years
JBossWS SVN: r18122 - in spi/branches/JBWS-3739/src: main/java/org/jboss/wsf/spi/metadata/config and 1 other directories.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2013-12-03 18:49:41 -0500 (Tue, 03 Dec 2013)
New Revision: 18122
Modified:
spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/AbstractHandlerChainsMetaDataParser.java
spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/config/AbstractCommonConfig.java
spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/config/ClientConfig.java
spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/config/CommonConfig.java
spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/config/ConfigMetaDataParser.java
spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/config/EndpointConfig.java
spi/branches/JBWS-3739/src/test/java/org/jboss/test/wsf/spi/metadata/config/ConfigMDParserTestCase.java
Log:
[JBWS-3708] Turn client/endpoint config into immutable objects
Modified: spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/AbstractHandlerChainsMetaDataParser.java
===================================================================
--- spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/AbstractHandlerChainsMetaDataParser.java 2013-12-03 14:47:28 UTC (rev 18121)
+++ spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/AbstractHandlerChainsMetaDataParser.java 2013-12-03 23:49:41 UTC (rev 18122)
@@ -71,7 +71,7 @@
protected UnifiedHandlerChainsMetaData parseHandlerChains(XMLStreamReader reader, String nsUri,
String handlerChainsElementNS, String handlerChainsElementName) throws XMLStreamException
{
- List<UnifiedHandlerChainMetaData> handlerChains = new LinkedList<UnifiedHandlerChainMetaData>();
+ List<UnifiedHandlerChainMetaData> handlerChains = new ArrayList<UnifiedHandlerChainMetaData>(1);
while (reader.hasNext())
{
switch (reader.nextTag())
Modified: spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/config/AbstractCommonConfig.java
===================================================================
--- spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/config/AbstractCommonConfig.java 2013-12-03 14:47:28 UTC (rev 18121)
+++ spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/config/AbstractCommonConfig.java 2013-12-03 23:49:41 UTC (rev 18122)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2013, 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.
*
@@ -21,7 +21,7 @@
*/
package org.jboss.wsf.spi.metadata.config;
-import java.util.HashMap;
+import java.util.Collections;
import java.util.List;
import java.util.Map;
@@ -37,32 +37,52 @@
*/
public abstract class AbstractCommonConfig implements CommonConfig
{
- private String configName;
- private Map<String, Feature> features = new HashMap<String, Feature>(2);
- private Map<String, String> properties = new HashMap<String, String>(4);
- private List<UnifiedHandlerChainMetaData> preHandlerChains;
- private List<UnifiedHandlerChainMetaData> postHandlerChains;
+ private final String configName;
+ private final Map<String, Feature> features;
+ private final Map<String, String> properties;
+ private final List<UnifiedHandlerChainMetaData> preHandlerChains;
+ private final List<UnifiedHandlerChainMetaData> postHandlerChains;
+
+ protected AbstractCommonConfig(String configName,
+ List<UnifiedHandlerChainMetaData> preHandlerChains,
+ List<UnifiedHandlerChainMetaData> postHandlerChains,
+ Map<String, String> properties,
+ Map<String, Feature> features)
+ {
+ super();
+ this.configName = configName;
+ if (features != null && !features.isEmpty()) {
+ this.features = Collections.unmodifiableMap(features);
+ } else {
+ this.features = Collections.emptyMap();
+ }
+ if (properties != null && !properties.isEmpty()) {
+ this.properties = Collections.unmodifiableMap(properties);
+ } else {
+ this.properties = Collections.emptyMap();
+ }
+ if (preHandlerChains != null && !preHandlerChains.isEmpty()) {
+ this.preHandlerChains = Collections.unmodifiableList(preHandlerChains);
+ } else {
+ this.preHandlerChains = Collections.emptyList();
+ }
+ if (postHandlerChains != null && !postHandlerChains.isEmpty()) {
+ this.postHandlerChains = Collections.unmodifiableList(postHandlerChains);
+ } else {
+ this.postHandlerChains = Collections.emptyList();
+ }
+ }
public List<UnifiedHandlerChainMetaData> getPostHandlerChains()
{
return postHandlerChains;
}
- public void setPostHandlerChains(List<UnifiedHandlerChainMetaData> postHandlerChain)
- {
- this.postHandlerChains = postHandlerChain;
- }
-
public List<UnifiedHandlerChainMetaData> getPreHandlerChains()
{
return preHandlerChains;
}
- public void setPreHandlerChains(List<UnifiedHandlerChainMetaData> preHandlerChains)
- {
- this.preHandlerChains = preHandlerChains;
- }
-
public List<UnifiedHandlerChainMetaData> getHandlers(HandlerType type)
{
List<UnifiedHandlerChainMetaData> handlerChains;
@@ -79,30 +99,11 @@
return configName;
}
- public void setConfigName(String configName)
- {
- this.configName = configName;
- }
-
public boolean hasFeature(String name)
{
return features.containsKey(name);
}
- public void setFeature(Feature feature, boolean enabled) {
-
- if(enabled) {
- features.put(feature.getName(), feature);
- }
- else
- features.remove(feature.getName());
- }
-
- public void setProperty(String name, String value)
- {
- properties.put(name, value);
- }
-
public String getProperty(String name)
{
return properties.get(name);
Modified: spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/config/ClientConfig.java
===================================================================
--- spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/config/ClientConfig.java 2013-12-03 14:47:28 UTC (rev 18121)
+++ spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/config/ClientConfig.java 2013-12-03 23:49:41 UTC (rev 18122)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2013, 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.
*
@@ -21,6 +21,11 @@
*/
package org.jboss.wsf.spi.metadata.config;
+import java.util.List;
+import java.util.Map;
+
+import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerChainMetaData;
+
/**
* A JBossWS client configuration
*
@@ -30,4 +35,11 @@
public class ClientConfig extends AbstractCommonConfig
{
public static final String STANDARD_CLIENT_CONFIG = "Standard-Client-Config";
+
+ public ClientConfig(String configName, List<UnifiedHandlerChainMetaData> preHandlerChains,
+ List<UnifiedHandlerChainMetaData> postHandlerChains, Map<String, String> properties,
+ Map<String, Feature> features)
+ {
+ super(configName, preHandlerChains, postHandlerChains, properties, features);
+ }
}
Modified: spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/config/CommonConfig.java
===================================================================
--- spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/config/CommonConfig.java 2013-12-03 14:47:28 UTC (rev 18121)
+++ spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/config/CommonConfig.java 2013-12-03 23:49:41 UTC (rev 18122)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2013, 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.
*
@@ -40,24 +40,14 @@
public List<UnifiedHandlerChainMetaData> getPostHandlerChains();
- public void setPostHandlerChains(List<UnifiedHandlerChainMetaData> postHandlerChain);
-
public List<UnifiedHandlerChainMetaData> getPreHandlerChains();
- public void setPreHandlerChains(List<UnifiedHandlerChainMetaData> preHandlerChains);
-
public List<UnifiedHandlerChainMetaData> getHandlers(HandlerType type);
public String getConfigName();
- public void setConfigName(String configName);
-
public boolean hasFeature(String name);
- public void setFeature(Feature feature, boolean enabled);
-
- public void setProperty(String name, String value);
-
public String getProperty(String name);
public Map<String, String> getProperties();
Modified: spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/config/ConfigMetaDataParser.java
===================================================================
--- spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/config/ConfigMetaDataParser.java 2013-12-03 14:47:28 UTC (rev 18121)
+++ spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/config/ConfigMetaDataParser.java 2013-12-03 23:49:41 UTC (rev 18122)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2013, 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.
*
@@ -44,6 +44,10 @@
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
import javax.xml.namespace.QName;
import javax.xml.stream.XMLStreamConstants;
@@ -52,6 +56,7 @@
import org.jboss.wsf.spi.Loggers;
import org.jboss.wsf.spi.metadata.AbstractHandlerChainsMetaDataParser;
+import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerChainMetaData;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerChainsMetaData;
import org.jboss.wsf.spi.util.StAXUtils;
@@ -153,14 +158,10 @@
}
case XMLStreamConstants.START_ELEMENT : {
if (match(reader, JBOSSWS_JAXWS_CONFIG_NS_4_0, ENDPOINT_CONFIG)) {
- EndpointConfig epConfig = new EndpointConfig();
- parseConfig(reader, epConfig, ENDPOINT_CONFIG);
- configRoot.addEndpointConfig(epConfig);
+ configRoot.addEndpointConfig(parseEndpointConfig(reader));
}
else if (match(reader, JBOSSWS_JAXWS_CONFIG_NS_4_0, CLIENT_CONFIG)) {
- ClientConfig clConfig = new ClientConfig();
- parseConfig(reader, clConfig, CLIENT_CONFIG);
- configRoot.addClientConfig(clConfig);
+ configRoot.addClientConfig(parseClientConfig(reader));
}
else
{
@@ -172,8 +173,23 @@
throw MESSAGES.reachedEndOfXMLDocUnexpectedly(getDescriptorForLogs());
}
- private void parseConfig(XMLStreamReader reader, CommonConfig config, String configElement) throws XMLStreamException
+ private EndpointConfig parseEndpointConfig(final XMLStreamReader reader) throws XMLStreamException
{
+ return (EndpointConfig)parseConfig(reader, ENDPOINT_CONFIG);
+ }
+
+ private ClientConfig parseClientConfig(final XMLStreamReader reader) throws XMLStreamException
+ {
+ return (ClientConfig)parseConfig(reader, CLIENT_CONFIG);
+ }
+
+ private CommonConfig parseConfig(final XMLStreamReader reader, final String configElement) throws XMLStreamException
+ {
+ String configName = null;
+ List<UnifiedHandlerChainMetaData> pre = null;
+ List<UnifiedHandlerChainMetaData> post = null;
+ List<Feature> features = new ArrayList<Feature>(1);
+ List<Prop> properties = new ArrayList<Prop>(1);
while (reader.hasNext())
{
switch (reader.nextTag())
@@ -181,7 +197,24 @@
case XMLStreamConstants.END_ELEMENT : {
if (match(reader, JBOSSWS_JAXWS_CONFIG_NS_4_0, configElement))
{
- return;
+ Map<String, String> props = null;
+ if (!properties.isEmpty()) {
+ props = new HashMap<String, String>(properties.size(), 1);
+ for (Prop ps : properties)
+ {
+ props.put(ps.getName(), ps.getValue());
+ }
+ }
+ Map<String, Feature> featuresMap = null;
+ if (!features.isEmpty()) {
+ featuresMap = new HashMap<String, Feature>(features.size(), 1);
+ for (Feature f : features)
+ {
+ featuresMap.put(f.getName(), f);
+ }
+ }
+ return CLIENT_CONFIG.equals(configElement) ? new ClientConfig(configName, pre, post, props,
+ featuresMap) : new EndpointConfig(configName, pre, post, props, featuresMap);
}
else
{
@@ -190,21 +223,21 @@
}
case XMLStreamConstants.START_ELEMENT : {
if (match(reader, JBOSSWS_JAXWS_CONFIG_NS_4_0, CONFIG_NAME)) {
- config.setConfigName(elementAsString(reader));
+ configName = elementAsString(reader);
}
else if (match(reader, JBOSSWS_JAXWS_CONFIG_NS_4_0, PRE_HANDLER_CHAINS)) {
UnifiedHandlerChainsMetaData uhcmd = parseHandlerChains(reader, JAVAEE_NS, JBOSSWS_JAXWS_CONFIG_NS_4_0, PRE_HANDLER_CHAINS);
- config.setPreHandlerChains(uhcmd.getHandlerChains());
+ pre = uhcmd.getHandlerChains();
}
else if (match(reader, JBOSSWS_JAXWS_CONFIG_NS_4_0, POST_HANDLER_CHAINS)) {
UnifiedHandlerChainsMetaData uhcmd = parseHandlerChains(reader, JAVAEE_NS, JBOSSWS_JAXWS_CONFIG_NS_4_0, POST_HANDLER_CHAINS);
- config.setPostHandlerChains(uhcmd.getHandlerChains());
+ post = uhcmd.getHandlerChains();
}
else if (match(reader, JBOSSWS_JAXWS_CONFIG_NS_4_0, FEATURE)) {
- config.setFeature(parseFeature(reader), true);
+ features.add(parseFeature(reader));
}
else if (match(reader, JBOSSWS_JAXWS_CONFIG_NS_4_0, PROPERTY)) {
- parseProperty(reader, config);
+ properties.add(parseProperty(reader));
}
else
{
@@ -216,7 +249,7 @@
throw MESSAGES.reachedEndOfXMLDocUnexpectedly(getDescriptorForLogs());
}
- private void parseProperty(XMLStreamReader reader, CommonConfig config) throws XMLStreamException
+ private Prop parseProperty(XMLStreamReader reader) throws XMLStreamException
{
String name = null;
String value = null;
@@ -231,8 +264,7 @@
{
throw MESSAGES.couldNotGetPropertyName(getDescriptorForLogs());
}
- config.setProperty(name, value);
- return;
+ return new Prop(name, value);
}
else
{
@@ -256,6 +288,28 @@
throw MESSAGES.reachedEndOfXMLDocUnexpectedly(getDescriptorForLogs());
}
+ private class Prop {
+ private final String name;
+ private final String value;
+
+ public Prop(String name, String value)
+ {
+ super();
+ this.name = name;
+ this.value = value;
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public String getValue()
+ {
+ return value;
+ }
+ }
+
private Feature parseFeature(XMLStreamReader reader) throws XMLStreamException
{
Feature feature = null;
Modified: spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/config/EndpointConfig.java
===================================================================
--- spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/config/EndpointConfig.java 2013-12-03 14:47:28 UTC (rev 18121)
+++ spi/branches/JBWS-3739/src/main/java/org/jboss/wsf/spi/metadata/config/EndpointConfig.java 2013-12-03 23:49:41 UTC (rev 18122)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2013, 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.
*
@@ -21,6 +21,11 @@
*/
package org.jboss.wsf.spi.metadata.config;
+import java.util.List;
+import java.util.Map;
+
+import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerChainMetaData;
+
/**
* A JBossWS endpoint configuration
*
@@ -30,4 +35,11 @@
public class EndpointConfig extends AbstractCommonConfig
{
public static final String STANDARD_ENDPOINT_CONFIG = "Standard-Endpoint-Config";
+
+ public EndpointConfig(String configName, List<UnifiedHandlerChainMetaData> preHandlerChains,
+ List<UnifiedHandlerChainMetaData> postHandlerChains, Map<String, String> properties,
+ Map<String, Feature> features)
+ {
+ super(configName, preHandlerChains, postHandlerChains, properties, features);
+ }
}
Modified: spi/branches/JBWS-3739/src/test/java/org/jboss/test/wsf/spi/metadata/config/ConfigMDParserTestCase.java
===================================================================
--- spi/branches/JBWS-3739/src/test/java/org/jboss/test/wsf/spi/metadata/config/ConfigMDParserTestCase.java 2013-12-03 14:47:28 UTC (rev 18121)
+++ spi/branches/JBWS-3739/src/test/java/org/jboss/test/wsf/spi/metadata/config/ConfigMDParserTestCase.java 2013-12-03 23:49:41 UTC (rev 18122)
@@ -51,8 +51,8 @@
ClientConfig cc = clientConfigs.get(0);
assertEquals("Standard Client", cc.getConfigName());
assertTrue(cc.getProperties().isEmpty());
- assertNull(cc.getPreHandlerChains());
- assertNull(cc.getPostHandlerChains());
+ assertTrue(cc.getPreHandlerChains() == null || cc.getPreHandlerChains().isEmpty());
+ assertTrue(cc.getPostHandlerChains() == null || cc.getPostHandlerChains().isEmpty());
List<EndpointConfig> endpointConfigs = metadata.getEndpointConfig();
assertEquals(2, endpointConfigs.size());
@@ -67,8 +67,8 @@
assertEquals("value2", ec.getProperty("name2"));
ec = metadata.getEndpointConfigByName(".NET friendly Endpoint");
- assertNull(ec.getPreHandlerChains());
- assertNull(ec.getPostHandlerChains());
+ assertTrue(ec.getPreHandlerChains() == null || ec.getPreHandlerChains().isEmpty());
+ assertTrue(ec.getPostHandlerChains() == null || ec.getPostHandlerChains().isEmpty());
assertTrue(ec.getProperties().isEmpty());
assertTrue(ec.hasFeature("http://org.jboss.ws/binding/wsdl/dotnet"));
}
11 years
JBossWS SVN: r18121 - in container/jboss72/branches/jbossws-jboss720-JBWS-3739/server-integration/src/main/java/org/jboss/as/webservices: dmr and 2 other directories.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2013-12-03 09:47:28 -0500 (Tue, 03 Dec 2013)
New Revision: 18121
Added:
container/jboss72/branches/jbossws-jboss720-JBWS-3739/server-integration/src/main/java/org/jboss/as/webservices/dmr/ListInjector.java
Modified:
container/jboss72/branches/jbossws-jboss720-JBWS-3739/server-integration/src/main/java/org/jboss/as/webservices/deployers/WSIntegrationProcessorJAXWS_JMS.java
container/jboss72/branches/jbossws-jboss720-JBWS-3739/server-integration/src/main/java/org/jboss/as/webservices/dmr/ClientConfigAdd.java
container/jboss72/branches/jbossws-jboss720-JBWS-3739/server-integration/src/main/java/org/jboss/as/webservices/dmr/EndpointConfigAdd.java
container/jboss72/branches/jbossws-jboss720-JBWS-3739/server-integration/src/main/java/org/jboss/as/webservices/dmr/HandlerAdd.java
container/jboss72/branches/jbossws-jboss720-JBWS-3739/server-integration/src/main/java/org/jboss/as/webservices/dmr/HandlerChainAdd.java
container/jboss72/branches/jbossws-jboss720-JBWS-3739/server-integration/src/main/java/org/jboss/as/webservices/dmr/PackageUtils.java
container/jboss72/branches/jbossws-jboss720-JBWS-3739/server-integration/src/main/java/org/jboss/as/webservices/dmr/WSSubsystemAdd.java
container/jboss72/branches/jbossws-jboss720-JBWS-3739/server-integration/src/main/java/org/jboss/as/webservices/service/ConfigService.java
container/jboss72/branches/jbossws-jboss720-JBWS-3739/server-integration/src/main/java/org/jboss/as/webservices/service/HandlerChainService.java
container/jboss72/branches/jbossws-jboss720-JBWS-3739/server-integration/src/main/java/org/jboss/as/webservices/service/HandlerService.java
container/jboss72/branches/jbossws-jboss720-JBWS-3739/server-integration/src/main/java/org/jboss/as/webservices/webserviceref/WSRefUtils.java
Log:
[JBWS-3739] Enforce jbossws-spi metadata immutability
Modified: container/jboss72/branches/jbossws-jboss720-JBWS-3739/server-integration/src/main/java/org/jboss/as/webservices/deployers/WSIntegrationProcessorJAXWS_JMS.java
===================================================================
--- container/jboss72/branches/jbossws-jboss720-JBWS-3739/server-integration/src/main/java/org/jboss/as/webservices/deployers/WSIntegrationProcessorJAXWS_JMS.java 2013-12-03 14:46:42 UTC (rev 18120)
+++ container/jboss72/branches/jbossws-jboss720-JBWS-3739/server-integration/src/main/java/org/jboss/as/webservices/deployers/WSIntegrationProcessorJAXWS_JMS.java 2013-12-03 14:47:28 UTC (rev 18121)
@@ -92,7 +92,7 @@
}
//extract SOAP-over-JMS 1.0 bindings
- final JMSEndpointsMetaData endpointsMetaData = new JMSEndpointsMetaData();
+ List<JMSEndpointMetaData> list = new LinkedList<JMSEndpointMetaData>();
if (!map.isEmpty()) {
for (String wsdlLocation : map.keySet()) {
@@ -114,14 +114,7 @@
ClassInfo webServiceClassInfo = (ClassInfo) ai.target();
String beanClassName = webServiceClassInfo.name().toString();
//service name ?
- JMSEndpointMetaData endpointMetaData = new JMSEndpointMetaData(endpointsMetaData);
- endpointMetaData.setEndpointName(port);
- endpointMetaData.setName(beanClassName);
- endpointMetaData.setImplementor(beanClassName);
- //endpointMetaData.setName(name);
- endpointMetaData.setSoapAddress(soapAddress);
- endpointMetaData.setWsdlLocation(wsdlLocation);
- endpointsMetaData.addEndpointMetaData(endpointMetaData);
+ list.add(new JMSEndpointMetaData(beanClassName, port, beanClassName, wsdlLocation, soapAddress));
}
}
} catch (Exception ignore) {
@@ -130,7 +123,7 @@
}
}
- unit.putAttachment(JMS_ENDPOINT_METADATA_KEY, endpointsMetaData);
+ unit.putAttachment(JMS_ENDPOINT_METADATA_KEY, new JMSEndpointsMetaData(list));
}
@Override
Modified: container/jboss72/branches/jbossws-jboss720-JBWS-3739/server-integration/src/main/java/org/jboss/as/webservices/dmr/ClientConfigAdd.java
===================================================================
--- container/jboss72/branches/jbossws-jboss720-JBWS-3739/server-integration/src/main/java/org/jboss/as/webservices/dmr/ClientConfigAdd.java 2013-12-03 14:46:42 UTC (rev 18120)
+++ container/jboss72/branches/jbossws-jboss720-JBWS-3739/server-integration/src/main/java/org/jboss/as/webservices/dmr/ClientConfigAdd.java 2013-12-03 14:47:28 UTC (rev 18121)
@@ -35,12 +35,13 @@
import org.jboss.as.webservices.util.ASHelper;
import org.jboss.as.webservices.util.WSServices;
import org.jboss.dmr.ModelNode;
+import org.jboss.msc.inject.Injector;
import org.jboss.msc.service.ServiceBuilder;
import org.jboss.msc.service.ServiceController;
import org.jboss.msc.service.ServiceName;
import org.jboss.msc.service.ServiceTarget;
import org.jboss.wsf.spi.management.ServerConfig;
-import org.jboss.wsf.spi.metadata.config.ClientConfig;
+import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerChainMetaData;
/**
* @author <a href="mailto:alessio.soldano@jboss.com">Alessio Soldano</a>
@@ -78,7 +79,9 @@
final ConfigService clientConfigService = new ConfigService(serverConfig, name, true);
final ServiceTarget target = context.getServiceTarget();
final ServiceBuilder<?> clientServiceBuilder = target.addService(serviceName, clientConfigService);
-
+ setDependency(context, clientServiceBuilder, clientConfigService.getPreHandlerChainsInjector(), serviceName, address, Constants.PRE_HANDLER_CHAIN);
+ final Injector<UnifiedHandlerChainMetaData> postInjector = clientConfigService.getPostHandlerChainsInjector();
+ setDependency(context, clientServiceBuilder, postInjector, serviceName, address, Constants.POST_HANDLER_CHAIN);
ServiceController<?> controller = clientServiceBuilder.setInitialMode(ServiceController.Mode.ACTIVE).install();
if (newControllers != null) {
newControllers.add(controller);
@@ -87,4 +90,11 @@
context.reloadRequired();
}
}
+
+ private void setDependency(final OperationContext context, final ServiceBuilder<?> builder, final Injector<UnifiedHandlerChainMetaData> injector,
+ final ServiceName serviceName, final PathAddress address, final String handlerChainType) {
+ for (ServiceName sn : PackageUtils.getServiceNameDependencies(context, serviceName, address, handlerChainType)) {
+ builder.addDependency(sn, UnifiedHandlerChainMetaData.class, injector);
+ }
+ }
}
Modified: container/jboss72/branches/jbossws-jboss720-JBWS-3739/server-integration/src/main/java/org/jboss/as/webservices/dmr/EndpointConfigAdd.java
===================================================================
--- container/jboss72/branches/jbossws-jboss720-JBWS-3739/server-integration/src/main/java/org/jboss/as/webservices/dmr/EndpointConfigAdd.java 2013-12-03 14:46:42 UTC (rev 18120)
+++ container/jboss72/branches/jbossws-jboss720-JBWS-3739/server-integration/src/main/java/org/jboss/as/webservices/dmr/EndpointConfigAdd.java 2013-12-03 14:47:28 UTC (rev 18121)
@@ -35,11 +35,13 @@
import org.jboss.as.webservices.util.ASHelper;
import org.jboss.as.webservices.util.WSServices;
import org.jboss.dmr.ModelNode;
+import org.jboss.msc.inject.Injector;
import org.jboss.msc.service.ServiceBuilder;
import org.jboss.msc.service.ServiceController;
import org.jboss.msc.service.ServiceName;
import org.jboss.msc.service.ServiceTarget;
import org.jboss.wsf.spi.management.ServerConfig;
+import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerChainMetaData;
/**
* @author <a href="ema(a)redhat.com">Jim Ma</a>
@@ -81,6 +83,8 @@
final ServiceTarget target = context.getServiceTarget();
final ServiceBuilder<?> clientServiceBuilder = target.addService(serviceName, endpointConfigService);
+ setDependency(context, clientServiceBuilder, endpointConfigService.getPreHandlerChainsInjector(), serviceName, address, Constants.PRE_HANDLER_CHAIN);
+ setDependency(context, clientServiceBuilder, endpointConfigService.getPostHandlerChainsInjector(), serviceName, address, Constants.POST_HANDLER_CHAIN);
ServiceController<?> controller = clientServiceBuilder.setInitialMode(ServiceController.Mode.ACTIVE).install();
if (newControllers != null) {
newControllers.add(controller);
@@ -89,4 +93,11 @@
context.reloadRequired();
}
}
+
+ private void setDependency(final OperationContext context, final ServiceBuilder<?> builder, final Injector<UnifiedHandlerChainMetaData> injector,
+ final ServiceName serviceName, final PathAddress address, final String handlerChainType) {
+ for (ServiceName sn : PackageUtils.getServiceNameDependencies(context, serviceName, address, handlerChainType)) {
+ builder.addDependency(sn, UnifiedHandlerChainMetaData.class, injector);
+ }
+ }
}
Modified: container/jboss72/branches/jbossws-jboss720-JBWS-3739/server-integration/src/main/java/org/jboss/as/webservices/dmr/HandlerAdd.java
===================================================================
--- container/jboss72/branches/jbossws-jboss720-JBWS-3739/server-integration/src/main/java/org/jboss/as/webservices/dmr/HandlerAdd.java 2013-12-03 14:46:42 UTC (rev 18120)
+++ container/jboss72/branches/jbossws-jboss720-JBWS-3739/server-integration/src/main/java/org/jboss/as/webservices/dmr/HandlerAdd.java 2013-12-03 14:47:28 UTC (rev 18121)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2012, Red Hat, Inc., and individual contributors
+ * Copyright 2013, Red Hat, Inc., and individual contributors
* as indicated by the @author tags. See the copyright.txt file in the
* distribution for a full listing of individual contributors.
*
@@ -43,7 +43,6 @@
import org.jboss.msc.service.ServiceName;
import org.jboss.msc.service.ServiceRegistry;
import org.jboss.msc.service.ServiceTarget;
-import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerChainMetaData;
/**
* @author <a href="mailto:alessio.soldano@jboss.com">Alessio Soldano</a>
@@ -73,6 +72,7 @@
final PathElement confElem = address.getElement(address.size() - 3);
final String configType = confElem.getKey();
final String configName = confElem.getValue();
+ final String handlerChainType = address.getElement(address.size() - 2).getKey();
final String handlerChainId = address.getElement(address.size() - 2).getValue();
final String handlerName = address.getElement(address.size() - 1).getValue();
final String handlerClass = operation.require(CLASS).asString();
@@ -84,15 +84,13 @@
if (registry.getService(configServiceName) == null) {
throw MESSAGES.missingConfig(configName);
}
- final ServiceName handlerChainServiceName = getHandlerChainServiceName(configServiceName, handlerChainId);
+ final ServiceName handlerChainServiceName = getHandlerChainServiceName(configServiceName, handlerChainType, handlerChainId);
if (registry.getService(handlerChainServiceName) == null) {
- String handlerChainType = address.getElement(address.size() - 2).getKey();
throw MESSAGES.missingHandlerChain(configName, handlerChainType, handlerChainId);
}
final ServiceName handlerServiceName = getHandlerServiceName(handlerChainServiceName, handlerName);
final ServiceBuilder<?> handlerServiceBuilder = target.addService(handlerServiceName, service);
- handlerServiceBuilder.addDependency(handlerChainServiceName, UnifiedHandlerChainMetaData.class, service.getHandlerChain());
ServiceController<?> controller = handlerServiceBuilder.setInitialMode(ServiceController.Mode.ACTIVE).install();
if (newControllers != null) {
newControllers.add(controller);
Modified: container/jboss72/branches/jbossws-jboss720-JBWS-3739/server-integration/src/main/java/org/jboss/as/webservices/dmr/HandlerChainAdd.java
===================================================================
--- container/jboss72/branches/jbossws-jboss720-JBWS-3739/server-integration/src/main/java/org/jboss/as/webservices/dmr/HandlerChainAdd.java 2013-12-03 14:46:42 UTC (rev 18120)
+++ container/jboss72/branches/jbossws-jboss720-JBWS-3739/server-integration/src/main/java/org/jboss/as/webservices/dmr/HandlerChainAdd.java 2013-12-03 14:47:28 UTC (rev 18121)
@@ -23,6 +23,7 @@
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.OP_ADDR;
import static org.jboss.as.webservices.WSMessages.MESSAGES;
+import static org.jboss.as.webservices.dmr.Constants.HANDLER;
import static org.jboss.as.webservices.dmr.Constants.PROTOCOL_BINDINGS;
import static org.jboss.as.webservices.dmr.PackageUtils.getConfigServiceName;
import static org.jboss.as.webservices.dmr.PackageUtils.getHandlerChainServiceName;
@@ -37,11 +38,12 @@
import org.jboss.as.controller.ServiceVerificationHandler;
import org.jboss.as.webservices.service.HandlerChainService;
import org.jboss.dmr.ModelNode;
+import org.jboss.msc.inject.Injector;
import org.jboss.msc.service.ServiceBuilder;
import org.jboss.msc.service.ServiceController;
import org.jboss.msc.service.ServiceName;
import org.jboss.msc.service.ServiceTarget;
-import org.jboss.wsf.spi.metadata.config.AbstractCommonConfig;
+import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerMetaData;
/**
* @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
@@ -80,11 +82,14 @@
throw MESSAGES.missingConfig(configName);
}
- final ServiceName handlerChainServiceName = getHandlerChainServiceName(configServiceName, handlerChainId);
- final HandlerChainService<AbstractCommonConfig> service = new HandlerChainService<AbstractCommonConfig>(handlerChainType, handlerChainId, protocolBindings);
+ final ServiceName handlerChainServiceName = getHandlerChainServiceName(configServiceName, handlerChainType, handlerChainId);
+ final HandlerChainService service = new HandlerChainService(handlerChainType, handlerChainId, protocolBindings);
final ServiceTarget target = context.getServiceTarget();
final ServiceBuilder<?> handlerChainServiceBuilder = target.addService(handlerChainServiceName, service);
- handlerChainServiceBuilder.addDependency(configServiceName, AbstractCommonConfig.class, service.getAbstractCommonConfig());
+ final Injector<UnifiedHandlerMetaData> injector = service.getHandlersInjector();
+ for (ServiceName sn : PackageUtils.getServiceNameDependencies(context, handlerChainServiceName, address, HANDLER)) {
+ handlerChainServiceBuilder.addDependency(sn, UnifiedHandlerMetaData.class, injector);
+ }
ServiceController<?> controller = handlerChainServiceBuilder.setInitialMode(ServiceController.Mode.ACTIVE).install();
if (newControllers != null) {
newControllers.add(controller);
Added: container/jboss72/branches/jbossws-jboss720-JBWS-3739/server-integration/src/main/java/org/jboss/as/webservices/dmr/ListInjector.java
===================================================================
--- container/jboss72/branches/jbossws-jboss720-JBWS-3739/server-integration/src/main/java/org/jboss/as/webservices/dmr/ListInjector.java (rev 0)
+++ container/jboss72/branches/jbossws-jboss720-JBWS-3739/server-integration/src/main/java/org/jboss/as/webservices/dmr/ListInjector.java 2013-12-03 14:47:28 UTC (rev 18121)
@@ -0,0 +1,36 @@
+package org.jboss.as.webservices.dmr;
+
+import java.util.List;
+
+import org.jboss.msc.inject.InjectionException;
+import org.jboss.msc.inject.Injector;
+import org.jboss.msc.inject.RetainingInjector;
+import org.jboss.msc.value.Value;
+
+public final class ListInjector<T> extends RetainingInjector<T> implements Injector<T> {
+ private final List<T> list;
+
+ public ListInjector(final List<T> list) {
+ this.list = list;
+ }
+
+ /** {@inheritDoc} */
+ public void inject(final T value) throws InjectionException {
+ synchronized (list) {
+ list.add(value);
+ super.inject(value);
+ }
+ }
+
+ /** {@inheritDoc} */
+ public void uninject() {
+ synchronized (list) {
+ try {
+ final Value<T> storedValue = getStoredValue();
+ if (storedValue != null) list.remove(storedValue.getValue());
+ } finally {
+ super.uninject();
+ }
+ }
+ }
+}
\ No newline at end of file
Property changes on: container/jboss72/branches/jbossws-jboss720-JBWS-3739/server-integration/src/main/java/org/jboss/as/webservices/dmr/ListInjector.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Modified: container/jboss72/branches/jbossws-jboss720-JBWS-3739/server-integration/src/main/java/org/jboss/as/webservices/dmr/PackageUtils.java
===================================================================
--- container/jboss72/branches/jbossws-jboss720-JBWS-3739/server-integration/src/main/java/org/jboss/as/webservices/dmr/PackageUtils.java 2013-12-03 14:46:42 UTC (rev 18120)
+++ container/jboss72/branches/jbossws-jboss720-JBWS-3739/server-integration/src/main/java/org/jboss/as/webservices/dmr/PackageUtils.java 2013-12-03 14:47:28 UTC (rev 18121)
@@ -24,9 +24,15 @@
import static org.jboss.as.webservices.dmr.Constants.ENDPOINT_CONFIG;
import static org.jboss.as.webservices.dmr.Constants.HANDLER;
-import static org.jboss.as.webservices.dmr.Constants.HANDLER_CHAIN;
import static org.jboss.as.webservices.dmr.Constants.PROPERTY;
+import java.util.LinkedList;
+import java.util.List;
+
+import org.jboss.as.controller.OperationContext;
+import org.jboss.as.controller.PathAddress;
+import org.jboss.as.controller.registry.Resource;
+import org.jboss.as.controller.registry.Resource.ResourceEntry;
import org.jboss.as.webservices.util.WSServices;
import org.jboss.msc.service.ServiceName;
@@ -52,14 +58,10 @@
return (ENDPOINT_CONFIG.equals(configType) ? getEndpointConfigServiceName(configName) : getClientConfigServiceName(configName));
}
- static ServiceName getHandlerChainServiceName(final String configType, final String configName, final String handlerChainId) {
- return getHandlerChainServiceName(getConfigServiceName(configType, configName), handlerChainId);
+ static ServiceName getHandlerChainServiceName(final ServiceName configServiceName, final String handlerChainType, final String handlerChainId) {
+ return configServiceName.append(handlerChainType).append(handlerChainId);
}
- static ServiceName getHandlerChainServiceName(final ServiceName configServiceName, final String handlerChainId) {
- return configServiceName.append(HANDLER_CHAIN).append(handlerChainId);
- }
-
static ServiceName getHandlerServiceName(final ServiceName handlerChainServiceName, final String handlerName) {
return handlerChainServiceName.append(HANDLER).append(handlerName);
}
@@ -68,4 +70,13 @@
return configServiceName.append(PROPERTY).append(propertyName);
}
+ static List<ServiceName> getServiceNameDependencies(final OperationContext context, final ServiceName baseServiceName, final PathAddress address, final String childType) {
+ final List<ServiceName> childrenServiceNames = new LinkedList<ServiceName>();
+ final Resource resource = context.readResourceFromRoot(address);
+ final ServiceName sn = baseServiceName.append(childType);
+ for (ResourceEntry re : resource.getChildren(childType)) {
+ childrenServiceNames.add(sn.append(re.getName()));
+ }
+ return childrenServiceNames;
+ }
}
\ No newline at end of file
Modified: container/jboss72/branches/jbossws-jboss720-JBWS-3739/server-integration/src/main/java/org/jboss/as/webservices/dmr/WSSubsystemAdd.java
===================================================================
--- container/jboss72/branches/jbossws-jboss720-JBWS-3739/server-integration/src/main/java/org/jboss/as/webservices/dmr/WSSubsystemAdd.java 2013-12-03 14:46:42 UTC (rev 18120)
+++ container/jboss72/branches/jbossws-jboss720-JBWS-3739/server-integration/src/main/java/org/jboss/as/webservices/dmr/WSSubsystemAdd.java 2013-12-03 14:47:28 UTC (rev 18121)
@@ -130,22 +130,7 @@
ServiceName configServiceName = Constants.CLIENT_CONFIG.equals(configType) ? PackageUtils
.getClientConfigServiceName(re.getName()) : PackageUtils.getEndpointConfigServiceName(re.getName());
serviceNames.add(configServiceName);
- readHandlerChainServiceNames(serviceNames, re, Constants.PRE_HANDLER_CHAIN, configServiceName);
- readHandlerChainServiceNames(serviceNames, re, Constants.POST_HANDLER_CHAIN, configServiceName);
- for (String propertyName : re.getChildrenNames(Constants.PROPERTY)) {
- serviceNames.add(PackageUtils.getPropertyServiceName(configServiceName, propertyName));
- }
}
}
- private static void readHandlerChainServiceNames(List<ServiceName> serviceNames, Resource configResource, String chainType, ServiceName configServiceName) {
- for (ResourceEntry re : configResource.getChildren(chainType)) {
- ServiceName handlerChainServiceName = PackageUtils.getHandlerChainServiceName(configServiceName, re.getName());
- serviceNames.add(handlerChainServiceName);
- for (String handlerName : re.getChildrenNames(Constants.HANDLER)) {
- serviceNames.add(PackageUtils.getHandlerServiceName(handlerChainServiceName, handlerName));
- }
- }
- }
-
}
Modified: container/jboss72/branches/jbossws-jboss720-JBWS-3739/server-integration/src/main/java/org/jboss/as/webservices/service/ConfigService.java
===================================================================
--- container/jboss72/branches/jbossws-jboss720-JBWS-3739/server-integration/src/main/java/org/jboss/as/webservices/service/ConfigService.java 2013-12-03 14:46:42 UTC (rev 18120)
+++ container/jboss72/branches/jbossws-jboss720-JBWS-3739/server-integration/src/main/java/org/jboss/as/webservices/service/ConfigService.java 2013-12-03 14:47:28 UTC (rev 18121)
@@ -21,6 +21,12 @@
*/
package org.jboss.as.webservices.service;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.CopyOnWriteArrayList;
+
+import org.jboss.as.webservices.dmr.ListInjector;
+import org.jboss.msc.inject.Injector;
import org.jboss.msc.service.Service;
import org.jboss.msc.service.StartContext;
import org.jboss.msc.service.StartException;
@@ -29,6 +35,7 @@
import org.jboss.wsf.spi.metadata.config.AbstractCommonConfig;
import org.jboss.wsf.spi.metadata.config.ClientConfig;
import org.jboss.wsf.spi.metadata.config.EndpointConfig;
+import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerChainMetaData;
/**
* A service for setting a ws client / endpoint config.
@@ -41,6 +48,8 @@
private final ServerConfig serverConfig;
private final String configName;
private final boolean client;
+ private final List<UnifiedHandlerChainMetaData> preHandlerChains = new ArrayList<UnifiedHandlerChainMetaData>(1);
+ private final List<UnifiedHandlerChainMetaData> postHandlerChains = new ArrayList<UnifiedHandlerChainMetaData>(1);
private volatile AbstractCommonConfig config;
public ConfigService(ServerConfig serverConfig, String configName, boolean client) {
@@ -59,11 +68,15 @@
if (client) {
ClientConfig clientConfig = new ClientConfig();
clientConfig.setConfigName(configName);
+ clientConfig.setPreHandlerChains(new CopyOnWriteArrayList<UnifiedHandlerChainMetaData>(preHandlerChains));
+ clientConfig.setPostHandlerChains(new CopyOnWriteArrayList<UnifiedHandlerChainMetaData>(postHandlerChains));
serverConfig.addClientConfig(clientConfig);
config = clientConfig;
} else {
EndpointConfig endpointConfig = new EndpointConfig();
endpointConfig.setConfigName(configName);
+ endpointConfig.setPreHandlerChains(new CopyOnWriteArrayList<UnifiedHandlerChainMetaData>(preHandlerChains));
+ endpointConfig.setPostHandlerChains(new CopyOnWriteArrayList<UnifiedHandlerChainMetaData>(postHandlerChains));
serverConfig.addEndpointConfig(endpointConfig);
config = endpointConfig;
}
@@ -77,4 +90,13 @@
serverConfig.getEndpointConfigs().remove(config);
}
}
+
+ public Injector<UnifiedHandlerChainMetaData> getPreHandlerChainsInjector() {
+ return new ListInjector<UnifiedHandlerChainMetaData>(preHandlerChains);
+ }
+
+ public Injector<UnifiedHandlerChainMetaData> getPostHandlerChainsInjector() {
+ return new ListInjector<UnifiedHandlerChainMetaData>(postHandlerChains);
+ }
+
}
Modified: container/jboss72/branches/jbossws-jboss720-JBWS-3739/server-integration/src/main/java/org/jboss/as/webservices/service/HandlerChainService.java
===================================================================
--- container/jboss72/branches/jbossws-jboss720-JBWS-3739/server-integration/src/main/java/org/jboss/as/webservices/service/HandlerChainService.java 2013-12-03 14:46:42 UTC (rev 18120)
+++ container/jboss72/branches/jbossws-jboss720-JBWS-3739/server-integration/src/main/java/org/jboss/as/webservices/service/HandlerChainService.java 2013-12-03 14:47:28 UTC (rev 18121)
@@ -23,32 +23,35 @@
import static org.jboss.as.webservices.WSMessages.MESSAGES;
+import java.util.ArrayList;
import java.util.List;
-import java.util.concurrent.CopyOnWriteArrayList;
+import org.jboss.as.webservices.dmr.ListInjector;
+import org.jboss.msc.inject.Injector;
import org.jboss.msc.service.Service;
import org.jboss.msc.service.StartContext;
import org.jboss.msc.service.StartException;
import org.jboss.msc.service.StopContext;
-import org.jboss.msc.value.InjectedValue;
-import org.jboss.wsf.spi.metadata.config.AbstractCommonConfig;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerChainMetaData;
+import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerMetaData;
/**
- * A service for setting a handler chain into an endpoint / client config.
+ * A service for creating handler chain metadata.
*
* @author <a href="mailto:alessio.soldano@jboss.com">Alessio Soldano</a>
*/
-public final class HandlerChainService<T extends AbstractCommonConfig> implements Service<UnifiedHandlerChainMetaData> {
+public final class HandlerChainService implements Service<UnifiedHandlerChainMetaData> {
- private InjectedValue<T> abstractCommonConfig = new InjectedValue<T>();
- private final String handlerChainType;
+ private final List<UnifiedHandlerMetaData> handlers = new ArrayList<UnifiedHandlerMetaData>(2);
private final String handlerChainId;
private final String protocolBindings;
private volatile UnifiedHandlerChainMetaData handlerChain;
public HandlerChainService(String handlerChainType, String handlerChainId, String protocolBindings) {
- this.handlerChainType = handlerChainType;
+ if (!handlerChainType.equalsIgnoreCase("pre-handler-chain") && !handlerChainType.equals("post-handler-chain")) {
+ throw new RuntimeException(
+ MESSAGES.wrongHandlerChainType(handlerChainType, "pre-handler-chain", "post-handler-chain"));
+ }
this.handlerChainId = handlerChainId;
this.protocolBindings = protocolBindings;
}
@@ -60,63 +63,15 @@
@Override
public void start(final StartContext context) throws StartException {
- final AbstractCommonConfig commonConfig = abstractCommonConfig.getValue();
- List<UnifiedHandlerChainMetaData> handlerChains;
- if ("pre-handler-chain".equals(handlerChainType)) {
- synchronized (commonConfig) { //JBWS-3707
- handlerChains = commonConfig.getPreHandlerChains();
- if (handlerChains == null) {
- handlerChains = new CopyOnWriteArrayList<UnifiedHandlerChainMetaData>();
- commonConfig.setPreHandlerChains(handlerChains);
- }
- }
- } else if ("post-handler-chain".equals(handlerChainType)) {
- synchronized (commonConfig) { //JBWS-3707
- handlerChains = commonConfig.getPostHandlerChains();
- if (handlerChains == null) {
- handlerChains = new CopyOnWriteArrayList<UnifiedHandlerChainMetaData>();
- commonConfig.setPostHandlerChains(handlerChains);
- }
- }
- } else {
- throw new StartException(
- MESSAGES.wrongHandlerChainType(handlerChainType, "pre-handler-chain", "post-handler-chain"));
- }
- handlerChain = getChain(handlerChains, handlerChainId);
- if (handlerChain != null) {
- throw new StartException(MESSAGES.multipleHandlerChainsWithSameId(handlerChainType, handlerChainId,
- commonConfig.getConfigName()));
- }
- handlerChain = new UnifiedHandlerChainMetaData();
- handlerChain.setId(handlerChainId);
- handlerChain.setProtocolBindings(protocolBindings);
- handlerChains.add(handlerChain);
+ handlerChain = new UnifiedHandlerChainMetaData(null, null, protocolBindings, handlers, false, handlerChainId);
}
- private static UnifiedHandlerChainMetaData getChain(final List<UnifiedHandlerChainMetaData> handlerChains,
- final String handlerChainId) {
- for (final UnifiedHandlerChainMetaData handlerChain : handlerChains) {
- if (handlerChainId.equals(handlerChain.getId())) {
- return handlerChain;
- }
- }
- return null;
- }
-
@Override
public void stop(final StopContext context) {
- final AbstractCommonConfig commonConfig = abstractCommonConfig.getValue();
-
- final List<UnifiedHandlerChainMetaData> handlerChains;
- if ("pre-handler-chain".equals(handlerChainType)) {
- handlerChains = commonConfig.getPreHandlerChains();
- } else {
- handlerChains = commonConfig.getPostHandlerChains();
- }
- handlerChains.remove(handlerChain);
+ handlerChain = null;
}
- public InjectedValue<T> getAbstractCommonConfig() {
- return abstractCommonConfig;
+ public Injector<UnifiedHandlerMetaData> getHandlersInjector() {
+ return new ListInjector<UnifiedHandlerMetaData>(handlers);
}
}
Modified: container/jboss72/branches/jbossws-jboss720-JBWS-3739/server-integration/src/main/java/org/jboss/as/webservices/service/HandlerService.java
===================================================================
--- container/jboss72/branches/jbossws-jboss720-JBWS-3739/server-integration/src/main/java/org/jboss/as/webservices/service/HandlerService.java 2013-12-03 14:46:42 UTC (rev 18120)
+++ container/jboss72/branches/jbossws-jboss720-JBWS-3739/server-integration/src/main/java/org/jboss/as/webservices/service/HandlerService.java 2013-12-03 14:47:28 UTC (rev 18121)
@@ -25,18 +25,15 @@
import org.jboss.msc.service.StartContext;
import org.jboss.msc.service.StartException;
import org.jboss.msc.service.StopContext;
-import org.jboss.msc.value.InjectedValue;
-import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerChainMetaData;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerMetaData;
/**
- * A service for setting a handler into the handler-chain of an endpoint / client config.
+ * A service for creating handler metadata.
*
* @author <a href="mailto:alessio.soldano@jboss.com">Alessio Soldano</a>
*/
public final class HandlerService implements Service<UnifiedHandlerMetaData> {
- private InjectedValue<UnifiedHandlerChainMetaData> handlerChain = new InjectedValue<UnifiedHandlerChainMetaData>();
private final String handlerName;
private final String handlerClass;
private volatile UnifiedHandlerMetaData handler;
@@ -53,24 +50,11 @@
@Override
public void start(final StartContext context) throws StartException {
- final UnifiedHandlerMetaData handler = new UnifiedHandlerMetaData();
- handler.setHandlerName(handlerName);
- handler.setHandlerClass(handlerClass);
- final UnifiedHandlerChainMetaData chain = handlerChain.getValue();
- synchronized (chain) { //JBWS-3707
- chain.addHandler(handler);
- }
+ handler = new UnifiedHandlerMetaData(handlerClass, handlerName, null, null, null, null);
}
@Override
public void stop(final StopContext context) {
- final UnifiedHandlerChainMetaData chain = handlerChain.getValue();
- synchronized (chain) { //JBWS-3707
- chain.getHandlers().remove(handler);
- }
+ handler = null;
}
-
- public InjectedValue<UnifiedHandlerChainMetaData> getHandlerChain() {
- return handlerChain;
- }
}
Modified: container/jboss72/branches/jbossws-jboss720-JBWS-3739/server-integration/src/main/java/org/jboss/as/webservices/webserviceref/WSRefUtils.java
===================================================================
--- container/jboss72/branches/jbossws-jboss720-JBWS-3739/server-integration/src/main/java/org/jboss/as/webservices/webserviceref/WSRefUtils.java 2013-12-03 14:46:42 UTC (rev 18120)
+++ container/jboss72/branches/jbossws-jboss720-JBWS-3739/server-integration/src/main/java/org/jboss/as/webservices/webserviceref/WSRefUtils.java 2013-12-03 14:47:28 UTC (rev 18121)
@@ -32,7 +32,10 @@
import java.net.URL;
import java.util.ArrayList;
import java.util.Collection;
+import java.util.HashSet;
+import java.util.LinkedList;
import java.util.List;
+import java.util.Set;
import javax.xml.namespace.QName;
import javax.xml.ws.Service;
@@ -177,66 +180,41 @@
final List<StubPropertyMetaData> stubPropertiesMD = jbossPortComponentMD.getStubProperties();
if (stubPropertiesMD != null) {
for (final StubPropertyMetaData stubPropertyMD : stubPropertiesMD) {
- final UnifiedStubPropertyMetaData stubPropertyUMDM = new UnifiedStubPropertyMetaData();
- stubPropertyUMDM.setPropName(stubPropertyMD.getPropName());
- stubPropertyUMDM.setPropValue(stubPropertyMD.getPropValue());
- portComponentUMDM.addStubProperty(stubPropertyUMDM);
+ portComponentUMDM.addStubProperty(new UnifiedStubPropertyMetaData(stubPropertyMD.getPropName(), stubPropertyMD.getPropValue()));
}
}
}
private static UnifiedHandlerMetaData getUnifiedHandlerMetaData(ServiceReferenceHandlerMetaData srhmd) {
- UnifiedHandlerMetaData handlerUMDM = new UnifiedHandlerMetaData();
- handlerUMDM.setHandlerName(srhmd.getHandlerName());
- handlerUMDM.setHandlerClass(srhmd.getHandlerClass());
+ List<UnifiedInitParamMetaData> unifiedInitParamMDs = new LinkedList<UnifiedInitParamMetaData>();
List<ParamValueMetaData> initParams = srhmd.getInitParam();
if (initParams != null) {
for (ParamValueMetaData initParam : initParams) {
- UnifiedInitParamMetaData param = new UnifiedInitParamMetaData();
- param.setParamName(initParam.getParamName());
- param.setParamValue(initParam.getParamValue());
- handlerUMDM.addInitParam(param);
+ unifiedInitParamMDs.add(new UnifiedInitParamMetaData(initParam.getParamName(), initParam.getParamValue()));
}
}
List<QName> soapHeaders = srhmd.getSoapHeader();
- if (soapHeaders != null) {
- for (QName soapHeader : soapHeaders) {
- handlerUMDM.addSoapHeader(soapHeader);
- }
- }
+ Set<QName> soapHeaderList = soapHeaders != null ? new HashSet<QName>(soapHeaders) : null;
List<String> soapRoles = srhmd.getSoapRole();
- if (soapRoles != null) {
- for (String soapRole : soapRoles) {
- handlerUMDM.addSoapRole(soapRole);
- }
- }
+ Set<String> soapRolesList = soapRoles != null ? new HashSet<String>(soapRoles) : null;
List<String> portNames = srhmd.getPortName();
- if (portNames != null) {
- for (String portName : portNames) {
- handlerUMDM.addPortName(portName);
- }
- }
- return handlerUMDM;
+ Set<String> portNameList = portNames != null ? new HashSet<String>(portNames) : null;
+ return new UnifiedHandlerMetaData(srhmd.getHandlerClass(), srhmd.getHandlerName(), unifiedInitParamMDs, soapHeaderList, soapRolesList, portNameList);
}
private static UnifiedHandlerChainsMetaData getUnifiedHandlerChainsMetaData(final ServiceReferenceHandlerChainsMetaData handlerChainsMD) {
- final UnifiedHandlerChainsMetaData handlerChainsUMDM = new UnifiedHandlerChainsMetaData();
-
+ List<UnifiedHandlerChainMetaData> uhcmds = new LinkedList<UnifiedHandlerChainMetaData>();
for (final ServiceReferenceHandlerChainMetaData handlerChainMD : handlerChainsMD.getHandlers()) {
- final UnifiedHandlerChainMetaData handlerChainUMDM = new UnifiedHandlerChainMetaData();
- handlerChainUMDM.setServiceNamePattern(handlerChainMD.getServiceNamePattern());
- handlerChainUMDM.setPortNamePattern(handlerChainMD.getPortNamePattern());
- handlerChainUMDM.setProtocolBindings(handlerChainMD.getProtocolBindings());
-
+ List<UnifiedHandlerMetaData> uhmds = new LinkedList<UnifiedHandlerMetaData>();
for (final ServiceReferenceHandlerMetaData handlerMD : handlerChainMD.getHandler()) {
final UnifiedHandlerMetaData handlerUMDM = getUnifiedHandlerMetaData(handlerMD);
- handlerChainUMDM.addHandler(handlerUMDM);
+ uhmds.add(handlerUMDM);
}
-
- handlerChainsUMDM.addHandlerChain(handlerChainUMDM);
+ uhcmds.add(new UnifiedHandlerChainMetaData(handlerChainMD.getServiceNamePattern(), handlerChainMD.getPortNamePattern(),
+ handlerChainMD.getProtocolBindings(), uhmds, false, null));
}
- return handlerChainsUMDM;
+ return new UnifiedHandlerChainsMetaData(uhcmds);
}
static void processType(final UnifiedServiceRefMetaData serviceRefUMDM) {
11 years
JBossWS SVN: r18120 - in container/jboss72/branches/jbossws-jboss720-JBWS-3739: server-integration and 1 other directories.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2013-12-03 09:46:42 -0500 (Tue, 03 Dec 2013)
New Revision: 18120
Modified:
container/jboss72/branches/jbossws-jboss720-JBWS-3739/pom.xml
container/jboss72/branches/jbossws-jboss720-JBWS-3739/server-integration/pom.xml
container/jboss72/branches/jbossws-jboss720-JBWS-3739/tests-integration/pom.xml
Log:
Updating poms
Modified: container/jboss72/branches/jbossws-jboss720-JBWS-3739/pom.xml
===================================================================
--- container/jboss72/branches/jbossws-jboss720-JBWS-3739/pom.xml 2013-12-03 14:43:59 UTC (rev 18119)
+++ container/jboss72/branches/jbossws-jboss720-JBWS-3739/pom.xml 2013-12-03 14:46:42 UTC (rev 18120)
@@ -35,7 +35,7 @@
<description>JBossWS JBoss AS 7.2.0.Final Integration Parent</description>
<groupId>org.jboss.ws</groupId>
<artifactId>jbossws-jboss720-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.3.0.Alpha1-SNAPSHOT</version>
<packaging>pom</packaging>
<scm>
@@ -51,7 +51,7 @@
<properties>
<jbossws.api.version>1.0.2.Final</jbossws.api.version>
- <jbossws.spi.version>2.2.2.Final</jbossws.spi.version>
+ <jbossws.spi.version>2.3.0.Alpha1-SNAPSHOT</jbossws.spi.version>
<jbossws.common.version>2.2.3.Final</jbossws.common.version>
<jboss.msc.version>1.0.4.GA</jboss.msc.version>
<jboss.version>7.2.0.Final</jboss.version>
Modified: container/jboss72/branches/jbossws-jboss720-JBWS-3739/server-integration/pom.xml
===================================================================
--- container/jboss72/branches/jbossws-jboss720-JBWS-3739/server-integration/pom.xml 2013-12-03 14:43:59 UTC (rev 18119)
+++ container/jboss72/branches/jbossws-jboss720-JBWS-3739/server-integration/pom.xml 2013-12-03 14:46:42 UTC (rev 18120)
@@ -29,7 +29,7 @@
<parent>
<groupId>org.jboss.ws</groupId>
<artifactId>jbossws-jboss720-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.3.0.Alpha1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
Modified: container/jboss72/branches/jbossws-jboss720-JBWS-3739/tests-integration/pom.xml
===================================================================
--- container/jboss72/branches/jbossws-jboss720-JBWS-3739/tests-integration/pom.xml 2013-12-03 14:43:59 UTC (rev 18119)
+++ container/jboss72/branches/jbossws-jboss720-JBWS-3739/tests-integration/pom.xml 2013-12-03 14:46:42 UTC (rev 18120)
@@ -29,7 +29,7 @@
<parent>
<groupId>org.jboss.ws</groupId>
<artifactId>jbossws-jboss720-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.3.0.Alpha1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
11 years
JBossWS SVN: r18119 - container/jboss72/branches.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2013-12-03 09:43:59 -0500 (Tue, 03 Dec 2013)
New Revision: 18119
Added:
container/jboss72/branches/jbossws-jboss720-JBWS-3739/
Log:
Branching for working on 3739 and 3708
11 years
JBossWS SVN: r18118 - spi/branches/JBWS-3739.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2013-12-03 08:53:06 -0500 (Tue, 03 Dec 2013)
New Revision: 18118
Modified:
spi/branches/JBWS-3739/pom.xml
Log:
Build to a different version, to allow publishing a snapshot that does not overlap with the trunk one
Modified: spi/branches/JBWS-3739/pom.xml
===================================================================
--- spi/branches/JBWS-3739/pom.xml 2013-12-03 11:58:12 UTC (rev 18117)
+++ spi/branches/JBWS-3739/pom.xml 2013-12-03 13:53:06 UTC (rev 18118)
@@ -7,7 +7,7 @@
<packaging>jar</packaging>
<description>JBossWS SPI</description>
- <version>2.3.0-SNAPSHOT</version>
+ <version>2.3.0.Alpha1-SNAPSHOT</version>
<!-- Parent -->
<parent>
11 years
JBossWS SVN: r18117 - stack/cxf/trunk.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2013-12-03 06:58:12 -0500 (Tue, 03 Dec 2013)
New Revision: 18117
Modified:
stack/cxf/trunk/pom.xml
Log:
Use latest 720 ASIL
Modified: stack/cxf/trunk/pom.xml
===================================================================
--- stack/cxf/trunk/pom.xml 2013-12-03 11:55:51 UTC (rev 18116)
+++ stack/cxf/trunk/pom.xml 2013-12-03 11:58:12 UTC (rev 18117)
@@ -65,7 +65,7 @@
<jbossws.common.tools.version>1.2.0.Final</jbossws.common.tools.version>
<jbossws.jboss712.version>4.2.1.Final</jbossws.jboss712.version>
<jbossws.jboss713.version>4.2.1.Final</jbossws.jboss713.version>
- <jbossws.jboss720.version>4.2.2.Final</jbossws.jboss720.version>
+ <jbossws.jboss720.version>4.3.0-SNAPSHOT</jbossws.jboss720.version>
<jbossws.native.version>4.1.2.Final</jbossws.native.version>
<jboss712.version>7.1.2.Final</jboss712.version>
<jboss713.version>7.1.3.Final</jboss713.version>
11 years