Class ScriptedRunnable

All Implemented Interfaces:
Runnable, Component, DestructableComponent, IdentifiableComponent, IdentifiedComponent, InitializableComponent, UnmodifiableComponent

public class ScriptedRunnable
extends AbstractIdentifiableInitializableComponent
implements Runnable, UnmodifiableComponent
A Runnable which executes a script.
  • Field Details

  • Constructor Details

    • ScriptedRunnable

      public ScriptedRunnable()
  • Method Details

    • doInitialize

      protected void doInitialize() throws ComponentInitializationException
      This method checks to ensure that the component ID is not null. Performs the initialization of the component. This method is executed within the lock on the object being initialized. The default implementation of this method is a no-op.
      Overrides:
      doInitialize in class AbstractIdentifiedInitializableComponent
      Throws:
      ComponentInitializationException - thrown if there is a problem initializing the component
    • getCustomObject

      @Nullable public Object getCustomObject()
      Return the custom (externally provided) object.
      Returns:
      the custom object
    • setCustomObject

      public void setCustomObject​(@Nullable Object object)
      Set the custom (externally provided) object.
      Parameters:
      object - the custom object
    • getScript

      @NonnullAfterInit public EvaluableScript getScript()
      Gets the script to be evaluated.
      Returns:
      the script to be evaluated
    • setScript

      public void setScript​(@Nonnull EvaluableScript matcherScript)
      Sets the script to be evaluated.
      Parameters:
      matcherScript - the script to be evaluated
    • run

      public void run()
      Specified by:
      run in interface Runnable