* be up, then it initializes all <code>AgentServer</code> structures from
* the <code>A3CMLConfig</code> ones. In particular the servers array is
* initialized.
*/
private static void configure() throws Exception {
A3CMLServer root = getConfig().getServer(serverId, clusterId);
//Allocates the temporary descriptors hashtable for each server.
servers = new ServersHT();
// Initialized the descriptor of current server in order to permit
// Channel and Engine initialization.
ServerDesc local = new ServerDesc(root.sid, root.name, root.hostname, -1);
servers.put(local);
// Parse configuration in order to fix route related to the
// current server
getConfig().configure(root);
// Creates all the local MessageConsumer.
createConsumers(root);
for (Enumeration s = getConfig().servers.elements();
s.hasMoreElements();) {
A3CMLServer server = (A3CMLServer) s.nextElement();
if (server.sid == root.sid) continue;
ServerDesc desc = createServerDesc(server);
addServerDesc(desc);
}
// for clusters
for (Enumeration c = getConfig().clusters.elements();
c.hasMoreElements();) {
A3CMLCluster cluster = (A3CMLCluster) c.nextElement();
for (Enumeration s = cluster.servers.elements();
s.hasMoreElements();) {
A3CMLServer server = (A3CMLServer) s.nextElement();
if (server.sid == root.sid) continue;
ServerDesc desc = servers.get(server.sid);
if (desc == null) {
desc = createServerDesc(server);