All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class RouterLayer.Router.RouterServerThread

Abstract.Connection
   |
   +----Abstract.ServerThread
           |
           +----BaseLayer.BServerThread
                   |
                   +----RouterLayer.Router.RouterServerThread

public class RouterServerThread
extends BServerThread
Router server thread. Two data members, incoming message box directiry and reservation table are added. The run() method will accept the connection from the Router clients and create RouterRecvThread.


Variable Index

 o _disconnectTable
Vector which contains the disconnected agent name list
 o _messageBoxPath
Incoming message box directory
 o _offLineList
Agent name array which contains the agent names those are off-line intentionally.
 o _reservedBook
Message reservation table.

Constructor Index

 o RouterServerThread()
Default Constructor
 o RouterServerThread(Address, ConnectionTable, Security, String, Hashtable, OffLineAgentTable, Vector)
Constructor

Method Index

 o createReceiverThread(Socket)
Create RouterReceiverThread and invoke start() method
 o run()
Run method will create RouterRecvThread by accepting connection.
 o setOffLineList(OffLineAgentTable)
Set the off line agent name list.
 o setReservedBook(Hashtable)
Set the ReservationTable

Variables

 o _messageBoxPath
 protected String _messageBoxPath
Incoming message box directory

 o _reservedBook
 protected Hashtable _reservedBook
Message reservation table. The key field is time stamp and field value is Reservation object

See Also:
Reservation
 o _offLineList
 protected OffLineAgentTable _offLineList
Agent name array which contains the agent names those are off-line intentionally. If a message receiver is in the off-line list, the RouterRecvThread will not send the message to the receiver. The message will be saved to the file. If the receiver is reconnect, the received messages will be sent.

 o _disconnectTable
 protected Vector _disconnectTable
Vector which contains the disconnected agent name list

Constructors

 o RouterServerThread
 public RouterServerThread()
Default Constructor

 o RouterServerThread
 public RouterServerThread(Address myaddress,
                           ConnectionTable connections,
                           Security security,
                           String messageboxpath,
                           Hashtable reservedBook,
                           OffLineAgentTable offlinelist,
                           Vector disconnectlist) throws IOException, ConnectionException, UnknownHostException
Constructor

Parameters:
myaddress - Router server address
connections - ConnectionTable, which will be passed to the RouterRecvThread
security - RouterSecurity
messageboxpath - Incoming message box directory
reservedbook - Message reservation table
offlinelist - The off line agent name list.
disconnectlist - The disconnected agents name list.
Throws: IOException
if socket error occurs
Throws: ConnectionException
if connection related error occurs
Throws: UnknownHostException
if host address is not found

Methods

 o setReservedBook
 public void setReservedBook(Hashtable reservedBook)
Set the ReservationTable

Parameters:
reservedBook - ReservationTable from the RouterAction
 o setOffLineList
 public void setOffLineList(OffLineAgentTable offlinelist)
Set the off line agent name list. The off-line means that an agent intentionally wants not to receive message before it reconnect to the Router.

Parameters:
offlinelist - Off line agent name list.
 o run
 public void run()
Run method will create RouterRecvThread by accepting connection. endWith character and maximum idle time will be set to the RouterRecvThread

Overrides:
run in class BServerThread
 o createReceiverThread
 protected synchronized void createReceiverThread(Socket socket)
Create RouterReceiverThread and invoke start() method

Parameters:
socket - Socket, created by the ServerSocket

All Packages  Class Hierarchy  This Package  Previous  Next  Index