Search in sources :

Example 6 with Invoker

use of org.apache.cxf.service.invoker.Invoker in project jbossws-cxf by jbossws.

the class BusHolder method newInvokerInstance.

private static Invoker newInvokerInstance(String className, Deployment dep) {
    final ClassLoader tccl = SecurityActions.getContextClassLoader();
    try {
        SecurityActions.setContextClassLoader(null);
        @SuppressWarnings("unchecked") Class<Invoker> clazz = (Class<Invoker>) tccl.loadClass(className);
        final AnnotationsInfo ai = dep.getAttachment(AnnotationsInfo.class);
        if (ai != null && clazz.isAssignableFrom(JBossWSInvoker.class)) {
            Constructor<Invoker> constr = clazz.getConstructor(boolean.class);
            return constr.newInstance(ai.hasAnnotatedClasses(UseAsyncMethod.class.getName()));
        } else {
            return clazz.newInstance();
        }
    } catch (Exception e) {
        throw new RuntimeException(e);
    } finally {
        SecurityActions.setContextClassLoader(tccl);
    }
}
Also used : JBossWSInvoker(org.jboss.wsf.stack.cxf.JBossWSInvoker) JBossWSInvoker(org.jboss.wsf.stack.cxf.JBossWSInvoker) Invoker(org.apache.cxf.service.invoker.Invoker) AnnotationsInfo(org.jboss.wsf.spi.deployment.AnnotationsInfo) WSFException(org.jboss.wsf.spi.WSFException)

Aggregations

Invoker (org.apache.cxf.service.invoker.Invoker)6 Endpoint (org.apache.cxf.endpoint.Endpoint)4 Application (javax.ws.rs.core.Application)2 Bus (org.apache.cxf.Bus)2 ClassLoaderHolder (org.apache.cxf.common.classloader.ClassLoaderUtils.ClassLoaderHolder)2 ServerImpl (org.apache.cxf.endpoint.ServerImpl)2 RequestPreprocessor (org.apache.cxf.jaxrs.impl.RequestPreprocessor)2 ServerProviderFactory (org.apache.cxf.jaxrs.provider.ServerProviderFactory)2 ServiceConstructionException (org.apache.cxf.service.factory.ServiceConstructionException)2 FactoryInvoker (org.apache.cxf.service.invoker.FactoryInvoker)2 List (java.util.List)1 ExecutionException (java.util.concurrent.ExecutionException)1 Executor (java.util.concurrent.Executor)1 FutureTask (java.util.concurrent.FutureTask)1 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)1 FactoryType (org.apache.cxf.annotations.FactoryType)1 Exchange (org.apache.cxf.message.Exchange)1 Message (org.apache.cxf.message.Message)1 MessageContentsList (org.apache.cxf.message.MessageContentsList)1 MessageImpl (org.apache.cxf.message.MessageImpl)1