[TIBCO.EMS .NET client library 8.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

ExceptionCondition
TIBCO.EMS..::.AuthenticationExceptionIf authentication to the naming server has failed.
TIBCO.EMS..::.ServiceUnavailableExceptionIf the naming service is unavailable.
TIBCO.EMS..::.NamingExceptionIf the named object is not found or the query to the naming service failed.

See Also