Search in sources :

Example 1 with HTTPTransportFactory

use of org.apache.cxf.transport.http.HTTPTransportFactory in project tomee by apache.

the class CxfRSService method beforeStart.

@Override
protected void beforeStart() {
    super.beforeStart();
    destinationFactory = new HTTPTransportFactory();
}
Also used : HTTPTransportFactory(org.apache.cxf.transport.http.HTTPTransportFactory)

Example 2 with HTTPTransportFactory

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

the class AtmosphereWebSocketJettyDestinationTest method testUseCXFDefaultAtmoosphereInterceptor.

@Test
public void testUseCXFDefaultAtmoosphereInterceptor() throws Exception {
    Bus bus = new ExtensionManagerBus();
    DestinationRegistry registry = new HTTPTransportFactory().getRegistry();
    EndpointInfo endpoint = new EndpointInfo();
    endpoint.setAddress(ENDPOINT_ADDRESS);
    endpoint.setName(ENDPOINT_NAME);
    AtmosphereWebSocketServletDestination dest = new AtmosphereWebSocketServletDestination(bus, registry, endpoint, ENDPOINT_ADDRESS);
    List<AtmosphereInterceptor> ais = dest.getAtmosphereFramework().interceptors();
    int added = 0;
    for (AtmosphereInterceptor a : ais) {
        if (DefaultProtocolInterceptor.class.equals(a.getClass())) {
            added++;
            break;
        }
    }
    assertEquals(1, added);
}
Also used : AtmosphereInterceptor(org.atmosphere.cpr.AtmosphereInterceptor) Bus(org.apache.cxf.Bus) ExtensionManagerBus(org.apache.cxf.bus.extension.ExtensionManagerBus) DestinationRegistry(org.apache.cxf.transport.http.DestinationRegistry) EndpointInfo(org.apache.cxf.service.model.EndpointInfo) HTTPTransportFactory(org.apache.cxf.transport.http.HTTPTransportFactory) ExtensionManagerBus(org.apache.cxf.bus.extension.ExtensionManagerBus) Test(org.junit.Test)

Example 3 with HTTPTransportFactory

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

the class AtmosphereWebSocketJettyDestinationTest method testUseCustomAtmoosphereInterceptor.

@Test
public void testUseCustomAtmoosphereInterceptor() throws Exception {
    Bus bus = new ExtensionManagerBus();
    bus.setProperty("atmosphere.interceptors", new CustomInterceptor1());
    DestinationRegistry registry = new HTTPTransportFactory().getRegistry();
    EndpointInfo endpoint = new EndpointInfo();
    endpoint.setAddress(ENDPOINT_ADDRESS);
    endpoint.setName(ENDPOINT_NAME);
    AtmosphereWebSocketServletDestination dest = new AtmosphereWebSocketServletDestination(bus, registry, endpoint, ENDPOINT_ADDRESS);
    List<AtmosphereInterceptor> ais = dest.getAtmosphereFramework().interceptors();
    int added = 0;
    for (AtmosphereInterceptor a : ais) {
        if (CustomInterceptor1.class.equals(a.getClass())) {
            added++;
            break;
        }
    }
    assertEquals(1, added);
}
Also used : AtmosphereInterceptor(org.atmosphere.cpr.AtmosphereInterceptor) Bus(org.apache.cxf.Bus) ExtensionManagerBus(org.apache.cxf.bus.extension.ExtensionManagerBus) DestinationRegistry(org.apache.cxf.transport.http.DestinationRegistry) EndpointInfo(org.apache.cxf.service.model.EndpointInfo) HTTPTransportFactory(org.apache.cxf.transport.http.HTTPTransportFactory) ExtensionManagerBus(org.apache.cxf.bus.extension.ExtensionManagerBus) Test(org.junit.Test)

Example 4 with HTTPTransportFactory

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

the class AtmosphereWebSocketServletDestinationTest method testUseCXFDefaultAtmoosphereInterceptor.

@Test
public void testUseCXFDefaultAtmoosphereInterceptor() throws Exception {
    Bus bus = new ExtensionManagerBus();
    DestinationRegistry registry = new HTTPTransportFactory().getRegistry();
    EndpointInfo endpoint = new EndpointInfo();
    endpoint.setAddress(ENDPOINT_ADDRESS);
    endpoint.setName(ENDPOINT_NAME);
    AtmosphereWebSocketServletDestination dest = new AtmosphereWebSocketServletDestination(bus, registry, endpoint, ENDPOINT_ADDRESS);
    List<AtmosphereInterceptor> ais = dest.getAtmosphereFramework().interceptors();
    int added = 0;
    for (AtmosphereInterceptor a : ais) {
        if (DefaultProtocolInterceptor.class.equals(a.getClass())) {
            added++;
            break;
        }
    }
    assertEquals(1, added);
}
Also used : AtmosphereInterceptor(org.atmosphere.cpr.AtmosphereInterceptor) Bus(org.apache.cxf.Bus) ExtensionManagerBus(org.apache.cxf.bus.extension.ExtensionManagerBus) DestinationRegistry(org.apache.cxf.transport.http.DestinationRegistry) EndpointInfo(org.apache.cxf.service.model.EndpointInfo) HTTPTransportFactory(org.apache.cxf.transport.http.HTTPTransportFactory) ExtensionManagerBus(org.apache.cxf.bus.extension.ExtensionManagerBus) Test(org.junit.Test)

Example 5 with HTTPTransportFactory

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

the class AtmosphereWebSocketServletDestinationTest method testUseCustomAtmoosphereInterceptor.

@Test
public void testUseCustomAtmoosphereInterceptor() throws Exception {
    Bus bus = new ExtensionManagerBus();
    bus.setProperty("atmosphere.interceptors", new CustomInterceptor1());
    DestinationRegistry registry = new HTTPTransportFactory().getRegistry();
    EndpointInfo endpoint = new EndpointInfo();
    endpoint.setAddress(ENDPOINT_ADDRESS);
    endpoint.setName(ENDPOINT_NAME);
    AtmosphereWebSocketServletDestination dest = new AtmosphereWebSocketServletDestination(bus, registry, endpoint, ENDPOINT_ADDRESS);
    List<AtmosphereInterceptor> ais = dest.getAtmosphereFramework().interceptors();
    int added = 0;
    for (AtmosphereInterceptor a : ais) {
        if (CustomInterceptor1.class.equals(a.getClass())) {
            added++;
            break;
        }
    }
    assertEquals(1, added);
}
Also used : AtmosphereInterceptor(org.atmosphere.cpr.AtmosphereInterceptor) Bus(org.apache.cxf.Bus) ExtensionManagerBus(org.apache.cxf.bus.extension.ExtensionManagerBus) DestinationRegistry(org.apache.cxf.transport.http.DestinationRegistry) EndpointInfo(org.apache.cxf.service.model.EndpointInfo) HTTPTransportFactory(org.apache.cxf.transport.http.HTTPTransportFactory) ExtensionManagerBus(org.apache.cxf.bus.extension.ExtensionManagerBus) Test(org.junit.Test)

Aggregations

HTTPTransportFactory (org.apache.cxf.transport.http.HTTPTransportFactory)30 EndpointInfo (org.apache.cxf.service.model.EndpointInfo)24 Test (org.junit.Test)22 QName (javax.xml.namespace.QName)16 Bus (org.apache.cxf.Bus)15 ServiceInfo (org.apache.cxf.service.model.ServiceInfo)15 ExtensionManagerBus (org.apache.cxf.bus.extension.ExtensionManagerBus)14 DestinationRegistry (org.apache.cxf.transport.http.DestinationRegistry)12 AbstractHTTPDestination (org.apache.cxf.transport.http.AbstractHTTPDestination)8 Message (org.apache.cxf.message.Message)7 HTTPServerPolicy (org.apache.cxf.transports.http.configuration.HTTPServerPolicy)7 URL (java.net.URL)6 Destination (org.apache.cxf.transport.Destination)6 AtmosphereInterceptor (org.atmosphere.cpr.AtmosphereInterceptor)6 HttpServletRequest (javax.servlet.http.HttpServletRequest)5 HashSet (java.util.HashSet)3 ConduitInitiator (org.apache.cxf.transport.ConduitInitiator)3 ConduitInitiatorManager (org.apache.cxf.transport.ConduitInitiatorManager)3 MessageObserver (org.apache.cxf.transport.MessageObserver)3 EndpointReferenceType (org.apache.cxf.ws.addressing.EndpointReferenceType)3