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);
}
}
Aggregations