Package org.openspaces.events.adapter
Class AbstractReflectionDynamicEventTemplateProviderAdapter
java.lang.Object
org.openspaces.events.adapter.AbstractReflectionDynamicEventTemplateProviderAdapter
- All Implemented Interfaces:
DynamicEventTemplateProvider,org.springframework.beans.factory.InitializingBean
- Direct Known Subclasses:
AnnotationDynamicEventTemplateProviderAdapter,MethodDynamicEventTemplateProviderAdapter
public abstract class AbstractReflectionDynamicEventTemplateProviderAdapter
extends Object
implements org.springframework.beans.factory.InitializingBean, DynamicEventTemplateProvider
Base class for reflection driven invocation of event template provider method. The event listener
method os found and delegated to an object configured using
setDelegate(Object).
Subclasses must implement the doGetListenerMethod() in order to list the possible
event listener method.
- Since:
- 9.1.1
- Author:
- Itai Frenkel
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final org.apache.commons.logging.LogLogger available to subclasses -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidprotected abstract MethodSubclasses should implement this in order to provide a list of all the possible event listener delegate methods.protected ObjectReturns the event listener delegate.Delegates the event listener invocation to the appropriate method of the configuredsetDelegate(Object).booleanvoidsetDelegate(Object delegate) The event listener delegate that will be searched for event listening methods and will have its method executed.voidsetFailSilentlyIfMethodNotFound(boolean failSilently) voidsetUseFastReflection(boolean useFastReflection) Controls if the listener will be invoked using fast reflection or not.
-
Field Details
-
logger
protected final org.apache.commons.logging.Log loggerLogger available to subclasses
-
-
Constructor Details
-
AbstractReflectionDynamicEventTemplateProviderAdapter
public AbstractReflectionDynamicEventTemplateProviderAdapter()
-
-
Method Details
-
setDelegate
The event listener delegate that will be searched for event listening methods and will have its method executed. -
getDelegate
Returns the event listener delegate. -
setUseFastReflection
public void setUseFastReflection(boolean useFastReflection) Controls if the listener will be invoked using fast reflection or not. Defaults totrue. -
afterPropertiesSet
public void afterPropertiesSet()- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean
-
getDynamicTemplate
Delegates the event listener invocation to the appropriate method of the configuredsetDelegate(Object).- Specified by:
getDynamicTemplatein interfaceDynamicEventTemplateProvider
-
setFailSilentlyIfMethodNotFound
public void setFailSilentlyIfMethodNotFound(boolean failSilently) - Parameters:
failSilently- - when set to trueafterPropertiesSet()will not raise an exception if an annotated method is not found.
-
isMethodFound
public boolean isMethodFound() -
doGetListenerMethod
Subclasses should implement this in order to provide a list of all the possible event listener delegate methods.- Returns:
- A list of all the event listener delegate methods
-