Search in sources :

Example 6 with Configurer

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;
}
Also used : Configurer(org.apache.cxf.configuration.Configurer)

Example 7 with Configurer

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());
}
Also used : Greeter(org.apache.hello_world_soap_http.Greeter) JaxWsProxyFactoryBean(org.apache.cxf.jaxws.JaxWsProxyFactoryBean) Configurer(org.apache.cxf.configuration.Configurer) Client(org.apache.cxf.endpoint.Client) Test(org.junit.Test) AbstractCXFTest(org.apache.cxf.test.AbstractCXFTest)

Example 8 with Configurer

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);
}
Also used : Configurer(org.apache.cxf.configuration.Configurer) URL(java.net.URL) Test(org.junit.Test)

Example 9 with Configurer

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());
}
Also used : Server(org.apache.cxf.endpoint.Server) Endpoint(org.apache.cxf.endpoint.Endpoint) GreeterImpl(org.apache.hello_world_soap_http.GreeterImpl) Configurer(org.apache.cxf.configuration.Configurer) JaxWsServerFactoryBean(org.apache.cxf.jaxws.JaxWsServerFactoryBean) Test(org.junit.Test) AbstractCXFTest(org.apache.cxf.test.AbstractCXFTest)

Aggregations

Configurer (org.apache.cxf.configuration.Configurer)9 Bus (org.apache.cxf.Bus)4 Test (org.junit.Test)4 Before (org.junit.Before)3 ConfigurerImpl (org.apache.cxf.configuration.spring.ConfigurerImpl)2 InstrumentationManager (org.apache.cxf.management.InstrumentationManager)2 AbstractCXFTest (org.apache.cxf.test.AbstractCXFTest)2 URL (java.net.URL)1 BusException (org.apache.cxf.BusException)1 BindingFactoryManager (org.apache.cxf.binding.BindingFactoryManager)1 BusLifeCycleManager (org.apache.cxf.buslifecycle.BusLifeCycleManager)1 ResourceInjector (org.apache.cxf.common.injection.ResourceInjector)1 Client (org.apache.cxf.endpoint.Client)1 Endpoint (org.apache.cxf.endpoint.Endpoint)1 Server (org.apache.cxf.endpoint.Server)1 ServerRegistry (org.apache.cxf.endpoint.ServerRegistry)1 JaxWsProxyFactoryBean (org.apache.cxf.jaxws.JaxWsProxyFactoryBean)1 JaxWsServerFactoryBean (org.apache.cxf.jaxws.JaxWsServerFactoryBean)1 PhaseManager (org.apache.cxf.phase.PhaseManager)1 ResourceManager (org.apache.cxf.resource.ResourceManager)1