Package org.drasyl.node.behaviour
Class Behavior
java.lang.Object
org.drasyl.node.behaviour.Behavior
- Direct Known Subclasses:
DeferredBehavior
The behavior of an node defines how it reacts to the events that it receives.
Behaviors can be formulated in a number of different ways, either by using the DSLs in Behaviors
.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Immutable builder for creatingBehavior
by chaining event handlers. -
Method Summary
-
Method Details
-
receive
Process an incoming event and return the next behavior.The returned behavior can in addition to normal behaviors be one of the canned special objects:
- returning
UNHANDLED
keeps the same behavior and signals that the event was not handled (event will be logged with DEBUG level). - returning
IGNORE
will ignore all future events. - returning
SAME
designates to reuse the current behavior. - returning
SHUTDOWN
will shutdown theDrasylNode
.
- returning
-
toString
-