use of org.jboss.wsf.spi.SPIProvider in project jbossws-cxf by jbossws.
the class BindingCustomizationTestCase method testCustomizationWriteAccess.
@Test
@RunAsClient
@SuppressWarnings("unchecked")
public void testCustomizationWriteAccess() throws Exception {
SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
DeploymentModelFactory deploymentModelFactory = spiProvider.getSPI(DeploymentModelFactory.class);
Endpoint endpoint = deploymentModelFactory.newHttpEndpoint(null);
BindingCustomization jaxbCustomization = new JAXBBindingCustomization();
jaxbCustomization.put("com.sun.xml.bind.defaultNamespaceRemap", "http://org.jboss.bindingCustomization");
endpoint.addAttachment(BindingCustomization.class, jaxbCustomization);
// a started endpoint should deny customizations
try {
endpoint.setState(EndpointState.STARTED);
endpoint.addAttachment(BindingCustomization.class, jaxbCustomization);
fail("It should not be possible to change bindinig customizations on a started endpoint");
} catch (Exception e) {
// all fine, this should happen
}
}
use of org.jboss.wsf.spi.SPIProvider in project jbossws-cxf by jbossws.
the class BindingCustomizationTestCase method testCustomizationReadAccess.
@Test
@RunAsClient
@SuppressWarnings("unchecked")
public void testCustomizationReadAccess() throws Exception {
SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
DeploymentModelFactory deploymentModelFactory = spiProvider.getSPI(DeploymentModelFactory.class);
Endpoint endpoint = deploymentModelFactory.newHttpEndpoint(null);
BindingCustomization jaxbCustomization = new JAXBBindingCustomization();
jaxbCustomization.put("com.sun.xml.bind.defaultNamespaceRemap", "http://org.jboss.bindingCustomization");
endpoint.addAttachment(BindingCustomization.class, jaxbCustomization);
endpoint.setState(EndpointState.STARTED);
// read a single customization
BindingCustomization knownCustomization = endpoint.getAttachment(BindingCustomization.class);
assertNotNull(knownCustomization);
// however the iteratoion should be unmodifiable
try {
endpoint.addAttachment(BindingCustomization.class, jaxbCustomization);
fail("Started Endpoints should only expose read acccess to their binding customizations");
} catch (Exception e) {
// all fine, we'd expect this
}
}
use of org.jboss.wsf.spi.SPIProvider in project jbossws-cxf by jbossws.
the class SupportServlet method getDataDir.
private File getDataDir() {
if (dataDir == null) {
ClassLoader loader = ClassLoaderProvider.getDefaultProvider().getServerIntegrationClassLoader();
SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
ServerConfig serverConfig = spiProvider.getSPI(ServerConfigFactory.class, loader).getServerConfig();
dataDir = serverConfig.getServerDataDir();
}
return dataDir;
}
use of org.jboss.wsf.spi.SPIProvider in project jbossws-cxf by jbossws.
the class TestUtils method getServerConfig.
private static ServerConfig getServerConfig() {
final ClassLoader cl = ClassLoaderProvider.getDefaultProvider().getServerIntegrationClassLoader();
SPIProvider spiProvider = SPIProviderResolver.getInstance(cl).getProvider();
return spiProvider.getSPI(ServerConfigFactory.class, cl).getServerConfig();
}
use of org.jboss.wsf.spi.SPIProvider in project jbossws-cxf by jbossws.
the class Helper method getServerConfig.
private static ServerConfig getServerConfig() {
final ClassLoader cl = ClassLoaderProvider.getDefaultProvider().getServerIntegrationClassLoader();
SPIProvider spiProvider = SPIProviderResolver.getInstance(cl).getProvider();
return spiProvider.getSPI(ServerConfigFactory.class, cl).getServerConfig();
}
Aggregations