roboguice.event
Class ObservesTypeListener
java.lang.Object
roboguice.event.ObservesTypeListener
- All Implemented Interfaces:
- com.google.inject.spi.TypeListener
public class ObservesTypeListener
- extends Object
- implements com.google.inject.spi.TypeListener
Guice driven type listener which scans for the @Observes annotations.
Registers these methods with the EventManager.
- Author:
- Adam Tybor, John Ericksen
Method Summary |
protected void |
checkMethodParameters(Method method)
Error checking method, verifies that the method has the correct number of parameters. |
protected
|
findContextObserver(Method method,
com.google.inject.spi.TypeEncounter<I> iTypeEncounter)
|
|
hear(com.google.inject.TypeLiteral<I> iTypeLiteral,
com.google.inject.spi.TypeEncounter<I> iTypeEncounter)
|
protected
|
registerContextObserver(com.google.inject.spi.TypeEncounter<I> iTypeEncounter,
Method method,
Class<T> parameterType,
EventThread threadType)
Error checks the observed method and registers method with typeEncounter |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
eventManagerProvider
protected com.google.inject.Provider<EventManager> eventManagerProvider
observerThreadingDecorator
protected EventListenerThreadingDecorator observerThreadingDecorator
ObservesTypeListener
public ObservesTypeListener(com.google.inject.Provider<EventManager> eventManagerProvider,
EventListenerThreadingDecorator observerThreadingDecorator)
hear
public <I> void hear(com.google.inject.TypeLiteral<I> iTypeLiteral,
com.google.inject.spi.TypeEncounter<I> iTypeEncounter)
- Specified by:
hear
in interface com.google.inject.spi.TypeListener
findContextObserver
protected <I> void findContextObserver(Method method,
com.google.inject.spi.TypeEncounter<I> iTypeEncounter)
registerContextObserver
protected <I,T> void registerContextObserver(com.google.inject.spi.TypeEncounter<I> iTypeEncounter,
Method method,
Class<T> parameterType,
EventThread threadType)
- Error checks the observed method and registers method with typeEncounter
- Parameters:
iTypeEncounter
- method
- parameterType
- threadType
- - T>
checkMethodParameters
protected void checkMethodParameters(Method method)
- Error checking method, verifies that the method has the correct number of parameters.
- Parameters:
method
-
Copyright © 2012. All Rights Reserved.