All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class RouterLayer.Router.RegistrarRecvThread

Abstract.Connection
   |
   +----Abstract.ReceiverThread
           |
           +----BaseLayer.BRecvThread
                   |
                   +----RouterLayer.Router.RegistrarRecvThread

public class RegistrarRecvThread
extends BRecvThread
Lightweight ReceiverThread, which is used only for the Router registration. After security check, it will stop. You can set timer by invoking setDurationTime(int minutes) method.

See Also:
ReceiverThread, ConnectionTable, TimerThread

Constructor Index

 o RegistrarRecvThread()
Default Constructor.
 o RegistrarRecvThread(Address, int, Address, ConnectionTable, MessageBuffer, Security, ThreadGroup)
This constructor is called when an agent want to initialize a connection to the Router Registrar, using Address.
 o RegistrarRecvThread(Socket, int, Address, ConnectionTable, MessageBuffer, Security)
Constructor.
 o RegistrarRecvThread(String)
Conctructor with the Agent name

Method Index

 o endConn()
Close the connection.
 o run()
Override Thread run() method.

Constructors

 o RegistrarRecvThread
 public RegistrarRecvThread()
Default Constructor.

 o RegistrarRecvThread
 public RegistrarRecvThread(String name)
Conctructor with the Agent name

Parameters:
name - Agent name
 o RegistrarRecvThread
 public RegistrarRecvThread(Socket client_socket,
                            int priority,
                            Address address,
                            ConnectionTable connections,
                            MessageBuffer queue,
                            Security security) throws ConnectionException
Constructor. This constructor will be invoked by RegistrarServerThread

Parameters:
client_scoket - The socket for the remote client;
priority - The priority of the thread.
address - Registrar address
connections - the connection table is passed as an argument.
queue - the Message Queue. Normally null
security - RegistrarSecurity
 o RegistrarRecvThread
 public RegistrarRecvThread(Address serveraddress,
                            int priority,
                            Address myaddress,
                            ConnectionTable connections,
                            MessageBuffer queue,
                            Security security,
                            ThreadGroup tg) throws ConnectionException
This constructor is called when an agent want to initialize a connection to the Router Registrar, using Address.

Parameters:
serveraddress - The address of the Router Registrar.
priority - The priority of the thread.
myaddress - My addres
connections - the connection table is passed as an argument.
queue - the Message Queue. Normally, null
security - The RouerSecurity object

Methods

 o run
 public void run()
Override Thread run() method. Only check the RouterSecurity and stop() Timer will be set to the limited time. Use setDuariionTime(int minutes) to set the time limit. If the time is elasped over the setting time, the Timer object will automatically kill this thread

Overrides:
run in class BRecvThread
 o endConn
 public synchronized void endConn()
Close the connection. Close socket,input stream and output stream

Overrides:
endConn in class BRecvThread

All Packages  Class Hierarchy  This Package  Previous  Next  Index