Package org.drasyl.pipeline
Class HandlerAdapter
java.lang.Object
org.drasyl.pipeline.HandlerAdapter
- All Implemented Interfaces:
Handler
- Direct Known Subclasses:
AddressHandlerAdapter
Skeleton implementation of a
Handler.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoideventTriggered(HandlerContext ctx, Event event, CompletableFuture<Void> future) Gets called if aEventwas emitted.voidexceptionCaught(HandlerContext ctx, Exception cause) Gets called if aExceptionwas thrown.voidDo nothing by default, sub-classes may override this method.voidDo nothing by default, sub-classes may override this method.voidread(HandlerContext ctx, Address sender, Object msg, CompletableFuture<Void> future) Gets called if aObjectwas received.voidwrite(HandlerContext ctx, Address recipient, Object msg, CompletableFuture<Void> future) Gets called if aObjectwas send from the application to a recipient.
-
Constructor Details
-
HandlerAdapter
public HandlerAdapter()
-
-
Method Details
-
handlerAdded
Do nothing by default, sub-classes may override this method.- Specified by:
handlerAddedin interfaceHandler
-
handlerRemoved
Do nothing by default, sub-classes may override this method.- Specified by:
handlerRemovedin interfaceHandler
-
read
Description copied from interface:HandlerGets called if aObjectwas received. -
eventTriggered
Description copied from interface:HandlerGets called if aEventwas emitted.- Specified by:
eventTriggeredin interfaceHandler- Parameters:
ctx- handler contextevent- the eventfuture- a future for the message
-
exceptionCaught
Description copied from interface:HandlerGets called if aExceptionwas thrown.- Specified by:
exceptionCaughtin interfaceHandler
-
write
public void write(HandlerContext ctx, Address recipient, Object msg, CompletableFuture<Void> future) Description copied from interface:HandlerGets called if aObjectwas send from the application to a recipient.
-