use of org.apache.cxf.jaxws.interceptors.HolderOutInterceptor in project cxf by apache.
the class JaxWsProxyFactoryBean method create.
/**
* Creates a JAX-WS proxy that can be used to make remote invocations.
*
* @return the proxy. You must cast the returned object to the approriate class
* before making remote calls
*/
@Override
public synchronized Object create() {
ClassLoaderHolder orig = null;
try {
if (getBus() != null) {
ClassLoader loader = getBus().getExtension(ClassLoader.class);
if (loader != null) {
orig = ClassLoaderUtils.setThreadContextClassloader(loader);
}
}
Object obj = super.create();
Service service = getServiceFactory().getService();
if (needWrapperClassInterceptor(service.getServiceInfos().get(0))) {
List<Interceptor<? extends Message>> in = super.getInInterceptors();
List<Interceptor<? extends Message>> out = super.getOutInterceptors();
in.add(new WrapperClassInInterceptor());
in.add(new HolderInInterceptor());
out.add(new WrapperClassOutInterceptor());
out.add(new HolderOutInterceptor());
}
return obj;
} finally {
if (orig != null) {
orig.reset();
}
}
}
Aggregations