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
Nested ClassesModifier and TypeClassDescriptionstatic classImmutable builder for creatingBehaviorby 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
UNHANDLEDkeeps the same behavior and signals that the event was not handled (event will be logged with DEBUG level). - returning
IGNOREwill ignore all future events. - returning
SAMEdesignates to reuse the current behavior. - returning
SHUTDOWNwill shutdown theDrasylNode.
- returning
-
toString
-