com.theopenstack.rtpdemo.util
Class ServiceLocator

java.lang.Object
  |
  +--com.theopenstack.rtpdemo.util.ServiceLocator

public class ServiceLocator
extends java.lang.Object

A utility class abstracting JNDI lookups of EJB objects. Provides caching service as well.


Method Summary
static ServiceLocator getInstance()
          An access point to ServiceLocator.
 java.lang.Object lookup(java.lang.String jndiName, java.lang.Class homeClass)
          Lookup an object in the JNDI tree.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static ServiceLocator getInstance()
                                  throws ServiceLocatorException
An access point to ServiceLocator.

Returns:
A reference to the ServiceLocator
Throws:
ServiceLocatorException - If any problem occured during the lookup

lookup

public java.lang.Object lookup(java.lang.String jndiName,
                               java.lang.Class homeClass)
                        throws ServiceLocatorException
Lookup an object in the JNDI tree. The method returns Object to facilitate the universal use of EJBHome and EJBLocalHome. The client's responsibility is to cast the reference to the correct type.

Throws:
ServiceLocatorException - If any error occured