public class UdpListener extends java.lang.Object implements Actor, ActorLogging, WithUdpSend, RequiresMessageQueue<UnboundedMessageQueueSemantics>
Actor.emptyBehavior$, Actor.ignoringBehavior$
Constructor and Description |
---|
UdpListener(UdpExt udp,
ChannelRegistry channelRegistry,
ActorRef bindCommander,
Udp.Bind bind) |
Modifier and Type | Method and Description |
---|---|
java.nio.channels.DatagramChannel |
channel() |
ActorContext |
context()
Stores the context for this actor, including self, and sender.
|
void |
doReceive(ChannelRegistration registration,
ActorRef handler) |
java.lang.Object |
localAddress() |
void |
postStop()
User overridable callback.
|
scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> |
readHandlers(ChannelRegistration registration) |
scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> |
receive()
This defines the initial actor behavior, it must return a partial function
with the actor logic.
|
ActorRef |
selector() |
ActorRef |
self()
The 'self' field holds the ActorRef for this actor.
|
Udp.UdpSettings |
settings() |
UdpExt |
udp() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
aroundPostRestart, aroundPostStop, aroundPreRestart, aroundPreStart, aroundReceive, postRestart, preRestart, preStart, sender, supervisorStrategy, unhandled
log
doSend, hasWritePending, sendHandlers
public UdpListener(UdpExt udp, ChannelRegistry channelRegistry, ActorRef bindCommander, Udp.Bind bind)
public Udp.UdpSettings settings()
settings
in interface WithUdpSend
public ActorContext context()
Actor
forward
.
WARNING: Only valid within the Actor itself, so do not close over it and publish it to other threads!
ActorContext
is the Scala API. getContext
returns a
UntypedActorContext
, which is the Java API of the actor
context.
public final ActorRef self()
Actor
self ! message
public UdpExt udp()
udp
in interface WithUdpSend
public ActorRef selector()
public java.nio.channels.DatagramChannel channel()
channel
in interface WithUdpSend
public java.lang.Object localAddress()
public scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> receive()
Actor
public scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> readHandlers(ChannelRegistration registration)
public void doReceive(ChannelRegistration registration, ActorRef handler)