org.perfectjpattern.jee.business.servicelocator
Class ServiceLocator

java.lang.Object
  extended by org.perfectjpattern.jee.business.servicelocator.ServiceLocator
All Implemented Interfaces:
ISingleton, IServiceLocator

public final class ServiceLocator
extends Object
implements IServiceLocator, ISingleton

Generic componentized implementation of IServiceLocator. Provides concrete IServiceLocator implementations with reusable JNDI service lookup and Services caching.

Note that all initial properties are loaded from the jndi.properties file

Version:
$Revision: 1.0 $Date: Feb 7, 2009 2:35:20 PM $
Author:
Giovanni Azua
 

Method Summary
static IServiceLocator getInstance()
          Returns Singleton instance of IServiceLocator
<S> S
locate(String aName)
          Returns the matching Service found
 void shutdown()
          Shutdown IServiceLocator and releases resources
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static IServiceLocator getInstance()
Returns Singleton instance of IServiceLocator

Returns:
Singleton instance of IServiceLocator

locate

public <S> S locate(String aName)
         throws IllegalArgumentException
Returns the matching Service found

Specified by:
locate in interface IServiceLocator
Parameters:
aName - Name of Service to lookup
Returns:
matching Service found
Throws:
IllegalArgumentException

shutdown

public void shutdown()
              throws ServiceLocatorException
Shutdown IServiceLocator and releases resources

Specified by:
shutdown in interface IServiceLocator
Throws:
ServiceLocatorException


Copyright © 2007-2009. All Rights Reserved.