public abstract class FlinkUntypedActor
extends akka.actor.UntypedActor
JobManagerMessages.LeaderSessionMessage
with the wrong leader session ID. If a message
of type RequiresLeaderSessionID
without being wrapped in a LeaderSessionMessage is
detected, then an Exception is thrown.
In order to implement the actor behavior, an implementing subclass has to override the method handleMessage, which defines how messages are processed. Furthermore, the subclass has to provide a leader session ID option which is returned by getLeaderSessionID.
Modifier and Type | Field and Description |
---|---|
protected org.slf4j.Logger |
LOG |
Constructor and Description |
---|
FlinkUntypedActor() |
Modifier and Type | Method and Description |
---|---|
protected Object |
decorateMessage(Object message)
This method should be called for every outgoing message.
|
protected abstract UUID |
getLeaderSessionID()
Returns the current leader session ID associated with this actor.
|
protected abstract void |
handleMessage(Object message)
This method contains the actor logic which defines how to react to incoming messages.
|
void |
onReceive(Object message)
This method is called by Akka if a new message has arrived for the actor.
|
akka$actor$Actor$_setter_$context_$eq, akka$actor$Actor$_setter_$self_$eq, aroundPostRestart, aroundPostStop, aroundPreRestart, aroundPreStart, aroundReceive, context, getContext, getSelf, getSender, postRestart, postStop, preRestart, preStart, receive, self, sender, supervisorStrategy, unhandled
public final void onReceive(Object message) throws Exception
Important: This method cannot be overridden. The actor specific message handling logic is implemented by the method handleMessage.
onReceive
in class akka.actor.UntypedActor
message
- Incoming messageException
protected abstract void handleMessage(Object message) throws Exception
message
- Incoming messageException
protected abstract UUID getLeaderSessionID()
protected Object decorateMessage(Object message)
RequiresLeaderSessionID
) in a
JobManagerMessages.LeaderSessionMessage
with the actor's leader session ID.
This method can be overridden to implement a different decoration behavior.
message
- Message to be decoratedCopyright © 2014–2019 The Apache Software Foundation. All rights reserved.