All Packages Class Hierarchy This Package Previous Next Index
Class ncsa.habanero.ServerListener
java.lang.Object
|
+----ncsa.habanero.Communicator
|
+----ncsa.habanero.ServerListener
- public class ServerListener
- extends Communicator
- implements Runnable, Marshallable
This is the server-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.
-
ServerListener(Collobject, CentralArbitrator)
-
-
ServerListener(Session, CentralArbitrator)
-
-
addOrphan(RequestHandler)
-
-
getSession()
-
-
handleConnection(MarshallInput, MarshallOutput)
-
-
lostConnection(RequestHandler)
-
-
makeManager(Session)
-
-
makeRequestHandler(MarshallInput, MarshallOutput, ServerListener)
-
-
numConnections()
-
-
removeOrphans()
-
-
run()
-
-
sendToEveryone(ServerMessage)
-
-
sendToIndividual(ServerMessage, SessionParticipant)
-
-
start()
-
-
stop()
-
ServerListener
public ServerListener(Session s,
CentralArbitrator a) throws IOException
ServerListener
public ServerListener(Collobject c,
CentralArbitrator a) throws IOException
start
public void start()
- Overrides:
- start in class Communicator
makeManager
public CommManager makeManager(Session s)
- Overrides:
- makeManager in class Communicator
makeRequestHandler
protected RequestHandler makeRequestHandler(MarshallInput in,
MarshallOutput out,
ServerListener l)
handleConnection
public void handleConnection(MarshallInput in,
MarshallOutput out)
run
public void run()
- Returns:
- Wait for the server object to get a connection - when it does, add the
connection to our list. Then tell the session a new connection was
made, and if the session OKs it, spawn a new thread to handle it.
sendToEveryone
public synchronized void sendToEveryone(ServerMessage message)
addOrphan
protected void addOrphan(RequestHandler orphan)
removeOrphans
public synchronized void removeOrphans()
sendToIndividual
public synchronized void sendToIndividual(ServerMessage message,
SessionParticipant who)
- Parameters:
- message - the message we want to send
- who - the session participant to receive the message
- Returns:
- sends an unserialized message to a single person
lostConnection
public void lostConnection(RequestHandler connection)
numConnections
public int numConnections()
stop
public void stop()
- Returns:
- stops the CentralArbitrator from running
- Overrides:
- stop in class Communicator
getSession
public Session getSession()
All Packages Class Hierarchy This Package Previous Next Index