Class prominence.msg.Router
All Packages Class Hierarchy This Package Previous Next Index
Class prominence.msg.Router
java.lang.Object
|
+----java.lang.Thread
|
+----prominence.msg.Router
- public class Router
- extends Thread
A class that reads messages from a RoutingInputStream
and forwards them on the MessageOutputs specified in the
message routing header.
- See Also:
- Demultiplexer
-
i
- The RoutingInputStream from which messages are read.
-
routes
- The message routing table.
-
Router(RoutingInputStream)
- Creates a new Router reading from a specified stream.
-
broadcast(byte[])
- Broadcasts a message to all streams registered in the routing
table.
-
deregister(String)
- Deregisters a particular target name.
-
multicast(String[], byte[])
- Broadcasts a message to a specified list of recipients.
-
register(String, MessageOutput)
- Registers a MessageOutput as the destination for messages to
a particular target.
-
run()
- Routes messages from the RoutingInputStream to the
MessageOutputs identified by their routing headers.
i
protected RoutingInputStream i
- The RoutingInputStream from which messages are read.
routes
protected Hashtable routes
- The message routing table. Maps from routing names to
MessageOutputs.
Router
public Router(RoutingInputStream i)
- Creates a new Router reading from a specified stream.
- Parameters:
- i - The RoutingInputStream from which messages should be read
register
public void register(String client,
MessageOutput o)
- Registers a MessageOutput as the destination for messages to
a particular target.
- Parameters:
- client - The client name that is to be routed
- o - The destination for such messages
deregister
public void deregister(String client)
- Deregisters a particular target name.
- Parameters:
- client - The client name that is to be deregistered
run
public void run()
- Routes messages from the RoutingInputStream to the
MessageOutputs identified by their routing headers.
This method is called by a new thread when the superclass
start() method is called.
- Overrides:
- run in class Thread
- See Also:
- start
broadcast
protected void broadcast(byte buffer[])
- Broadcasts a message to all streams registered in the routing
table.
- Parameters:
- buffer - The message to be broadcast
multicast
protected void multicast(String dst[],
byte buffer[])
- Broadcasts a message to a specified list of recipients.
- Parameters:
- dst - a List of recipient names
- buffer - The message to be broadcast
All Packages Class Hierarchy This Package Previous Next Index