@Override public void handleMessage(Message message) throws Fault { Endpoint endpoint = EndpointAssociation.getEndpoint(); Exchange exchange = message.getExchange(); exchange.put(Endpoint.class, endpoint); } }
/** * Serves the requests */ public final void service(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { try { EndpointAssociation.setEndpoint(endpoint); RequestHandler requestHandler = endpoint.getRequestHandler(); requestHandler.handleHttpRequest(endpoint, req, res, getServletContext()); } finally { this.postService(); EndpointAssociation.removeEndpoint(); } }
private Handler getInstance(final HandlerInfo info) throws Exception { final Endpoint ep = EndpointAssociation.getEndpoint(); final Handler handler; if (ep != null) { handler = (Handler)ep.getInstanceProvider().getInstance(info.getHandlerClass().getName()).getValue(); } else { handler = (Handler)info.getHandlerClass().newInstance(); } return handler; }
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 { if (endpoint.getSecurityDomainContext() != null) { endpoint.getSecurityDomainContext().cleanupSubjectContext(); } EndpointAssociation.removeEndpoint(); BusFactory.setThreadDefaultBus(null); } } }
@SuppressWarnings("unchecked") protected boolean handleInbound(MessageContext ctx) Endpoint endpoint = EndpointAssociation.getEndpoint(); if (endpoint != null && isRecording(endpoint))
@SuppressWarnings("unchecked") protected boolean handleInbound(SOAPMessageContext ctx) Endpoint endpoint = EndpointAssociation.getEndpoint(); if (endpoint != null && isRecording(endpoint))
@SuppressWarnings("unchecked") protected boolean handleOutbound(MessageContext ctx) Endpoint endpoint = EndpointAssociation.getEndpoint(); if (endpoint != null && isRecording(endpoint))
@SuppressWarnings("unchecked") protected boolean handleOutbound(SOAPMessageContext ctx) Endpoint endpoint = EndpointAssociation.getEndpoint(); if (endpoint != null && isRecording(endpoint))