Index: WebServiceEndpointStatsProviderImpl.java =================================================================== --- WebServiceEndpointStatsProviderImpl.java (revision 5254) +++ WebServiceEndpointStatsProviderImpl.java (revision 5255) @@ -60,7 +60,7 @@ // Setters -- that change the state - public void setRequestTimeStamp(long t , String host, String user, + public synchronized void setRequestTimeStamp(long t , String host, String user, int rSize) { enterTime = t; @@ -69,7 +69,7 @@ cUser = user; } - public void setSuccess(int resSize, long exitTime, long respTime) { + public synchronized void setSuccess(int resSize, long exitTime, long respTime) { precheck(); @@ -88,7 +88,7 @@ cleanup(); } - void calculateResponseTimes (long curRespTime) { + private void calculateResponseTimes (long curRespTime) { if ( curRespTime > maxResponseTime) { maxResponseTime = curRespTime; } @@ -101,7 +101,7 @@ totalResponseTime += curRespTime; } - public void setFault(int resSize, long exitTime, long rTime, String fCode, String fString, + public synchronized void setFault(int resSize, long exitTime, long rTime, String fCode, String fString, String fActor) { precheck(); @@ -123,7 +123,7 @@ } - public void setAuthFailure (long t) { + public synchronized void setAuthFailure (long t) { // precheck(); -- precheck may not be called for auth failures @@ -140,7 +140,7 @@ } - public void precheck() { + private void precheck() { if ( enterTime == 0 ) { throw new RuntimeException( "Request method should also update the request stats"); @@ -150,12 +150,12 @@ } - public void cleanup() { + private void cleanup() { enterTime = 0; cHost = cUser = null; } - public void reset() { + public synchronized void reset() { faultActor = faultString = faultCode = clientHost = clientUser = null; responseSize = requestSize = totalFaults = totalSuccess = totalAuthFailures = totalAuthSuccess = 0; @@ -167,11 +167,11 @@ } // Getters -- used by the monioring MBeans - public long getLastResetTime() { + public synchronized long getLastResetTime() { return resetTime; } - public long getAverageResponseTime() { + public synchronized long getAverageResponseTime() { int totalInv = totalSuccess + totalFaults; if (totalInv == 0 ) { return (long)0; @@ -180,7 +180,7 @@ } } - public long getMinResponseTime() { + public synchronized long getMinResponseTime() { if (minResponseTime < 0 ) { return 0; } else { @@ -188,31 +188,31 @@ } } - public long getMaxResponseTime() { + public synchronized long getMaxResponseTime() { return maxResponseTime; } - public long getResponseTime() { + public synchronized long getResponseTime() { return responseTime; } - public int getTotalFailures() { + public synchronized int getTotalFailures() { return totalFaults; } - public int getTotalSuccesses() { + public synchronized int getTotalSuccesses() { return totalSuccess; } - public int getTotalAuthFailures() { + public synchronized int getTotalAuthFailures() { return totalAuthFailures; } - public int getTotalAuthSuccesses() { + public synchronized int getTotalAuthSuccesses() { return totalAuthSuccess; } - public double getThroughput() { + public synchronized double getThroughput() { long avgRespTime = getAverageResponseTime(); double dValue = avgRespTime; if ( avgRespTime == 0 ) { @@ -267,4 +267,4 @@ long resetTime =0; int reqSize = 0; String cHost = null, cUser = null; -} +} \ No newline at end of file