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.
-
_disconnectTable
- Vector which contains the disconnected agent name list
-
_messageBoxPath
- Incoming message box directory
-
_offLineList
- Agent name array which contains the agent names those are off-line intentionally.
-
_reservedBook
- Message reservation table.
-
RouterServerThread()
- Default Constructor
-
RouterServerThread(Address, ConnectionTable, Security, String, Hashtable, OffLineAgentTable, Vector)
- Constructor
-
createReceiverThread(Socket)
- Create RouterReceiverThread and invoke start() method
-
run()
- Run method will create RouterRecvThread by accepting connection.
-
setOffLineList(OffLineAgentTable)
- Set the off line agent name list.
-
setReservedBook(Hashtable)
- Set the ReservationTable
_messageBoxPath
protected String _messageBoxPath
- Incoming message box directory
_reservedBook
protected Hashtable _reservedBook
- Message reservation table. The key field is time stamp and field value is
Reservation object
- See Also:
- Reservation
_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.
_disconnectTable
protected Vector _disconnectTable
- Vector which contains the disconnected agent name list
RouterServerThread
public RouterServerThread()
- Default Constructor
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
setReservedBook
public void setReservedBook(Hashtable reservedBook)
- Set the ReservationTable
- Parameters:
- reservedBook - ReservationTable from the RouterAction
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.
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
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