Author: asoldano
Date: 2014-09-22 11:47:53 -0400 (Mon, 22 Sep 2014)
New Revision: 18941
Modified:
common/trunk/src/main/java/org/jboss/ws/common/deployment/EndpointAddressDeploymentAspect.java
Log:
[JBWS-3805] Move metadata creation earlier in the DA chain and use it in EndpointAddressDA
too
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-09-22
14:25:57 UTC (rev 18940)
+++
common/trunk/src/main/java/org/jboss/ws/common/deployment/EndpointAddressDeploymentAspect.java 2014-09-22
15:47:53 UTC (rev 18941)
@@ -39,12 +39,14 @@
import org.jboss.wsf.spi.deployment.HttpEndpoint;
import org.jboss.wsf.spi.deployment.Service;
import org.jboss.wsf.spi.management.ServerConfig;
+import org.jboss.wsf.spi.metadata.config.SOAPAddressRewriteMetadata;
import org.jboss.wsf.spi.metadata.j2ee.EJBArchiveMetaData;
import org.jboss.wsf.spi.metadata.j2ee.EJBMetaData;
import org.jboss.wsf.spi.metadata.j2ee.EJBSecurityMetaData;
import org.jboss.wsf.spi.metadata.j2ee.JSEArchiveMetaData;
import org.jboss.wsf.spi.metadata.j2ee.JSESecurityMetaData;
import org.jboss.wsf.spi.metadata.j2ee.JSESecurityMetaData.JSEResourceCollection;
+import org.jboss.wsf.spi.metadata.webservices.JBossWebservicesMetaData;
/**
* A deployer that assigns the endpoint address.
@@ -58,15 +60,19 @@
@Override
public void start(Deployment dep)
{
+ // prepare the WSDL soap:address metadata and attach it to the deployment for later
usage
+ final SOAPAddressRewriteMetadata sarm = new
SOAPAddressRewriteMetadata(getServerConfig(),
+ dep.getAttachment(JBossWebservicesMetaData.class));
+ dep.addAttachment(SOAPAddressRewriteMetadata.class, sarm);
+
final Service service = dep.getService();
String contextRoot = service.getContextRoot();
if (contextRoot == null)
throw Messages.MESSAGES.cannotObtainContextRoot(dep.getSimpleName());
PortValue port = new PortValue((Integer)service.getProperty("port"),
null);
- ServerConfig serverConfig = getServerConfig();
- port.setServerConfig(serverConfig);
- String host = serverConfig.getWebServiceHost();
+ port.setSOAPAddressRewriteMetadata(sarm);
+ String host = sarm.getWebServiceHost();
Map<String, Endpoint> endpointsMap = new HashMap<String, Endpoint>();
List<Endpoint> deleteList = new LinkedList<Endpoint>();
for (Endpoint ep : service.getEndpoints())
@@ -175,7 +181,7 @@
}
private static class PortValue {
- private ServerConfig config;
+ private SOAPAddressRewriteMetadata sarm;
private Integer port;
private Integer securePort;
@@ -184,11 +190,11 @@
this.securePort = securePort;
}
- public void setServerConfig(ServerConfig config)
+ public void setSOAPAddressRewriteMetadata(SOAPAddressRewriteMetadata sarm)
{
this.port = null;
this.securePort = null;
- this.config = config;
+ this.sarm = sarm;
}
public Integer getValue(boolean confidential) {
@@ -197,18 +203,18 @@
public Integer getPortValue()
{
- if (this.port == null && this.config != null)
+ if (this.port == null && this.sarm != null)
{
- this.port = this.config.getWebServicePort();
+ this.port = this.sarm.getWebServicePort();
}
return this.port;
}
public Integer getSecurePortValue()
{
- if (this.securePort == null && this.config != null)
+ if (this.securePort == null && this.sarm != null)
{
- this.securePort = this.config.getWebServiceSecurePort();
+ this.securePort = this.sarm.getWebServiceSecurePort();
}
return this.securePort;
}
Show replies by date