
Static Public Member Functions | |
| static ThreadGroup | getThreadGroup () |
| static Engine | getEngine () |
| static Transaction | getTransaction () |
| static boolean | isHAServer () |
| static boolean | isMasterHAServer () |
| static ConfigController | getConfigController () |
| static final Timer | getTimer () |
| static final void | setConfig (A3CMLConfig a3config) throws Exception |
| static final A3CMLConfig | getConfig () throws Exception |
| static A3CMLConfig | getAppConfig (String[] domains) throws Exception |
| static final short | getServerId () |
| static final short | getClusterId () |
| static final String | getName () |
| static short | getServerIdByName (String name) throws Exception |
| static String | getProperty (String key) |
| static String | getProperty (String key, String value) |
| static Integer | getInteger (String key) |
| static Integer | getInteger (String key, int value) |
| static Enumeration | elementsServerDesc () |
| static Enumeration | getServersIds () |
| static final String | getHostname (short sid) throws UnknownServerException |
| static final String | getServiceArgs (short sid, String classname) throws Exception |
| static final String | getServiceArgs (String hostname, String classname) throws Exception |
| static int | getStatus () |
| static String | getStatusInfo () |
| static int | init (String args[]) throws Exception |
| static void | reset (boolean force) |
| static void | reset () |
| static void | init (short sid, String path, LoggerFactory loggerFactory) throws Exception |
| static void | init (short sid, String path, LoggerFactory loggerFactory, short cid) throws Exception |
| static String | start () throws Exception |
| static void | stop (boolean sync) |
| static void | stop (boolean sync, long delay, boolean reset) |
| static void | stop () |
| static void | main (String args[]) throws Exception |
Static Public Attributes | |
| static final short | NULL_ID = -1 |
| static final String | ADMIN_DOMAIN = "D0" |
| static final String | ADMIN_SERVER = "s0" |
| static final String | CFG_DIR_PROPERTY = "fr.dyade.aaa.agent.A3CONF_DIR" |
| static final String | DEFAULT_CFG_DIR = null |
| static final String | CFG_FILE_PROPERTY = "fr.dyade.aaa.agent.A3CONF_FILE" |
| static final String | DEFAULT_CFG_FILE = "a3servers.xml" |
| static final String | DEFAULT_SER_CFG_FILE = "a3cmlconfig" |
| static final String | CFG_NAME_PROPERTY = "fr.dyade.aaa.agent.A3CONF_NAME" |
| static final String | DEFAULT_CFG_NAME = "default" |
| static final String | A3CMLWRP_PROPERTY = "fr.dyade.aaa.agent.A3CMLWrapper" |
| static final String | DEFAULT_A3CMLWRP = "fr.dyade.aaa.agent.conf.A3CMLSaxWrapper" |
| static final String | OKSTRING = "OK" |
| static final String | ERRORSTRING = "ERROR" |
| static final String | ENDSTRING = "END" |
Static Package Functions | |
| static void | addConsumer (String domain, MessageConsumer cons) throws Exception |
| static Enumeration | getConsumers () |
| static MessageConsumer | getConsumer (String domain) throws Exception |
| static void | removeConsumer (String domain) |
| static final void | setConfig (A3CMLConfig a3config, boolean force) throws Exception |
| static void | addServerDesc (ServerDesc desc) throws Exception |
| static ServerDesc | removeServerDesc (short sid) throws Exception |
| static final int | getServerNb () |
| static final ServerDesc | getServerDesc (short sid) throws UnknownServerException |
| static final MessageConsumer | getConsumer (short sid) throws UnknownServerException |
| static final ServiceDesc[] | getServices () throws UnknownServerException |
| static void | initServerDesc (ServerDesc desc, A3CMLServer server) throws Exception |
| static String | startConsumers () throws Exception |
Static Package Attributes | |
| static ThreadGroup | tgroup = null |
| static Engine | engine = null |
| static Transaction | transaction = null |
| static Status | status = new Status() |
AgentServer class manages the global configuration of an agent server. It reads the configuration file, then it creates and configure Engine, Channel, Networks. This class contains the main method for AgentServer, for example to activate a server you have to run this class with two parameters: the server id. and the path of the root of persistency. You can also use a specialized main calling methods init and start.
The configuration file contains a config element, that is essentially made up of domains elements, and servers (servers elements):
Network implementation (class SimpleNetwork by default). hostname attribute describes the name or the IP address of this node) network element with attributes giving the domain's name (domain attribute) and the communication port (port attribute). service element describing it. config element or in a server one.
<blockquote>
<?xml version="1.0"?> <!DOCTYPE config SYSTEM "a3config.dtd">
<config> <domain name="D1"/> <domain name="D2" class="fr.dyade.aaa.agent.PoolCnxNetwork"/>
<property name="D2.nbMaxCnx" value="1">
<server id="0" name="S0" hostname="acores">
<network domain="D1" port="16300"/>
<service class=\"fr.dyade.aaa.ns.NameService\" args=\"\"/>
<property name="A3DEBUG_PROXY" value="true">
</server>
<server id="2" name="S2" hostname="bermudes">
<network domain="D1" port="16310"/>
<network domain="D2" port="16312"/>
</server>
<server id="3" name="S3" hostname="baleares">
<network domain="D2" port="16320"/>
</server>
</config>
</blockquote>
This file described a 2 domains configuration D1 and D2, D1 with default network protocol and D2 with the PoolCnxNetwork one, and 4 servers:
Definition at line 144 of file AgentServer.java.
| static Engine fr.dyade.aaa.agent.AgentServer.getEngine | ( | ) | [static] |
Returns the agent server engine.
Definition at line 185 of file AgentServer.java.
References fr.dyade.aaa.agent.AgentServer.engine.
| static Transaction fr.dyade.aaa.agent.AgentServer.getTransaction | ( | ) | [static] |
Returns the agent server transaction context.
Definition at line 195 of file AgentServer.java.
References fr.dyade.aaa.agent.AgentServer.transaction.
| static boolean fr.dyade.aaa.agent.AgentServer.isHAServer | ( | ) | [static] |
| static boolean fr.dyade.aaa.agent.AgentServer.isMasterHAServer | ( | ) | [static] |
Test if the server is a master (coordinator).
Definition at line 216 of file AgentServer.java.
References fr.dyade.aaa.agent.JGroups.isCoordinator().
Here is the call graph for this function:

| static final Timer fr.dyade.aaa.agent.AgentServer.getTimer | ( | ) | [static] |
Returns a shared timer provided by the agent server.
Definition at line 283 of file AgentServer.java.
| static final void fr.dyade.aaa.agent.AgentServer.setConfig | ( | A3CMLConfig | a3config | ) | throws Exception [static] |
Set the agent server configuration. Be careful, this method cannot be called after initialization.
| a3config | A3CMLConfig |
| Exception | Server is already initialized. |
Definition at line 300 of file AgentServer.java.
| static final A3CMLConfig fr.dyade.aaa.agent.AgentServer.getConfig | ( | ) | throws Exception [static] |
Returns the agent server configuration.
Definition at line 320 of file AgentServer.java.
Referenced by fr.dyade.aaa.agent.AgentServer.getAppConfig(), fr.dyade.aaa.agent.AgentServer.getServerIdByName(), fr.dyade.aaa.agent.AgentServer.getServiceArgs(), and fr.dyade.aaa.agent.AgentServer.initServerDesc().
| static A3CMLConfig fr.dyade.aaa.agent.AgentServer.getAppConfig | ( | String[] | domains | ) | throws Exception [static] |
Gets configuration of agent servers for a domain from the current A3CMLConfig object. This method fills the object graph configuration in a A3CMLConfig object.
| domains | list of domain's names |
A3CMLConfig object. Definition at line 333 of file AgentServer.java.
References fr.dyade.aaa.agent.AgentServer.getConfig(), and fr.dyade.aaa.agent.conf.A3CMLConfig.getDomainConfig().
Here is the call graph for this function:

| static short fr.dyade.aaa.agent.AgentServer.getServerIdByName | ( | String | name | ) | throws Exception [static] |
Returns the identifier of the agent server which name is specified.
| name | the name of the agent server |
| Exception | if the server name is unknown. |
Definition at line 358 of file AgentServer.java.
References fr.dyade.aaa.agent.AgentServer.getConfig(), and fr.dyade.aaa.agent.conf.A3CMLConfig.getServerIdByName().
Here is the call graph for this function:

| static String fr.dyade.aaa.agent.AgentServer.getProperty | ( | String | key | ) | [static] |
Searches for the property with the specified key in the server property list.
| key | the hashtable key. |
Definition at line 369 of file AgentServer.java.
Referenced by fr.dyade.aaa.agent.AgentServer.init().
| static String fr.dyade.aaa.agent.AgentServer.getProperty | ( | String | key, | |
| String | value | |||
| ) | [static] |
Searches for the property with the specified key in the server property list.
| key | the hashtable key. | |
| value | a default value. |
Definition at line 381 of file AgentServer.java.
| static Integer fr.dyade.aaa.agent.AgentServer.getInteger | ( | String | key | ) | [static] |
Determines the integer value of the server property with the specified name.
| key | property name. |
Definition at line 392 of file AgentServer.java.
| static Integer fr.dyade.aaa.agent.AgentServer.getInteger | ( | String | key, | |
| int | value | |||
| ) | [static] |
Determines the integer value of the server property with the specified name.
| key | property name. | |
| value | a default value. |
Definition at line 408 of file AgentServer.java.
| static final int fr.dyade.aaa.agent.AgentServer.getServerNb | ( | ) | [static, package] |
Gets the number of server known on the current server.
Definition at line 441 of file AgentServer.java.
References fr.dyade.aaa.agent.ServersHT.size().
Here is the call graph for this function:

| static final ServerDesc fr.dyade.aaa.agent.AgentServer.getServerDesc | ( | short | sid | ) | throws UnknownServerException [static, package] |
Gets the characteristics of the corresponding server.
| sid | agent server id. |
Definition at line 451 of file AgentServer.java.
References fr.dyade.aaa.agent.ServersHT.get().
Referenced by fr.dyade.aaa.agent.AgentServer.getConsumer(), fr.dyade.aaa.agent.AgentServer.getHostname(), fr.dyade.aaa.agent.AgentServer.getServices(), and fr.dyade.aaa.agent.AgentServer.init().
Here is the call graph for this function:

| static final MessageConsumer fr.dyade.aaa.agent.AgentServer.getConsumer | ( | short | sid | ) | throws UnknownServerException [static, package] |
Gets the message consumer for the corresponding server.
| sid | agent server id. |
Definition at line 464 of file AgentServer.java.
References fr.dyade.aaa.agent.ServerDesc.domain, and fr.dyade.aaa.agent.AgentServer.getServerDesc().
Here is the call graph for this function:

| static final String fr.dyade.aaa.agent.AgentServer.getHostname | ( | short | sid | ) | throws UnknownServerException [static] |
Get the host name of an agent server.
| sid | agent server id |
Definition at line 474 of file AgentServer.java.
References fr.dyade.aaa.agent.ServerDesc.getHostname(), and fr.dyade.aaa.agent.AgentServer.getServerDesc().
Here is the call graph for this function:

| static final ServiceDesc [] fr.dyade.aaa.agent.AgentServer.getServices | ( | ) | throws UnknownServerException [static, package] |
Get the description of all services of the current agent server.
Definition at line 483 of file AgentServer.java.
References fr.dyade.aaa.agent.AgentServer.getServerDesc(), fr.dyade.aaa.agent.AgentServer.getServerId(), and fr.dyade.aaa.agent.ServerDesc.services.
Here is the call graph for this function:

| static final String fr.dyade.aaa.agent.AgentServer.getServiceArgs | ( | short | sid, | |
| String | classname | |||
| ) | throws Exception [static] |
Get the argument strings for a particular service. The information provides from the A3 configuration file, so it's only available if this file contains service's informations for all nodes.
| sid | agent server id | |
| classname | the service class name |
| UnknownServerException | The specified server does not exist. | |
| UnknownServiceException | The specified service is not declared on this server. | |
| Exception | Probably there is no configuration defined. |
Definition at line 506 of file AgentServer.java.
References fr.dyade.aaa.agent.AgentServer.getConfig(), and fr.dyade.aaa.agent.conf.A3CMLConfig.getServiceArgs().
Here is the call graph for this function:

| static final String fr.dyade.aaa.agent.AgentServer.getServiceArgs | ( | String | hostname, | |
| String | classname | |||
| ) | throws Exception [static] |
Get the argument strings for a particular service running on a server identified by its host. The information provides from the A3 configuration file, so it's only available if this file contains service's informations for all nodes.
| hostname | hostname | |
| classname | the service class name |
| UnknownServiceException | The specified service is not declared on this server. | |
| Exception | Probably there is no configuration defined. |
Definition at line 529 of file AgentServer.java.
References fr.dyade.aaa.agent.AgentServer.getConfig(), and fr.dyade.aaa.agent.conf.A3CMLConfig.getServiceArgsHost().
Here is the call graph for this function:

| static int fr.dyade.aaa.agent.AgentServer.init | ( | String | args[] | ) | throws Exception [static] |
Parses agent server arguments, then initializes this agent server. The start function is then called to start this agent server execution. Between the init and start calls, agents may be created and deployed, and notifications may be sent using the Channel sendTo function.
| args | launching arguments, the first one is the server id and the second one the persistency directory. |
| Exception | unspecialized exception |
Definition at line 796 of file AgentServer.java.
References fr.dyade.aaa.agent.AgentServer.NULL_ID.
Referenced by fr.dyade.aaa.agent.AgentServer.init(), and fr.dyade.aaa.agent.AgentServer.main().
| static void fr.dyade.aaa.agent.AgentServer.reset | ( | ) | [static] |
Cleans an AgentServer configuration in order to restart it from persistent storage.
Definition at line 836 of file AgentServer.java.
References fr.dyade.aaa.util.Transaction.close(), fr.dyade.aaa.agent.AgentServer.getConsumers(), fr.dyade.aaa.agent.AgentServer.getName(), fr.dyade.aaa.agent.AgentServer.getStatusInfo(), fr.dyade.aaa.agent.AgentServer.status, and fr.dyade.aaa.agent.AgentServer.transaction.
Referenced by fr.dyade.aaa.agent.AgentServer.init(), and fr.dyade.aaa.agent.AgentServer.reset().
Here is the call graph for this function:

| static void fr.dyade.aaa.agent.AgentServer.init | ( | short | sid, | |
| String | path, | |||
| LoggerFactory | loggerFactory | |||
| ) | throws Exception [static] |
Initializes this agent server. start function is then called to start this agent server execution. Between the init and start calls, agents may be created and deployed, and notifications may be sent using the Channel sendTo function.
| sid | the server id | |
| path | the persistency directory. | |
| loggerFactory | the monolog LoggerFactory; |
| Exception | unspecialized exception |
Definition at line 905 of file AgentServer.java.
References fr.dyade.aaa.agent.AgentServer.init(), and fr.dyade.aaa.agent.AgentServer.NULL_ID.
Here is the call graph for this function:

| static void fr.dyade.aaa.agent.AgentServer.init | ( | short | sid, | |
| String | path, | |||
| LoggerFactory | loggerFactory, | |||
| short | cid | |||
| ) | throws Exception [static] |
Initializes this agent server. start function is then called to start this agent server execution. Between the init and start calls, agents may be created and deployed, and notifications may be sent using the Channel sendTo function.
| sid | the server id | |
| path | the persistency directory. | |
| loggerFactory | the monolog LoggerFactory; | |
| cid | the cluster id |
| Exception | unspecialized exception |
Definition at line 927 of file AgentServer.java.
References fr.dyade.aaa.agent.conf.A3CMLConfig.addDomain(), fr.dyade.aaa.agent.conf.A3CMLConfig.addServer(), fr.dyade.aaa.agent.conf.A3CMLDomain.addServer(), fr.dyade.aaa.agent.AgentServer.ADMIN_DOMAIN, fr.dyade.aaa.agent.AgentServer.ADMIN_SERVER, fr.dyade.aaa.util.Transaction.begin(), fr.dyade.aaa.util.Transaction.commit(), fr.dyade.aaa.agent.AgentServer.DEFAULT_SER_CFG_FILE, fr.dyade.aaa.agent.ServiceDesc.getArguments(), fr.dyade.aaa.agent.ServiceDesc.getClassName(), fr.dyade.aaa.agent.conf.A3CMLConfig.getConfig(), fr.dyade.aaa.util.Transaction.getList(), fr.dyade.aaa.agent.AgentServer.getName(), fr.dyade.aaa.agent.AgentServer.getProperty(), fr.dyade.aaa.agent.AgentServer.getServerDesc(), fr.dyade.aaa.agent.AgentServer.getStatusInfo(), fr.dyade.aaa.util.Transaction.init(), fr.dyade.aaa.agent.conf.A3CMLConfig.load(), fr.dyade.aaa.agent.conf.A3CMLServer.networks, fr.dyade.aaa.agent.AgentServer.NULL_ID, fr.dyade.aaa.agent.AgentServer.reset(), fr.dyade.aaa.agent.conf.A3CMLConfig.save(), fr.dyade.aaa.agent.conf.A3CMLServer.services, fr.dyade.aaa.agent.AgentServer.status, fr.dyade.aaa.agent.AgentServer.tgroup, and fr.dyade.aaa.agent.AgentServer.transaction.
Here is the call graph for this function:

| static String fr.dyade.aaa.agent.AgentServer.start | ( | ) | throws Exception [static] |
Causes this AgentServer to begin its execution. This method starts all MessageConsumer (i.e. the engine and the network components).
Definition at line 1273 of file AgentServer.java.
References fr.dyade.aaa.util.Transaction.begin(), fr.dyade.aaa.util.Transaction.commit(), fr.dyade.aaa.agent.AgentServer.getName(), fr.dyade.aaa.agent.AgentServer.getStatusInfo(), fr.dyade.aaa.agent.AgentServer.status, and fr.dyade.aaa.agent.AgentServer.transaction.
Referenced by fr.dyade.aaa.agent.AgentServer.main().
Here is the call graph for this function:

| static void fr.dyade.aaa.agent.AgentServer.stop | ( | boolean | sync | ) | [static] |
Forces this AgentServer to stop executing. This method stops all consumers and services. Be careful, if you specify a synchronous process, this method wait for all server's thread to terminate; so if this method is called from a server's thread it should result a dead-lock.
| sync | If true the stop is processed synchronously, otherwise a thread is created and the method returns. |
Definition at line 1365 of file AgentServer.java.
References fr.dyade.aaa.agent.AgentServer.stop().
Here is the call graph for this function:

| static void fr.dyade.aaa.agent.AgentServer.stop | ( | boolean | sync, | |
| long | delay, | |||
| boolean | reset | |||
| ) | [static] |
Forces this AgentServer to stop executing. This method stops all consumers and services. Be careful, if you specify a synchronous process, this method wait for all server's thread to terminate; so if this method is called from a server's thread it should result a dead-lock.
| sync | If true the stop is processed synchronously, otherwise a thread is created and the method returns. | |
| delay | if sync is false then the thread in charge of stopping the server waits this delay before initiating the stop. | |
| reset | If true the server is stopped then reseted. |
Definition at line 1383 of file AgentServer.java.
| static void fr.dyade.aaa.agent.AgentServer.stop | ( | ) | [static] |
Forces this AgentServer to stop executing. This method stops all consumers and services. Be careful, the stop process is now synchronous and wait for all server's thread to terminate ; If this method is called from a server's thread it should result a dead-lock.
Definition at line 1424 of file AgentServer.java.
References fr.dyade.aaa.util.Timer.cancel(), fr.dyade.aaa.agent.AgentServer.getName(), fr.dyade.aaa.agent.AgentServer.getStatusInfo(), fr.dyade.aaa.agent.AgentServer.getThreadGroup(), fr.dyade.aaa.agent.AgentServer.status, fr.dyade.aaa.util.Transaction.stop(), and fr.dyade.aaa.agent.AgentServer.transaction.
Referenced by fr.dyade.aaa.agent.AgentServer.stop().
Here is the call graph for this function:

| static void fr.dyade.aaa.agent.AgentServer.main | ( | String | args[] | ) | throws Exception [static] |
Main for a standard agent server. The start arguments include in first position the identifier of the agent server to start, and in second position the directory name where the agent server stores its persistent data.
| args | start arguments |
| Exception | unspecialized exception |
Definition at line 1528 of file AgentServer.java.
References fr.dyade.aaa.agent.AgentServer.ENDSTRING, fr.dyade.aaa.agent.AgentServer.ERRORSTRING, fr.dyade.aaa.agent.AgentServer.getName(), fr.dyade.aaa.agent.AgentServer.init(), fr.dyade.aaa.agent.AgentServer.OKSTRING, and fr.dyade.aaa.agent.AgentServer.start().
Here is the call graph for this function:

Engine fr.dyade.aaa.agent.AgentServer.engine = null [static, package] |
Static reference to the engine. Used in Channel.sendTo to know if the method is called from a react or no.
Definition at line 180 of file AgentServer.java.
Referenced by fr.dyade.aaa.agent.AgentServer.getEngine().
Transaction fr.dyade.aaa.agent.AgentServer.transaction = null [static, package] |
Static reference to the transactional monitor.
Definition at line 190 of file AgentServer.java.
Referenced by fr.dyade.aaa.agent.AgentServer.getTransaction(), fr.dyade.aaa.agent.AgentServer.init(), fr.dyade.aaa.agent.AgentServer.reset(), fr.dyade.aaa.agent.AgentServer.start(), and fr.dyade.aaa.agent.AgentServer.stop().
1.5.0