public abstract class AbstractListenerImpl extends Object
CacheManagerNotifierImpl
and
CacheNotifierImpl
Modifier and Type | Class and Description |
---|---|
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.
|
Modifier and Type | Field and Description |
---|---|
protected ExecutorService |
asyncProcessor |
protected Map<Class<? extends Annotation>,List<AbstractListenerImpl.ListenerInvocation>> |
listenersMap |
protected ExecutorService |
syncProcessor |
Constructor and Description |
---|
AbstractListenerImpl() |
Modifier and Type | Method and Description |
---|---|
void |
addListener(Object listener) |
void |
addListener(Object listener,
ClassLoader classLoader) |
protected abstract Map<Class<? extends Annotation>,Class<?>> |
getAllowedMethodAnnotations() |
protected List<AbstractListenerImpl.ListenerInvocation> |
getListenerCollectionForAnnotation(Class<? extends Annotation> annotation) |
Set<Object> |
getListeners() |
protected abstract Log |
getLog() |
void |
removeListener(Object listener) |
protected abstract void |
resumeIfNeeded(Transaction transaction) |
void |
start() |
protected abstract Transaction |
suspendIfNeeded() |
protected static Listener |
testListenerClassValidity(Class<?> listenerClass)
Tests if a class is properly annotated as a CacheListener and returns the Listener annotation.
|
protected static void |
testListenerMethodValidity(Method m,
Class<?> allowedParameter,
String annotationName) |
protected void |
validateAndAddListenerInvocation(Object listener,
KeyFilter filter,
ClassLoader classLoader)
Loops through all valid methods on the object passed in, and caches the relevant methods as
AbstractListenerImpl.ListenerInvocation for invocation by reflection. |
protected final Map<Class<? extends Annotation>,List<AbstractListenerImpl.ListenerInvocation>> listenersMap
protected ExecutorService syncProcessor
protected ExecutorService asyncProcessor
public void start()
protected abstract Log getLog()
protected abstract Map<Class<? extends Annotation>,Class<?>> getAllowedMethodAnnotations()
protected List<AbstractListenerImpl.ListenerInvocation> getListenerCollectionForAnnotation(Class<? extends Annotation> annotation)
public void removeListener(Object listener)
public void addListener(Object listener)
public void addListener(Object listener, ClassLoader classLoader)
protected void validateAndAddListenerInvocation(Object listener, KeyFilter filter, ClassLoader classLoader)
AbstractListenerImpl.ListenerInvocation
for invocation by reflection.listener
- object to be considered as a listener.protected static Listener testListenerClassValidity(Class<?> listenerClass)
listenerClass
- class to inspectprotected static void testListenerMethodValidity(Method m, Class<?> allowedParameter, String annotationName)
protected abstract Transaction suspendIfNeeded()
protected abstract void resumeIfNeeded(Transaction transaction)
Copyright © 2014 JBoss, a division of Red Hat. All Rights Reserved.