org.infinispan.notifications
Class AbstractListenerImpl
java.lang.Object
org.infinispan.notifications.AbstractListenerImpl
- Direct Known Subclasses:
- CacheManagerNotifierImpl, CacheNotifierImpl
public abstract class AbstractListenerImpl
- extends Object
Functionality common to both CacheManagerNotifierImpl
and
CacheNotifierImpl
- Author:
- Manik Surtani
Nested Class Summary |
protected class |
AbstractListenerImpl.ListenerInvocation
Class that encapsulates a valid invocation for a given registered listener - containing a reference to the method
to be invoked as well as the target object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
listenersMap
protected final Map<Class<? extends Annotation>,List<AbstractListenerImpl.ListenerInvocation>> listenersMap
syncProcessor
protected ExecutorService syncProcessor
asyncProcessor
protected ExecutorService asyncProcessor
AbstractListenerImpl
public AbstractListenerImpl()
start
public void start()
getLog
protected abstract Log getLog()
getAllowedMethodAnnotations
protected abstract Map<Class<? extends Annotation>,Class<?>> getAllowedMethodAnnotations()
getListenerCollectionForAnnotation
protected List<AbstractListenerImpl.ListenerInvocation> getListenerCollectionForAnnotation(Class<? extends Annotation> annotation)
removeListener
public void removeListener(Object listener)
addListener
public void addListener(Object listener)
getListeners
public Set<Object> getListeners()
testListenerClassValidity
protected static boolean testListenerClassValidity(Class<?> listenerClass)
- Tests if a class is properly annotated as a CacheListener and returns whether callbacks on this class should be
invoked synchronously or asynchronously.
- Parameters:
listenerClass
- class to inspect
- Returns:
- true if callbacks on this class should use the syncProcessor; false if it should use the asyncProcessor.
testListenerMethodValidity
protected static void testListenerMethodValidity(Method m,
Class<?> allowedParameter,
String annotationName)
Copyright © 2012 JBoss, a division of Red Hat. All Rights Reserved.