com.tibbo.aggregate.common.binding

## Class DefaultBindingProcessor

- java.lang.Object
- - com.tibbo.aggregate.common.binding.DefaultBindingProcessor

- All Implemented Interfaces:
    BindingProcessor

      public class DefaultBindingProcessor
      extends java.lang.Object
      implements BindingProcessor

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `DefaultBindingProcessor.Builder`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultBindingProcessor(BindingProvider provider, Evaluator evaluator)`
    `DefaultBindingProcessor(BindingProvider provider, Evaluator evaluator, java.util.concurrent.ExecutorService executionService)`
    `DefaultBindingProcessor(BindingProvider provider, Evaluator evaluator, java.util.Timer timer, java.util.concurrent.ExecutorService executionService)`
    `DefaultBindingProcessor(BindingProvider provider, Evaluator evaluator, java.util.Timer timer, java.util.concurrent.ExecutorService executionService, boolean bufferingEventBindings)`
    `DefaultBindingProcessor(BindingProvider provider, Evaluator evaluator, TimerFactory timerFactory, java.util.concurrent.ExecutorService executionService)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `awaitBindingsProcessorStart(long millis)`
    `protected boolean` | `checkCondition(EvaluationOptions options, EvaluationEnvironment evaluationEnvironment, Evaluator evaluator)`
    `protected void` | `ensureTimer()`
    `void` | `evaluateBindingExpression(int method, Binding binding, EvaluationOptions options)`
    `protected void` | `evaluateBindingExpression(int method, Binding binding, EvaluationOptions options, EvaluationEnvironment evaluationEnvironment, Reference cause, ChangeCache cache)`
    `Evaluator` | `getEvaluator()`
    `java.util.concurrent.ExecutorService` | `getExecutorService()` Returns processor's thread pool.
    `BindingProvider` | `getProvider()`
    `java.util.Timer` | `getTimer()` Returns processor's timer
    `protected void` | `initBinding(Binding binding, EvaluationOptions options)`
    `void` | `initEventBindings()`
    `boolean` | `isDisableStartupConcurrency()`
    `boolean` | `isEnabled()`
    `boolean` | `isStopped()` Checks whether the binding processor is stopped.
    `void` | `processPendingEventBindings()`
    `void` | `setDisableStartupConcurrency(boolean disableStartupConcurrency)`
    `void` | `setEnabled(boolean enabled)` Enables (resumes) or disables (pauses) a running processor.
    `void` | `setExecutionService(java.util.concurrent.ExecutorService service)`
    `void` | `setStartupBindingsEvaluatedCallback(java.util.function.BiConsumer<java.lang.Integer,java.lang.Long> startupBindingsEvaluatedCallback)`
    `boolean` | `start()` Starts the binding provider.
    `protected void` | `start(boolean concurrentProcessing)`
    `protected void` | `startImpl(boolean concurrentProcessing)`
    `void` | `stop()` Stops the binding processor.
    `void` | `submit(java.util.concurrent.Callable task)` Submits a task to processor's thread pool.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### DefaultBindingProcessor

          public DefaultBindingProcessor(BindingProvider provider,
                                         Evaluator evaluator)

    - #### DefaultBindingProcessor

          public DefaultBindingProcessor(BindingProvider provider,
                                         Evaluator evaluator,
                                         java.util.concurrent.ExecutorService executionService)

    - #### DefaultBindingProcessor

          public DefaultBindingProcessor(BindingProvider provider,
                                         Evaluator evaluator,
                                         java.util.Timer timer,
                                         java.util.concurrent.ExecutorService executionService)

    - #### DefaultBindingProcessor

          public DefaultBindingProcessor(BindingProvider provider,
                                         Evaluator evaluator,
                                         TimerFactory timerFactory,
                                         java.util.concurrent.ExecutorService executionService)

    - #### DefaultBindingProcessor

          public DefaultBindingProcessor(BindingProvider provider,
                                         Evaluator evaluator,
                                         java.util.Timer timer,
                                         java.util.concurrent.ExecutorService executionService,
                                         boolean bufferingEventBindings)

  - ### Method Detail

    - #### start

          public boolean start()

      Description copied from interface: `BindingProcessor`
      Starts the binding provider.
      Specified by:
        `start` in interface `BindingProcessor`
      Returns:
        true if startup was successful, false otherwise

    - #### start

          protected void start(boolean concurrentProcessing)

    - #### startImpl

          protected void startImpl(boolean concurrentProcessing)

    - #### stop

          public void stop()

      Description copied from interface: `BindingProcessor`
      Stops the binding processor.
      Specified by:
        `stop` in interface `BindingProcessor`

    - #### evaluateBindingExpression

          public void evaluateBindingExpression(int method,
                                                Binding binding,
                                                EvaluationOptions options)
                                         throws EvaluationException,
                                                SyntaxErrorException,
                                                BindingException

      Throws:
        `EvaluationException`
        `SyntaxErrorException`
        `BindingException`

    - #### evaluateBindingExpression

          protected void evaluateBindingExpression(int method,
                                                   Binding binding,
                                                   EvaluationOptions options,
                                                   EvaluationEnvironment evaluationEnvironment,
                                                   Reference cause,
                                                   ChangeCache cache)
                                            throws EvaluationException,
                                                   SyntaxErrorException,
                                                   BindingException

      Throws:
        `EvaluationException`
        `SyntaxErrorException`
        `BindingException`

    - #### initBinding

          protected void initBinding(Binding binding,
                                     EvaluationOptions options)

    - #### processPendingEventBindings

          public void processPendingEventBindings()

    - #### initEventBindings

          public void initEventBindings()

    - #### ensureTimer

          protected void ensureTimer()

    - #### checkCondition

          protected boolean checkCondition(EvaluationOptions options,
                                           EvaluationEnvironment evaluationEnvironment,
                                           Evaluator evaluator)
                                    throws BindingException

      Throws:
        `BindingException`

    - #### isStopped

          public boolean isStopped()

      Description copied from interface: `BindingProcessor`
      Checks whether the binding processor is stopped.
      Specified by:
        `isStopped` in interface `BindingProcessor`
      Returns:
        true if stopped, false if running

    - #### setStartupBindingsEvaluatedCallback

          public void setStartupBindingsEvaluatedCallback(@Nullable
                                                          java.util.function.BiConsumer<java.lang.Integer,java.lang.Long> startupBindingsEvaluatedCallback)

    - #### submit

          public void submit(java.util.concurrent.Callable task)

      Description copied from interface: `BindingProcessor`
      Submits a task to processor's thread pool. Can be used to add "external" work for the processor.
      Specified by:
        `submit` in interface `BindingProcessor`
      Parameters:
        `task` - The task to execute

    - #### setExecutionService

          public void setExecutionService(java.util.concurrent.ExecutorService service)

    - #### isEnabled

          public boolean isEnabled()

    - #### setEnabled

          public void setEnabled(boolean enabled)

      Description copied from interface: `BindingProcessor`
      Enables (resumes) or disables (pauses) a running processor.
      Specified by:
        `setEnabled` in interface `BindingProcessor`
      Parameters:
        `enabled` - the new state

    - #### getExecutorService

          public java.util.concurrent.ExecutorService getExecutorService()

      Description copied from interface: `BindingProcessor`
      Returns processor's thread pool.
      Specified by:
        `getExecutorService` in interface `BindingProcessor`
      Returns:
        The thread pool

    - #### getProvider

          public BindingProvider getProvider()

    - #### getEvaluator

          public Evaluator getEvaluator()

    - #### getTimer

          public java.util.Timer getTimer()

      Description copied from interface: `BindingProcessor`
      Returns processor's timer
      Specified by:
        `getTimer` in interface `BindingProcessor`
      Returns:
        The timer

    - #### isDisableStartupConcurrency

          public boolean isDisableStartupConcurrency()

    - #### setDisableStartupConcurrency

          public void setDisableStartupConcurrency(boolean disableStartupConcurrency)

    - #### awaitBindingsProcessorStart

          public boolean awaitBindingsProcessorStart(long millis)