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.


Constructor Index

 o ServerListener(Collobject, CentralArbitrator)
 o ServerListener(Session, CentralArbitrator)

Method Index

 o addOrphan(RequestHandler)
 o getSession()
 o handleConnection(MarshallInput, MarshallOutput)
 o lostConnection(RequestHandler)
 o makeManager(Session)
 o makeRequestHandler(MarshallInput, MarshallOutput, ServerListener)
 o numConnections()
 o removeOrphans()
 o run()
 o sendToEveryone(ServerMessage)
 o sendToIndividual(ServerMessage, SessionParticipant)
 o start()
 o stop()

Constructors

 o ServerListener
 public ServerListener(Session s,
                       CentralArbitrator a) throws IOException
 o ServerListener
 public ServerListener(Collobject c,
                       CentralArbitrator a) throws IOException

Methods

 o start
 public void start()
Overrides:
start in class Communicator
 o makeManager
 public CommManager makeManager(Session s)
Overrides:
makeManager in class Communicator
 o makeRequestHandler
 protected RequestHandler makeRequestHandler(MarshallInput in,
                                             MarshallOutput out,
                                             ServerListener l)
 o handleConnection
 public void handleConnection(MarshallInput in,
                              MarshallOutput out)
 o 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.
 o sendToEveryone
 public synchronized void sendToEveryone(ServerMessage message)
 o addOrphan
 protected void addOrphan(RequestHandler orphan)
 o removeOrphans
 public synchronized void removeOrphans()
 o 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
 o lostConnection
 public void lostConnection(RequestHandler connection)
 o numConnections
 public int numConnections()
 o stop
 public void stop()
Returns:
stops the CentralArbitrator from running
Overrides:
stop in class Communicator
 o getSession
 public Session getSession()

All Packages  Class Hierarchy  This Package  Previous  Next  Index