public class SingletonChainingContext<ST> extends Object implements MutableContext
| Constructor and Description |
|---|
SingletonChainingContext(Class<ST> type,
ST service,
Context chain) |
| Modifier and Type | Method and Description |
|---|---|
void |
bind(String name,
Object obj)
Binds named object.
|
<T> T |
lookup(Class<T> serviceClass,
Predicate<T,Context>... selectors)
Looks up single object (service) by type.
|
Object |
lookup(String name)
Looks up object by name.
|
<T> Iterator<T> |
lookupAll(Class<T> serviceClass,
Predicate<T,Context>... selectors)
Looks up all services of given type.
|
<T> void |
register(Class<? super T> type,
T service)
Registers service.
|
Object |
unbind(String name)
Unbinds named object.
|
<T> void |
unregister(Class<? super T> type,
T service)
Removes service registration.
|
public SingletonChainingContext(Class<ST> type, ST service, Context chain)
public void bind(String name, Object obj)
MutableContextbind in interface MutableContextname - Object name.obj - Object reference. Cannot be null.public <T> void register(Class<? super T> type, T service)
MutableContextregister in interface MutableContextT - Service implementation type.type - Service type.service - Service instance.public Object unbind(String name)
MutableContextunbind in interface MutableContextpublic <T> void unregister(Class<? super T> type, T service)
MutableContextunregister in interface MutableContextpublic Object lookup(String name)
Contextpublic <T> T lookup(Class<T> serviceClass, Predicate<T,Context>... selectors)
Context