All Packages Class Hierarchy This Package Previous Next Index
Class ncsa.habanero.ClientListener
java.lang.Object
|
+----ncsa.habanero.Communicator
|
+----ncsa.habanero.ClientListener
- public class ClientListener
- extends Communicator
- implements Runnable, Marshallable
This is the Client-side portion of our centralized Arbitrator. It
listens for connections from client-side Arbitrators, and once it
gets them waits for ActionRequests. Upon receiving an ActionRequest,
it decides if it is valid, and if so creates an ActionGranted which
it passes to its Router.
-
connection
-
-
frozen
-
-
thread
-
-
ClientListener()
-
-
ClientListener(Collobject, String)
-
-
ClientListener(Session)
-
-
addToManager(CommManager, String)
-
-
checkTemperature()
- This routine blocks while the variable frozen is > 0.
-
freezeInput()
-
-
getSession()
-
-
handleInput(MarshallInput)
- This is called when input is made available.
-
listen()
- Listen on input and handle it.
-
makeManager(Session)
-
-
readAMessage(MarshallInput)
-
-
run()
- Listen on input and handle it.
-
sendQuestion(Answerable)
-
-
start()
-
-
stop()
-
-
thawInput()
-
connection
protected DeferredIO connection
frozen
protected int frozen
thread
protected transient Thread thread
ClientListener
public ClientListener(Session s) throws IOException
ClientListener
public ClientListener(Collobject c,
String sib) throws IOException
ClientListener
public ClientListener()
start
public void start()
- Overrides:
- start in class Communicator
addToManager
protected boolean addToManager(CommManager m,
String key)
- Overrides:
- addToManager in class Communicator
makeManager
public CommManager makeManager(Session s)
- Overrides:
- makeManager in class Communicator
run
public void run()
- Listen on input and handle it.
listen
public void listen()
- Listen on input and handle it.
handleInput
protected boolean handleInput(MarshallInput in)
- This is called when input is made available. First, it checks the
frozen instance variable, and if it is supposed to be frozen, goes
into wait. When it is not frozen, it unmarshalls the ActionGranted
and sends it to its Serializer. If it cannot unmarshall properly,
it prints an error and exits, because someone really ought to fix the
problem. This routine cannot be synchronized, because it is always
blocking in unmarshall, but it calls checkTemperature to block
if input should be frozen.
readAMessage
public static boolean readAMessage(MarshallInput in)
freezeInput
public synchronized void freezeInput()
thawInput
public synchronized void thawInput()
checkTemperature
protected synchronized void checkTemperature()
- This routine blocks while the variable frozen is > 0.
stop
public synchronized void stop()
- Returns:
- stops the CentralArbitrator from running
- Overrides:
- stop in class Communicator
getSession
public Session getSession()
sendQuestion
public void sendQuestion(Answerable a)
All Packages Class Hierarchy This Package Previous Next Index