public interface Context
| Modifier and Type | Method and Description |
|---|---|
void |
addContextListener(Class<?> type,
ContextListener listener)
Registers a
ContextListener for a specified type. |
<T> T |
find(Class<T> type)
Finds an instance of the specified type in this context.
|
<T> Collection<? extends T> |
findAll(Class<T> type)
Finds all instances of the specified type in this context.
|
void |
removeContextListener(Class<?> type,
ContextListener listener)
Unegisters a
ContextListener for a specified type. |
<T> T find(Class<T> type)
T - the specified typetype - the specified typenull if no instance was
found.
TODO: return Optional?<T> Collection<? extends T> findAll(Class<T> type)
T - the specified typetype - the specified typeList instead of Collection? <T> instead of <? extends T>?void addContextListener(Class<?> type, ContextListener listener)
ContextListener for a specified type.
The listener will be notified when instances of the specified type get added or removed.type - the type to listen forlistener - the ContextListenervoid removeContextListener(Class<?> type, ContextListener listener)
ContextListener for a specified type.type - the type to listen forlistener - the ContextListenerCopyright © 2012–2016 Drombler. All rights reserved.