InitialContext

An application uses an InitialContext object to create objects from object definitions that are retrieved from a repository of administered objects.

    Inheritance hierarchy:
    None

Parent topic: .NET interfaces


.NET properties

    Summary of .NET properties:

    .NET property Description
    Environment Get the environment.


Environment - Get the environment

    Interface:
    Hashtable Environment
    {
         get;
    }

Get the environment.

    Exceptions:

    • Exceptions are specific to the directory service being used.


Constructors

    Summary of constructors:

    Constructor Description
    InitialContext Create an InitialContext object.


InitialContext - Create Initial Context

    Interface:
    InitialContext(Hashtable env);

Create an InitialContext object.

    Parameters:

    The information required to establish a connection to the repository of administered objects is provided to the constructor in an environment Hashtable.

    Exceptions:

    • XMSException


Methods

    Summary of methods:

    Method Description
    AddToEnvironment Add a new property to the environment.
    Close Close this context.
    Lookup Create an object from an object definition that is retrieved from the repository of administered objects.
    RemoveFromEnvironment Remove a property from the environment.


AddToEnvironment - Add a New Property to the Environment

    Interface:
    Object AddToEnvironment(String propName, Object propVal);

Add a new property to the environment.

    Parameters:

      propName (input)
      A String object encapsulating the name of the property to be added.

      propVal (input)
      The value of the property to be added.

    Returns:
    The old value of the property.

    Exceptions:

    • Exceptions are specific to the directory service being used.


Close - Close this context

    Interface:
    void Close()

Close this context.

    Parameters:
    None

    Returns:
    None

    Exceptions:

    • Exceptions are specific to the directory service being used.


Lookup - Look Up Object in Initial Context

    Interface:
    Object Lookup(String name);

Create an object from an object definition that is retrieved from the repository of administered objects.

    Parameters:

      name (input)
      A String object encapsulating the name of the administered object to be retrieved. The name can be either a simple name or a complex name. For further details, see Retrieval of administered objects.

    Returns:
    Either an IConnectionFactory or an IDestination, depending on the type of object being retrieved. If the function can access the directory, but cannot find the required object, a null is returned.

    Exceptions:

    • Exceptions are specific to the directory service being used.


RemoveFromEnvironment - Remove a Property from the Environment

    Interface:
    Object RemoveFromEnvironment(String propName);

Remove a property from the environment.

    Parameters:

      propName (input)
      A String object encapsulating the name of the property to be removed.

    Returns:
    The object that was removed.

    Exceptions:

    • Exceptions are specific to the directory service being used.