Author: mmusaji
Date: 2013-08-07 07:49:10 -0400 (Wed, 07 Aug 2013)
New Revision: 17858
Modified:
stack/cxf/branches/jbossws-cxf-3.1.2.SP7_JBPAPP-9534/modules/server/src/main/java/org/jboss/wsf/stack/cxf/RequestHandlerImpl.java
stack/cxf/branches/jbossws-cxf-3.1.2.SP7_JBPAPP-9534/modules/server/src/main/java/org/jboss/wsf/stack/cxf/ServletControllerExt.java
Log:
[JBPAPP-9534] Merged fix from JBWS-2669 to omplement missing endpoint metrics
Modified:
stack/cxf/branches/jbossws-cxf-3.1.2.SP7_JBPAPP-9534/modules/server/src/main/java/org/jboss/wsf/stack/cxf/RequestHandlerImpl.java
===================================================================
---
stack/cxf/branches/jbossws-cxf-3.1.2.SP7_JBPAPP-9534/modules/server/src/main/java/org/jboss/wsf/stack/cxf/RequestHandlerImpl.java 2013-08-06
21:38:31 UTC (rev 17857)
+++
stack/cxf/branches/jbossws-cxf-3.1.2.SP7_JBPAPP-9534/modules/server/src/main/java/org/jboss/wsf/stack/cxf/RequestHandlerImpl.java 2013-08-07
11:49:10 UTC (rev 17858)
@@ -54,11 +54,11 @@
public void handleHttpRequest(Endpoint ep, HttpServletRequest req, HttpServletResponse
res, ServletContext context) throws ServletException, IOException
{
- ServletController controller =
(ServletController)context.getAttribute(ServletController.class.getName());
+ ServletControllerExt controller =
(ServletControllerExt)context.getAttribute(ServletController.class.getName());
if (controller == null)
throw new IllegalStateException("Cannot obtain servlet controller");
- controller.invoke(req, res);
+ controller.invoke(req, res, ep);
}
public void handleRequest(Endpoint endpoint, InputStream inStream, OutputStream
outStream, InvocationContext context)
Modified:
stack/cxf/branches/jbossws-cxf-3.1.2.SP7_JBPAPP-9534/modules/server/src/main/java/org/jboss/wsf/stack/cxf/ServletControllerExt.java
===================================================================
---
stack/cxf/branches/jbossws-cxf-3.1.2.SP7_JBPAPP-9534/modules/server/src/main/java/org/jboss/wsf/stack/cxf/ServletControllerExt.java 2013-08-06
21:38:31 UTC (rev 17857)
+++
stack/cxf/branches/jbossws-cxf-3.1.2.SP7_JBPAPP-9534/modules/server/src/main/java/org/jboss/wsf/stack/cxf/ServletControllerExt.java 2013-08-07
11:49:10 UTC (rev 17858)
@@ -163,14 +163,50 @@
return false;
}
- public void invoke(HttpServletRequest req, HttpServletResponse res) throws
ServletException
+ public void invoke(HttpServletRequest req, HttpServletResponse res, Endpoint ep)
throws ServletException
{
ServletDestination dest = findDestination(req);
boolean requestHandled = handleQuery(req, res, dest);
if (false == requestHandled)
{
- invokeDestination(req, res, dest);
+ Long beginTime = initRequestMetrics(ep);
+ HttpServletResponseExt response = new HttpServletResponseExt(res);
+ invokeDestination(req, response, dest);
+ if (response.getStatus() < 500)
+ {
+ processResponseMetrics(ep, beginTime);
+ }
+ else
+ {
+ processFaultMetrics(ep, beginTime);
+ }
}
}
+
+ private long initRequestMetrics(Endpoint endpoint)
+ {
+ long beginTime = 0;
+
+ EndpointMetrics metrics = endpoint.getEndpointMetrics();
+ if (metrics != null)
+ beginTime = metrics.processRequestMessage();
+
+ return beginTime;
+ }
+
+ private void processResponseMetrics(Endpoint endpoint, long beginTime)
+ {
+ EndpointMetrics metrics = endpoint.getEndpointMetrics();
+ if (metrics != null)
+ metrics.processResponseMessage(beginTime);
+ }
+
+ private void processFaultMetrics(Endpoint endpoint, long beginTime)
+ {
+ EndpointMetrics metrics = endpoint.getEndpointMetrics();
+ if (metrics != null)
+ metrics.processFaultMessage(beginTime);
+ }
+
}
Show replies by date