fr.dyade.aaa.agent
Class Network
java.lang.Object
fr.dyade.aaa.agent.Network
- MessageConsumer, NetworkMBean
public abstract class Network
extends java.lang.Object
The Network
abstract class provides ..
protected String | bootTSFN - Filename for boot time stamp storage
|
protected String | domain - The domain name.
|
protected int | idxLS - Index of local server in status and matrix arrays.
|
protected Logger | logmon
|
protected String | name - The component's name as it appears in logging.
|
protected int | port - The communication port.
|
protected fr.dyade.aaa.agent.MessageVector | qout - The
MessageVector associated with this network component.
|
protected short[] | servers - List of id.
|
protected String | serversFN - Filename for servers storage
|
protected short | sid - Id.
|
Network() - Creates a new network component.
|
void | delete() - This operation always throws an IllegalStateException.
|
protected void | deliver(fr.dyade.aaa.agent.Message msg) - Try to deliver the received message to the right consumer.
|
String | getDomainName() - Returns the corresponding domain's name.
|
String | getName() - Returns this session's name.
|
int | getPort()
|
fr.dyade.aaa.agent.MessageQueue | getQueue()
|
protected int | index(short id) - Returns the index in internal table of the specified server.
|
void | init(String name, int port, short[] servers) - Initializes a new network component.
|
void | insert(fr.dyade.aaa.agent.Message msg) - Insert a message in the
MessageQueue .
|
void | post(fr.dyade.aaa.agent.Message msg) - Adds a message in "ready to deliver" list.
|
void | restore() - Restores component's information from persistent storage.
|
void | save() - Saves information to persistent storage.
|
void | setPort(int port) - Updates the network port.
|
String | toString() - Returns a string representation of this consumer.
|
void | validate() - Validates all messages pushed in queue during transaction session.
|
bootTSFN
protected String bootTSFN
Filename for boot time stamp storage
domain
protected String domain
The domain name.
idxLS
protected int idxLS
Index of local server in status and matrix arrays.
logmon
protected Logger logmon
name
protected String name
The component's name as it appears in logging.
port
protected int port
The communication port.
qout
protected fr.dyade.aaa.agent.MessageVector qout
The MessageVector
associated with this network component.
servers
protected short[] servers
List of id. for all servers in the domain, this list is sorted and
is used as index for internal tables.
serversFN
protected String serversFN
Filename for servers storage
sid
protected short sid
Id. of local server.
Network
public Network()
Creates a new network component. This simple constructor is required in
order to use Class.newInstance()
method during configuration.
The configuration of component is then done by init
method.
delete
public void delete()
throws IllegalStateException
This operation always throws an IllegalStateException.
- delete in interface MessageConsumer
deliver
protected void deliver(fr.dyade.aaa.agent.Message msg)
throws Exception
Try to deliver the received message to the right consumer.
msg
- the message.
getDomainName
public final String getDomainName()
Returns the corresponding domain's name.
- getDomainName in interface MessageConsumer
- this domain's name.
getPort
public final int getPort()
index
protected final int index(short id)
Returns the index in internal table of the specified server.
The servers array must be ordered.
id
- the unique server id.
init
public void init(String name,
int port,
short[] servers)
throws Exception
Initializes a new network component. This method is used in order to
easily creates and configure a Network component from a class name.
So we can use the Class.newInstance()
method for create
(whitout any parameter) the component, then we can initialize it with
this method.
This method initializes the logical clock for the domain.
name
- The domain name.port
- The listen port.servers
- The list of servers directly accessible from this
network interface.
insert
public void insert(fr.dyade.aaa.agent.Message msg)
Insert a message in the MessageQueue
.
This method is used during initialisation to restore the component
state from persistent storage.
- insert in interface MessageConsumer
msg
- the message
post
public void post(fr.dyade.aaa.agent.Message msg)
throws Exception
Adds a message in "ready to deliver" list. This method allocates a
new time stamp to the message ; be Careful, changing the stamp imply
the filename change too.
- post in interface MessageConsumer
restore
public void restore()
throws Exception
Restores component's information from persistent storage.
If it is the first load, initializes it.
- restore in interface MessageConsumer
save
public void save()
throws IOException
Saves information to persistent storage.
- save in interface MessageConsumer
setPort
public void setPort(int port)
Updates the network port.
toString
public String toString()
Returns a string representation of this consumer.
- A string representation of this consumer.
validate
public void validate()
Validates all messages pushed in queue during transaction session.
- validate in interface MessageConsumer
Copyright B) 2004 Scalagent - All rights reserved