Collapse All Expand All

.NET Framework Class Library
LookupContext Class See Also

[TIBCO.EMS .NET client library 5.1 documentation]

Lookup an object in the naming server

Namespace: TIBCO.EMS
Assembly: TIBCO.EMS (in TIBCO.EMS.dll)

# Syntax

    public virtual Object Lookup(
    	string name
    )

    Public Overridable Function Lookup ( _
    	name As String _
    ) As Object

    public:
    virtual Object^ Lookup(
    	String^ name
    )

#### Parameters

name
  Type: System..::.String
  The name of the object to look up from the naming server.

#### Return Value

The named object.

#### Implements

ILookupContext..::.Lookup(String)

# Remarks

This method provides the naming service to query an object by its name.

# Examples

For example:

| Copy Code
--- | ---
                     Hashtable env = new Hashtable();
                     env.Add(LookupContext.PROVIDER_URL, "tibjmsnaming://localhost:7222");
                     env.Add(LookupContext.SECURITY_PRINCIPAL", "myUserName");
                     env.Add(LookupContext.SECURITY_CREDENTIALS", "myPassword");
                     try {
                           LookupContext searcher = new LookupContext(env);
                           TIBCO.EMS.Queue queue = (TIBCO.EMS.Queue)searcher.Lookup("theQueueName");
                           ...
                     } catch (NamingException) {
                           ...
                     }

# Exceptions

Exception | Condition
--- | ---
TIBCO.EMS..::.AuthenticationException | If authentication to the naming server has failed.
TIBCO.EMS..::.ServiceUnavailableException | If the naming service is unavailable.
TIBCO.EMS..::.NamingException | If the named object is not found or the query to the naming service failed.

# See Also

LookupContext Class
TIBCO.EMS Namespace