org.apache.cxf.transport.http.HttpDestinationFactory Java Examples

The following examples show how to use org.apache.cxf.transport.http.HttpDestinationFactory. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CxfDefaultBusHandler.java    From wildfly-camel with Apache License 2.0 6 votes vote down vote up
public CxfDefaultBusEndpointStrategy() {
    super();
    final Bus bus;
    final ClassLoader origClassLoader = SecurityActions.getContextClassLoader();
    try {
        SecurityActions.setContextClassLoader(CxfComponent.class.getClassLoader());
        bus = BusFactory.getDefaultBus(true);
    } finally {
        SecurityActions.setContextClassLoader(origClassLoader);
    }
    /* Check if the default bus is the one we want */
    final HttpDestinationFactory httpDestinationFactory = bus.getExtension(HttpDestinationFactory.class);
    if (httpDestinationFactory instanceof UndertowDestinationFactory) {
        this.bus = bus;
    } else {
        throw new IllegalStateException(String.format("Expected %s returning %s, found %s", Bus.class.getName(),
                UndertowDestinationFactory.class.getName(), httpDestinationFactory.getClass().getName()));
    }
}
 
Example #2
Source File: CxfDefaultBusHandler.java    From wildfly-camel with Apache License 2.0 6 votes vote down vote up
public void onRoutesAdd(Collection<Route> routes) {
    /*
     * LifecycleStrategySupport.onEndpointAdd() is not called for CxfRsEndpoints created via direct constructor
     * invocation. Therefore we check if the buses on CxfRsEndpoints are correct.
     */
    for (Route route : routes) {
        final Endpoint endpoint = route.getEndpoint();
        if (endpoint instanceof CxfRsEndpoint) {
            final CxfRsEndpoint rsEnspoint = (CxfRsEndpoint) endpoint;
            final Bus endpointBus = rsEnspoint.getBus();
            if (endpointBus == null || (endpointBus != bus && !(endpointBus
                    .getExtension(HttpDestinationFactory.class) instanceof UndertowDestinationFactory))) {
                /* Not a correct bus instance */
                throw new IllegalStateException("A " + CxfRsEndpoint.class.getName() + " used in route " + route
                        + " either does not have " + Bus.class.getName() + " set or the "
                        + Bus.class.getSimpleName() + " set was not created using correct context class loader."
                        + " This is known to happen for " + CxfRsEndpoint.class.getName()
                        + " instances created by direct constructor invocation."
                        + " Consider using camelContext.getEndpoint(\"cxfrs:http[s]://my-host/my-endpoint\", CxfRsEndpoint.class) instead"
                        + " or add your manually created endpoint to the context management manually using CamelContext.addEndpoint(String uri, Endpoint endpoint)");
            }
        }
    }
}
 
Example #3
Source File: WebServiceProtocol.java    From dubbo-2.6.5 with Apache License 2.0 4 votes vote down vote up
public WebServiceProtocol() {
    super(Fault.class);
    bus.setExtension(new ServletDestinationFactory(), HttpDestinationFactory.class);
}
 
Example #4
Source File: WebServiceProtocol.java    From dubbox with Apache License 2.0 4 votes vote down vote up
public WebServiceProtocol() {
    super(Fault.class);
    bus.setExtension(new ServletDestinationFactory(), HttpDestinationFactory.class);
}
 
Example #5
Source File: WebServiceProtocol.java    From dubbox-hystrix with Apache License 2.0 4 votes vote down vote up
public WebServiceProtocol() {
    super(Fault.class);
    bus.setExtension(new ServletDestinationFactory(), HttpDestinationFactory.class);
}
 
Example #6
Source File: WebServiceProtocol.java    From dubbox with Apache License 2.0 4 votes vote down vote up
public WebServiceProtocol() {
    super(Fault.class);
    bus.setExtension(new ServletDestinationFactory(), HttpDestinationFactory.class);
}
 
Example #7
Source File: WebServiceProtocol.java    From dubbox with Apache License 2.0 4 votes vote down vote up
public WebServiceProtocol() {
    super(Fault.class);
    bus.setExtension(new ServletDestinationFactory(), HttpDestinationFactory.class);
}