use of org.apache.cxf.configuration.Configurer in project cxf by apache.
the class WSAFeatureXmlTest method testClientProxyFactory.
@Test
public void testClientProxyFactory() {
JaxWsProxyFactoryBean cf = new JaxWsProxyFactoryBean();
cf.setAddress("http://localhost:" + PORT + "/test");
cf.setServiceClass(Greeter.class);
cf.setBus(getBus());
Configurer c = getBus().getExtension(Configurer.class);
c.configureBean("client.proxyFactory", cf);
Greeter greeter = (Greeter) cf.create();
Client client = ClientProxy.getClient(greeter);
checkAddressInterceptors(client.getInInterceptors());
}
use of org.apache.cxf.configuration.Configurer in project cxf by apache.
the class ExtensionManagerImpl method loadAndRegister.
final void loadAndRegister(Extension e) {
Class<?> cls = null;
if (null != e.getInterfaceName() && !"".equals(e.getInterfaceName())) {
cls = e.loadInterface(loader);
} else {
cls = e.getClassObject(loader);
}
if (null != activated && null != cls && null != activated.get(cls)) {
return;
}
synchronized (e) {
Object obj = e.load(loader, bus);
if (obj == null) {
return;
}
if (null != activated) {
Configurer configurer = (Configurer) (activated.get(Configurer.class));
if (null != configurer) {
configurer.configureBean(obj);
}
}
// let the object know for which namespaces it has been activated
ResourceResolver namespacesResolver = null;
if (null != e.getNamespaces()) {
namespacesResolver = new SinglePropertyResolver(ACTIVATION_NAMESPACES_PROPERTY_NAME, e.getNamespaces());
resourceManager.addResourceResolver(namespacesResolver);
}
// Now we call the setActivationNamespaces method directly here
if (e.getNamespaces() != null && !e.getNamespaces().isEmpty()) {
invokeSetterActivationNSMethod(obj, e.getNamespaces());
}
ResourceInjector injector = new ResourceInjector(resourceManager);
try {
injector.inject(obj);
injector.construct(obj);
} finally {
if (null != namespacesResolver) {
resourceManager.removeResourceResolver(namespacesResolver);
}
}
if (null != activated) {
if (cls == null) {
cls = obj.getClass();
}
activated.put(cls, obj);
}
}
}
use of org.apache.cxf.configuration.Configurer in project cxf by apache.
the class SpringBusFactoryTest method testDefault.
@Test
public void testDefault() {
Bus bus = new SpringBusFactory().createBus();
assertNotNull(bus);
BindingFactoryManager bfm = bus.getExtension(BindingFactoryManager.class);
assertNotNull("No binding factory manager", bfm);
assertNotNull("No configurer", bus.getExtension(Configurer.class));
assertNotNull("No resource manager", bus.getExtension(ResourceManager.class));
assertNotNull("No destination factory manager", bus.getExtension(DestinationFactoryManager.class));
assertNotNull("No conduit initiator manager", bus.getExtension(ConduitInitiatorManager.class));
assertNotNull("No phase manager", bus.getExtension(PhaseManager.class));
assertNotNull("No workqueue manager", bus.getExtension(WorkQueueManager.class));
assertNotNull("No lifecycle manager", bus.getExtension(BusLifeCycleManager.class));
assertNotNull("No service registry", bus.getExtension(ServerRegistry.class));
try {
bfm.getBindingFactory("http://cxf.apache.org/unknown");
} catch (BusException ex) {
// expected
}
assertEquals("Unexpected interceptors", 0, bus.getInInterceptors().size());
assertEquals("Unexpected interceptors", 0, bus.getInFaultInterceptors().size());
assertEquals("Unexpected interceptors", 0, bus.getOutInterceptors().size());
assertEquals("Unexpected interceptors", 0, bus.getOutFaultInterceptors().size());
}
use of org.apache.cxf.configuration.Configurer in project cxf by apache.
the class JettyHTTPServerEngineTest method setUp.
@Before
public void setUp() throws Exception {
control = EasyMock.createNiceControl();
bus = control.createMock(Bus.class);
Configurer configurer = new ConfigurerImpl();
bus.getExtension(Configurer.class);
EasyMock.expectLastCall().andReturn(configurer).anyTimes();
InstrumentationManager iManager = control.createMock(InstrumentationManager.class);
iManager.getMBeanServer();
EasyMock.expectLastCall().andReturn(ManagementFactory.getPlatformMBeanServer()).anyTimes();
bus.getExtension(InstrumentationManager.class);
EasyMock.expectLastCall().andReturn(iManager).anyTimes();
control.replay();
factory = new JettyHTTPServerEngineFactory();
factory.setBus(bus);
}
use of org.apache.cxf.configuration.Configurer in project cxf by apache.
the class NettyHttpServerEngineTest method setUp.
@Before
public void setUp() throws Exception {
control = EasyMock.createNiceControl();
bus = control.createMock(Bus.class);
Configurer configurer = control.createMock(Configurer.class);
bus.getExtension(Configurer.class);
EasyMock.expectLastCall().andReturn(configurer).anyTimes();
control.replay();
factory = new NettyHttpServerEngineFactory();
factory.setBus(bus);
}
Aggregations