Package org.drasyl.intravm
Class IntraVmDiscovery
- java.lang.Object
-
- org.drasyl.pipeline.skeleton.HandlerAdapter
-
- org.drasyl.pipeline.skeleton.AddressHandlerAdapter<A>
-
- org.drasyl.pipeline.skeleton.SimpleOutboundHandler<Object,Address>
-
- org.drasyl.intravm.IntraVmDiscovery
-
- All Implemented Interfaces:
Handler
public class IntraVmDiscovery extends SimpleOutboundHandler<Object,Address>
Uses shared memory to discover other drasyl nodes running on same JVM.Inspired by: https://github.com/actoron/jadex/blob/10e464b230d7695dfd9bf2b36f736f93d69ee314/platform/base/src/main/java/jadex/platform/service/awareness/IntraVMAwarenessAgent.java
-
-
Field Summary
Fields Modifier and Type Field Description static IntraVmDiscovery
INSTANCE
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
matchedOutbound(HandlerContext ctx, Address recipient, Object msg, CompletableFuture<Void> future)
Is called for each message of typeSimpleOutboundHandler
.void
onEvent(HandlerContext ctx, Event event, CompletableFuture<Void> future)
Gets called if aEvent
was emitted.-
Methods inherited from class org.drasyl.pipeline.skeleton.SimpleOutboundHandler
acceptOutbound, onOutbound
-
Methods inherited from class org.drasyl.pipeline.skeleton.AddressHandlerAdapter
acceptAddress
-
Methods inherited from class org.drasyl.pipeline.skeleton.HandlerAdapter
onAdded, onException, onInbound, onRemoved
-
-
-
-
Field Detail
-
INSTANCE
public static final IntraVmDiscovery INSTANCE
-
-
Method Detail
-
onEvent
public void onEvent(HandlerContext ctx, Event event, CompletableFuture<Void> future)
Description copied from interface:Handler
Gets called if aEvent
was emitted.- Specified by:
onEvent
in interfaceHandler
- Overrides:
onEvent
in classHandlerAdapter
- Parameters:
ctx
- handler contextevent
- the eventfuture
- a future for the message
-
matchedOutbound
protected void matchedOutbound(HandlerContext ctx, Address recipient, Object msg, CompletableFuture<Void> future)
Description copied from class:SimpleOutboundHandler
Is called for each message of typeSimpleOutboundHandler
.- Specified by:
matchedOutbound
in classSimpleOutboundHandler<Object,Address>
- Parameters:
ctx
- handler contextrecipient
- the recipient of the messagemsg
- the messagefuture
- a future for the message
-
-