Class AbstractSessionFactoryProcessor

java.lang.Object
org.apache.nifi.components.AbstractConfigurableComponent
org.apache.nifi.processor.AbstractSessionFactoryProcessor
All Implemented Interfaces:
ConfigurableComponent, Processor
Direct Known Subclasses:
AbstractProcessor

public abstract class AbstractSessionFactoryProcessor extends AbstractConfigurableComponent implements Processor

Provides a standard partial implementation of a Processor. This implementation provides default behavior and various convenience hooks for processing.

Implementation/Design note: This class follows the open/closed principle in a fairly strict manner meaning that subclasses are free to customize behavior in specifically designed points exclusively. If greater flexibility is necessary then it is still possible to simply implement the Processor interface.

Thread safe

  • Field Details

    • identifier

      private String identifier
    • logger

      private ComponentLog logger
    • scheduled

      private volatile boolean scheduled
    • configurationRestored

      private volatile boolean configurationRestored
    • serviceLookup

      private ControllerServiceLookup serviceLookup
    • nodeTypeProvider

      private NodeTypeProvider nodeTypeProvider
    • description

      private String description
  • Constructor Details

    • AbstractSessionFactoryProcessor

      public AbstractSessionFactoryProcessor()
  • Method Details

    • initialize

      public final void initialize(ProcessorInitializationContext context)
      Description copied from interface: Processor
      Provides the processor with access to objects that may be of use throughout the life of the Processor
      Specified by:
      initialize in interface Processor
      Parameters:
      context - of initialization
    • getControllerServiceLookup

      protected final ControllerServiceLookup getControllerServiceLookup()
      Returns:
      the ControllerServiceLookup that was passed to the init(ProcessorInitializationContext) method
    • getNodeTypeProvider

      protected final NodeTypeProvider getNodeTypeProvider()
      Returns:
      the NodeTypeProvider that was passed to the init(ProcessorInitializationContext) method
    • getRelationships

      public Set<Relationship> getRelationships()
      Specified by:
      getRelationships in interface Processor
      Returns:
      Set of all relationships this processor expects to transfer a flow file to. An empty set indicates this processor does not have any destination relationships. Guaranteed non null.
    • getLogger

      protected final ComponentLog getLogger()
    • init

      protected void init(ProcessorInitializationContext context)
      Provides subclasses the ability to perform initialization logic
      Parameters:
      context - in which to perform initialization
    • isScheduled

      protected final boolean isScheduled()
      Returns:
      true if the processor is scheduled to run, false otherwise
    • updateScheduledTrue

      @OnScheduled public final void updateScheduledTrue()
    • updateScheduledFalse

      @OnUnscheduled public final void updateScheduledFalse()
    • updateConfiguredRestoredTrue

      @OnConfigurationRestored public final void updateConfiguredRestoredTrue()
    • isConfigurationRestored

      protected boolean isConfigurationRestored()
      Returns a boolean indicating whether or not the configuration of the Processor has already been restored. See the OnConfigurationRestored annotation for more information about what it means for the configuration to be restored.
      Returns:
      true if configuration has been restored, false otherwise.
    • getIdentifier

      public final String getIdentifier()
      Specified by:
      getIdentifier in interface ConfigurableComponent
      Returns:
      the unique identifier that the framework assigned to this component
    • toString

      public String toString()
      Overrides:
      toString in class AbstractConfigurableComponent