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);
}
}
Aggregations