Class AbstractStatefulPluginTransactionSelector<S>

java.lang.Object
org.hyperledger.besu.plugin.services.txselection.AbstractStatefulPluginTransactionSelector<S>
Type Parameters:
S - The type of the state used by the selector
All Implemented Interfaces:
PluginTransactionSelector, TransactionSelector

public abstract class AbstractStatefulPluginTransactionSelector<S> extends Object implements PluginTransactionSelector
This class represents an abstract plugin transaction selector which provides methods to manage the selector state.
  • Constructor Details

    • AbstractStatefulPluginTransactionSelector

      public AbstractStatefulPluginTransactionSelector(SelectorsStateManager selectorsStateManager, S initialState, SelectorsStateManager.StateDuplicator<S> stateDuplicator)
      Initialize the plugin state to an initial value
      Parameters:
      selectorsStateManager - the selectors state manager
      initialState - the initial value of the state
      stateDuplicator - the function that duplicates the state
  • Method Details

    • getWorkingState

      protected S getWorkingState()
      Get the working state for this selector. A working state contains changes that have not yet committed
      Returns:
      the working state of this selector
    • setWorkingState

      protected void setWorkingState(S newState)
      Set the working state for this selector. A working state contains changes that have not yet commited
      Parameters:
      newState - the new working state of this selector
    • getCommitedState

      protected S getCommitedState()
      Get the commited state for this selector. A commited state contains changes that have been commited
      Returns:
      the commited state of this selector