@NotThreadSafe public class NettyDataReaderStateMachine extends Object
generateStateDiagram(Path)
. After you update the states and triggers, create a diagram
and check if the new state transitions are properly handled.Modifier and Type | Class and Description |
---|---|
static class |
NettyDataReaderStateMachine.TriggerEvent
Trigger event definition for
NettyClientStateMachine . |
static class |
NettyDataReaderStateMachine.TriggerEventsWithParam
Trigger event with parameters for @{NettyClientStateMacine}.
|
Constructor and Description |
---|
NettyDataReaderStateMachine(FileSystemContext context,
WorkerNetAddress address,
Protocol.ReadRequest.Builder requestBuilder,
ReadTargetBuffer buffer)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
fireNext(NettyDataReaderStateMachine.TriggerEvent triggerEvent)
Helper method to allow firing triggers within state handler methods.
|
<Arg0T> void |
fireNext(com.github.oxo42.stateless4j.triggers.TriggerWithParameters1<Arg0T,NettyDataReaderStateMachine.TriggerEvent> triggerEvent,
Arg0T arg0)
Helper method to allow firing triggers within state handler methods.
|
void |
generateStateDiagram(Path outputFile)
Generates a diagram describing the state transition in a .dot file.
|
int |
getBytesRead()
Gets the number of bytes that has been received and written into the output channel.
|
PartialReadException |
getException()
Gets the exception during execution.
|
NettyDataReaderStateMachine.TriggerEventsWithParam |
getTriggerEventsWithParam()
Get the TriggerEventsWithParam.
|
void |
run()
Starts the state machine.
|
public NettyDataReaderStateMachine(FileSystemContext context, WorkerNetAddress address, Protocol.ReadRequest.Builder requestBuilder, ReadTargetBuffer buffer)
context
- address
- requestBuilder
- buffer
- public void fireNext(NettyDataReaderStateMachine.TriggerEvent triggerEvent)
triggerEvent
- the next trigger event to firepublic <Arg0T> void fireNext(com.github.oxo42.stateless4j.triggers.TriggerWithParameters1<Arg0T,NettyDataReaderStateMachine.TriggerEvent> triggerEvent, Arg0T arg0)
Arg0T
- the type of the argument to be usedtriggerEvent
- the next trigger event to firearg0
- the argument to be usedpublic NettyDataReaderStateMachine.TriggerEventsWithParam getTriggerEventsWithParam()
public void run()
public int getBytesRead()
public void generateStateDiagram(Path outputFile) throws IOException
outputFile
- path to the output fileIOException
- when writing file fails@Nullable public PartialReadException getException()
Copyright © 2023. All Rights Reserved.