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 Details

    • logger

      protected final org.apache.commons.logging.Log logger
      Logger available to subclasses
  • Constructor Details

    • AbstractReflectionDynamicEventTemplateProviderAdapter

      public AbstractReflectionDynamicEventTemplateProviderAdapter()
  • Method Details

    • 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 org.springframework.beans.factory.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