use of org.jboss.wsf.stack.cxf.metadata.services.DDBeans in project jbossws-cxf by jbossws.
the class BusHolderTest method setupPropertyAndGetAlternativeSelector.
private static String setupPropertyAndGetAlternativeSelector(String alternative) {
JBossWebservicesMetaData wsmd = null;
if (alternative != null) {
Map<String, String> props = new HashMap<String, String>();
props.put(Constants.CXF_POLICY_ALTERNATIVE_SELECTOR_PROP, alternative);
wsmd = new JBossWebservicesMetaData(null, null, null, null, props, null, null);
}
BusHolder holder = new BusHolder(new DDBeans());
try {
Deployment dep = new DefaultDeploymentModelFactory().newDeployment("testDeployment", null, null);
dep.addAttachment(SOAPAddressRewriteMetadata.class, new SOAPAddressRewriteMetadata(getTestServerConfig(), null));
holder.configure(null, null, wsmd, dep);
return holder.getBus().getExtension(PolicyEngine.class).getAlternativeSelector().getClass().getName();
} finally {
holder.close();
}
}
use of org.jboss.wsf.stack.cxf.metadata.services.DDBeans in project jbossws-cxf by jbossws.
the class MetadataBuilder method build.
public DDBeans build(Deployment dep) {
final SOAPAddressRewriteMetadata sarm = dep.getAttachment(SOAPAddressRewriteMetadata.class);
Map<QName, String> serviceNameAddressMap = new HashMap<QName, String>();
Map<String, SOAPAddressWSDLParser> soapAddressWsdlParsers = new HashMap<String, SOAPAddressWSDLParser>();
DDBeans dd = new DDBeans();
for (Endpoint ep : dep.getService().getEndpoints()) {
DDEndpoint ddep = createDDEndpoint(ep.getTargetBeanClass(), (ArchiveDeployment) dep, ep);
if (ep instanceof HttpEndpoint) {
ddep.setInvoker(JBossWSInvoker.class.getName());
}
processWSDDContribution(ddep, (ArchiveDeployment) dep);
URL wsdlLocation = getWsdlLocationURL(ddep, ((ArchiveDeployment) dep).getResourceResolver());
processAddressRewrite(ddep, wsdlLocation, sarm, soapAddressWsdlParsers);
METADATA_LOGGER.addingServiceEndpointMetadata(METADATA_LOGGER.isDebugEnabled() ? ddep.toStringExtended() : ddep.toString());
dd.addEndpoint(ddep);
serviceNameAddressMap.put(ddep.getServiceName(), ddep.getAddress());
}
dep.setProperty("ServiceAddressMap", serviceNameAddressMap);
return dd;
}
use of org.jboss.wsf.stack.cxf.metadata.services.DDBeans 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.metadata.services.DDBeans 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