Search in sources :

Example 1 with MonitorContextImpl

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

the class MonitoringPipe method firePreInvocation.

private void firePreInvocation(HttpServletRequest httpRequest, Packet pipeRequest, JAXWSEndpointImpl endpointTracer, SOAPMessageContextImpl soapMessageContext, JavaCallInfo javaCallInfo) {
    if (seiModel instanceof SOAPSEIModel) {
        SOAPSEIModel soapSEIModel = (SOAPSEIModel) seiModel;
        Globals.get(MonitorFilter.class).filterRequest(pipeRequest, new MonitorContextImpl(javaCallInfo, soapSEIModel, wsdlModel, ownerEndpoint, endpoint));
    }
    // Invoke preProcessRequest on global listeners. If there's a global listener we get
    // a trace ID back to trace this message
    String messageTraceId = wsMonitor.preProcessRequest(endpointTracer);
    if (messageTraceId != null) {
        soapMessageContext.put(MESSAGE_ID, messageTraceId);
        wsMonitor.getThreadLocal().set(new ThreadLocalInfo(messageTraceId, httpRequest));
    }
    try {
        // Invoke processRequest on global listeners
        endpointTracer.processRequest(soapMessageContext);
    } catch (Exception e) {
    // temporary - need to send back SOAP fault message
    }
}
Also used : MonitorContextImpl(org.glassfish.webservices.monitoring.MonitorContextImpl) ThreadLocalInfo(org.glassfish.webservices.monitoring.ThreadLocalInfo) SOAPSEIModel(com.sun.xml.ws.model.SOAPSEIModel) MonitorFilter(org.glassfish.webservices.monitoring.MonitorFilter)

Example 2 with MonitorContextImpl

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

the class MonitoringPipe method firePostInvocation.

private void firePostInvocation(HttpServletResponse httpResponse, Packet pipeResponse, Packet pipeRequest, JAXWSEndpointImpl endpointTracer, SOAPMessageContextImpl soapMessageContext) {
    if (seiModel instanceof SOAPSEIModel) {
        SOAPSEIModel soapSEIModel = (SOAPSEIModel) seiModel;
        Globals.get(MonitorFilter.class).filterResponse(pipeRequest, pipeResponse, new MonitorContextImpl(soapSEIModel.getDatabinding().deserializeRequest(pipeRequest), soapSEIModel, wsdlModel, ownerEndpoint, endpoint));
    }
    // Make the response packet available in the MessageContext
    soapMessageContext.setPacket(pipeResponse);
    try {
        // Invoke processRequest on global and local listeners
        endpointTracer.processResponse(soapMessageContext);
    } catch (Exception e) {
    // temporary - need to send back SOAP fault message
    }
    String messageTraceId = (String) soapMessageContext.get(MESSAGE_ID);
    if (messageTraceId != null) {
        wsMonitor.postProcessResponse(messageTraceId, new HttpResponseInfoImpl(httpResponse));
    }
}
Also used : MonitorContextImpl(org.glassfish.webservices.monitoring.MonitorContextImpl) SOAPSEIModel(com.sun.xml.ws.model.SOAPSEIModel) HttpResponseInfoImpl(org.glassfish.webservices.monitoring.HttpResponseInfoImpl) MonitorFilter(org.glassfish.webservices.monitoring.MonitorFilter)

Aggregations

SOAPSEIModel (com.sun.xml.ws.model.SOAPSEIModel)2 MonitorContextImpl (org.glassfish.webservices.monitoring.MonitorContextImpl)2 MonitorFilter (org.glassfish.webservices.monitoring.MonitorFilter)2 HttpResponseInfoImpl (org.glassfish.webservices.monitoring.HttpResponseInfoImpl)1 ThreadLocalInfo (org.glassfish.webservices.monitoring.ThreadLocalInfo)1