public POJOWebServiceContainerFactoryGBean(PortInfo portInfo,
String endpointClassName,
ClassLoader classLoader,
Map componentContext,
Kernel kernel,
TransactionManager transactionManager,
URL configurationBaseUrl,
AnnotationHolder holder,
String contextRoot) throws ClassNotFoundException, IllegalAccessException, InstantiationException {
Context context = null;
if (componentContext != null) {
// The name should match WebServiceContextAnnotationHelper.RELATIVE_JNDI_NAME
componentContext.put("env/WebServiceContext", new WebServiceContextReference());
GeronimoUserTransaction userTransaction = new GeronimoUserTransaction(transactionManager);
try {
context = EnterpriseNamingContext.createEnterpriseNamingContext(componentContext,
userTransaction,
kernel,
classLoader);
} catch (NamingException e) {
LOG.warn("Failed to create naming context", e);
}
}
this.bus = CXFWebServiceContainer.getBus();
this.configurationBaseUrl = configurationBaseUrl;
this.servletClass = classLoader.loadClass(endpointClassName);
this.bus.setExtension(new ServerJNDIResolver(context), JNDIResolver.class);
this.bus.setExtension(portInfo, PortInfo.class);
this.bus.setExtension(context, Context.class);
this.bus.setExtension(holder, AnnotationHolder.class);
URL catalog = JAXWSUtils.getOASISCatalogURL(this.configurationBaseUrl,
classLoader,
JAXWSUtils.DEFAULT_CATALOG_WEB);
if (catalog != null) {
CXFCatalogUtils.loadOASISCatalog(this.bus, catalog);
}
}
|