Calypso Gateway v1.0

codec.server
Class ServantRequestPool

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--codec.server.ServantRequestPool

public final class ServantRequestPool
extends java.lang.Thread

Class responsible for managing the replies from Servers after performing asynchronous invocation requests. It is running in a separate thread, constantly checking responses from all registered requests. Once response is obtained, it delegates its further processing to ServerPool.


Field Summary
private  java.util.Set requests
           
private  java.lang.Boolean requestUnlock
          The field is for notifying the main class thread that new request is to be registered.
 
Fields inherited from class java.lang.Thread
contextClassLoader, daemon, eetop, group, inheritedAccessControlContext, MAX_PRIORITY, MIN_PRIORITY, name, NORM_PRIORITY, priority, single_step, stillborn, stopThreadPermission, target, threadInitNumber, threadQ, values
 
Constructor Summary
ServantRequestPool()
           
 
Method Summary
 void register(ServantRequest request)
          Register the request object.
 void run()
          Class core checking for the operation responses from registered requests.
 
Methods inherited from class java.lang.Thread
, activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, exit, getContextClassLoader, getName, getPriority, getThreadGroup, init, interrupt, interrupt0, interrupted, isAlive, isDaemon, isInterrupted, isInterrupted, join, join, join, nextThreadNum, registerNatives, resume, resume0, setContextClassLoader, setDaemon, setName, setPriority, setPriority0, sleep, sleep, start, stop, stop, stop0, suspend, suspend0, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

requests

private java.util.Set requests

requestUnlock

private volatile java.lang.Boolean requestUnlock
The field is for notifying the main class thread that new request is to be registered. Main class thread will then remove the lock from "requests" object and will try to obtain the lock again no earlier than this field is again set to 0.
Constructor Detail

ServantRequestPool

public ServantRequestPool()
Method Detail

register

public void register(ServantRequest request)
Register the request object. Normally this shall be used after making asynchronous invocation. Since then class instance will be polling for operation response.

run

public void run()
Class core checking for the operation responses from registered requests.
Overrides:
run in class java.lang.Thread

Calypso Gateway v1.0