Next: MASIF Classes
Up: System
Previous: AgentSystemID
  Contents
The platform uses hash tables for many purposes. These are in particular hashes
for the Agents, the System Agents, the service proxies and the configuration.
Since some of them do not fit in the normal unique key - to - value scheme,
but can contain more then one value per key it was necessary to create special
version of hash tables which can handle more values per key. These are called
OTM*Hashtable using the acronym OTM for one - to - many hash tables. There
exists two kinds of
OTMHashtable, the
normal
OTMHashtable which can handle strings as keys and the
more general
OTMObjectHashtable
which can handle any objects as you like as key and value. Since these special
versions of hash tables are not as optimized for speed as the default
Hashtable
of the Java class library it is strongly recommended to use them only if it
is really necessary.
The Agents residing in the System are archived in the Hashtable agents. As key
the
AgentID is used and the value is the reference to the
Agent. To provide good hash codes for the ID objects and other
TAgents
proprietary objects there exists a class called
HashCode
which produces unique hash codes for a string and for a byte array. Since the
IDs are normally presented as strings (in the ID objects) or as byte code (in
the
Name object) these are the two possible cases where hash
codes are needed. Internally the hash code is generated by using the hash code
generating method of the standard class
String of the Java
class libraries. This is achieved in the class
HashCode by
converting the byte array into an
String and return its hash
code value.
The System Agents are maintained as the Agents in a Hashtable
with the AgentID as key and the reference to the System Agent
as value. Separate from them exists a OTMHashtable for the
services (proxies) they are providing. The proxies hash table uses the string
of the name of the interface as key and as value the reference to the proxy.
Since more then one System Agent can provide the same interface, like for example
the general
tagents.sysagent.communication.AgentCommIFace, an OTMHashtable
is used here to store the proxies.
Places
are handled different since they do not fit into the key
- value scheme but only have one value. They are stored into a
Vector.
Since places are still not supported in this version of
TAgents, this
can be changed in the future.
Next: MASIF Classes
Up: System
Previous: AgentSystemID
  Contents
Thomas Letsch
2001-02-21