if(PerformanceClientTest.NUM_OF_CALLS.equals(method))
{
Integer totalCountInteger = (Integer) param;
int totalCount = totalCountInteger.intValue();
System.out.println("received totalCallCount call with total count of " + totalCount + " from " + sessionId);
CallTracker tracker = (CallTracker) callTrackers.get(sessionId);
if(tracker != null)
{
tracker.createTotalCount(totalCount);
}
else
{
int port = ((Integer)callbackServerPort.get()).intValue();
SocketHandler callbackHandler = new SocketHandler(serverBindAddress, sessionId, port);
tracker = new CallTracker(sessionId, callbackHandler);
callTrackers.put(sessionId, tracker);
tracker.createTotalCount(totalCount);
}
return totalCountInteger;
}
else if(PerformanceClientTest.TEST_INVOCATION.equals(method))
{
Payload clientPayload = (Payload) param;
int clientInvokerCallCount = clientPayload.getCallNumber();
CallTracker tracker = (CallTracker) callTrackers.get(sessionId);
if(tracker != null)
{
tracker.verifyClientInvokeCount(clientInvokerCallCount);
}
else
{
log.error("No call tracker exists for session id " + sessionId);
throw new Exception("No call tracker exists for session id " + sessionId);