ADK CVS

tryllian.naming
Interface NamingConstants


public interface NamingConstants

This interface contains useful constants for manipulating the JNDI context used by the ADK, and address agent based on these bindings. To get the initial ARE context an agent has to call ExecutionEnvironment.getJNDIContext(). Contexts created this way are associated with the agent that created it. This means that the JNDI names can contain local references such as LOCAL_HABITAT. The agent does have to get a new fresh ADK JNDI Context from the ExecutionEnvironment after every move for this to work reliable, but since the returned context is not Serializable anyway that is required anyway when using the ADK JNDI context from an agent.

Non-agent code can create an ARE JNDI context by initializing the JNDI InitialContext environment with the value of the constant INITIAL_CONTEXT_FACTORY as follows:

     Hashtable environment = new Hashtable();
     environment.add(Context.INITIAL_CONTEXT_FACTORY,
                     NamingConstant.INITIAL_CONTEXT_FACTORY);
     Context context = InitialContext(environment);
 
Note that you need to make sure that all runtime classes are included in the context class loader (which happens automatically when you use the are-startup.jar to launch your application or service). In general the following construct will work:
      Thread thread = Thread.currentThread();
      ClassLoader currentCl = thread.getContextClassLoader();
      try {
          thread.setContextClassLoader(this.getClass().getClassLoader());
          jndi = new InitialContext(environment);
      } finally {
          thread.setContextClassLoader(currentCl);
      }
 
XXX How about setting/having the habitat-id ?!?

The ADK JNDI context contains at least one subcontext, the ROOT_CONTEXT. This root context contains all habitats known to the current habitat. Your current local habitat can be found as a subcontext called LOCAL_HABITAT (or directly as context by CURRENT_HABITAT_CONTEXT).

There are three generic type of constants in this class. These are described below by the last part of the name of the variable:

See Also:
AddressURI, ExecutionEnvironment.getJNDIContext(), InitialContext

Field Summary
static java.lang.String AGENT_STATISTICS_SA
          The name of the Agent Statistics System Agent.
static java.lang.String AGENT_STATISTICS_SA_PATH
          The path to the Tryllian Agent Statistics System Agent context.
static java.lang.String AGENTS_CONTEXT
          The full name of the system agents part of the tryllian namespace.
static java.lang.String AGENTS_PATH
          The base path to the Tryllian Agents context.
static java.lang.String AGENTS_SPACE
          The name of the agents namespace, where canonical agent names are bound.
static java.lang.String ALL_HABITATS_CONTEXT
          The full name of union of all habitats
static java.lang.String ALL_HABITATS_NAMES_CONTEXT
          The full name of union of all names of all habitats namespace.
static java.lang.String CURRENT_HABITAT_CONTEXT
          The full name of the current local habitat.
static java.lang.String ECHO_SA
          The name of the Echo System Agent.
static java.lang.String ECHO_SA_PATH
          The path to the Tryllian Echo System Agent context.
static java.lang.String FILETRANSFER_SA
          The name of the file transfer system agent
static java.lang.String FILETRANSFER_SA_PATH
          The path to the Tryllian Filetransfer System Agent context.
static java.lang.String GLOBAL_HABITAT
          Symbolic link to the global habitat.
static java.lang.String GROUPS_CONTEXT
          The full name of the groups context.
static java.lang.String GROUPS_PATH
          The base path for the groups context.
static java.lang.String GROUPS_SPACE
          The name of the groups namespace.
static java.lang.String HABITAT_NAMES_CONTEXT
          The full name of the namespace with all nnames of the local habitat.
static java.lang.String HABITAT_NAMES_SPACE
          The name of the habitat-names namespace
static java.lang.String HABITAT_SA
          The name of the Habitat System Agent.
static java.lang.String HABITAT_SA_PATH
          The path to the Tryllian Habitat System Agent context.
static java.lang.String INITIAL_CONTEXT_FACTORY
          The name of the factory class to use for the Context.INITIAL_CONTEXT_FACTORY environment property.
static java.lang.String JNDI_SA
          The name of the JNDI System Agent.
static java.lang.String JNDI_SA_PATH
          The path to the Tryllian JNDI System Agent context.
static java.lang.String LOCAL_HABITAT
          Symbolic link to the local habitat.
static java.lang.String MESSAGE_BROKER_SA
          The name of the Message Broker System Agent.
static java.lang.String MESSAGE_BROKER_SA_PATH
          The path to the Tryllian Message Broker System Agent context.
static java.lang.String PROPERTIES_SA
          The name of the Properties System Agent.
static java.lang.String PROPERTIES_SA_PATH
          The path to the Tryllian Properties System Agent context.
static java.lang.String ROOT_CONTEXT
          The root context of the ADK.
static java.lang.String ROOT_SPACE
          The name of the root namespace.
static java.lang.String SEP
          The character used to separate JNDI name components.
static java.lang.String SERVICES_CONTEXT
          The full name of the service agents part of the tryllian namespace.
static java.lang.String SERVICES_PATH
          The base path to the Tryllian Services context.
static java.lang.String SERVICES_SPACE
          The name of the services namespace.
static java.lang.String STATISTICS_SA
          The name of the Statistics System Agent.
static java.lang.String STATISTICS_SA_PATH
          The path to the Tryllian Statistics System Agent context.
static java.lang.String SYSTEM_AGENTS_CONTEXT
          The full name of the system agents part of the tryllian namespace.
static java.lang.String SYSTEM_AGENTS_PATH
          The base path to the Tryllian System Agents context.
static java.lang.String SYSTEM_AGENTS_SPACE
          The name of the system agents namespace.
static java.lang.String TRANSPORTER_SA
          The name of the Transporter System Agent.
static java.lang.String TRANSPORTER_SA_PATH
          The path to the Tryllian Transporter System Agent context.
static java.lang.String TRYLLIAN_CONTEXT
          The full name of the tryllian part of the namespace
static java.lang.String TRYLLIAN_PATH
          The base path to the Tryllian context.
static java.lang.String TRYLLIAN_SPACE
          The name of the Tryllian namespace.
static java.lang.String USER_CONTEXT
          The full name of the user part of the namespace.
static java.lang.String USER_PATH
          The base path to the User context.
static java.lang.String USER_SPACE
          The name of the user namespace.
static java.lang.String WAKEUP_SA
          The name of the WakeUp System Agent.
static java.lang.String WAKEUP_SA_PATH
          The path to the Tryllian WakeUp System Agent context.
 

Field Detail

INITIAL_CONTEXT_FACTORY

public static final java.lang.String INITIAL_CONTEXT_FACTORY
The name of the factory class to use for the Context.INITIAL_CONTEXT_FACTORY environment property.

See Also:
Constant Field Values

SEP

public static final java.lang.String SEP
The character used to separate JNDI name components.

See Also:
Constant Field Values

LOCAL_HABITAT

public static final java.lang.String LOCAL_HABITAT
Symbolic link to the local habitat.

See Also:
Constant Field Values

GLOBAL_HABITAT

public static final java.lang.String GLOBAL_HABITAT
Symbolic link to the global habitat.

See Also:
Constant Field Values

TRYLLIAN_SPACE

public static final java.lang.String TRYLLIAN_SPACE
The name of the Tryllian namespace.

See Also:
Constant Field Values

USER_SPACE

public static final java.lang.String USER_SPACE
The name of the user namespace.

See Also:
Constant Field Values

ROOT_SPACE

public static final java.lang.String ROOT_SPACE
The name of the root namespace.

See Also:
Constant Field Values

SERVICES_SPACE

public static final java.lang.String SERVICES_SPACE
The name of the services namespace.

See Also:
Constant Field Values

SYSTEM_AGENTS_SPACE

public static final java.lang.String SYSTEM_AGENTS_SPACE
The name of the system agents namespace.

See Also:
Constant Field Values

AGENTS_SPACE

public static final java.lang.String AGENTS_SPACE
The name of the agents namespace, where canonical agent names are bound.

See Also:
Constant Field Values

HABITAT_NAMES_SPACE

public static final java.lang.String HABITAT_NAMES_SPACE
The name of the habitat-names namespace

See Also:
Constant Field Values

GROUPS_SPACE

public static final java.lang.String GROUPS_SPACE
The name of the groups namespace.

See Also:
Constant Field Values

ROOT_CONTEXT

public static final java.lang.String ROOT_CONTEXT
The root context of the ADK. This context contains all known habitat names.

It is defined as ROOT_SPACE + SEP.

See Also:
Constant Field Values

CURRENT_HABITAT_CONTEXT

public static final java.lang.String CURRENT_HABITAT_CONTEXT
The full name of the current local habitat.

It is defined as ROOT_CONTEXT + LOCAL_HABITAT + SEP.

See Also:
Constant Field Values

ALL_HABITATS_CONTEXT

public static final java.lang.String ALL_HABITATS_CONTEXT
The full name of union of all habitats

It is defined as ROOT_CONTEXT + GLOBAL_HABITAT + SEP.

See Also:
Constant Field Values

TRYLLIAN_CONTEXT

public static final java.lang.String TRYLLIAN_CONTEXT
The full name of the tryllian part of the namespace

It is defined as CURRENT_HABITAT_CONTEXT + TRYLLIAN_SPACE + SEP.

See Also:
Constant Field Values

TRYLLIAN_PATH

public static final java.lang.String TRYLLIAN_PATH
The base path to the Tryllian context.

It is defined as TRYLLIAN_SPACE + SEP

See Also:
Constant Field Values

USER_CONTEXT

public static final java.lang.String USER_CONTEXT
The full name of the user part of the namespace.

It is defined as CURRENT_HABITAT_CONTEXT + USER_SPACE + SEP.

See Also:
Constant Field Values

USER_PATH

public static final java.lang.String USER_PATH
The base path to the User context. It can be used to create addresses to user defined JDNI contexts and bindings.

It is defined as USER_SPACE + SEP

See Also:
Constant Field Values

SYSTEM_AGENTS_CONTEXT

public static final java.lang.String SYSTEM_AGENTS_CONTEXT
The full name of the system agents part of the tryllian namespace.

It is defined as TRYLLIAN_CONTEXT + SYSTEM_AGENTS_SPACE + SEP.

See Also:
Constant Field Values

SYSTEM_AGENTS_PATH

public static final java.lang.String SYSTEM_AGENTS_PATH
The base path to the Tryllian System Agents context. It can be used to create addresses for Tryllian System Agents.

It is defined as TRYLLIAN_PATH + SYSTEM_AGENTS_SPACE + SEP

See Also:
Constant Field Values

AGENTS_CONTEXT

public static final java.lang.String AGENTS_CONTEXT
The full name of the system agents part of the tryllian namespace.

It is defined as TRYLLIAN_CONTEXT + SEP + AGENTS_SPACE + SEP.

See Also:
Constant Field Values

HABITAT_NAMES_CONTEXT

public static final java.lang.String HABITAT_NAMES_CONTEXT
The full name of the namespace with all nnames of the local habitat.

It is defined as CURRENT_HABITAT_CONTEXT + TRYLLIAN_SPACE + SEP + HABITAT_NAMES_SPACE + SEP;.

See Also:
Constant Field Values

ALL_HABITATS_NAMES_CONTEXT

public static final java.lang.String ALL_HABITATS_NAMES_CONTEXT
The full name of union of all names of all habitats namespace.

It is defined as ALL_HABITATS_CONTEXT + TRYLLIAN_SPACE + SEP + HABITAT_NAMES_SPACE + SEP;.

See Also:
Constant Field Values

AGENTS_PATH

public static final java.lang.String AGENTS_PATH
The base path to the Tryllian Agents context. It can be used to create addresses for agents with their IDReference as name.

It is defined as TRYLLIAN_PATH + AGENTS_SPACE + SEP

See Also:
Constant Field Values

SERVICES_CONTEXT

public static final java.lang.String SERVICES_CONTEXT
The full name of the service agents part of the tryllian namespace.

It is defined as CURRENT_HABITAT_CONTEXT + SERVICES_SPACE + SEP.

See Also:
Constant Field Values

SERVICES_PATH

public static final java.lang.String SERVICES_PATH
The base path to the Tryllian Services context. It can be used to create addresses for name based services as registered with "register-sender-as-service" protocol.

It is defined as SERVICES_SPACE + SEP

See Also:
Constant Field Values

GROUPS_CONTEXT

public static final java.lang.String GROUPS_CONTEXT
The full name of the groups context. Using the JNDI System Agent, agents can use this context to organize themselves in groups. It is defined as USER_CONTEXT + GROUPS_SPACE + SEP

See Also:
Constant Field Values

GROUPS_PATH

public static final java.lang.String GROUPS_PATH
The base path for the groups context. It is defined as GROUPS_SPACE + SEP

See Also:
Constant Field Values

HABITAT_SA

public static final java.lang.String HABITAT_SA
The name of the Habitat System Agent.

See Also:
Constant Field Values

HABITAT_SA_PATH

public static final java.lang.String HABITAT_SA_PATH
The path to the Tryllian Habitat System Agent context. It can be used to create the address for the Habitat System Agent.

It is defined as SYSTEM_AGENTS_PATH + HABITAT_SA

See Also:
Constant Field Values

ECHO_SA

public static final java.lang.String ECHO_SA
The name of the Echo System Agent.

See Also:
Constant Field Values

ECHO_SA_PATH

public static final java.lang.String ECHO_SA_PATH
The path to the Tryllian Echo System Agent context. It can be used to create the address for the Echo System Agent.

It is defined as TRYLLIAN_PATH + SYSTEM_AGENTS_PATH + SEP

See Also:
Constant Field Values

FILETRANSFER_SA

public static final java.lang.String FILETRANSFER_SA
The name of the file transfer system agent

See Also:
Constant Field Values

FILETRANSFER_SA_PATH

public static final java.lang.String FILETRANSFER_SA_PATH
The path to the Tryllian Filetransfer System Agent context. It can be used to create the address for the FileTransfers System Agent.

It is defined as TRYLLIAN_PATH + SYSTEM_AGENTS_PATH + SEP

See Also:
Constant Field Values

AGENT_STATISTICS_SA

public static final java.lang.String AGENT_STATISTICS_SA
The name of the Agent Statistics System Agent.

See Also:
Constant Field Values

AGENT_STATISTICS_SA_PATH

public static final java.lang.String AGENT_STATISTICS_SA_PATH
The path to the Tryllian Agent Statistics System Agent context. It can be used to create the address for the Agent Statistics System Agent.

It is defined as SYSTEM_AGENTS_PATH + AGENT_STATISTICS_SA

See Also:
Constant Field Values

MESSAGE_BROKER_SA

public static final java.lang.String MESSAGE_BROKER_SA
The name of the Message Broker System Agent.

See Also:
Constant Field Values

MESSAGE_BROKER_SA_PATH

public static final java.lang.String MESSAGE_BROKER_SA_PATH
The path to the Tryllian Message Broker System Agent context. It can be used to create the address for the Message Broker System Agent.

It is defined as SYSTEM_AGENTS_PATH + MESSAGE_BROKER_SA

See Also:
Constant Field Values

PROPERTIES_SA

public static final java.lang.String PROPERTIES_SA
The name of the Properties System Agent.

See Also:
Constant Field Values

PROPERTIES_SA_PATH

public static final java.lang.String PROPERTIES_SA_PATH
The path to the Tryllian Properties System Agent context. It can be used to create the address for the Properties System Agent.

It is defined as SYSTEM_AGENTS_PATH + PROPERTIES_SA

See Also:
Constant Field Values

STATISTICS_SA

public static final java.lang.String STATISTICS_SA
The name of the Statistics System Agent.

See Also:
Constant Field Values

STATISTICS_SA_PATH

public static final java.lang.String STATISTICS_SA_PATH
The path to the Tryllian Statistics System Agent context. It can be used to create the address for the Statistics System Agent.

It is defined as SYSTEM_AGENTS_PATH + STATISTICS_SA

See Also:
Constant Field Values

TRANSPORTER_SA

public static final java.lang.String TRANSPORTER_SA
The name of the Transporter System Agent.

See Also:
Constant Field Values

TRANSPORTER_SA_PATH

public static final java.lang.String TRANSPORTER_SA_PATH
The path to the Tryllian Transporter System Agent context. It can be used to create the address for the Transporter System Agent.

It is defined as SYSTEM_AGENTS_PATH + TRANSPORTER_SA

See Also:
Constant Field Values

WAKEUP_SA

public static final java.lang.String WAKEUP_SA
The name of the WakeUp System Agent.

See Also:
Constant Field Values

WAKEUP_SA_PATH

public static final java.lang.String WAKEUP_SA_PATH
The path to the Tryllian WakeUp System Agent context. It can be used to create the address for the WakeUp System Agent.

It is defined as SYSTEM_AGENTS_PATH + WAKEUP_SA

See Also:
Constant Field Values

JNDI_SA

public static final java.lang.String JNDI_SA
The name of the JNDI System Agent.

See Also:
Constant Field Values

JNDI_SA_PATH

public static final java.lang.String JNDI_SA_PATH
The path to the Tryllian JNDI System Agent context. It can be used to create the address for the JNDI System Agent.

It is defined as SYSTEM_AGENTS_PATH + JNDI_SA

See Also:
Constant Field Values

Copyright 2005, Tryllian Solutions B.V.