globalReqCount, msgContext);
}
}
// handle Service response time
ResponseTimeProcessor proc = new ResponseTimeProcessor();
if (service != null) {
Object responseTimeProcessorObj = null;
Object serviceCountObj = msgContext
.getConfigurationContext()
.getProperty(
ClientStatisticsPublisherConstants.BAM_USER_DEFINED_SERVICE_REQUEST_COUNTER_PROPERTY);
try {
responseTimeProcessorObj = msgContext
.getConfigurationContext()
.getProperty(
ClientStatisticsPublisherConstants.BAM_USER_DEFINED_SERVICE_RESPONSE_TIME_PROCESSOR_PROPERTY);
} catch (Exception e) {
e.printStackTrace();
}
int serviceCount = 0;
if (serviceCountObj != null) {
if (serviceCountObj instanceof Counter) {
serviceCount = ((Counter) serviceCountObj).getCount();
}
}
if (responseTimeProcessorObj != null) {
proc.addResponseTime(responseTime, serviceCount, msgContext);
} else {
proc.addResponseTime(responseTime, serviceCount, msgContext);
msgContext
.getConfigurationContext()
.setProperty(
ClientStatisticsPublisherConstants.BAM_USER_DEFINED_SERVICE_RESPONSE_TIME_PROCESSOR_PROPERTY,
proc);
}
}
// Handle operation response time
if (operation != null) {
Object opeResTimeprocessorObj = msgContext
.getConfigurationContext()
.getProperty(
ClientStatisticsPublisherConstants.BAM_USER_DEFINED_OPERATION_RESPONSE_TIME_PROCESSOR_PROPERTY);
Object opReqCounterObj = msgContext
.getConfigurationContext()
.getProperty(
ClientStatisticsPublisherConstants.BAM_USER_DEFINED_IN_OPERATION_COUNTER_PROPERTY);
int opReqCount = 0;
if (opReqCounterObj != null) {
if (opReqCounterObj instanceof Counter) {
opReqCount = ((Counter) opReqCounterObj).getCount();
}
}
if (opeResTimeprocessorObj != null) {
proc.addResponseTime(responseTime, opReqCount, msgContext);
} else {
proc.addResponseTime(responseTime, opReqCount, msgContext);
msgContext
.getConfigurationContext()
.setProperty(
ClientStatisticsPublisherConstants.BAM_USER_DEFINED_OPERATION_RESPONSE_TIME_PROCESSOR_PROPERTY,
proc);