MonitoringPipepublic class MonitoringPipe extends com.sun.xml.ws.api.pipe.helper.AbstractFilterPipeImpl This pipe is used to do app server monitoring |
Fields Summary |
---|
private final com.sun.xml.ws.api.model.SEIModel | seiModel | private final com.sun.xml.ws.api.model.wsdl.WSDLPort | wsdlModel | private final com.sun.xml.ws.api.server.WSEndpoint | owner | private final com.sun.enterprise.deployment.WebServiceEndpoint | endpoint | private final com.sun.enterprise.webservice.monitoring.WebServiceEngineImpl | wsEngine |
Methods Summary |
---|
public final com.sun.xml.ws.api.pipe.Pipe | copy(com.sun.xml.ws.api.pipe.PipeCloner cloner)
return new MonitoringPipe(this, cloner);
| public com.sun.xml.ws.api.message.Packet | process(com.sun.xml.ws.api.message.Packet request)
// 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.
if(ServiceEngineUtil.isJBIRequest(request.webServiceContextDelegate.getClass().getName())) {
return next.process(request);
}
// No monitoring available for restful services
if(HTTPBinding.HTTP_BINDING.equals(endpoint.getProtocolBinding())) {
return next.process(request);
}
SOAPMessageContext ctxt = new SOAPMessageContextImpl(request);
HttpServletRequest httpRequest =
(HttpServletRequest) request.get(javax.xml.ws.handler.MessageContext.SERVLET_REQUEST);
HttpServletResponse httpResponse =
(HttpServletResponse) request.get(javax.xml.ws.handler.MessageContext.SERVLET_RESPONSE);
String messageId=null;
if (wsEngine.getGlobalMessageListener()!=null) {
Endpoint endpt;
if(endpoint.implementedByWebComponent()) {
endpt = wsEngine.getEndpoint(httpRequest.getServletPath());
} else {
endpt = wsEngine.getEndpoint(httpRequest.getRequestURI());
}
messageId = wsEngine.preProcessRequest(endpt);
if (messageId!=null) {
ctxt.put(EndpointImpl.MESSAGE_ID, messageId);
ThreadLocalInfo config = new ThreadLocalInfo(messageId, httpRequest);
wsEngine.getThreadLocal().set(config);
}
}
JAXWSEndpointImpl endpt = null;
try {
if (wsEngine.getGlobalMessageListener()!=null) {
if(endpoint.implementedByWebComponent()) {
endpt =
(JAXWSEndpointImpl)wsEngine.getEndpoint(httpRequest.getServletPath());
} else {
endpt =
(JAXWSEndpointImpl)wsEngine.getEndpoint(httpRequest.getRequestURI());
}
endpt.processRequest(ctxt);
}
} catch (Exception e) {
// temporary - need to send back SOAP fault message
}
Packet pipeResponse = next.process(request);
//Make the response packet available in the MessageContext
((SOAPMessageContextImpl)ctxt).setPacket(pipeResponse);
try {
if (endpt != null) {
endpt.processResponse(ctxt);
}
} catch (Exception e) {
// temporary - need to send back SOAP fault message
}
if (messageId!=null) {
HttpResponseInfoImpl info = new HttpResponseInfoImpl(httpResponse);
wsEngine.postProcessResponse(messageId, info);
}
return pipeResponse;
|
|