Search in sources :

Example 1 with DestinationRegistryImpl

use of org.apache.cxf.transport.http.DestinationRegistryImpl in project cxf by apache.

the class HTTPTransportActivator method start.

public void start(final BundleContext context) throws Exception {
    ConfigAdminHttpConduitConfigurer conduitConfigurer = new ConfigAdminHttpConduitConfigurer();
    registerService(context, ManagedServiceFactory.class, conduitConfigurer, ConfigAdminHttpConduitConfigurer.FACTORY_PID);
    registerService(context, HTTPConduitConfigurer.class, conduitConfigurer, "org.apache.cxf.http.conduit-configurer");
    if (PropertyUtils.isTrue(context.getProperty(DISABLE_DEFAULT_HTTP_TRANSPORT))) {
        // directly in the CXF_CONFIG_SCOPE properties file
        return;
    }
    DestinationRegistry destinationRegistry = new DestinationRegistryImpl();
    HTTPTransportFactory transportFactory = new HTTPTransportFactory(destinationRegistry);
    HttpServiceTrackerCust customizer = new HttpServiceTrackerCust(destinationRegistry, context);
    httpServiceTracker = new ServiceTracker<>(context, HttpService.class, customizer);
    httpServiceTracker.open();
    context.registerService(DestinationRegistry.class.getName(), destinationRegistry, null);
    context.registerService(HTTPTransportFactory.class.getName(), transportFactory, null);
    BlueprintNameSpaceHandlerFactory factory = new BlueprintNameSpaceHandlerFactory() {

        @Override
        public Object createNamespaceHandler() {
            return new HttpBPHandler();
        }
    };
    NamespaceHandlerRegisterer.register(context, factory, "http://cxf.apache.org/transports/http/configuration");
}
Also used : DestinationRegistry(org.apache.cxf.transport.http.DestinationRegistry) BlueprintNameSpaceHandlerFactory(org.apache.cxf.bus.blueprint.BlueprintNameSpaceHandlerFactory) HttpBPHandler(org.apache.cxf.transport.http.blueprint.HttpBPHandler) HttpService(org.osgi.service.http.HttpService) HTTPTransportFactory(org.apache.cxf.transport.http.HTTPTransportFactory) DestinationRegistryImpl(org.apache.cxf.transport.http.DestinationRegistryImpl)

Example 2 with DestinationRegistryImpl

use of org.apache.cxf.transport.http.DestinationRegistryImpl in project cxf by apache.

the class JAXWSHttpSpiDestinationTest method testMessage.

@Test
public void testMessage() throws Exception {
    HttpExchange exchange = setUpExchange();
    control.replay();
    JAXWSHttpSpiDestination destination = new JAXWSHttpSpiDestination(bus, new DestinationRegistryImpl(), endpoint);
    destination.setMessageObserver(observer);
    destination.doService(new HttpServletRequestAdapter(exchange), new HttpServletResponseAdapter(exchange));
    control.verify();
}
Also used : HttpExchange(javax.xml.ws.spi.http.HttpExchange) DestinationRegistryImpl(org.apache.cxf.transport.http.DestinationRegistryImpl) Test(org.junit.Test)

Example 3 with DestinationRegistryImpl

use of org.apache.cxf.transport.http.DestinationRegistryImpl in project cxf by apache.

the class JAXWSHttpSpiDestinationTest method testCtor.

@Test
public void testCtor() throws Exception {
    control.replay();
    JAXWSHttpSpiDestination destination = new JAXWSHttpSpiDestination(bus, new DestinationRegistryImpl(), endpoint);
    assertNull(destination.getMessageObserver());
    assertNotNull(destination.getAddress());
    assertNotNull(destination.getAddress().getAddress());
    assertEquals(ADDRESS, destination.getAddress().getAddress().getValue());
}
Also used : DestinationRegistryImpl(org.apache.cxf.transport.http.DestinationRegistryImpl) Test(org.junit.Test)

Aggregations

DestinationRegistryImpl (org.apache.cxf.transport.http.DestinationRegistryImpl)3 Test (org.junit.Test)2 HttpExchange (javax.xml.ws.spi.http.HttpExchange)1 BlueprintNameSpaceHandlerFactory (org.apache.cxf.bus.blueprint.BlueprintNameSpaceHandlerFactory)1 DestinationRegistry (org.apache.cxf.transport.http.DestinationRegistry)1 HTTPTransportFactory (org.apache.cxf.transport.http.HTTPTransportFactory)1 HttpBPHandler (org.apache.cxf.transport.http.blueprint.HttpBPHandler)1 HttpService (org.osgi.service.http.HttpService)1