Search in sources :

Example 1 with JAXWSEndpointImpl

use of org.glassfish.webservices.monitoring.JAXWSEndpointImpl in project Payara by payara.

the class MonitoringPipe method process.

@Override
public Packet process(Packet pipeRequest) {
    // If it is a JBI request then skip the monitoring logic. This is done
    // as HTTPServletRequest/Response is not available when the invocation
    // is from JavaEE service engine.
    String delegateClassName = pipeRequest.webServiceContextDelegate.getClass().getName();
    if (delegateClassName.equals("com.sun.enterprise.jbi.serviceengine." + "bridge.transport.NMRServerConnection")) {
        return next.process(pipeRequest);
    }
    // No monitoring available for restful services
    if ("http://www.w3.org/2004/08/wsdl/http".equals(endpoint.getProtocolBinding())) {
        return next.process(pipeRequest);
    }
    HttpServletRequest httpRequest = (HttpServletRequest) pipeRequest.get(SERVLET_REQUEST);
    HttpServletResponse httpResponse = (HttpServletResponse) pipeRequest.get(SERVLET_RESPONSE);
    JAXWSEndpointImpl endpointTracer = getEndpointTracer(httpRequest);
    SOAPMessageContextImpl soapMessageContext = new SOAPMessageContextImpl(pipeRequest);
    InvocationManager invocationManager = Globals.get(InvocationManager.class);
    JavaCallInfo javaCallInfo = getJavaCallInfo(pipeRequest);
    try {
        pushWebServiceMethod(invocationManager, javaCallInfo);
        firePreInvocation(httpRequest, pipeRequest, endpointTracer, soapMessageContext, javaCallInfo);
        // Copy pipe request, since when the endpoint is NOT an EJB, it's body will be emptied after the service invocation
        Packet originalPipeRequest = pipeRequest.copy(true);
        Packet pipeResponse = next.process(pipeRequest);
        firePostInvocation(httpResponse, pipeResponse, originalPipeRequest, endpointTracer, soapMessageContext);
        return pipeResponse;
    } finally {
        popWebServiceMethod(invocationManager, javaCallInfo);
    }
}
Also used : HttpServletRequest(javax.servlet.http.HttpServletRequest) Packet(com.sun.xml.ws.api.message.Packet) InvocationManager(org.glassfish.api.invocation.InvocationManager) HttpServletResponse(javax.servlet.http.HttpServletResponse) JavaCallInfo(com.oracle.webservices.api.databinding.JavaCallInfo) JAXWSEndpointImpl(org.glassfish.webservices.monitoring.JAXWSEndpointImpl)

Aggregations

JavaCallInfo (com.oracle.webservices.api.databinding.JavaCallInfo)1 Packet (com.sun.xml.ws.api.message.Packet)1 HttpServletRequest (javax.servlet.http.HttpServletRequest)1 HttpServletResponse (javax.servlet.http.HttpServletResponse)1 InvocationManager (org.glassfish.api.invocation.InvocationManager)1 JAXWSEndpointImpl (org.glassfish.webservices.monitoring.JAXWSEndpointImpl)1