Class StatePoller.Builder<S,F extends Enum<F>>
java.lang.Object
net.officefloor.plugin.managedobject.poll.StatePoller.Builder<S,F>
- Enclosing class:
- StatePoller<S,
F extends Enum<F>>
Builder for the
StatePoller.-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds theStatePoller.defaultPollInterval(long defaultPollInterval, TimeUnit unit) Allows specifying the default poll interval.identifier(String identifier) Allows providing an identifier in the log message to identify theStatePoller.Allows specifying theLogger.parameter(Function<StatePollContext<S>, Object> parameterFactory) Allows providing a parameter to theProcessStateinvoked from theManagedObjectExecuteContextfor polling.pollMargin(long margin, TimeUnit unit) Allows specifying the poll margin.startup(Consumer<ManagedObjectStartupProcess> startupProcessDecorator) Provides a decorator of theManagedObjectStartupProcess.successLogLevel(Level successLogLevel) Allows specifying the success logLevel.
-
Method Details
-
defaultPollInterval
Allows specifying the default poll interval.- Parameters:
defaultPollInterval- Default poll interval.unit-TimeUnitfor the default poll interval.- Returns:
this.
-
pollMargin
Allows specifying the poll margin. This is the margin before considering polling not triggering.- Parameters:
margin- Margin before assuming polling not triggering.unit-TimeUnit.- Returns:
this.
-
successLogLevel
Allows specifying the success logLevel.- Parameters:
successLogLevel- Success logLevel. Providingnullwill reset to default.- Returns:
this.
-
logger
Allows specifying theLogger.- Parameters:
logger-Logger. Providingnullwill reset to default.- Returns:
this.
-
parameter
Allows providing a parameter to theProcessStateinvoked from theManagedObjectExecuteContextfor polling.- Parameters:
parameterFactory- Factory for parameter.- Returns:
this.
-
identifier
Allows providing an identifier in the log message to identify theStatePoller.- Parameters:
identifier- Identifier.- Returns:
this.
-
startup
public StatePoller.Builder<S,F> startup(Consumer<ManagedObjectStartupProcess> startupProcessDecorator) Provides a decorator of theManagedObjectStartupProcess.- Parameters:
startupProcessDecorator- Decorate of theManagedObjectStartupProcess.- Returns:
this.
-
build
Builds theStatePoller.- Returns:
StatePoller.
-