JBossWS SVN: r13812 - stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2011-03-01 05:17:49 -0500 (Tue, 01 Mar 2011)
New Revision: 13812
Modified:
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ProviderImpl.java
Log:
[JBWS-3223] Forgot to override a jaxws 22 provider method
Modified: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ProviderImpl.java
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ProviderImpl.java 2011-02-28 20:30:22 UTC (rev 13811)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ProviderImpl.java 2011-03-01 10:17:49 UTC (rev 13812)
@@ -40,6 +40,7 @@
import javax.xml.ws.Endpoint;
import javax.xml.ws.EndpointReference;
import javax.xml.ws.WebServiceFeature;
+import javax.xml.ws.spi.Invoker;
import javax.xml.ws.spi.ServiceDelegate;
import org.apache.cxf.Bus;
@@ -84,14 +85,7 @@
try
{
restoreTCCL = checkAndFixContextClassLoader(origClassLoader);
- //we override this method to prevent using the default bus when the current
- //thread is not already associated to a bus. In those situations we create
- //a new bus from scratch instead and link that to the thread.
- Bus bus = BusFactory.getThreadDefaultBus(false);
- if (bus == null)
- {
- bus = BusFactory.newInstance().createBus(); //this also set thread local bus internally as it's not set yet
- }
+ setValidThreadDefaultBus();
return new DelegateEndpointImpl(super.createEndpoint(bindingId, implementor));
}
finally
@@ -110,14 +104,7 @@
try
{
restoreTCCL = checkAndFixContextClassLoader(origClassLoader);
- //we override this method to prevent using the default bus when the current
- //thread is not already associated to a bus. In those situations we create
- //a new bus from scratch instead and link that to the thread.
- Bus bus = BusFactory.getThreadDefaultBus(false);
- if (bus == null)
- {
- bus = BusFactory.newInstance().createBus(); //this also set thread local bus internally as it's not set yet
- }
+ setValidThreadDefaultBus();
return new DelegateEndpointImpl(super.createEndpoint(bindingId, implementor, features));
}
finally
@@ -126,6 +113,24 @@
setContextClassLoader(origClassLoader);
}
}
+
+ @Override
+ public Endpoint createEndpoint(String bindingId, Class<?> implementorClass,
+ Invoker invoker, WebServiceFeature ... features) {
+ ClassLoader origClassLoader = getContextClassLoader();
+ boolean restoreTCCL = false;
+ try
+ {
+ restoreTCCL = checkAndFixContextClassLoader(origClassLoader);
+ setValidThreadDefaultBus();
+ return new DelegateEndpointImpl(super.createEndpoint(bindingId, implementorClass, invoker, features));
+ }
+ finally
+ {
+ if (restoreTCCL)
+ setContextClassLoader(origClassLoader);
+ }
+ }
@SuppressWarnings("rawtypes")
@Override
@@ -136,14 +141,7 @@
try
{
restoreTCCL = checkAndFixContextClassLoader(origClassLoader);
- //we override this method to prevent using the default bus when the current
- //thread is not already associated to a bus. In those situations we create
- //a new bus from scratch instead and link that to the thread.
- Bus bus = BusFactory.getThreadDefaultBus(false);
- if (bus == null)
- {
- bus = BusFactory.newInstance().createBus(); //this also set thread local bus internally as it's not set yet
- }
+ Bus bus = setValidThreadDefaultBus();
return new ServiceImpl(bus, url, qname, cls);
}
finally
@@ -163,14 +161,7 @@
try
{
restoreTCCL = checkAndFixContextClassLoader(origClassLoader);
- //we override this method to prevent using the default bus when the current
- //thread is not already associated to a bus. In those situations we create
- //a new bus from scratch instead and link that to the thread.
- Bus bus = BusFactory.getThreadDefaultBus(false);
- if (bus == null)
- {
- bus = BusFactory.newInstance().createBus(); //this also set thread local bus internally as it's not set yet
- }
+ setValidThreadDefaultBus();
return super.createServiceDelegate(wsdlDocumentLocation, serviceName, serviceClass, features);
}
finally
@@ -212,6 +203,19 @@
}
return false;
}
+
+ static Bus setValidThreadDefaultBus()
+ {
+ //we need to prevent using the default bus when the current
+ //thread is not already associated to a bus. In those situations we create
+ //a new bus from scratch instead and link that to the thread.
+ Bus bus = BusFactory.getThreadDefaultBus(false);
+ if (bus == null)
+ {
+ bus = BusFactory.newInstance().createBus(); //this also set thread local bus internally as it's not set yet
+ }
+ return bus;
+ }
/**
* Get context classloader.