Package net.solarnetwork.node.reactor
Class SimpleInstructionExecutionService
java.lang.Object
net.solarnetwork.node.reactor.SimpleInstructionExecutionService
- All Implemented Interfaces:
InstructionExecutionService
public class SimpleInstructionExecutionService
extends Object
implements InstructionExecutionService
Default implementation of
InstructionExecutionService.- Since:
- 2.0
- Version:
- 1.0
- Author:
- matt
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intDefault value for theexecutionReceivedHourLimitproperty. -
Constructor Summary
ConstructorsConstructorDescriptionConstructor. -
Method Summary
Modifier and TypeMethodDescriptionexecuteInstruction(Instruction instruction) Execute a single instruction.voidsetExecutionReceivedHourLimit(int executionReceivedHourLimit) Set the minimum amount of time to wait before forcing instructions into theInstructionStatus.InstructionState.Declinedstate.
-
Field Details
-
DEFAULT_EXECUTION_RECEIVED_HOUR_LIMIT
public static final int DEFAULT_EXECUTION_RECEIVED_HOUR_LIMITDefault value for theexecutionReceivedHourLimitproperty.- See Also:
-
-
Constructor Details
-
SimpleInstructionExecutionService
Constructor.- Parameters:
handlers- the handlers- Throws:
IllegalArgumentException- if any argument is null
-
-
Method Details
-
executeInstruction
Description copied from interface:InstructionExecutionServiceExecute a single instruction.- Specified by:
executeInstructionin interfaceInstructionExecutionService- Parameters:
instruction- the instruction to execute- Returns:
- the resulting status for the instruction, or null if not handled
-
setExecutionReceivedHourLimit
public void setExecutionReceivedHourLimit(int executionReceivedHourLimit) Set the minimum amount of time to wait before forcing instructions into theInstructionStatus.InstructionState.Declinedstate. This prevents instructions not handled by any handler from sticking around on the node indefinitely. Defaults toDEFAULT_EXECUTION_RECEIVED_HOUR_LIMIT.- Parameters:
executionReceivedHourLimit- the hour limit
-