use of org.jboss.wsf.spi.metadata.config.SOAPAddressRewriteMetadata in project jbossws-cxf by jbossws.
the class BusHolderLifeCycleTestCase method shutdownTestWithNoShutdown.
private static void shutdownTestWithNoShutdown(BusHolder holder) {
Bus bus = holder.getBus();
TestLifeCycleListener listener = new TestLifeCycleListener();
bus.getExtension(BusLifeCycleManager.class).registerLifeCycleListener(listener);
Deployment dep = new DefaultDeploymentModelFactory().newDeployment("testDeployment", null, null);
dep.addAttachment(SOAPAddressRewriteMetadata.class, new SOAPAddressRewriteMetadata(getTestServerConfig(), null));
holder.configure(null, null, null, dep);
assertEquals("preShutdown method on listener shouldn't be called before holder is closed: number of actual calls: " + listener.getCount(), 0, listener.getCount());
holder.close();
}
use of org.jboss.wsf.spi.metadata.config.SOAPAddressRewriteMetadata in project jbossws-cxf by jbossws.
the class BusHolderLifeCycleTestCase method shutdownTestWithInnerShutdown.
private static void shutdownTestWithInnerShutdown(BusHolder holder) {
Bus bus = holder.getBus();
TestLifeCycleListener listener = new TestLifeCycleListener();
bus.getExtension(BusLifeCycleManager.class).registerLifeCycleListener(listener);
Deployment dep = new DefaultDeploymentModelFactory().newDeployment("testDeployment", null, null);
dep.addAttachment(SOAPAddressRewriteMetadata.class, new SOAPAddressRewriteMetadata(getTestServerConfig(), null));
holder.configure(null, null, null, dep);
bus.shutdown(true);
holder.close();
assertEquals("preShutdown method on listener should be called exactly once; number of actual calls: " + listener.getCount(), 1, listener.getCount());
}
use of org.jboss.wsf.spi.metadata.config.SOAPAddressRewriteMetadata in project jbossws-cxf by jbossws.
the class BusHolderLifeCycleTestCase method simpleShutdownTest.
private static void simpleShutdownTest(BusHolder holder) {
Bus bus = holder.getBus();
TestLifeCycleListener listener = new TestLifeCycleListener();
bus.getExtension(BusLifeCycleManager.class).registerLifeCycleListener(listener);
Deployment dep = new DefaultDeploymentModelFactory().newDeployment("testDeployment", null, null);
dep.addAttachment(SOAPAddressRewriteMetadata.class, new SOAPAddressRewriteMetadata(getTestServerConfig(), null));
holder.configure(null, null, null, dep);
holder.close();
assertEquals("preShutdown method on listener should be called exactly once; number of actual calls: " + listener.getCount(), 1, listener.getCount());
}
use of org.jboss.wsf.spi.metadata.config.SOAPAddressRewriteMetadata 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.spi.metadata.config.SOAPAddressRewriteMetadata in project jbossws-cxf by jbossws.
the class EndpointImpl method updateSoapAddress.
/**
* For both code-first and wsdl-first scenarios, reset the endpoint address
* so that it is written to the generated wsdl file.
*/
private void updateSoapAddress() {
final SOAPAddressRewriteMetadata metadata = getSOAPAddressRewriteMetadata();
if (metadata.isModifySOAPAddress()) {
// - code-first handling
List<ServiceInfo> sevInfos = getServer().getEndpoint().getService().getServiceInfos();
for (ServiceInfo si : sevInfos) {
Collection<EndpointInfo> epInfos = si.getEndpoints();
for (EndpointInfo ei : epInfos) {
String publishedEndpointUrl = (String) ei.getProperty(WSDLGetUtils.PUBLISHED_ENDPOINT_URL);
if (publishedEndpointUrl != null) {
ei.setAddress(publishedEndpointUrl);
} else {
// - wsdl-first handling
if (ei.getAddress().contains(ServerConfig.UNDEFINED_HOSTNAME)) {
String epurl = SoapAddressRewriteHelper.getRewrittenPublishedEndpointUrl(ei.getAddress(), metadata);
ei.setAddress(epurl);
}
}
}
}
}
}
Aggregations