code: public static <T> T getService(String name, Class<T> clazz) throws NamingException {		
  		Object object = SingletonHolder.locator.context.lookup(name);
  		if(object != null) {
  			return clazz.cast(object);
  		}
  		return null;
  	}
docs: Locates a service given its JNDI name and automatically casts its reference
  to the appropriate class, as specified by the caller.
  
  @param name
  the JNDI name of the resource to lookup.
  @param clazz
  the type to be used for casting the reference.
  @return
  the type-cast resource reference, or null if no resource found.
  @throws NamingException
  if there was a problem with the JNDI lookup.