public interface Context
Modifier and Type | Method and Description |
---|---|
<T> void |
addContextListener(Class<T> type,
ContextListener<T> 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<T> |
findAll(Class<T> type)
Finds all instances of the specified type in this context.
|
<T> void |
removeContextListener(Class<T> type,
ContextListener<T> listener)
Unregisters a
ContextListener for a specified type. |
<T> T find(Class<T> type)
T
- the specified typetype
- the specified typenull
if no instance was found.<T> Collection<T> findAll(Class<T> type)
T
- the specified typetype
- the specified type<T> void addContextListener(Class<T> type, ContextListener<T> listener)
ContextListener
for a specified type.
The listener will be notified when instances of the specified type get added or removed.T
- the specified typetype
- the type to listen forlistener
- the ContextListener<T> void removeContextListener(Class<T> type, ContextListener<T> listener)
ContextListener
for a specified type.T
- the specified typetype
- the type to listen forlistener
- the ContextListenerCopyright © 2012–2019 Drombler. All rights reserved.