Class AbstractInInterceptorGenerator<T extends AbstractInInterceptor>

  • All Implemented Interfaces:
    adams.core.CleanUpHandler, adams.core.Destroyable, adams.core.GlobalInfoSupporter, adams.core.logging.LoggingLevelHandler, adams.core.logging.LoggingSupporter, adams.core.option.OptionHandler, adams.core.SizeOfHandler, Serializable
    Direct Known Subclasses:
    BaseLoggingGenerator, EnqueueGenerator, LogFileGenerator, NullGenerator, XMLLoggingGenerator

    public abstract class AbstractInInterceptorGenerator<T extends AbstractInInterceptor>
    extends adams.core.option.AbstractOptionHandler
    implements adams.core.CleanUpHandler
    Ancestor for generators for incoming message interceptors.
    Version:
    $Revision$
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected boolean m_Enabled
      whether the generator is enabled.
      protected T m_LastInterceptor
      the last interceptor generated.
      • Fields inherited from class adams.core.option.AbstractOptionHandler

        m_OptionManager
      • Fields inherited from class adams.core.logging.LoggingObject

        m_Logger, m_LoggingIsEnabled, m_LoggingLevel
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected void check()
      Hook method for checks, throws an exception if check fails.
      void cleanUp()
      Cleans up data structures, frees up memory.
      void defineOptions()
      Adds options to the internal list of options.
      protected abstract T doGenerate()
      Generates the actual interceptor for incoming messages.
      String enabledTipText()
      Returns the tip text for this property.
      T generate()
      Generates the interceptor for incoming messages.
      boolean getEnabled()
      Returns whether the generator is enabled, ie instantiating the interceptor.
      T getLastInterceptor()
      Returns the last interceptor that was generated.
      boolean hasLastInterceptor()
      Checks whether there is a last interceptor available.
      void setEnabled​(boolean value)
      Sets whether the generator is enabled, ie instantiating the interceptor.
      • Methods inherited from class adams.core.option.AbstractOptionHandler

        cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, globalInfo, initialize, loggingLevelTipText, newOptionManager, reset, setLoggingLevel, toCommandLine, toString
      • Methods inherited from class adams.core.logging.LoggingObject

        configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
      • Methods inherited from interface adams.core.logging.LoggingLevelHandler

        getLoggingLevel
    • Field Detail

      • m_Enabled

        protected boolean m_Enabled
        whether the generator is enabled.
      • m_LastInterceptor

        protected transient T extends AbstractInInterceptor m_LastInterceptor
        the last interceptor generated.
    • Constructor Detail

      • AbstractInInterceptorGenerator

        public AbstractInInterceptorGenerator()
    • Method Detail

      • defineOptions

        public void defineOptions()
        Adds options to the internal list of options.
        Specified by:
        defineOptions in interface adams.core.option.OptionHandler
        Overrides:
        defineOptions in class adams.core.option.AbstractOptionHandler
      • setEnabled

        public void setEnabled​(boolean value)
        Sets whether the generator is enabled, ie instantiating the interceptor.
        Parameters:
        value - true if enabled
      • getEnabled

        public boolean getEnabled()
        Returns whether the generator is enabled, ie instantiating the interceptor.
        Returns:
        true if enabled
      • enabledTipText

        public String enabledTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • check

        protected void check()
        Hook method for checks, throws an exception if check fails.

        Default implementation does nothing.
      • doGenerate

        protected abstract T doGenerate()
        Generates the actual interceptor for incoming messages.
        Returns:
        the interceptor
      • generate

        public T generate()
        Generates the interceptor for incoming messages.
        Returns:
        the interceptor
      • hasLastInterceptor

        public boolean hasLastInterceptor()
        Checks whether there is a last interceptor available.
        Returns:
        true if available
      • getLastInterceptor

        public T getLastInterceptor()
        Returns the last interceptor that was generated.
        Returns:
        the interceptor, null if not available
      • cleanUp

        public void cleanUp()
        Cleans up data structures, frees up memory.
        Specified by:
        cleanUp in interface adams.core.CleanUpHandler