use of org.jboss.wsf.stack.cxf.configuration.BusHolder in project jbossws-cxf by jbossws.
the class BusHolderLifeCycleTestCase method testBusShutdown.
@Test
public void testBusShutdown() {
simpleShutdownTest(new BusHolder(new DDBeans()));
shutdownTestWithInnerShutdown(new BusHolder(new DDBeans()));
shutdownTestWithNoShutdown(new BusHolder(new DDBeans()));
}
use of org.jboss.wsf.stack.cxf.configuration.BusHolder in project jbossws-cxf by jbossws.
the class CXFServletExt method updateAvailableBusWithServletInfo.
private void updateAvailableBusWithServletInfo(ServletConfig servletConfig) {
BusHolder holder = endpoint.getService().getDeployment().getAttachment(BusHolder.class);
// set the bus from deployment into the CXF servlet and assign it to the current thread (do not touch the default bus!)
bus = holder.getBus();
BusFactory.setThreadDefaultBus(bus);
// update the resource manager adding the ServletContextResourceResolver that was to be added by CXF servlet
ResourceManager resourceManager = bus.getExtension(ResourceManager.class);
resourceManager.addResourceResolver(new ServletContextResourceResolver(servletConfig.getServletContext()));
}
use of org.jboss.wsf.stack.cxf.configuration.BusHolder 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);
}
}
use of org.jboss.wsf.stack.cxf.configuration.BusHolder in project jbossws-cxf by jbossws.
the class BusDeploymentAspect method stop.
@Override
public void stop(final Deployment dep) {
final BusHolder holder = dep.removeAttachment(BusHolder.class);
if (holder != null) {
holder.close();
WSDLFilePublisher wsdlFilePublisher = dep.getAttachment(WSDLFilePublisher.class);
if (wsdlFilePublisher != null) {
wsdlFilePublisher.unpublishWsdlFiles();
}
}
}
Aggregations