Package org.drasyl.node.behaviour
Class BehavioralDrasylNode
java.lang.Object
org.drasyl.node.DrasylNode
org.drasyl.node.behaviour.BehavioralDrasylNode
Describes a
DrasylNode as a finite state machine.
Note: Unlike the default DrasylNode, this node can only process one event at a time.
Please consider to run long-running operations asynchronously in a separate thread.
-
Field Summary
Fields inherited from class org.drasyl.node.DrasylNode
bootstrap, identity -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedprotectedBehavioralDrasylNode(Identity identity, io.netty.bootstrap.ServerBootstrap bootstrap, io.netty.channel.ChannelFuture channelFuture, io.netty.channel.Channel channel, Behavior behavior, List<SocketAddress> sntpServers) protectedBehavioralDrasylNode(Identity identity, io.netty.bootstrap.ServerBootstrap bootstrap, io.netty.channel.ChannelFuture channelFuture, List<SocketAddress> sntpServers) protectedBehavioralDrasylNode(DrasylConfig config) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract Behaviorcreated()Returns the initialBehaviorof the node.protected Behavior.BehaviorBuilderCreates a newBehavior.BehaviorBuilderto build a newBehaviorfor inbound message/event handling.final voidSendseventto the application and tells it information about the local node, other peers, connections or incoming messages.
-
Constructor Details
-
BehavioralDrasylNode
- Throws:
DrasylException
-
BehavioralDrasylNode
- Throws:
DrasylException
-
BehavioralDrasylNode
protected BehavioralDrasylNode(Identity identity, io.netty.bootstrap.ServerBootstrap bootstrap, io.netty.channel.ChannelFuture channelFuture, io.netty.channel.Channel channel, Behavior behavior, List<SocketAddress> sntpServers) -
BehavioralDrasylNode
protected BehavioralDrasylNode(Identity identity, io.netty.bootstrap.ServerBootstrap bootstrap, io.netty.channel.ChannelFuture channelFuture, List<SocketAddress> sntpServers)
-
-
Method Details
-
onEvent
Description copied from class:DrasylNodeSendseventto the application and tells it information about the local node, other peers, connections or incoming messages.- Specified by:
onEventin classDrasylNode- Parameters:
event- the event
-
created
Returns the initialBehaviorof the node.- Returns:
- the initial
Behavior
-
newBehaviorBuilder
Creates a newBehavior.BehaviorBuilderto build a newBehaviorfor inbound message/event handling.
-