GigaSpaces XAP 9.7.2 API

org.openspaces.events.adapter
Class AbstractReflectionDynamicEventTemplateProviderAdapter

java.lang.Object
  extended by org.openspaces.events.adapter.AbstractReflectionDynamicEventTemplateProviderAdapter
All Implemented Interfaces:
DynamicEventTemplateProvider, InitializingBean
Direct Known Subclasses:
AnnotationDynamicEventTemplateProviderAdapter, MethodDynamicEventTemplateProviderAdapter

public abstract class AbstractReflectionDynamicEventTemplateProviderAdapter
extends Object
implements 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
protected  Log logger
          Logger available to subclasses
 
Constructor Summary
AbstractReflectionDynamicEventTemplateProviderAdapter()
           
 
Method Summary
 void afterPropertiesSet()
           
protected abstract  Method doGetListenerMethod()
          Subclasses should implement this in order to provide a list of all the possible event listener delegate methods.
protected  Object getDelegate()
          Returns the event listener delegate.
 Object getDynamicTemplate()
          Delegates the event listener invocation to the appropriate method of the configured setDelegate(Object).
 boolean isMethodFound()
           
 void setDelegate(Object delegate)
          The event listener delegate that will be searched for event listening methods and will have its method executed.
 void setFailSilentlyIfMethodNotFound(boolean failSilently)
           
 void setUseFastReflection(boolean useFastReflection)
          Controls if the listener will be invoked using fast reflection or not.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected final Log logger
Logger available to subclasses

Constructor Detail

AbstractReflectionDynamicEventTemplateProviderAdapter

public AbstractReflectionDynamicEventTemplateProviderAdapter()
Method Detail

setDelegate

public void setDelegate(Object delegate)
The event listener delegate that will be searched for event listening methods and will have its method executed.


getDelegate

protected Object 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 to true.


afterPropertiesSet

public void afterPropertiesSet()
Specified by:
afterPropertiesSet in interface InitializingBean

getDynamicTemplate

public Object getDynamicTemplate()
Delegates the event listener invocation to the appropriate method of the configured setDelegate(Object).

Specified by:
getDynamicTemplate in interface DynamicEventTemplateProvider

setFailSilentlyIfMethodNotFound

public void setFailSilentlyIfMethodNotFound(boolean failSilently)
Parameters:
failSilently - - when set to true afterPropertiesSet() will not raise an exception if an annotated method is not found.

isMethodFound

public boolean isMethodFound()

doGetListenerMethod

protected abstract Method 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

GigaSpaces XAP 9.7.2 API

Copyright © GigaSpaces.