JBossWS SVN: r18733 - in stack/cxf/trunk/modules/testsuite: cxf-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2014-06-13 16:28:00 -0400 (Fri, 13 Jun 2014)
New Revision: 18733
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/stsstore.jks
stack/cxf/trunk/modules/testsuite/pom.xml
Log:
[JBWS-3686] Restoring WS-Trust ActAs and OnBehalfOf tests; the STS keystore needs trusted certs for the ActAs client too, otherwise WSS4J 2.0 does not trust the client in the STS server
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/stsstore.jks
===================================================================
(Binary files differ)
Modified: stack/cxf/trunk/modules/testsuite/pom.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/pom.xml 2014-06-13 17:24:11 UTC (rev 18732)
+++ stack/cxf/trunk/modules/testsuite/pom.xml 2014-06-13 20:28:00 UTC (rev 18733)
@@ -695,10 +695,6 @@
<!-- # [JBWS-3620] Authentication failures w/ Undertow -->
<exclude>org/jboss/test/ws/jaxws/cxf/httpauth/HelloDigestTestCase*</exclude>
- <!-- [JBWS-3686] Restore WSTrustActAsTestCase and WSTrustOnBehalfOfTestCase -->
- <exclude>org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustActAsTestCase.*</exclude>
- <exclude>org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustOnBehalfOfTestCase.*</exclude>
-
<!-- Manually setup KDC before run this test-->
<exclude>org/jboss/test/ws/jaxws/samples/wsse/kerberos/*TestCase*</exclude>
</excludes>
@@ -784,10 +780,6 @@
<!-- # [JBWS-3620] Authentication failures w/ Undertow -->
<exclude>org/jboss/test/ws/jaxws/cxf/httpauth/HelloDigestTestCase*</exclude>
- <!-- [JBWS-3686] Restore WSTrustActAsTestCase and WSTrustOnBehalfOfTestCase -->
- <exclude>org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustActAsTestCase.*</exclude>
- <exclude>org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustOnBehalfOfTestCase.*</exclude>
-
<!-- Manually setup KDC before run this test-->
<exclude>org/jboss/test/ws/jaxws/samples/wsse/kerberos/*TestCase*</exclude>
</excludes>
@@ -874,10 +866,6 @@
<!-- # [JBWS-3620] Authentication failures w/ Undertow -->
<exclude>org/jboss/test/ws/jaxws/cxf/httpauth/HelloDigestTestCase*</exclude>
- <!-- [JBWS-3686] Restore WSTrustActAsTestCase and WSTrustOnBehalfOfTestCase -->
- <exclude>org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustActAsTestCase.*</exclude>
- <exclude>org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustOnBehalfOfTestCase.*</exclude>
-
<!-- Manually setup KDC before run this test-->
<exclude>org/jboss/test/ws/jaxws/samples/wsse/kerberos/*TestCase*</exclude>
</excludes>
10 years, 6 months
JBossWS SVN: r18732 - in stack/cxf/branches/rsearls: modules/testsuite/shared-tests and 1 other directories.
by jbossws-commits@lists.jboss.org
Author: rsearls
Date: 2014-06-13 13:24:11 -0400 (Fri, 13 Jun 2014)
New Revision: 18732
Added:
stack/cxf/branches/rsearls/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2150/JBWS2150WsdlContentsTestCaseForked.java
stack/cxf/branches/rsearls/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2150/TestUtils.java
Modified:
stack/cxf/branches/rsearls/modules/testsuite/shared-tests/pom.xml
stack/cxf/branches/rsearls/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2150/JBWS2150TestCaseForked.java
stack/cxf/branches/rsearls/pom.xml
Log:
[JBWS-3801] new test to verify soap:address rewrite to wsdl.
Modified: stack/cxf/branches/rsearls/modules/testsuite/shared-tests/pom.xml
===================================================================
--- stack/cxf/branches/rsearls/modules/testsuite/shared-tests/pom.xml 2014-06-12 16:05:44 UTC (rev 18731)
+++ stack/cxf/branches/rsearls/modules/testsuite/shared-tests/pom.xml 2014-06-13 17:24:11 UTC (rev 18732)
@@ -29,6 +29,16 @@
<scope>runtime</scope> <!-- override scope from parent dependency to make sure tests are not compiled using (JBWS-)CXF classes -->
</dependency>
<dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-dmr</artifactId>
+ <version>${jboss-dmr-version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.wildfly</groupId>
+ <artifactId>wildfly-controller</artifactId>
+ <version>${jboss.version}</version>
+ </dependency>
+ <dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
Modified: stack/cxf/branches/rsearls/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2150/JBWS2150TestCaseForked.java
===================================================================
--- stack/cxf/branches/rsearls/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2150/JBWS2150TestCaseForked.java 2014-06-12 16:05:44 UTC (rev 18731)
+++ stack/cxf/branches/rsearls/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2150/JBWS2150TestCaseForked.java 2014-06-13 17:24:11 UTC (rev 18732)
@@ -69,6 +69,7 @@
private static final ObjectName SERVER_CONFIG_OBJECT_NAME = ObjectNameFactory.create("jboss.ws:service=ServerConfig");
private static final String NAMESPACE = "http://test.jboss.org/addressrewrite";
private static final String NAMESPACE_IMP = "http://test.jboss.org/addressrewrite/wsdlimp";
+ private TestUtils testUtils = new TestUtils();
protected static class JBWS2150TestSetup extends JBossWSTestSetup {
@@ -115,7 +116,7 @@
*/
public void testRewrite() throws Exception
{
- setModifySOAPAddress(true);
+ testUtils.setModifySOAPAddress(true);
deploy("jaxws-jbws2150.war");
try
{
@@ -172,7 +173,7 @@
*/
public void testRewriteLoadBalancer() throws Exception
{
- setModifySOAPAddress(true);
+ testUtils.setModifySOAPAddress(true);
final String testWebServiceHost = "myloadbalancer.com";
setWebServiceHost(testWebServiceHost);
deploy("jaxws-jbws2150.war");
@@ -225,7 +226,7 @@
*/
public void testAutoRewrite() throws Exception
{
- setModifySOAPAddress(true);
+ testUtils.setModifySOAPAddress(true);
setWebServiceHost(ServerConfig.UNDEFINED_HOSTNAME);
deploy("jaxws-jbws2150.war");
try
@@ -271,7 +272,7 @@
*/
public void testSecureRewrite() throws Exception
{
- setModifySOAPAddress(true);
+ testUtils.setModifySOAPAddress(true);
deploy("jaxws-jbws2150-sec.war");
try
{
@@ -319,7 +320,7 @@
*/
public void testSecureRewriteLoadBalancer() throws Exception
{
- setModifySOAPAddress(true);
+ testUtils.setModifySOAPAddress(true);
final String testWebServiceHost = "myloadbalancer.com";
setWebServiceHost(testWebServiceHost);
deploy("jaxws-jbws2150-sec.war");
@@ -372,7 +373,7 @@
*/
public void testNoRewrite() throws Exception
{
- setModifySOAPAddress(false);
+ testUtils.setModifySOAPAddress(false);
deploy("jaxws-jbws2150.war");
try
{
@@ -420,7 +421,7 @@
*/
public void testRewriteCodeFirst() throws Exception
{
- setModifySOAPAddress(true);
+ testUtils.setModifySOAPAddress(true);
deploy("jaxws-jbws2150-codefirst.war");
try
{
@@ -442,7 +443,7 @@
*/
public void testNoRewriteCodeFirst() throws Exception
{
- setModifySOAPAddress(false);
+ testUtils.setModifySOAPAddress(false);
deploy("jaxws-jbws2150-codefirst.war");
try
{
@@ -464,7 +465,7 @@
*/
public void testRewriteLoadBalancerCodeFirst() throws Exception
{
- setModifySOAPAddress(true);
+ testUtils.setModifySOAPAddress(true);
final String testWebServiceHost = "myloadbalancer.com";
setWebServiceHost(testWebServiceHost);
deploy("jaxws-jbws2150-codefirst.war");
@@ -489,7 +490,7 @@
*/
public void testNoRewriteLoadBalancerCodeFirst() throws Exception
{
- setModifySOAPAddress(false);
+ testUtils.setModifySOAPAddress(false);
final String testWebServiceHost = "myloadbalancer2.com";
setWebServiceHost(testWebServiceHost);
deploy("jaxws-jbws2150-codefirst.war");
@@ -513,7 +514,7 @@
*/
public void testAutoRewriteCodeFirst() throws Exception
{
- setModifySOAPAddress(true);
+ testUtils.setModifySOAPAddress(true);
setWebServiceHost(ServerConfig.UNDEFINED_HOSTNAME);
deploy("jaxws-jbws2150-codefirst.war");
try
@@ -528,18 +529,18 @@
undeploy("jaxws-jbws2150-codefirst.war");
}
}
-
+
/**
* Test soap:address rewrite when a path rewrite rule is specified.
- *
+ *
* @throws Exception
*/
public void testRewriteWithPathRule() throws Exception
{
- setModifySOAPAddress(true);
+ testUtils.setModifySOAPAddress(true);
final String expectedContext = "xx/jaxws-jbws2150";
final String sedCmd = "s/jaxws-jbws2150/xx\\/jaxws-jbws2150/g";
- setWebServicePathRewriteRule(sedCmd);
+ testUtils.setWebServicePathRewriteRule(sedCmd);
deploy("jaxws-jbws2150.war");
try
{
@@ -566,7 +567,7 @@
address = getPortAddress(definition, "InvalidSecureURLService", "InvalidSecureURLPort");
assertEquals("https://" + serverHost + ":8443/" + expectedContext + "/InvalidSecureURL", address);
- //check wsdl import (which is bound to the endpoint currently serving the wsdl)
+ //check wsdl import (which is bound to the endpoint currently serving the wsdl)
assertTrue(getWsdlImportAddress(definition).contains(expectedContext));
}
}
@@ -578,15 +579,15 @@
/**
* Test soap:address rewrite for code-first endpoints when a path rewrite rule is specified
- *
+ *
* @throws Exception
*/
public void testRewriteCodeFirstPathRule() throws Exception
{
- setModifySOAPAddress(true);
+ testUtils.setModifySOAPAddress(true);
final String expectedContext = "xx/jaxws-jbws2150-codefirst";
final String sedCmd = "s/jaxws-jbws2150-codefirst/xx\\/jaxws-jbws2150-codefirst/g";
- setWebServicePathRewriteRule(sedCmd);
+ testUtils.setWebServicePathRewriteRule(sedCmd);
deploy("jaxws-jbws2150-codefirst.war");
try
{
@@ -611,10 +612,10 @@
*/
public void testAutoRewriteCodeFirstPathRule() throws Exception
{
- setModifySOAPAddress(true);
+ testUtils.setModifySOAPAddress(true);
final String expectedContext = "xx/jaxws-jbws2150-codefirst";
final String sedCmd = "s/jaxws-jbws2150-codefirst/xx\\/jaxws-jbws2150-codefirst/g";
- setWebServicePathRewriteRule(sedCmd);
+ testUtils.setWebServicePathRewriteRule(sedCmd);
setWebServiceHost(ServerConfig.UNDEFINED_HOSTNAME);
deploy("jaxws-jbws2150-codefirst.war");
try
@@ -644,10 +645,10 @@
*/
public void testAutoRewritePathRule() throws Exception
{
- setModifySOAPAddress(true);
+ testUtils.setModifySOAPAddress(true);
final String expectedContext = "xx/jaxws-jbws2150";
final String sedCmd = "s/jaxws-jbws2150/xx\\/jaxws-jbws2150/g";
- setWebServicePathRewriteRule(sedCmd);
+ testUtils.setWebServicePathRewriteRule(sedCmd);
setWebServiceHost(ServerConfig.UNDEFINED_HOSTNAME);
deploy("jaxws-jbws2150.war");
try
@@ -710,25 +711,13 @@
return "localhost".equals(getServerHost());
}
- private void setModifySOAPAddress(Boolean value) throws Exception
- {
- Attribute attr = new Attribute("ModifySOAPAddress", value);
- getServer().setAttribute(SERVER_CONFIG_OBJECT_NAME, attr);
- }
-
private void setWebServiceHost(String value) throws Exception
{
Attribute attr = new Attribute("WebServiceHost", value);
getServer().setAttribute(SERVER_CONFIG_OBJECT_NAME, attr);
}
- private void setWebServicePathRewriteRule(String value) throws Exception
- {
- Attribute attr = new Attribute("WebServicePathRewriteRule", value);
- getServer().setAttribute(SERVER_CONFIG_OBJECT_NAME, attr);
- }
-
- private ServiceIface getEndpoint(String wsdlLocation, String serviceName) throws Exception
+ private ServiceIface getEndpoint(String wsdlLocation, String serviceName) throws Exception
{
List<WebServiceFeature> features = new LinkedList<WebServiceFeature>();
if (isIntegrationCXF()) {
Added: stack/cxf/branches/rsearls/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2150/JBWS2150WsdlContentsTestCaseForked.java
===================================================================
--- stack/cxf/branches/rsearls/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2150/JBWS2150WsdlContentsTestCaseForked.java (rev 0)
+++ stack/cxf/branches/rsearls/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2150/JBWS2150WsdlContentsTestCaseForked.java 2014-06-13 17:24:11 UTC (rev 18732)
@@ -0,0 +1,310 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2014, 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.jbws2150;
+
+import junit.framework.Test;
+import org.jboss.as.controller.client.ModelControllerClient;
+import org.jboss.as.controller.client.OperationBuilder;
+import org.jboss.as.controller.descriptions.ModelDescriptionConstants;
+import org.jboss.dmr.ModelNode;
+import org.jboss.logging.Logger;
+import org.jboss.ws.common.DOMUtils;
+import org.jboss.ws.common.ObjectNameFactory;
+import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestSetup;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.xml.sax.SAXException;
+
+import javax.management.Attribute;
+import javax.management.ObjectName;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.net.InetAddress;
+import java.util.HashMap;
+import java.util.List;
+
+/**
+ * Verify the soap:address is written to the server's on disk wsdl file using
+ * the JBossWS rewrite rule settings.
+ *
+ * User: rsearls
+ * Date: 6/12/14
+ */
+public class JBWS2150WsdlContentsTestCaseForked extends JBossWSTest
+{
+ private static final ObjectName SERVER_CONFIG_OBJECT_NAME =
+ ObjectNameFactory.create("jboss.ws:service=ServerConfig");
+ private TestUtils testUtils = new TestUtils();
+
+ private static final Logger LOGGER = Logger.getLogger(JBWS2150WsdlContentsTestCaseForked.class);
+ private static final int DEFAULT_PORT = 9990;
+ private static InetAddress hostAddress;
+ private static Integer port;
+ private static String protocol;
+ private static File serverWSDLDir;
+
+ protected static class JBWS2150WsdlContentsTestSetup extends JBossWSTestSetup {
+
+ protected static Boolean modifySOAPAddress;
+ protected static String webServiceHost;
+ protected static String webServicePath;
+
+ public JBWS2150WsdlContentsTestSetup() {
+ super(JBWS2150WsdlContentsTestCaseForked.class, null);
+ }
+
+ public void setUp() throws Exception
+ {
+ modifySOAPAddress = (Boolean)getServer().getAttribute(SERVER_CONFIG_OBJECT_NAME, "ModifySOAPAddress");
+ webServiceHost = (String)getServer().getAttribute(SERVER_CONFIG_OBJECT_NAME, "WebServiceHost");
+ webServicePath = (String)getServer().getAttribute(SERVER_CONFIG_OBJECT_NAME, "WebServicePathRewriteRule");
+
+ try {
+ final String host = webServiceHost;
+ hostAddress = host != null ? InetAddress.getByName(host) : InetAddress.getByName("localhost");
+ port = new Integer(DEFAULT_PORT);
+ protocol = "http-remoting";
+ } catch (final IOException e) {
+ LOGGER.fatal(e.getMessage(), e);
+ }
+
+ serverWSDLDir = getServerWsdlDir();
+ super.setUp();
+ }
+ }
+
+ public static Test suite()
+ {
+ return new JBWS2150WsdlContentsTestSetup();
+ }
+
+ public void tearDown() throws Exception
+ {
+ Attribute attr = new Attribute("ModifySOAPAddress", JBWS2150WsdlContentsTestSetup.modifySOAPAddress);
+ getServer().setAttribute(SERVER_CONFIG_OBJECT_NAME, attr);
+ attr = new Attribute("WebServiceHost", JBWS2150WsdlContentsTestSetup.webServiceHost);
+ getServer().setAttribute(SERVER_CONFIG_OBJECT_NAME, attr);
+ attr = new Attribute("WebServicePathRewriteRule", JBWS2150WsdlContentsTestSetup.webServicePath);
+ getServer().setAttribute(SERVER_CONFIG_OBJECT_NAME, attr);
+ }
+
+ /**
+ * Test soap:address rewrite when a path rewrite rule is specified.
+ *
+ * @throws Exception
+ */
+ public void testRewriteWithPathRule() throws Exception
+ {
+ testUtils.setModifySOAPAddress(true);
+ final String expectedContext = "xx/jaxws-jbws2150";
+ final String sedCmd = "s/jaxws-jbws2150/xx\\/jaxws-jbws2150/g";
+ testUtils.setWebServicePathRewriteRule(sedCmd);
+ String archive = "jaxws-jbws2150.war";
+ deploy(archive);
+ try {
+ assertNotNull("Server's (localhost) " + "wsdl directory could not be found.", serverWSDLDir);
+ Document postDoc = getWSDLFromDisk(new File(serverWSDLDir, archive), "Service.wsdl");
+ HashMap<String, String> postSoapAddressMap = getServiceSoapAddresses(postDoc);
+ final String serverHost = getServerHost();
+
+ assertEquals("http://" + serverHost + ":8080/" + expectedContext + "/ValidURL",
+ postSoapAddressMap.get("ValidURLService"));
+
+ assertEquals("http://" + serverHost + ":8080/" + expectedContext + "/InvalidURL",
+ postSoapAddressMap.get("InvalidURLService"));
+
+ assertEquals("https://" + serverHost + ":8443/" + expectedContext + "/ValidSecureURL",
+ postSoapAddressMap.get("ValidSecureURLService"));
+
+ assertEquals("https://" + serverHost + ":8443/" + expectedContext + "/InvalidSecureURL",
+ postSoapAddressMap.get("InvalidSecureURLService"));
+ }
+ finally
+ {
+ undeploy("jaxws-jbws2150.war");
+ }
+ }
+
+ /**
+ * Test soap:address rewrite for code-first endpoints when a path rewrite rule is specified
+ *
+ * @throws Exception
+ */
+ public void testRewriteCodeFirstPathRule() throws Exception
+ {
+ testUtils.setModifySOAPAddress(true);
+ final String expectedContext = "xx/jaxws-jbws2150-codefirst";
+ final String sedCmd = "s/jaxws-jbws2150-codefirst/xx\\/jaxws-jbws2150-codefirst/g";
+ testUtils.setWebServicePathRewriteRule(sedCmd);
+ String archive = "jaxws-jbws2150-codefirst.war";
+ deploy(archive);
+ try
+ {
+ assertNotNull("Server's (localhost) " + "wsdl directory could not be found.", serverWSDLDir);
+ Document postDoc = getWSDLFromDisk(new File(serverWSDLDir, archive), "CodeFirstService.wsdl");
+ HashMap<String, String> postSoapAddressMap = getServiceSoapAddresses(postDoc);
+ final String serverHost = getServerHost();
+
+ assertEquals("http://" + serverHost + ":8080/" + expectedContext + "/CodeFirstService",
+ postSoapAddressMap.get("CodeFirstService"));
+ }
+ finally
+ {
+ undeploy("jaxws-jbws2150-codefirst.war");
+ }
+ }
+
+
+ /**
+ * Retrieve the absolute path to the (localhost's) JBOSS_HOME/standalone/data which will
+ * contain the wsdl dir and wsdl file.
+ * cli cmd to check this setting: /core-service=server-environment:read-attribute(name=data-dir)
+ */
+ private static File getServerWsdlDir() throws Exception{
+
+ final ModelNode request = new ModelNode();
+ request.get(ModelDescriptionConstants.OP).set(ModelDescriptionConstants.READ_ATTRIBUTE_OPERATION);
+ request.get(ModelDescriptionConstants.OP_ADDR)
+ .add(ModelDescriptionConstants.CORE_SERVICE).add("server-environment");
+ request.get(ModelDescriptionConstants.NAME).set("data-dir");
+
+ try {
+ final ModelNode response = applyUpdate(request);
+ String dataDir = response.get(ModelDescriptionConstants.RESULT).asString();
+ if (dataDir != null) {
+ File dir = new File(dataDir, "wsdl");
+ if (dir.exists()) {
+ return dir;
+ } else {
+ throw new Exception("Directory does not exist: " + dir.getAbsolutePath());
+ }
+ }
+
+ } catch (Exception e) {
+ throw e;
+ }
+ return null;
+ }
+
+
+ private static ModelNode applyUpdate(final ModelNode update) throws Exception {
+ final ModelControllerClient client = newModelControllerClient();
+ try {
+ final ModelNode result = client.execute(new OperationBuilder(update).build());
+ checkResult(result);
+ return result;
+ } finally {
+ client.close();
+ }
+ }
+
+ private static void checkResult(final ModelNode result) throws Exception {
+ if (result.hasDefined(ModelDescriptionConstants.OUTCOME) &&
+ ModelDescriptionConstants.SUCCESS.equals(result.get(ModelDescriptionConstants.OUTCOME).asString())) {
+ if (result.hasDefined(ModelDescriptionConstants.RESULT)) {
+ LOGGER.info(result.get(ModelDescriptionConstants.RESULT));
+ }
+ } else if (result.hasDefined(ModelDescriptionConstants.FAILURE_DESCRIPTION)) {
+ throw new Exception(result.get(ModelDescriptionConstants.FAILURE_DESCRIPTION).toString());
+ } else {
+ throw new Exception("Operation not successful; outcome = " +
+ result.get(ModelDescriptionConstants.OUTCOME));
+ }
+ }
+
+ private static ModelControllerClient newModelControllerClient() throws Exception {
+ return ModelControllerClient.Factory.create(protocol,
+ hostAddress.getHostAddress(), port, null, null, 60000);
+ }
+
+ private Document loadXMLFrom(java.io.InputStream is) throws SAXException, IOException {
+
+ DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+ factory.setNamespaceAware(true);
+ DocumentBuilder builder = null;
+ try {
+ builder = factory.newDocumentBuilder();
+ }
+ catch (ParserConfigurationException ex) {
+ }
+ Document doc = builder.parse(is);
+ is.close();
+ return doc;
+ }
+
+
+ /**
+ * Retrieve service name and soap:address location tuple.
+ * @param doc
+ * @return
+ */
+ private HashMap<String, String> getServiceSoapAddresses(Document doc) {
+
+ HashMap<String, String> soapAddresMap = new HashMap<String, String>();
+
+ List<Element> elList = DOMUtils.getChildElementsAsList(doc.getDocumentElement(),
+ "service", true);
+
+ for (Element el : elList) {
+ String serviceName = DOMUtils.getAttributeValue(el, "name");
+ List<Element> childList = DOMUtils.getChildElementsAsList(el, "address", true);
+ if (!childList.isEmpty()) {
+ String loc = childList.get(0).getAttribute("location");
+ soapAddresMap.put(serviceName, loc);
+ }
+ }
+ return soapAddresMap;
+ }
+
+
+ private Document getWSDLFromDisk(File serverWSDLDir, String wsdlName) throws Exception {
+ Document doc = null;
+ FileInputStream fis = null;
+ try {
+ File file = new File(serverWSDLDir, wsdlName);
+ if (file.exists()) {
+ fis = new FileInputStream(file);
+ doc = loadXMLFrom(fis);
+ } else {
+ throw new Exception("File does not exist: " + file.getAbsolutePath());
+ }
+ } catch (Exception e) {
+ throw e;
+ }
+ finally {
+ if (fis != null) {
+ try {
+ fis.close();
+ } catch (IOException e) {
+ // do nothing
+ }
+ }
+ }
+ return doc;
+ }
+
+}
Added: stack/cxf/branches/rsearls/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2150/TestUtils.java
===================================================================
--- stack/cxf/branches/rsearls/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2150/TestUtils.java (rev 0)
+++ stack/cxf/branches/rsearls/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2150/TestUtils.java 2014-06-13 17:24:11 UTC (rev 18732)
@@ -0,0 +1,36 @@
+package org.jboss.test.ws.jaxws.jbws2150;
+
+import org.jboss.ws.common.ObjectNameFactory;
+import org.jboss.wsf.test.JBossWSTestHelper;
+
+import javax.management.Attribute;
+import javax.management.MBeanServerConnection;
+import javax.management.ObjectName;
+import javax.naming.NamingException;
+
+/**
+ * User: rsearls
+ * Date: 6/12/14
+ */
+public class TestUtils
+{
+ private static final ObjectName SERVER_CONFIG_OBJECT_NAME = ObjectNameFactory.create("jboss.ws:service=ServerConfig");
+
+ public void setModifySOAPAddress(Boolean value) throws Exception
+ {
+ Attribute attr = new Attribute("ModifySOAPAddress", value);
+ getServer().setAttribute(SERVER_CONFIG_OBJECT_NAME, attr);
+ }
+
+ public void setWebServicePathRewriteRule(String value) throws Exception
+ {
+ Attribute attr = new Attribute("WebServicePathRewriteRule", value);
+ getServer().setAttribute(SERVER_CONFIG_OBJECT_NAME, attr);
+ }
+
+ private MBeanServerConnection getServer() throws NamingException
+ {
+ return JBossWSTestHelper.getServer();
+ }
+
+}
Modified: stack/cxf/branches/rsearls/pom.xml
===================================================================
--- stack/cxf/branches/rsearls/pom.xml 2014-06-12 16:05:44 UTC (rev 18731)
+++ stack/cxf/branches/rsearls/pom.xml 2014-06-13 17:24:11 UTC (rev 18732)
@@ -111,6 +111,7 @@
<shrinkwrap.version>1.1.3</shrinkwrap.version>
<jaspi.api.version>1.0.0.Alpha1</jaspi.api.version>
<javax.inject.version>1</javax.inject.version>
+ <jboss-dmr-version>1.2.0.Final</jboss-dmr-version>
</properties>
10 years, 6 months
JBossWS SVN: r18731 - in stack/cxf/trunk/modules: server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect and 3 other directories.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2014-06-12 12:05:44 -0400 (Thu, 12 Jun 2014)
New Revision: 18731
Modified:
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/BusHolder.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/BusDeploymentAspect.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/metadata/MetadataBuilder.java
stack/cxf/trunk/modules/server/src/test/java/org/jboss/wsf/stack/cxf/configuration/BusHolderTest.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3098/BusHolderLifeCycleTestCase.java
Log:
[JBWS-3793] More cleanup
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/BusHolder.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/BusHolder.java 2014-06-12 16:04:16 UTC (rev 18730)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/BusHolder.java 2014-06-12 16:05:44 UTC (rev 18731)
@@ -147,7 +147,7 @@
AnnotationsInfo ai = dep.getAttachment(AnnotationsInfo.class);
if (ai == null || ai.hasAnnotatedClasses(PolicySets.class.getName())) {
- policySetsListener = new PolicySetsAnnotationListener(dep.getRuntimeClassLoader());
+ policySetsListener = new PolicySetsAnnotationListener(dep.getClassLoader());
bus.getExtension(FactoryBeanListenerManager.class).addListener(policySetsListener);
}
}
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/BusDeploymentAspect.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/BusDeploymentAspect.java 2014-06-12 16:04:16 UTC (rev 18730)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/BusDeploymentAspect.java 2014-06-12 16:05:44 UTC (rev 18731)
@@ -102,7 +102,7 @@
//use origClassLoader (which on AS7 is set to ASIL aggregation module's classloader by TCCLDeploymentProcessor) as
//parent to make sure user provided libs in the deployment do no mess up the WS endpoint's deploy if they duplicates
//libraries already available on the application server modules.
- SecurityActions.setContextClassLoader(new DelegateClassLoader(dep.getRuntimeClassLoader(), origClassLoader));
+ SecurityActions.setContextClassLoader(new DelegateClassLoader(dep.getClassLoader(), origClassLoader));
if (jbosswsCxfXml != null)
{
// Spring available and jbossws-cxf.xml provided
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/metadata/MetadataBuilder.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/metadata/MetadataBuilder.java 2014-06-12 16:04:16 UTC (rev 18730)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/metadata/MetadataBuilder.java 2014-06-12 16:05:44 UTC (rev 18731)
@@ -230,7 +230,7 @@
if (anWebService != null && anWebService.endpointInterface().length() > 0)
{
seiName = anWebService.endpointInterface();
- ClassLoader runtimeClassLoader = dep.getRuntimeClassLoader();
+ ClassLoader runtimeClassLoader = dep.getClassLoader();
if(null == runtimeClassLoader)
throw MESSAGES.runtimeLoaderCannotBeNull(dep);
Modified: stack/cxf/trunk/modules/server/src/test/java/org/jboss/wsf/stack/cxf/configuration/BusHolderTest.java
===================================================================
--- stack/cxf/trunk/modules/server/src/test/java/org/jboss/wsf/stack/cxf/configuration/BusHolderTest.java 2014-06-12 16:04:16 UTC (rev 18730)
+++ stack/cxf/trunk/modules/server/src/test/java/org/jboss/wsf/stack/cxf/configuration/BusHolderTest.java 2014-06-12 16:05:44 UTC (rev 18731)
@@ -69,7 +69,7 @@
}
BusHolder holder = new NonSpringBusHolder(new DDBeans());
try {
- holder.configure(null, null, wsmd, new DefaultDeploymentModelFactory().newDeployment("testDeployment", null));
+ holder.configure(null, null, wsmd, new DefaultDeploymentModelFactory().newDeployment("testDeployment", null, null));
return holder.getBus().getExtension(PolicyEngine.class).getAlternativeSelector().getClass().getName();
} finally {
holder.close();
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3098/BusHolderLifeCycleTestCase.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3098/BusHolderLifeCycleTestCase.java 2014-06-12 16:04:16 UTC (rev 18730)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3098/BusHolderLifeCycleTestCase.java 2014-06-12 16:05:44 UTC (rev 18731)
@@ -64,7 +64,7 @@
Bus bus = holder.getBus();
TestLifeCycleListener listener = new TestLifeCycleListener();
bus.getExtension(BusLifeCycleManager.class).registerLifeCycleListener(listener);
- holder.configure(null, null, null, new DefaultDeploymentModelFactory().newDeployment("testDeployment", null));
+ holder.configure(null, null, null, new DefaultDeploymentModelFactory().newDeployment("testDeployment", null, null));
holder.close();
assertEquals("preShutdown method on listener should be called exactly once; number of actual calls: "
+ listener.getCount(), 1, listener.getCount());
@@ -75,7 +75,7 @@
Bus bus = holder.getBus();
TestLifeCycleListener listener = new TestLifeCycleListener();
bus.getExtension(BusLifeCycleManager.class).registerLifeCycleListener(listener);
- holder.configure(null, null, null, new DefaultDeploymentModelFactory().newDeployment("testDeployment", null));
+ holder.configure(null, null, null, new DefaultDeploymentModelFactory().newDeployment("testDeployment", null, null));
bus.shutdown(true);
holder.close();
assertEquals("preShutdown method on listener should be called exactly once; number of actual calls: "
@@ -87,7 +87,7 @@
Bus bus = holder.getBus();
TestLifeCycleListener listener = new TestLifeCycleListener();
bus.getExtension(BusLifeCycleManager.class).registerLifeCycleListener(listener);
- holder.configure(null, null, null, new DefaultDeploymentModelFactory().newDeployment("testDeployment", null));
+ holder.configure(null, null, null, new DefaultDeploymentModelFactory().newDeployment("testDeployment", null, null));
assertEquals("preShutdown method on listener shouldn't be called before holder is closed: number of actual calls: "
+ listener.getCount(), 0, listener.getCount());
holder.close();
10 years, 6 months
JBossWS SVN: r18730 - container/wildfly80/branches/jbossws-wildfly800/server-integration/src/main/java/org/jboss/as/webservices/deployers/deployment.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2014-06-12 12:04:16 -0400 (Thu, 12 Jun 2014)
New Revision: 18730
Modified:
container/wildfly80/branches/jbossws-wildfly800/server-integration/src/main/java/org/jboss/as/webservices/deployers/deployment/AbstractDeploymentModelBuilder.java
Log:
[JBWS-3793] More cleanup
Modified: container/wildfly80/branches/jbossws-wildfly800/server-integration/src/main/java/org/jboss/as/webservices/deployers/deployment/AbstractDeploymentModelBuilder.java
===================================================================
--- container/wildfly80/branches/jbossws-wildfly800/server-integration/src/main/java/org/jboss/as/webservices/deployers/deployment/AbstractDeploymentModelBuilder.java 2014-06-12 16:04:01 UTC (rev 18729)
+++ container/wildfly80/branches/jbossws-wildfly800/server-integration/src/main/java/org/jboss/as/webservices/deployers/deployment/AbstractDeploymentModelBuilder.java 2014-06-12 16:04:16 UTC (rev 18730)
@@ -50,6 +50,7 @@
import org.jboss.wsf.spi.deployment.DeploymentModelFactory;
import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.spi.deployment.EndpointType;
+import org.jboss.wsf.spi.deployment.UnifiedVirtualFile;
import org.jboss.wsf.spi.metadata.webservices.JBossWebservicesMetaData;
import org.jboss.wsf.spi.metadata.webservices.WebservicesMetaData;
@@ -184,27 +185,21 @@
} else {
classLoader = module.getClassLoader();
}
- final ArchiveDeployment dep = this.newDeployment(unit.getName(), classLoader);
+ ArchiveDeployment parentDep = null;
if (unit.getParent() != null) {
- final String parentDeploymentName = unit.getParent().getName();
final Module parentModule = unit.getParent().getAttachment(Attachments.MODULE);
if (parentModule == null) {
throw MESSAGES.classLoaderResolutionFailed(deploymentRoot);
}
- final ClassLoader parentClassLoader = parentModule.getClassLoader();
ROOT_LOGGER.creatingUnifiedWebservicesDeploymentModel(unit.getParent());
- final ArchiveDeployment parentDep = this.newDeployment(parentDeploymentName, parentClassLoader);
- dep.setParent(parentDep);
+ parentDep = this.newDeployment(null, unit.getParent().getName(), parentModule.getClassLoader(), null);
}
- if (root != null) {
- dep.setRootFile(new VirtualFileAdaptor(root));
- } else {
- dep.setRootFile(new ResourceLoaderAdapter(classLoader));
- }
- dep.setRuntimeClassLoader(classLoader);
+ final UnifiedVirtualFile uvf = root != null ? new VirtualFileAdaptor(root) : new ResourceLoaderAdapter(classLoader);
+ final ArchiveDeployment dep = this.newDeployment(parentDep, unit.getName(), classLoader, uvf);
+
//add an AnnotationInfo attachment that uses composite jandex index
dep.addAttachment(AnnotationsInfo.class, new JandexAnnotationsInfo(unit));
@@ -218,7 +213,12 @@
* @param loader deployment loader
* @return new archive deployment
*/
- private ArchiveDeployment newDeployment(final String name, final ClassLoader loader) {
- return (ArchiveDeployment) this.deploymentModelFactory.newDeployment(name, loader);
+ private ArchiveDeployment newDeployment(final ArchiveDeployment parent, final String name, final ClassLoader loader, final UnifiedVirtualFile rootFile) {
+ if (parent != null) {
+ return (ArchiveDeployment) this.deploymentModelFactory.newDeployment(parent, name, loader, rootFile);
+ } else {
+ return (ArchiveDeployment) this.deploymentModelFactory.newDeployment(name, loader, rootFile);
+ }
+
}
}
10 years, 6 months
JBossWS SVN: r18729 - container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/deployers/deployment.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2014-06-12 12:04:01 -0400 (Thu, 12 Jun 2014)
New Revision: 18729
Modified:
container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/deployers/deployment/AbstractDeploymentModelBuilder.java
Log:
[JBWS-3793] More cleanup
Modified: container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/deployers/deployment/AbstractDeploymentModelBuilder.java
===================================================================
--- container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/deployers/deployment/AbstractDeploymentModelBuilder.java 2014-06-12 16:04:00 UTC (rev 18728)
+++ container/wildfly81/branches/jbossws-wildfly810/server-integration/src/main/java/org/jboss/as/webservices/deployers/deployment/AbstractDeploymentModelBuilder.java 2014-06-12 16:04:01 UTC (rev 18729)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2014, 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.
*
@@ -50,6 +50,7 @@
import org.jboss.wsf.spi.deployment.DeploymentModelFactory;
import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.spi.deployment.EndpointType;
+import org.jboss.wsf.spi.deployment.UnifiedVirtualFile;
import org.jboss.wsf.spi.metadata.webservices.JBossWebservicesMetaData;
import org.jboss.wsf.spi.metadata.webservices.WebservicesMetaData;
@@ -184,27 +185,20 @@
} else {
classLoader = module.getClassLoader();
}
- final ArchiveDeployment dep = this.newDeployment(unit.getName(), classLoader);
-
+
+ ArchiveDeployment parentDep = null;
if (unit.getParent() != null) {
- final String parentDeploymentName = unit.getParent().getName();
final Module parentModule = unit.getParent().getAttachment(Attachments.MODULE);
if (parentModule == null) {
throw MESSAGES.classLoaderResolutionFailed(deploymentRoot);
}
- final ClassLoader parentClassLoader = parentModule.getClassLoader();
-
ROOT_LOGGER.creatingUnifiedWebservicesDeploymentModel(unit.getParent());
- final ArchiveDeployment parentDep = this.newDeployment(parentDeploymentName, parentClassLoader);
- dep.setParent(parentDep);
+ parentDep = this.newDeployment(null, unit.getParent().getName(), parentModule.getClassLoader(), null);
}
+
+ final UnifiedVirtualFile uvf = root != null ? new VirtualFileAdaptor(root) : new ResourceLoaderAdapter(classLoader);
+ final ArchiveDeployment dep = this.newDeployment(parentDep, unit.getName(), classLoader, uvf);
- if (root != null) {
- dep.setRootFile(new VirtualFileAdaptor(root));
- } else {
- dep.setRootFile(new ResourceLoaderAdapter(classLoader));
- }
- dep.setRuntimeClassLoader(classLoader);
//add an AnnotationInfo attachment that uses composite jandex index
dep.addAttachment(AnnotationsInfo.class, new JandexAnnotationsInfo(unit));
@@ -218,7 +212,11 @@
* @param loader deployment loader
* @return new archive deployment
*/
- private ArchiveDeployment newDeployment(final String name, final ClassLoader loader) {
- return (ArchiveDeployment) this.deploymentModelFactory.newDeployment(name, loader);
+ private ArchiveDeployment newDeployment(final ArchiveDeployment parent, final String name, final ClassLoader loader, final UnifiedVirtualFile rootFile) {
+ if (parent != null) {
+ return (ArchiveDeployment) this.deploymentModelFactory.newDeployment(parent, name, loader, rootFile);
+ } else {
+ return (ArchiveDeployment) this.deploymentModelFactory.newDeployment(name, loader, rootFile);
+ }
}
}
10 years, 6 months
JBossWS SVN: r18728 - common/trunk/src/main/java/org/jboss/ws/common/deployment.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2014-06-12 12:04:00 -0400 (Thu, 12 Jun 2014)
New Revision: 18728
Modified:
common/trunk/src/main/java/org/jboss/ws/common/deployment/AbstractDefaultEndpoint.java
common/trunk/src/main/java/org/jboss/ws/common/deployment/ArchiveDeploymentImpl.java
common/trunk/src/main/java/org/jboss/ws/common/deployment/ArchiveDeploymentModelFactory.java
common/trunk/src/main/java/org/jboss/ws/common/deployment/DefaultDeployment.java
common/trunk/src/main/java/org/jboss/ws/common/deployment/DefaultDeploymentModelFactory.java
common/trunk/src/main/java/org/jboss/ws/common/deployment/DefaultHttpEndpoint.java
common/trunk/src/main/java/org/jboss/ws/common/deployment/DefaultJMSEndpoint.java
common/trunk/src/main/java/org/jboss/ws/common/deployment/DefaultService.java
common/trunk/src/main/java/org/jboss/ws/common/deployment/DeploymentAspectManagerImpl.java
common/trunk/src/main/java/org/jboss/ws/common/deployment/EndpointAddressDeploymentAspect.java
common/trunk/src/main/java/org/jboss/ws/common/deployment/ResourceResolverImpl.java
Log:
[JBWS-3793] More cleanup
Modified: common/trunk/src/main/java/org/jboss/ws/common/deployment/AbstractDefaultEndpoint.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/deployment/AbstractDefaultEndpoint.java 2014-06-12 16:03:46 UTC (rev 18727)
+++ common/trunk/src/main/java/org/jboss/ws/common/deployment/AbstractDefaultEndpoint.java 2014-06-12 16:04:00 UTC (rev 18728)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2014, 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.
*
@@ -54,22 +54,22 @@
*/
public class AbstractDefaultEndpoint extends AbstractExtensible
{
- protected Service service;
- protected ObjectName name;
- protected String shortName;
- protected String urlPattern;
- protected String targetBean;
- protected Class<?> targetBeanClass;
- protected EndpointState state;
- protected EndpointType type;
- protected RequestHandler requestHandler;
- protected InvocationHandler invocationHandler;
- protected LifecycleHandler lifecycleHandler;
- protected EndpointMetrics metrics;
- protected String address;
- protected List<RecordProcessor> recordProcessors = new CopyOnWriteArrayList<RecordProcessor>();
- protected SecurityDomainContext securityDomainContext;
- protected InstanceProvider instanceProvider;
+ protected volatile Service service;
+ protected volatile ObjectName name;
+ protected volatile String shortName;
+ protected volatile String urlPattern;
+ protected volatile String targetBean;
+ protected volatile Class<?> targetBeanClass;
+ protected volatile EndpointState state;
+ protected volatile EndpointType type;
+ protected volatile RequestHandler requestHandler;
+ protected volatile InvocationHandler invocationHandler;
+ protected volatile LifecycleHandler lifecycleHandler;
+ protected volatile EndpointMetrics metrics;
+ protected volatile String address;
+ protected volatile List<RecordProcessor> recordProcessors = new CopyOnWriteArrayList<RecordProcessor>();
+ protected volatile SecurityDomainContext securityDomainContext;
+ protected volatile InstanceProvider instanceProvider;
AbstractDefaultEndpoint(String targetBean)
{
@@ -105,7 +105,7 @@
if (targetBeanClass != null)
return targetBeanClass;
- ClassLoader classLoader = service.getDeployment().getRuntimeClassLoader();
+ ClassLoader classLoader = service.getDeployment().getClassLoader();
try
{
@@ -158,12 +158,12 @@
}
- public synchronized EndpointState getState()
+ public EndpointState getState()
{
return state;
}
- public synchronized void setState(EndpointState state)
+ public void setState(EndpointState state)
{
this.state = state;
}
@@ -249,7 +249,7 @@
super.setProperty(key, value);
}
- protected synchronized void assertEndpointSetterAccess()
+ protected void assertEndpointSetterAccess()
{
if (state == EndpointState.STARTED)
throw Messages.MESSAGES.cannotModifyEndpointInState(state, getName());
Modified: common/trunk/src/main/java/org/jboss/ws/common/deployment/ArchiveDeploymentImpl.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/deployment/ArchiveDeploymentImpl.java 2014-06-12 16:03:46 UTC (rev 18727)
+++ common/trunk/src/main/java/org/jboss/ws/common/deployment/ArchiveDeploymentImpl.java 2014-06-12 16:04:00 UTC (rev 18728)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2014, 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,8 @@
*/
package org.jboss.ws.common.deployment;
+import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
import org.jboss.wsf.spi.deployment.ArchiveDeployment;
@@ -37,25 +39,29 @@
public class ArchiveDeploymentImpl extends DefaultDeployment implements ArchiveDeployment
{
// The optional parent
- private ArchiveDeployment parent;
+ private final ArchiveDeployment parent;
// The root file for this deployment
- private UnifiedVirtualFile rootFile;
+ private final UnifiedVirtualFile rootFile;
private List<UnifiedVirtualFile> metadataFiles;
- ArchiveDeploymentImpl(String simpleName, ClassLoader classLoader)
+ ArchiveDeploymentImpl(String simpleName, ClassLoader classLoader, UnifiedVirtualFile rootFile)
{
super(simpleName, classLoader);
+ this.parent = null;
+ this.rootFile = rootFile;
}
- public ArchiveDeployment getParent()
+ ArchiveDeploymentImpl(ArchiveDeployment parent, String simpleName, ClassLoader classLoader, UnifiedVirtualFile rootFile)
{
- return parent;
+ super(simpleName, classLoader);
+ this.parent = parent;
+ this.rootFile = rootFile;
}
- public void setParent(ArchiveDeployment parent)
+ public ArchiveDeployment getParent()
{
- this.parent = parent;
+ return parent;
}
public UnifiedVirtualFile getRootFile()
@@ -63,11 +69,6 @@
return rootFile;
}
- public void setRootFile(UnifiedVirtualFile rootFile)
- {
- this.rootFile = rootFile;
- }
-
public String getCanonicalName()
{
String name = getSimpleName();
@@ -76,14 +77,21 @@
return name;
}
- public List<UnifiedVirtualFile> getMetadataFiles()
+ public synchronized List<UnifiedVirtualFile> getMetadataFiles()
{
- return metadataFiles;
+ if (metadataFiles == null) {
+ return Collections.emptyList();
+ } else {
+ return Collections.unmodifiableList(metadataFiles);
+ }
}
- public void setMetadataFiles(List<UnifiedVirtualFile> metadataFiles)
+ public synchronized void addMetadataFile(UnifiedVirtualFile file)
{
- this.metadataFiles = metadataFiles;
+ if (metadataFiles == null) {
+ metadataFiles = new ArrayList<UnifiedVirtualFile>();
+ }
+ metadataFiles.add(file);
}
public ResourceResolver getResourceResolver()
Modified: common/trunk/src/main/java/org/jboss/ws/common/deployment/ArchiveDeploymentModelFactory.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/deployment/ArchiveDeploymentModelFactory.java 2014-06-12 16:03:46 UTC (rev 18727)
+++ common/trunk/src/main/java/org/jboss/ws/common/deployment/ArchiveDeploymentModelFactory.java 2014-06-12 16:04:00 UTC (rev 18728)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2014, 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,10 +21,11 @@
*/
package org.jboss.ws.common.deployment;
+import org.jboss.wsf.spi.deployment.ArchiveDeployment;
+import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.DeploymentModelFactory;
-import org.jboss.wsf.spi.deployment.Deployment;
-import org.jboss.wsf.spi.deployment.Service;
import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.deployment.UnifiedVirtualFile;
/**
* @author Thomas.Diesler(a)jboss.com
@@ -32,14 +33,14 @@
*/
public class ArchiveDeploymentModelFactory extends DeploymentModelFactory
{
- public Deployment newDeployment(String simpleName, ClassLoader initialLoader)
+ public Deployment newDeployment(String simpleName, ClassLoader classLoader, UnifiedVirtualFile rootFile)
{
- return new ArchiveDeploymentImpl(simpleName, initialLoader);
+ return new ArchiveDeploymentImpl(simpleName, classLoader, rootFile);
}
- public Service newService()
+ public Deployment newDeployment(ArchiveDeployment parent, String simpleName, ClassLoader classLoader, UnifiedVirtualFile rootFile)
{
- return new DefaultService();
+ return new ArchiveDeploymentImpl(parent, simpleName, classLoader, rootFile);
}
public Endpoint newHttpEndpoint(String targetBean)
Modified: common/trunk/src/main/java/org/jboss/ws/common/deployment/DefaultDeployment.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/deployment/DefaultDeployment.java 2014-06-12 16:03:46 UTC (rev 18727)
+++ common/trunk/src/main/java/org/jboss/ws/common/deployment/DefaultDeployment.java 2014-06-12 16:04:00 UTC (rev 18728)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2014, 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.
*
@@ -23,7 +23,6 @@
import org.jboss.wsf.spi.deployment.AbstractExtensible;
import org.jboss.wsf.spi.deployment.Deployment;
-import org.jboss.wsf.spi.deployment.DeploymentState;
import org.jboss.wsf.spi.deployment.Service;
/**
@@ -37,23 +36,18 @@
public class DefaultDeployment extends AbstractExtensible implements Deployment
{
// The name for this deployment
- private String simpleName;
+ private final String simpleName;
// A deployment has one service
- private Service service;
- // The state for this deployment
- private DeploymentState state;
- // The deployment class loader
- private ClassLoader initialLoader;
+ private final Service service;
// The runtime class loader
- private ClassLoader runtimeLoader;
+ private final ClassLoader classLoader;
DefaultDeployment(String name, ClassLoader classLoader)
{
super(12, 4);
- simpleName = name;
- state = DeploymentState.UNDEFINED;
- initialLoader = classLoader;
- setService(new DefaultService());
+ this.simpleName = name;
+ this.classLoader = classLoader;
+ this.service = new DefaultService(this);
}
public String getSimpleName()
@@ -61,49 +55,13 @@
return simpleName;
}
- public void setSimpleName(String name)
+ public ClassLoader getClassLoader()
{
- this.simpleName = name;
+ return classLoader;
}
- public void setInitialClassLoader(ClassLoader classLoader)
- {
- this.initialLoader = classLoader;
- }
-
- public ClassLoader getInitialClassLoader()
- {
- return initialLoader;
- }
-
- public void setRuntimeClassLoader(ClassLoader classLoader)
- {
- this.runtimeLoader = classLoader;
- }
-
- public ClassLoader getRuntimeClassLoader()
- {
- return runtimeLoader;
- }
-
public Service getService()
{
return service;
}
-
- public void setService(Service service)
- {
- service.setDeployment(this);
- this.service = service;
- }
-
- public DeploymentState getState()
- {
- return state;
- }
-
- public void setState(DeploymentState deploymentState)
- {
- this.state = deploymentState;
- }
}
Modified: common/trunk/src/main/java/org/jboss/ws/common/deployment/DefaultDeploymentModelFactory.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/deployment/DefaultDeploymentModelFactory.java 2014-06-12 16:03:46 UTC (rev 18727)
+++ common/trunk/src/main/java/org/jboss/ws/common/deployment/DefaultDeploymentModelFactory.java 2014-06-12 16:04:00 UTC (rev 18728)
@@ -21,10 +21,11 @@
*/
package org.jboss.ws.common.deployment;
+import org.jboss.wsf.spi.deployment.ArchiveDeployment;
+import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.DeploymentModelFactory;
-import org.jboss.wsf.spi.deployment.Deployment;
-import org.jboss.wsf.spi.deployment.Service;
import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.deployment.UnifiedVirtualFile;
/**
* @author Heiko.Braun(a)jboss.com
@@ -32,16 +33,11 @@
*/
public class DefaultDeploymentModelFactory extends DeploymentModelFactory
{
- public Deployment newDeployment(String simpleName, ClassLoader initialLoader)
+ public Deployment newDeployment(String simpleName, ClassLoader classLoader, UnifiedVirtualFile rootFile)
{
- return new DefaultDeployment(simpleName, initialLoader);
+ return new DefaultDeployment(simpleName, classLoader);
}
- public Service newService()
- {
- return new DefaultService();
- }
-
public Endpoint newHttpEndpoint(String targetBean)
{
return new DefaultHttpEndpoint(targetBean);
@@ -51,4 +47,9 @@
{
return new DefaultJMSEndpoint(targetBean);
}
+
+ public Deployment newDeployment(ArchiveDeployment parent, String simpleName, ClassLoader classLoader, UnifiedVirtualFile rootFile)
+ {
+ throw new UnsupportedOperationException();
+ }
}
Modified: common/trunk/src/main/java/org/jboss/ws/common/deployment/DefaultHttpEndpoint.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/deployment/DefaultHttpEndpoint.java 2014-06-12 16:03:46 UTC (rev 18727)
+++ common/trunk/src/main/java/org/jboss/ws/common/deployment/DefaultHttpEndpoint.java 2014-06-12 16:04:00 UTC (rev 18728)
@@ -37,11 +37,13 @@
super(targetBean);
}
+ @Override
public EndpointMetrics getEndpointMetrics()
{
return metrics;
}
+ @Override
public void setEndpointMetrics(EndpointMetrics metrics)
{
assertEndpointSetterAccess();
Modified: common/trunk/src/main/java/org/jboss/ws/common/deployment/DefaultJMSEndpoint.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/deployment/DefaultJMSEndpoint.java 2014-06-12 16:03:46 UTC (rev 18727)
+++ common/trunk/src/main/java/org/jboss/ws/common/deployment/DefaultJMSEndpoint.java 2014-06-12 16:04:00 UTC (rev 18728)
@@ -33,11 +33,10 @@
*/
public class DefaultJMSEndpoint extends AbstractDefaultEndpoint implements JMSEndpoint
{
+ private volatile String targetDestination;
+ private volatile String replyDestination;
+ private volatile URI requestURI;
- private String targetDestination;
- private String replyDestination;
- private URI requestURI;
-
DefaultJMSEndpoint(String targetBean)
{
super(targetBean);
Modified: common/trunk/src/main/java/org/jboss/ws/common/deployment/DefaultService.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/deployment/DefaultService.java 2014-06-12 16:03:46 UTC (rev 18727)
+++ common/trunk/src/main/java/org/jboss/ws/common/deployment/DefaultService.java 2014-06-12 16:04:00 UTC (rev 18728)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2014, 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.
*
@@ -27,28 +27,29 @@
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.Endpoint;
+import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
/**
- * A general service.
+ * A service collecting endpoints belonging to the same deployment.
*
- * Maintains a named set of Endpoints
- *
* @author Thomas.Diesler(a)jboss.com
+ * @author alessio.soldano(a)jboss.com
* @since 20-Apr-2007
*/
public class DefaultService extends AbstractExtensible implements Service
{
- private Deployment dep;
+ private final Deployment dep;
private final List<Endpoint> endpoints = new LinkedList<Endpoint>();
- private String contextRoot;
- private String virtualHost;
+ private volatile String contextRoot;
+ private volatile String virtualHost;
- DefaultService()
+ DefaultService(Deployment dep)
{
super(4, 4);
+ this.dep = dep;
}
public Deployment getDeployment()
@@ -56,20 +57,24 @@
return dep;
}
- public void setDeployment(Deployment dep)
- {
- this.dep = dep;
- }
-
public void addEndpoint(Endpoint endpoint)
{
endpoint.setService(this);
endpoints.add(endpoint);
}
+
+ public boolean removeEndpoint(Endpoint endpoint)
+ {
+ boolean done = endpoints.remove(endpoint);
+ if (done) {
+ endpoint.setService(null);
+ }
+ return done;
+ }
public List<Endpoint> getEndpoints()
{
- return endpoints;
+ return Collections.unmodifiableList(endpoints);
}
@Override
@@ -83,7 +88,7 @@
result.add(endpoint);
}
}
- return result;
+ return Collections.unmodifiableList(result);
}
public Endpoint getEndpointByName(String shortName)
Modified: common/trunk/src/main/java/org/jboss/ws/common/deployment/DeploymentAspectManagerImpl.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/deployment/DeploymentAspectManagerImpl.java 2014-06-12 16:03:46 UTC (rev 18727)
+++ common/trunk/src/main/java/org/jboss/ws/common/deployment/DeploymentAspectManagerImpl.java 2014-06-12 16:04:00 UTC (rev 18728)
@@ -32,7 +32,6 @@
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.DeploymentAspect;
import org.jboss.wsf.spi.deployment.DeploymentAspectManager;
-import org.jboss.wsf.spi.deployment.DeploymentState;
import org.jboss.wsf.spi.deployment.WSFDeploymentException;
/**
@@ -143,8 +142,6 @@
throw rte;
}
}
-
- dep.setState(DeploymentState.STARTED);
}
public void undeploy(Deployment dep)
@@ -155,8 +152,6 @@
DeploymentAspect aspect = deploymentAspects.get(i - 1);
failsafeStop(aspect, dep);
}
-
- dep.setState(DeploymentState.STOPPED);
}
private void failsafeStop(DeploymentAspect aspect, Deployment dep)
Modified: common/trunk/src/main/java/org/jboss/ws/common/deployment/EndpointAddressDeploymentAspect.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/deployment/EndpointAddressDeploymentAspect.java 2014-06-12 16:03:46 UTC (rev 18727)
+++ common/trunk/src/main/java/org/jboss/ws/common/deployment/EndpointAddressDeploymentAspect.java 2014-06-12 16:04:00 UTC (rev 18728)
@@ -104,7 +104,7 @@
//Remove endpoints with duplicated address
for (Endpoint ep : deleteList)
{
- service.getEndpoints().remove(ep);
+ service.removeEndpoint(ep);
}
}
Modified: common/trunk/src/main/java/org/jboss/ws/common/deployment/ResourceResolverImpl.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/deployment/ResourceResolverImpl.java 2014-06-12 16:03:46 UTC (rev 18727)
+++ common/trunk/src/main/java/org/jboss/ws/common/deployment/ResourceResolverImpl.java 2014-06-12 16:04:00 UTC (rev 18728)
@@ -119,14 +119,10 @@
resourceURL = vfResource.toURL();
}
}
- if (resourceURL == null && deployment.getRuntimeClassLoader() != null)
+ if (resourceURL == null && deployment.getClassLoader() != null)
{
- resourceURL = deployment.getRuntimeClassLoader().getResource(resourcePath);
+ resourceURL = deployment.getClassLoader().getResource(resourcePath);
}
- if (resourceURL == null && deployment.getInitialClassLoader() != null)
- {
- resourceURL = deployment.getInitialClassLoader().getResource(resourcePath);
- }
if (resourceURL == null)
{
throw Messages.MESSAGES.cannotResolveResource(resourcePath, deployment.getSimpleName());
10 years, 6 months
JBossWS SVN: r18727 - spi/trunk/src/main/java/org/jboss/wsf/spi/deployment.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2014-06-12 12:03:46 -0400 (Thu, 12 Jun 2014)
New Revision: 18727
Removed:
spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/DeploymentState.java
Modified:
spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/ArchiveDeployment.java
spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/Deployment.java
spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/DeploymentModelFactory.java
spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/Endpoint.java
spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/Service.java
Log:
[JBWS-3793] More cleanup
Modified: spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/ArchiveDeployment.java
===================================================================
--- spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/ArchiveDeployment.java 2014-06-11 15:57:09 UTC (rev 18726)
+++ spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/ArchiveDeployment.java 2014-06-12 16:03:46 UTC (rev 18727)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2014, 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.
*
@@ -24,10 +24,8 @@
import java.util.List;
/**
- * A general web service deployment dep.
+ * A general web service deployment.
*
- * It has no notion of J2EE deployment packages.
- *
* @author Thomas.Diesler(a)jboss.com
* @since 20-Apr-2007
*/
@@ -36,23 +34,17 @@
/** Get the optional parent of this deployment */
ArchiveDeployment getParent();
- /** Set the optional parent for this deployment */
- void setParent (ArchiveDeployment parent);
-
/** Get the root file for this deployment */
UnifiedVirtualFile getRootFile();
- /** Set the root file for this deployment */
- void setRootFile(UnifiedVirtualFile root);
-
/** The concatenated names including all parents. */
String getCanonicalName();
/** Get additional metadata files attached to the deployment **/
List<UnifiedVirtualFile> getMetadataFiles();
- /** Set additional metadata files for this deployment **/
- void setMetadataFiles(List<UnifiedVirtualFile> metadataFiles);
+ /** Add additional metadata file to the deployment **/
+ void addMetadataFile(UnifiedVirtualFile file);
/** Get the resource resolver to be used to access resources from this archive */
ResourceResolver getResourceResolver();
Modified: spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/Deployment.java
===================================================================
--- spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/Deployment.java 2014-06-11 15:57:09 UTC (rev 18726)
+++ spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/Deployment.java 2014-06-12 16:03:46 UTC (rev 18727)
@@ -22,10 +22,8 @@
package org.jboss.wsf.spi.deployment;
/**
- * A general web service deployment dep.
+ * A general web service deployment.
*
- * It has no notion of J2EE deployment packages.
- *
* @author Thomas.Diesler(a)jboss.com
*/
public interface Deployment extends Extensible
@@ -33,30 +31,9 @@
/** Get the identifier for this deployment */
String getSimpleName();
- /** Set the identifier for this deployment */
- void setSimpleName(String name);
-
/** Get the class loader for this deployment */
- ClassLoader getInitialClassLoader();
+ ClassLoader getClassLoader();
- /** Set the class loader for this deployment */
- void setInitialClassLoader(ClassLoader loader);
-
- /** Get the runtime class loader for this deployment */
- ClassLoader getRuntimeClassLoader();
-
- /** Set the runtime class loader for this deployment */
- void setRuntimeClassLoader(ClassLoader loader);
-
- /** Get the current deployment state */
- DeploymentState getState();
-
- /** Set the current deployment state */
- void setState(DeploymentState type);
-
/** Get the service associated with this deployment */
Service getService();
-
- /** Set the service associated with this deployment */
- void setService(Service service);
}
Modified: spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/DeploymentModelFactory.java
===================================================================
--- spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/DeploymentModelFactory.java 2014-06-11 15:57:09 UTC (rev 18726)
+++ spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/DeploymentModelFactory.java 2014-06-12 16:03:46 UTC (rev 18727)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2014, 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,9 +28,9 @@
*/
public abstract class DeploymentModelFactory
{
- public abstract Deployment newDeployment(String simpleName, ClassLoader initialLoader);
+ public abstract Deployment newDeployment(String simpleName, ClassLoader classLoader, UnifiedVirtualFile rootFile);
- public abstract Service newService();
+ public abstract Deployment newDeployment(ArchiveDeployment parent, String simpleName, ClassLoader classLoader, UnifiedVirtualFile rootFile);
public abstract Endpoint newHttpEndpoint(String targetBean);
Deleted: spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/DeploymentState.java
===================================================================
--- spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/DeploymentState.java 2014-06-11 15:57:09 UTC (rev 18726)
+++ spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/DeploymentState.java 2014-06-12 16:03:46 UTC (rev 18727)
@@ -1,33 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2011, 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.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.jboss.wsf.spi.deployment;
-
-/**
- * WebService deployment state.
- *
- * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
- */
-public enum DeploymentState
-{
- UNDEFINED, STARTED, STOPPED
-}
\ No newline at end of file
Modified: spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/Endpoint.java
===================================================================
--- spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/Endpoint.java 2014-06-11 15:57:09 UTC (rev 18726)
+++ spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/Endpoint.java 2014-06-12 16:03:46 UTC (rev 18727)
@@ -84,7 +84,7 @@
void setTargetBeanName(String epImpl);
/** Use the deployment classloader to load the bean */
- Class getTargetBeanClass();
+ Class<?> getTargetBeanClass();
/** Set the request handler for this endpoint */
void setRequestHandler(RequestHandler handler);
Modified: spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/Service.java
===================================================================
--- spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/Service.java 2014-06-11 15:57:09 UTC (rev 18726)
+++ spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/Service.java 2014-06-12 16:03:46 UTC (rev 18727)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2014, 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.
*
@@ -24,44 +24,86 @@
import java.util.List;
/**
- * A general service deployment.
+ * A service collecting endpoints belonging to the same deployment.
*
- * Maintains a named set of EndpointDeployments
- *
* @author Thomas.Diesler(a)jboss.com
+ * @author alessio.soldano(a)jboss.com
* @since 20-Apr-2007
*/
public interface Service extends Extensible
{
- /** Get the deployment this service belongs to */
+ /**
+ * Get the deployment this service belongs to
+ *
+ * @return the deployment this service belongs to
+ */
Deployment getDeployment();
- /** Set the deployment this service belongs to */
- void setDeployment(Deployment dep);
-
- /** Add an endpoint to the service */
+ /**
+ * Add an endpoint to the service
+ *
+ * @param endpoint the endpoint to be added
+ */
void addEndpoint(Endpoint endpoint);
- /** Get the list of endpoints */
+ /**
+ * Remove an endpoint from the service, returns true if successfull
+ *
+ * @param endpoint the endpoint to remove
+ * @return true if the endpoint was actually removed, false otherwise
+ */
+ boolean removeEndpoint(Endpoint endpoint);
+
+ /**
+ * Get the list of endpoints
+ *
+ * @return a copy of the list of endpoints
+ */
List<Endpoint> getEndpoints();
- /** Get the list of endpoints */
+ /**
+ * Get the list of endpoints
+ *
+ * @param filter a filter for selecting endpoints
+ * @return a list of selected endpoints
+ */
List<Endpoint> getEndpoints(EndpointTypeFilter filter);
- /** Get an endpoint by name */
+ /**
+ * Get an endpoint by name
+ *
+ * @param simpleName the name of the endpoint to get
+ * @return the selected endpoint
+ */
Endpoint getEndpointByName(String simpleName);
- /** Get the context root for this service */
+ /**
+ * Get the context root for this service
+ *
+ * @return the context root for this service
+ */
String getContextRoot();
- /** Set the context root for this service */
+ /**
+ * Set the context root for this service
+ *
+ * @param contextRoot the context root for this service
+ */
void setContextRoot(String contextRoot);
- /** Get the virtual host for this service */
+ /**
+ * Get the virtual host for this service
+ *
+ * @return the virtual host for this service
+ */
String getVirtualHost();
- /** Set the virtual host for this service */
+ /**
+ * Set the virtual host for this service
+ *
+ * @param virtualHost the virtual host for this service
+ */
void setVirtualHost(String virtualHost);
}
10 years, 6 months
JBossWS SVN: r18726 - in stack/cxf/branches/rsearls/modules/server/src/main/java/org/jboss/wsf/stack/cxf: interceptor and 1 other directories.
by jbossws-commits@lists.jboss.org
Author: rsearls
Date: 2014-06-11 11:57:09 -0400 (Wed, 11 Jun 2014)
New Revision: 18726
Modified:
stack/cxf/branches/rsearls/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/EndpointImpl.java
stack/cxf/branches/rsearls/modules/server/src/main/java/org/jboss/wsf/stack/cxf/interceptor/WSDLSoapAddressRewriteInterceptor.java
stack/cxf/branches/rsearls/modules/server/src/main/java/org/jboss/wsf/stack/cxf/interceptor/util/WSDLSoapAddressRewriteUtils.java
Log:
revised code in accordance with CXF-5792 patch integration
Modified: stack/cxf/branches/rsearls/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/EndpointImpl.java
===================================================================
--- stack/cxf/branches/rsearls/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/EndpointImpl.java 2014-06-09 12:19:56 UTC (rev 18725)
+++ stack/cxf/branches/rsearls/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/EndpointImpl.java 2014-06-11 15:57:09 UTC (rev 18726)
@@ -33,7 +33,6 @@
import org.apache.cxf.Bus;
import org.apache.cxf.configuration.Configurer;
import org.apache.cxf.endpoint.Endpoint;
-import org.apache.cxf.frontend.WSDLGetInterceptor;
import org.apache.cxf.frontend.WSDLGetUtils;
import org.apache.cxf.interceptor.Interceptor;
import org.apache.cxf.jaxws.support.JaxWsImplementorInfo;
@@ -91,21 +90,13 @@
}
/**
- * Replaces the WSDLGetInInterceptor with a custom interceptor that also does proper soap:address rewrite
+ * Add interceptor that enables the desired soap:address rewrite
*/
private void replaceWSDLGetInterceptor(){
if (SoapAddressRewriteHelper.isPathRewriteRequired(getServerConfig())) {
- for (Endpoint ep : getService().getEndpoints().values()) {
- final List<Interceptor<? extends Message>> inList = ep.getInInterceptors();
- for (Interceptor<? extends Message> in : inList) {
- if (in instanceof WSDLGetInterceptor) {
- int index = inList.indexOf(in);
- if (index > -1) {
- inList.remove(index);
- inList.add(index, WSDLSoapAddressRewriteInterceptor.INSTANCE);
- }
- }
- }
+ List<Interceptor<? extends Message>> inInterceptors = getInInterceptors();
+ if(!inInterceptors.contains(WSDLSoapAddressRewriteInterceptor.INSTANCE)){
+ inInterceptors.add(WSDLSoapAddressRewriteInterceptor.INSTANCE);
}
}
}
@@ -150,8 +141,7 @@
/**
* Publish the contract to a file using the configured wsdl publisher
- *
- * @param endpoint
+ *
*/
protected void publishContractToFilesystem()
{
@@ -245,4 +235,5 @@
}
return AccessController.doPrivileged(AbstractServerConfig.GET_SERVER_INTEGRATION_SERVER_CONFIG);
}
+
}
Modified: stack/cxf/branches/rsearls/modules/server/src/main/java/org/jboss/wsf/stack/cxf/interceptor/WSDLSoapAddressRewriteInterceptor.java
===================================================================
--- stack/cxf/branches/rsearls/modules/server/src/main/java/org/jboss/wsf/stack/cxf/interceptor/WSDLSoapAddressRewriteInterceptor.java 2014-06-09 12:19:56 UTC (rev 18725)
+++ stack/cxf/branches/rsearls/modules/server/src/main/java/org/jboss/wsf/stack/cxf/interceptor/WSDLSoapAddressRewriteInterceptor.java 2014-06-11 15:57:09 UTC (rev 18726)
@@ -21,123 +21,31 @@
*/
package org.jboss.wsf.stack.cxf.interceptor;
-import org.apache.cxf.binding.soap.interceptor.EndpointSelectionInterceptor;
-import org.apache.cxf.common.util.StringUtils;
-import org.apache.cxf.common.util.UrlUtils;
-import org.apache.cxf.endpoint.Endpoint;
-import org.apache.cxf.frontend.WSDLGetInterceptor;
-import org.apache.cxf.frontend.WSDLGetOutInterceptor;
-import org.apache.cxf.interceptor.*;
+import org.apache.cxf.frontend.WSDLGetUtils;
+import org.apache.cxf.interceptor.Fault;
import org.apache.cxf.message.Message;
-import org.apache.cxf.message.MessageImpl;
import org.apache.cxf.phase.AbstractPhaseInterceptor;
import org.apache.cxf.phase.Phase;
-import org.apache.cxf.service.model.EndpointInfo;
-import org.apache.cxf.transport.common.gzip.GZIPOutInterceptor;
import org.jboss.wsf.stack.cxf.interceptor.util.WSDLSoapAddressRewriteUtils;
-import org.w3c.dom.Document;
-import java.util.Iterator;
-import java.util.Map;
-
/**
- * This is a customization of org.apache.cxf.frontend.WSDLGetInterceptor. It
- * enables the handling of rewriting the path of a URL.
- *
+ * This inInterceptor registers a custom WSDLGetUtils which will preform the desired
+ * soap:address rewrite
+ *
* @author rsearls(a)redhat.com
* @since 19-May-2014
*/
public class WSDLSoapAddressRewriteInterceptor extends AbstractPhaseInterceptor<Message> {
public static final WSDLSoapAddressRewriteInterceptor INSTANCE =
new WSDLSoapAddressRewriteInterceptor();
- private static final String TRANSFORM_SKIP = "transform.skip";
- private Interceptor<Message> wsdlGetOutInterceptor = WSDLGetOutInterceptor.INSTANCE;
public WSDLSoapAddressRewriteInterceptor() {
- super(Phase.READ);
- getAfter().add(EndpointSelectionInterceptor.class.getName());
+ // this must run before WSDLGetInterceptor which is in Phase.READ
+ super(Phase.POST_STREAM);
}
- public WSDLSoapAddressRewriteInterceptor(Interceptor<Message> outInterceptor) {
- this();
- // Let people override the wsdlGetOutInterceptor
- wsdlGetOutInterceptor = outInterceptor;
- }
-
public void handleMessage(Message message) throws Fault {
- String method = (String)message.get(Message.HTTP_REQUEST_METHOD);
- String query = (String)message.get(Message.QUERY_STRING);
-
- if (!"GET".equals(method) || StringUtils.isEmpty(query)) {
- return;
- }
-
- String baseUri = (String)message.get(Message.REQUEST_URL);
- String ctx = (String)message.get(Message.PATH_INFO);
-
- Map<String, String> map = UrlUtils.parseQueryString(query);
- if (isRecognizedQuery(map, baseUri, ctx, message.getExchange().getEndpoint().getEndpointInfo())) {
- Document doc = getDocument(message, baseUri, map, ctx);
-
- Endpoint e = message.getExchange().get(Endpoint.class);
- Message mout = new MessageImpl();
- mout.setExchange(message.getExchange());
- mout = e.getBinding().createMessage(mout);
- mout.setInterceptorChain(OutgoingChainInterceptor.getOutInterceptorChain(message.getExchange()));
- message.getExchange().setOutMessage(mout);
-
- mout.put(WSDLGetInterceptor.DOCUMENT_HOLDER, doc);
- mout.put(Message.CONTENT_TYPE, "text/xml");
-
- // just remove the interceptor which should not be used
- cleanUpOutInterceptors(mout);
-
- // notice this is being added after the purge above, don't swap the order!
- mout.getInterceptorChain().add(wsdlGetOutInterceptor);
-
- message.getExchange().put(TRANSFORM_SKIP, Boolean.TRUE);
- // skip the service executor and goto the end of the chain.
- message.getInterceptorChain().doInterceptStartingAt(
- message,
- OutgoingChainInterceptor.class.getName());
- }
+ message.setContextualProperty(WSDLGetUtils.class.getName(), new WSDLSoapAddressRewriteUtils());
}
- protected void cleanUpOutInterceptors(Message outMessage) {
- // TODO - how can I improve this to provide a specific interceptor chain that just has the
- // stax, gzip and message sender components, while also ensuring that GZIP is only provided
- // if its already configured for the endpoint.
- Iterator<Interceptor<? extends Message>> iterator = outMessage.getInterceptorChain().iterator();
- while (iterator.hasNext()) {
- Interceptor<? extends Message> inInterceptor = iterator.next();
- if (!inInterceptor.getClass().equals(StaxOutInterceptor.class)
- && !inInterceptor.getClass().equals(GZIPOutInterceptor.class)
- && !inInterceptor.getClass().equals(MessageSenderInterceptor.class)) {
- outMessage.getInterceptorChain().remove(inInterceptor);
- }
- }
-
- }
-
- private Document getDocument(Message message, String base, Map<String, String> params, String ctxUri) {
- // cannot have two wsdl's being generated for the same endpoint at the same
- // time as the addresses may get mixed up
- // For WSDL's the WSDLWriter does not share any state between documents.
- // For XSD's, the WSDLSoapAddressRewriteUtils makes a copy of any XSD schema documents before updating
- // any addresses and returning them, so for both WSDL and XSD this is the only part that needs
- // to be synchronized.
- synchronized (message.getExchange().getEndpoint()) {
- return new WSDLSoapAddressRewriteUtils().getDocument(message, base, params, ctxUri,
- message.getExchange().getEndpoint().getEndpointInfo());
- }
- }
-
- private boolean isRecognizedQuery(Map<String, String> map, String baseUri, String ctx,
- EndpointInfo endpointInfo) {
- if (map.containsKey("wsdl") || map.containsKey("xsd")) {
- return true;
- }
- return false;
- }
-
}
Modified: stack/cxf/branches/rsearls/modules/server/src/main/java/org/jboss/wsf/stack/cxf/interceptor/util/WSDLSoapAddressRewriteUtils.java
===================================================================
--- stack/cxf/branches/rsearls/modules/server/src/main/java/org/jboss/wsf/stack/cxf/interceptor/util/WSDLSoapAddressRewriteUtils.java 2014-06-09 12:19:56 UTC (rev 18725)
+++ stack/cxf/branches/rsearls/modules/server/src/main/java/org/jboss/wsf/stack/cxf/interceptor/util/WSDLSoapAddressRewriteUtils.java 2014-06-11 15:57:09 UTC (rev 18726)
@@ -73,8 +73,27 @@
}
- @Override
- public Document getDocument(Message message,
+ @Override
+ public String getPublishableEndpointUrl(Definition def, String epurl,
+ EndpointInfo endpointInfo){
+
+ if (endpointInfo.getProperty(PUBLISHED_ENDPOINT_URL) != null) {
+ epurl = String.valueOf(endpointInfo.getProperty(PUBLISHED_ENDPOINT_URL));
+ updatePublishedEndpointUrl(epurl, def, endpointInfo.getName());
+ } else {
+ // When using replacement path, must set replacement path in the active url.
+ final ServerConfig sc = getServerConfig();
+ if (SoapAddressRewriteHelper.isPathRewriteRequired(sc)
+ && endpointInfo.getAddress().contains(ServerConfig.UNDEFINED_HOSTNAME)) {
+ epurl = SoapAddressRewriteHelper.getRewrittenPublishedEndpointUrl(epurl, sc);
+ updatePublishedEndpointUrl(epurl, def, endpointInfo.getName());
+ }
+ }
+ return epurl;
+ }
+
+ //@Override
+ public Document XXgetDocument(Message message,
String base,
Map<String, String> params,
String ctxUri,
@@ -133,11 +152,12 @@
Definition def = builder.build(new HashMap<String, SchemaInfo>());
mp.put("", def);
- updateDefinition(bus, def, mp, smp, base, endpointInfo, "");
+ updateDefinition(bus, def, mp, smp, base, "");
}
Document doc;
+ //- xsd, mp, wsdl, bus, base, endpointInfo
if (xsd == null) {
Definition def = mp.get(wsdl);
if (def == null) {
@@ -178,6 +198,7 @@
doc = wsdlWriter.getDocument(def);
}
} else {
+ //-- xsd, smp, bus, base, wsdl,
SchemaReference si = smp.get(xsd);
if (si == null) {
String xsd2 = resolveWithCatalogs(OASISCatalogManager.getCatalogManager(bus),
10 years, 6 months
JBossWS SVN: r18725 - stack/cxf/trunk/modules/client/src/main/resources/META-INF.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2014-06-09 08:19:56 -0400 (Mon, 09 Jun 2014)
New Revision: 18725
Removed:
stack/cxf/trunk/modules/client/src/main/resources/META-INF/bus-extensions.xml
Log:
[JBWS-3686] Removing file not needed
Deleted: stack/cxf/trunk/modules/client/src/main/resources/META-INF/bus-extensions.xml
===================================================================
--- stack/cxf/trunk/modules/client/src/main/resources/META-INF/bus-extensions.xml 2014-06-09 09:40:41 UTC (rev 18724)
+++ stack/cxf/trunk/modules/client/src/main/resources/META-INF/bus-extensions.xml 2014-06-09 12:19:56 UTC (rev 18725)
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
--->
-<extensions xmlns="http://cxf.apache.org/bus/extension">
- <extension class="org.apache.cxf.endpoint.ServerLifeCycleManagerImpl" interface="org.apache.cxf.endpoint.ServerLifeCycleManager" />
- <extension class="org.apache.cxf.endpoint.ClientLifeCycleManagerImpl" interface="org.apache.cxf.endpoint.ClientLifeCycleManager" />
-</extensions>
-
10 years, 6 months
JBossWS SVN: r18724 - stack/cxf/trunk/modules/dist/src/main/scripts.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2014-06-09 05:40:41 -0400 (Mon, 09 Jun 2014)
New Revision: 18724
Modified:
stack/cxf/trunk/modules/dist/src/main/scripts/assembly-deploy-artifacts.xml
Log:
[JBWS-3799] Fixing bin dist
Modified: stack/cxf/trunk/modules/dist/src/main/scripts/assembly-deploy-artifacts.xml
===================================================================
--- stack/cxf/trunk/modules/dist/src/main/scripts/assembly-deploy-artifacts.xml 2014-06-06 13:26:58 UTC (rev 18723)
+++ stack/cxf/trunk/modules/dist/src/main/scripts/assembly-deploy-artifacts.xml 2014-06-09 09:40:41 UTC (rev 18724)
@@ -41,6 +41,7 @@
<include>org.apache.cxf.services.sts:cxf-services-sts-core:jar</include>
<include>org.apache.cxf.services.ws-discovery:cxf-services-ws-discovery-api:jar</include>
<include>org.apache.cxf.xjcplugins:cxf-*</include>
+ <include>com.sun.xml.bind:jaxb-core:jar</include>
<include>com.sun.xml.bind:jaxb-impl:jar</include>
<include>com.sun.xml.bind:jaxb-xjc:jar</include>
<include>org.jboss:jandex:jar</include>
10 years, 6 months