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.
-
Field Summary
Fields inherited from interface PluginTransactionSelector
ACCEPT_ALL -
Constructor Summary
ConstructorsConstructorDescriptionAbstractStatefulPluginTransactionSelector(SelectorsStateManager selectorsStateManager, S initialState, SelectorsStateManager.StateDuplicator<S> stateDuplicator) Initialize the plugin state to an initial value -
Method Summary
Modifier and TypeMethodDescriptionprotected SGet the commited state for this selector.protected SGet the working state for this selector.protected voidsetWorkingState(S newState) Set the working state for this selector.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface PluginTransactionSelector
evaluateTransactionPostProcessing, evaluateTransactionPreProcessing, getOperationTracer, onTransactionNotSelected, onTransactionSelected
-
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 managerinitialState- the initial value of the statestateDuplicator- the function that duplicates the state
-
-
Method Details
-
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
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
Get the commited state for this selector. A commited state contains changes that have been commited- Returns:
- the commited state of this selector
-