use of org.apache.cxf.configuration.Configurer in project cxf by apache.
the class ClientProxyFactoryBean method configureObject.
private void configureObject() {
if (configured) {
return;
}
if (bus == null) {
bus = BusFactory.getThreadDefaultBus();
}
Configurer configurer = bus.getExtension(Configurer.class);
String name = getConfiguredName();
if (null != configurer && name != null) {
configurer.configureBean(name, this);
}
configured = true;
}
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 ServiceImplTest method testConfigureBean.
@Test
public // CXF-2723 :Allow configuration of JaxWsClientFactoryBean during port creation
void testConfigureBean() throws Exception {
Configurer oldConfiguer = this.getBus().getExtension(Configurer.class);
JAXWSClientFactoryCongfiguer clientConfiguer = new JAXWSClientFactoryCongfiguer();
getBus().setExtension(clientConfiguer, Configurer.class);
URL wsdl1 = getClass().getResource("/wsdl/calculator.wsdl");
ServiceImpl service = new ServiceImpl(getBus(), wsdl1, SERVICE_1, ServiceImpl.class);
service.createPort(PORT_1, null, CalculatorPortType.class);
assertTrue("The JAXWSClientFcatoryBean is not configured by the new configurer", isJAXWSClientFactoryConfigured);
assertTrue("The ClientProxyFcatoryBean is not configured by the new configurer", isClientProxyFactoryBeanConfigured);
getBus().setExtension(oldConfiguer, Configurer.class);
}
use of org.apache.cxf.configuration.Configurer in project cxf by apache.
the class WSAFeatureXmlTest method testServerFactory.
@Test
public void testServerFactory() {
JaxWsServerFactoryBean sf = new JaxWsServerFactoryBean();
assert bus != null;
sf.setServiceBean(new GreeterImpl());
sf.setAddress("http://localhost:" + PORT + "/test");
sf.setStart(false);
Configurer c = getBus().getExtension(Configurer.class);
c.configureBean("server", sf);
Server server = sf.create();
Endpoint endpoint = server.getEndpoint();
checkAddressInterceptors(endpoint.getInInterceptors());
}
Aggregations