Class prominence.msgx.GenericRegistryHandler
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class prominence.msgx.GenericRegistryHandler

java.lang.Object
   |
   +----java.lang.Thread
           |
           +----prominence.msg.GenericHandler
                   |
                   +----prominence.msgx.GenericRegistryHandler

public class GenericRegistryHandler
extends GenericHandler
An extension to the GenericHandler class that broadcasts when clients join and leave.
See Also:
GenericRegistryServer

Constructor Index

 o GenericRegistryHandler(Hashtable, InputStream, OutputStream)
Creates a new GenericRegistryHandler with a specified routing table and communication channel to the client.

Method Index

 o accept(String)
Attempts to register the client in the server routing table and informs the client of success.
 o announce(boolean)
Broadcasts when the client joins or leaves.
 o listUsers()
Sends the client a list of the existing clients.

Constructors

 o GenericRegistryHandler
  public GenericRegistryHandler(Hashtable routes,
                                InputStream i,
                                OutputStream o)
Creates a new GenericRegistryHandler with a specified routing table and communication channel to the client.
Parameters:
routes - The server routing table
i - An InputStream from the client
o - An OutputStream to the cleitn

Methods

 o accept
  protected void accept(String name) throws IOException
Attempts to register the client in the server routing table and informs the client of success. If registered, announces the new client to existing clients, lists the existing clients to the new client andproceeds to route messages to and from the client.

Registers a QueueOutputStream in the routing table that writes messages for the client into the client's outbound message queue.

Parameters:
name - The client name
Throws: IOException
Occurs if a problem is encountered communicating with the client.
Overrides:
accept in class GenericHandler
See Also:
announce, listUsers, execute
 o announce
  protected void announce(boolean isJoin) throws IOException
Broadcasts when the client joins or leaves.
Parameters:
isJoin - Indicates whether the client is joining (true) or leaving (false)
Throws: IOException
Should not occur.
 o listUsers
  protected void listUsers() throws IOException
Sends the client a list of the existing clients.
Throws: IOException
Should not occur.

All Packages  Class Hierarchy  This Package  Previous  Next  Index