Author: asoldano
Date: 2014-08-25 11:02:32 -0400 (Mon, 25 Aug 2014)
New Revision: 18864
Modified:
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ClientBusSelector.java
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFServiceObjectFactoryJAXWS.java
Log:
[JBWS-3821] Ensure WebServiceRef injection is not affected by system bus selection
strategy
Modified:
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ClientBusSelector.java
===================================================================
---
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ClientBusSelector.java 2014-08-25
12:43:15 UTC (rev 18863)
+++
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ClientBusSelector.java 2014-08-25
15:02:32 UTC (rev 18864)
@@ -102,4 +102,8 @@
}
return featureStrategy != null ? featureStrategy : sysPropStrategy;
}
+
+ public static String getDefaultStrategy() {
+ return sysPropStrategy;
+ }
}
Modified:
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFServiceObjectFactoryJAXWS.java
===================================================================
---
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFServiceObjectFactoryJAXWS.java 2014-08-25
12:43:15 UTC (rev 18863)
+++
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFServiceObjectFactoryJAXWS.java 2014-08-25
15:02:32 UTC (rev 18864)
@@ -53,7 +53,9 @@
import org.jboss.wsf.spi.deployment.UnifiedVirtualFile;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedPortComponentRefMetaData;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedServiceRefMetaData;
+import org.jboss.wsf.stack.cxf.client.ClientBusSelector;
import org.jboss.wsf.stack.cxf.client.Constants;
+import org.jboss.wsf.stack.cxf.client.UseThreadBusFeature;
import org.jboss.wsf.stack.cxf.client.configuration.JBossWSSpringBusFactory;
/**
@@ -223,7 +225,12 @@
private Service instantiateService(final UnifiedServiceRefMetaData serviceRefMD, final
Class<?> serviceClass)
throws NoSuchMethodException, InstantiationException, IllegalAccessException,
InvocationTargetException, WSFException
{
- final WebServiceFeature[] features = getFeatures(serviceRefMD);
+ final List<WebServiceFeature> featuresList = getFeatures(serviceRefMD);
+ //force THREAD_BUS strategy so that the bus created before for this specific ref is
used
+ if (ClientBusSelector.getDefaultStrategy() != Constants.THREAD_BUS_STRATEGY) {
+ featuresList.add(new UseThreadBusFeature());
+ }
+ final WebServiceFeature[] features = featuresList.size() == 0 ? null :
featuresList.toArray(new WebServiceFeature[]{});
final QName serviceQName = this.getServiceQName(serviceRefMD, serviceClass);
URL wsdlURL = this.getWsdlURL(serviceRefMD, serviceClass);
if (wsdlURL == null)
@@ -437,7 +444,7 @@
}
}
- private WebServiceFeature[] getFeatures(final UnifiedServiceRefMetaData serviceRef)
+ private List<WebServiceFeature> getFeatures(final UnifiedServiceRefMetaData
serviceRef)
{
List<WebServiceFeature> features = new
LinkedList<WebServiceFeature>();
@@ -471,8 +478,7 @@
features.add(new RespectBindingFeature(enabled));
}
- return features.size() == 0 ? null : features.toArray(new WebServiceFeature[]
- {});
+ return features;
}
private WebServiceFeature[] getFeatures(final UnifiedPortComponentRefMetaData
portComponentRefMD)
Show replies by date