org.apache.hivemind.lib.impl
Class NameLookupImpl

java.lang.Object
  extended by org.apache.hivemind.lib.impl.NameLookupImpl
All Implemented Interfaces:
java.util.EventListener, NameLookup, RemoteExceptionListener

public class NameLookupImpl
extends java.lang.Object
implements NameLookup, RemoteExceptionListener

Standard implementation of the NameLookup service interface.

Author:
Howard Lewis Ship

Constructor Summary
NameLookupImpl()
           
 
Method Summary
protected  javax.naming.Context constructContext(java.util.Hashtable properties)
          Constructs the InitialContext (this is separated out in a standalone method so that it may be overridden in a testing subclass).
 java.lang.Object lookup(java.lang.String name, java.lang.Class expected)
          Performs the lookup, returning the object that was found.
 void remoteExceptionDidOccur(RemoteExceptionEvent event)
          Sets the InitialContext to null.
 void setCoordinator(RemoteExceptionCoordinator coordinator)
           
 void setInitialFactory(java.lang.String string)
          Sets the initial factory used to create the initial JNDI context.
 void setProviderURL(java.lang.String string)
          Sets the JNDI provider URL, used to create the initial JNDI context.
 void setURLPackages(java.lang.String string)
          Sets the URL packages, used to create the initial JNDI context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NameLookupImpl

public NameLookupImpl()
Method Detail

lookup

public java.lang.Object lookup(java.lang.String name,
                               java.lang.Class expected)
Description copied from interface: NameLookup
Performs the lookup, returning the object that was found.

Specified by:
lookup in interface NameLookup
Parameters:
name - the name to lookup
expected - the expected class of the object; the object found must be assignable to this class (which may be a class or interface)

constructContext

protected javax.naming.Context constructContext(java.util.Hashtable properties)
                                         throws javax.naming.NamingException
Constructs the InitialContext (this is separated out in a standalone method so that it may be overridden in a testing subclass).

Throws:
javax.naming.NamingException

remoteExceptionDidOccur

public void remoteExceptionDidOccur(RemoteExceptionEvent event)
Sets the InitialContext to null.

Specified by:
remoteExceptionDidOccur in interface RemoteExceptionListener

setInitialFactory

public void setInitialFactory(java.lang.String string)
Sets the initial factory used to create the initial JNDI context. Equivalent to the system property java.naming.factory.initial.


setProviderURL

public void setProviderURL(java.lang.String string)
Sets the JNDI provider URL, used to create the initial JNDI context. Equivalent to the system property java.naming.provider.url.


setURLPackages

public void setURLPackages(java.lang.String string)
Sets the URL packages, used to create the initial JNDI context. Equivalent to the system property java.naming.factory.url.pkgs


setCoordinator

public void setCoordinator(RemoteExceptionCoordinator coordinator)


Copyright © 2003-2007 Apache Software Foundation. All Rights Reserved.