|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfr.dyade.aaa.agent.AgentIdStamp
final class AgentIdStamp
AgentIdStamp
class defines static members, variable and
functions, to manage the allocation of new identifiers. It locally
maintains a pair of counters, one for local agent server, one for remote
agent server, keeping track of the last allocated stamp for the given
target domain. Stamps are allocated in growing order and are never reused
once allocated, even after agents are deleted.
AgentId
class.
Field Summary | |
---|---|
private int |
local
Stamp counter for local agent server. |
private int |
remote
Stamp counter for remote agent server. |
private static long |
serialVersionUID
Define serialVersionUID for interoperability. |
(package private) static AgentIdStamp |
stamp
Static reference to local AgentIdStamp object. |
Constructor Summary | |
---|---|
AgentIdStamp()
|
Method Summary | |
---|---|
(package private) static void |
init()
Initializes AgentIdStamp class. |
(package private) static AgentIdStamp |
load()
Restores the object state from the persistent storage. |
(package private) int |
newStamp(short to)
Allocates a new stamp for the target agent server. |
private void |
readObject(java.io.ObjectInputStream in)
The readObject is responsible for reading from the stream
and restoring the classes fields. |
(package private) void |
save()
Saves the object state on persistent storage. |
private void |
writeObject(java.io.ObjectOutputStream out)
The writeObject method is responsible for writing the
state of the object for its particular class so that the corresponding
readObject method can restore it. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final long serialVersionUID
static AgentIdStamp stamp
AgentIdStamp
object.
private int local
private int remote
Constructor Detail |
---|
AgentIdStamp()
Method Detail |
---|
static void init() throws java.io.IOException, java.lang.ClassNotFoundException
AgentIdStamp
class.
java.io.IOException
- IO problem during loading.
java.lang.ClassNotFoundException
- should never happenedvoid save() throws java.io.IOException
java.io.IOException
static AgentIdStamp load() throws java.io.IOException, java.lang.ClassNotFoundException
java.io.IOException
java.lang.ClassNotFoundException
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException
writeObject
method is responsible for writing the
state of the object for its particular class so that the corresponding
readObject
method can restore it.
out
- the underlying output stream.
java.io.IOException
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException
readObject
is responsible for reading from the stream
and restoring the classes fields.
in
- the underlying input stream.
java.lang.ClassNotFoundException
java.io.IOException
int newStamp(short to) throws java.io.IOException
to
- The target agent server
java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |