Author: alessio.soldano(a)jboss.com
Date: 2013-07-16 10:17:41 -0400 (Tue, 16 Jul 2013)
New Revision: 17789
Modified:
container/jboss71/branches/jbossws-jboss712/server-integration/src/main/java/org/jboss/as/webservices/publish/EndpointPublisherImpl.java
Log:
[JBWS-3659] Removing JBWS-3441 hack and setting InvocationHandler using an additional DA
Modified:
container/jboss71/branches/jbossws-jboss712/server-integration/src/main/java/org/jboss/as/webservices/publish/EndpointPublisherImpl.java
===================================================================
---
container/jboss71/branches/jbossws-jboss712/server-integration/src/main/java/org/jboss/as/webservices/publish/EndpointPublisherImpl.java 2013-07-16
14:13:42 UTC (rev 17788)
+++
container/jboss71/branches/jbossws-jboss712/server-integration/src/main/java/org/jboss/as/webservices/publish/EndpointPublisherImpl.java 2013-07-16
14:17:41 UTC (rev 17789)
@@ -52,6 +52,9 @@
import org.jboss.metadata.web.spec.ServletMappingMetaData;
import org.jboss.msc.service.ServiceTarget;
import org.jboss.ws.common.deployment.DeploymentAspectManagerImpl;
+import org.jboss.ws.common.deployment.EndpointHandlerDeploymentAspect;
+import org.jboss.ws.common.integration.AbstractDeploymentAspect;
+import org.jboss.ws.common.invocation.InvocationHandlerJAXWS;
import org.jboss.wsf.spi.classloading.ClassLoaderProvider;
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.DeploymentAspect;
@@ -73,6 +76,7 @@
private Host host;
private boolean runningInService = false;
+ private static List<DeploymentAspect> publisherDepAspects = null;
private static List<DeploymentAspect> depAspects = null;
public EndpointPublisherImpl(Host host) {
@@ -241,28 +245,64 @@
}
private List<DeploymentAspect> getDeploymentAspects() {
- return runningInService ? DeploymentAspectsProvider.getSortedDeploymentAspects()
: getPublisherDeploymentAspects();
+ return runningInService ? getReplacedDeploymentAspects() :
getPublisherDeploymentAspects();
}
- private static synchronized List<DeploymentAspect>
getPublisherDeploymentAspects() {
+ private static synchronized List<DeploymentAspect>
getReplacedDeploymentAspects() {
if (depAspects == null) {
depAspects = new LinkedList<DeploymentAspect>();
- final List<DeploymentAspect> serverAspects =
DeploymentAspectsProvider.getSortedDeploymentAspects();
+ List<DeploymentAspect> serverAspects =
DeploymentAspectsProvider.getSortedDeploymentAspects();
+ for (DeploymentAspect aspect : serverAspects) {
+ if(aspect instanceof EndpointHandlerDeploymentAspect) {
+ depAspects.add(aspect);
+ //add another aspect to set InvocationHandlerJAXWS to each endpoint
+ ForceJAXWSInvocationHandlerDeploymentAspect handlerAspect = new
ForceJAXWSInvocationHandlerDeploymentAspect();
+ handlerAspect.setForJaxRpc(false);
+ depAspects.add(handlerAspect);
+ } else {
+ depAspects.add(aspect);
+ }
+ }
+ }
+ return depAspects;
+ }
+
+ private static synchronized List<DeploymentAspect>
getPublisherDeploymentAspects() {
+ if (publisherDepAspects == null) {
+ publisherDepAspects = new LinkedList<DeploymentAspect>();
//copy to replace the EndpointServiceDeploymentAspect
+ List<DeploymentAspect> serverAspects =
DeploymentAspectsProvider.getSortedDeploymentAspects();
for (DeploymentAspect aspect : serverAspects) {
if (aspect instanceof EndpointServiceDeploymentAspect) {
final EndpointServiceDeploymentAspect a =
(EndpointServiceDeploymentAspect)aspect;
EndpointServiceDeploymentAspect clone =
(EndpointServiceDeploymentAspect)(a.clone());
clone.setStopServices(true);
- depAspects.add(clone);
+ publisherDepAspects.add(clone);
+ } else if(aspect instanceof EndpointHandlerDeploymentAspect) {
+ publisherDepAspects.add(aspect);
+ //add another aspect to set InvocationHandlerJAXWS to each endpoint
+ ForceJAXWSInvocationHandlerDeploymentAspect handlerAspect = new
ForceJAXWSInvocationHandlerDeploymentAspect();
+ handlerAspect.setForJaxRpc(false);
+ publisherDepAspects.add(handlerAspect);
} else {
- depAspects.add(aspect);
+ publisherDepAspects.add(aspect);
}
}
}
- return depAspects;
+ return publisherDepAspects;
}
+ static class ForceJAXWSInvocationHandlerDeploymentAspect extends
AbstractDeploymentAspect {
+ public ForceJAXWSInvocationHandlerDeploymentAspect() {
+ }
+ @Override
+ public void start(final Deployment dep) {
+ for (final Endpoint ep : dep.getService().getEndpoints()) {
+ ep.setInvocationHandler(new InvocationHandlerJAXWS());
+ }
+ }
+ }
+
private static class LocalInstanceManager implements InstanceManager {
LocalInstanceManager() {
}