com.hammurapi.util
Class FacadeContext
java.lang.Object
com.hammurapi.util.FacadeContext
- All Implemented Interfaces:
- Context
public class FacadeContext
- extends Object
- implements Context
Simple context implementation.
- Author:
- Pavel Vlasov
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FacadeContext
public FacadeContext(Map<Class<?>,Iterable<?>> services,
Map<String,?> bindings)
- Parameters:
classLoader - ClassLoader for services. Can be null.bindings - Name bindings. Can be null.
lookup
public Object lookup(String name)
- Description copied from interface:
Context
- Looks up object by name.
- Specified by:
lookup in interface Context
- Parameters:
name - Object name.
- Returns:
- named object or null.
lookup
public <T> T lookup(Class<T> serviceClass)
- Description copied from interface:
Context
- Looks up single object (service) by type.
- Specified by:
lookup in interface Context
- Type Parameters:
T - Service type.- Parameters:
serviceClass - Requested service type.
- Returns:
- Service instance or null.
lookupAll
public <T> Iterator<T> lookupAll(Class<T> serviceClass)
- Description copied from interface:
Context
- Looks up all services of given type.
- Specified by:
lookupAll in interface Context
- Type Parameters:
T - Service type.- Parameters:
serviceClass - Requested service type.
- Returns:
- Iterator over services of requested type.