Search in sources :

Example 1 with ServiceDelegate

use of javax.xml.ws.spi.ServiceDelegate in project jbossws-cxf by jbossws.

the class ProviderImpl method createServiceDelegate.

@SuppressWarnings("rawtypes")
@Override
public ServiceDelegate createServiceDelegate(URL url, QName qname, Class cls) {
    final String busStrategy = ClientBusSelector.getInstance().selectStrategy();
    ClassLoader origClassLoader = getContextClassLoader();
    boolean restoreTCCL = false;
    Bus orig = null;
    try {
        restoreTCCL = checkAndFixContextClassLoader(origClassLoader);
        orig = BusFactory.getThreadDefaultBus(false);
        Bus bus = getOrCreateBus(busStrategy, origClassLoader);
        ServiceDelegate serviceDelegate = new JBossWSServiceImpl(bus, url, qname, cls);
        setDisableCacheSchema(bus);
        return serviceDelegate;
    } finally {
        restoreThreadDefaultBus(busStrategy, orig);
        if (restoreTCCL)
            setContextClassLoader(origClassLoader);
    }
}
Also used : Bus(org.apache.cxf.Bus) DelegateClassLoader(org.jboss.ws.common.utils.DelegateClassLoader) SecurityActions.setContextClassLoader(org.jboss.wsf.stack.cxf.client.SecurityActions.setContextClassLoader) SecurityActions.getContextClassLoader(org.jboss.wsf.stack.cxf.client.SecurityActions.getContextClassLoader) ServiceDelegate(javax.xml.ws.spi.ServiceDelegate)

Example 2 with ServiceDelegate

use of javax.xml.ws.spi.ServiceDelegate in project tomee by apache.

the class JaxWsProviderWrapper method createServiceDelegate.

@SuppressWarnings("unchecked")
@Override
public ServiceDelegate createServiceDelegate(final URL wsdlDocumentLocation, final QName serviceName, final Class serviceClass) {
    ServiceDelegate serviceDelegate = delegate.createServiceDelegate(wsdlDocumentLocation, serviceName, serviceClass);
    serviceDelegate = new ServiceDelegateWrapper(serviceDelegate);
    return serviceDelegate;
}
Also used : ServiceDelegate(javax.xml.ws.spi.ServiceDelegate)

Example 3 with ServiceDelegate

use of javax.xml.ws.spi.ServiceDelegate in project jbossws-cxf by jbossws.

the class ProviderImpl method createServiceDelegate.

@SuppressWarnings("rawtypes")
@Override
public ServiceDelegate createServiceDelegate(URL wsdlDocumentLocation, QName serviceName, Class serviceClass, WebServiceFeature... features) {
    // check feature types
    for (WebServiceFeature f : features) {
        final String fName = f.getClass().getName();
        if (!fName.startsWith("javax.xml.ws") && !fName.startsWith("org.jboss.ws")) {
            throw Messages.MESSAGES.unknownFeature(f.getClass().getName());
        }
    }
    final String busStrategy = ClientBusSelector.getInstance().selectStrategy(features);
    ClassLoader origClassLoader = getContextClassLoader();
    boolean restoreTCCL = false;
    Bus orig = null;
    try {
        restoreTCCL = checkAndFixContextClassLoader(origClassLoader);
        orig = BusFactory.getThreadDefaultBus(false);
        Bus bus = getOrCreateBus(busStrategy, origClassLoader);
        ServiceDelegate serviceDelegate = new JBossWSServiceImpl(bus, wsdlDocumentLocation, serviceName, serviceClass, features);
        setDisableCacheSchema(bus);
        return serviceDelegate;
    } finally {
        restoreThreadDefaultBus(busStrategy, orig);
        if (restoreTCCL)
            setContextClassLoader(origClassLoader);
    }
}
Also used : Bus(org.apache.cxf.Bus) WebServiceFeature(javax.xml.ws.WebServiceFeature) DelegateClassLoader(org.jboss.ws.common.utils.DelegateClassLoader) SecurityActions.setContextClassLoader(org.jboss.wsf.stack.cxf.client.SecurityActions.setContextClassLoader) SecurityActions.getContextClassLoader(org.jboss.wsf.stack.cxf.client.SecurityActions.getContextClassLoader) ServiceDelegate(javax.xml.ws.spi.ServiceDelegate)

Aggregations

ServiceDelegate (javax.xml.ws.spi.ServiceDelegate)3 Bus (org.apache.cxf.Bus)2 DelegateClassLoader (org.jboss.ws.common.utils.DelegateClassLoader)2 SecurityActions.getContextClassLoader (org.jboss.wsf.stack.cxf.client.SecurityActions.getContextClassLoader)2 SecurityActions.setContextClassLoader (org.jboss.wsf.stack.cxf.client.SecurityActions.setContextClassLoader)2 WebServiceFeature (javax.xml.ws.WebServiceFeature)1