use of org.jboss.wsf.stack.cxf.resolver.JBossWSResourceResolver in project jbossws-cxf by jbossws.
the class BusDeploymentAspect method startDeploymentBus.
private void startDeploymentBus(final Deployment dep) {
BusFactory.setThreadDefaultBus(null);
ClassLoader origClassLoader = SecurityActions.getContextClassLoader();
try {
final ArchiveDeployment aDep = (ArchiveDeployment) dep;
final ResourceResolver deploymentResolver = aDep.getResourceResolver();
final org.apache.cxf.resource.ResourceResolver resolver = new JBossWSResourceResolver(deploymentResolver);
// set the runtime classloader (pointing to the deployment unit) to allow CXF accessing to the classes;
// use origClassLoader (which on AS7 is set to ASIL aggregation module's classloader by TCCLDeploymentProcessor) as
// parent to make sure user provided libs in the deployment do no mess up the WS endpoint's deploy if they duplicates
// libraries already available on the application server modules.
SecurityActions.setContextClassLoader(new DelegateClassLoader(dep.getClassLoader(), origClassLoader));
DDBeans metadata = dep.getAttachment(DDBeans.class);
BusHolder holder = new BusHolder(metadata);
Configurer configurer = holder.createServerConfigurer(dep.getAttachment(BindingCustomization.class), new WSDLFilePublisher(aDep), aDep);
holder.configure(resolver, configurer, dep.getAttachment(JBossWebservicesMetaData.class), dep);
dep.addAttachment(BusHolder.class, holder);
} finally {
BusFactory.setThreadDefaultBus(null);
SecurityActions.setContextClassLoader(origClassLoader);
}
}
Aggregations