Search in sources :

Example 1 with RequestHandler

use of org.jboss.wsf.spi.invocation.RequestHandler in project jbossws-cxf by jbossws.

the class ServletHelper method callRequestHandler.

public static void callRequestHandler(HttpServletRequest req, HttpServletResponse res, ServletContext ctx, Bus bus, Endpoint endpoint) throws ServletException {
    try {
        BusFactory.setThreadDefaultBus(bus);
        // set the current endpoint into the threadlocal association that is later
        // used by the EndpointAssociationInterceptor for linking the message exchange
        // related to this invocation to the proper endpoint serving it (the bus, and
        // hence the interceptor, can span multiple invocation related to multiple
        // endpoints)
        EndpointAssociation.setEndpoint(endpoint);
        RequestHandler requestHandler = (RequestHandler) endpoint.getRequestHandler();
        requestHandler.handleHttpRequest(endpoint, req, res, ctx);
    } catch (IOException ioe) {
        throw new ServletException(ioe);
    } finally {
        EndpointAssociation.removeEndpoint();
        BusFactory.setThreadDefaultBus(null);
    }
}
Also used : ServletException(javax.servlet.ServletException) RequestHandler(org.jboss.wsf.spi.invocation.RequestHandler) IOException(java.io.IOException)

Aggregations

IOException (java.io.IOException)1 ServletException (javax.servlet.ServletException)1 RequestHandler (org.jboss.wsf.spi.invocation.RequestHandler)1