public abstract class TcpConnection extends java.lang.Object implements Actor, ActorLogging, RequiresMessageQueue<UnboundedMessageQueueSemantics>
INTERNAL API
Modifier and Type | Class and Description |
---|---|
static class |
TcpConnection.AllRead$ |
static class |
TcpConnection.CloseInformation
Used to transport information to the postStop method to notify
interested party about a connection close.
|
static class |
TcpConnection.CloseInformation$ |
static class |
TcpConnection.ConnectionInfo
Groups required connection-related data that are only available once the connection has been fully established.
|
static class |
TcpConnection.ConnectionInfo$ |
static class |
TcpConnection.EmptyPendingWrite$ |
static class |
TcpConnection.EndOfStream$ |
static class |
TcpConnection.MoreDataWaiting$ |
class |
TcpConnection.PendingBufferWrite |
static class |
TcpConnection.PendingWrite |
class |
TcpConnection.PendingWriteFile |
static interface |
TcpConnection.ReadResult |
static class |
TcpConnection.UpdatePendingWriteAndThen |
static class |
TcpConnection.UpdatePendingWriteAndThen$ |
static class |
TcpConnection.WriteFileFailed |
static class |
TcpConnection.WriteFileFailed$ |
Actor.emptyBehavior$, Actor.ignoringBehavior$
Constructor and Description |
---|
TcpConnection(TcpExt tcp,
java.nio.channels.SocketChannel channel,
boolean pullMode) |
Modifier and Type | Method and Description |
---|---|
void |
abort() |
protected abstract static void |
akka$actor$Actor$_setter_$context_$eq(ActorContext x$1) |
protected abstract static void |
akka$actor$Actor$_setter_$self_$eq(ActorRef x$1) |
static void |
akka$actor$ActorLogging$$_log_$eq(LoggingAdapter x$1) |
static LoggingAdapter |
akka$actor$ActorLogging$$_log() |
protected static void |
aroundPostRestart(java.lang.Throwable reason) |
protected static void |
aroundPostStop() |
protected static void |
aroundPreRestart(java.lang.Throwable reason,
scala.Option<java.lang.Object> message) |
protected static void |
aroundPreStart() |
protected static void |
aroundReceive(scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> receive,
java.lang.Object msg) |
java.nio.channels.SocketChannel |
channel() |
TcpConnection.CloseInformation |
closedMessage() |
Tcp.ConnectionClosed |
closeReason() |
scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> |
closing(TcpConnection.ConnectionInfo info,
scala.Option<ActorRef> closeCommander)
connection is closed on our side and we're waiting from confirmation from the other side
|
scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> |
closingWithPendingWrite(TcpConnection.ConnectionInfo info,
scala.Option<ActorRef> closeCommander,
Tcp.ConnectionClosed closedEvent)
connection is closing but a write has to be finished first
|
void |
completeConnect(ChannelRegistration registration,
ActorRef commander,
scala.collection.immutable.Traversable<Inet.SocketOption> options)
used in subclasses to start the common machinery above once a channel is connected
|
scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> |
connected(TcpConnection.ConnectionInfo info)
normal connected state
|
ActorContext |
context()
Stores the context for this actor, including self, and sender.
|
void |
doCloseConnection(ActorRef handler,
scala.Option<ActorRef> closeCommander,
Tcp.ConnectionClosed closedEvent) |
static scala.Function0<scala.runtime.BoxedUnit> |
doNothing() |
void |
doRead(TcpConnection.ConnectionInfo info,
scala.Option<ActorRef> closeCommander) |
void |
doWrite(TcpConnection.ConnectionInfo info) |
static java.io.IOException |
DroppingWriteBecauseQueueIsFullException() |
static java.io.IOException |
DroppingWriteBecauseWritingIsSuspendedException() |
void |
handleClose(TcpConnection.ConnectionInfo info,
scala.Option<ActorRef> closeCommander,
Tcp.ConnectionClosed closedEvent) |
void |
handleError(ActorRef handler,
java.io.IOException exception) |
scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> |
handleWriteMessages(TcpConnection.ConnectionInfo info) |
static LoggingAdapter |
log() |
scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> |
peerSentEOF(TcpConnection.ConnectionInfo info)
the peer sent EOF first, but we may still want to send
|
TcpConnection.PendingBufferWrite |
PendingBufferWrite(ActorRef commander,
ByteString data,
Tcp.Event ack,
Tcp.WriteCommand tail) |
TcpConnection.PendingWrite |
PendingWrite(ActorRef commander,
Tcp.WriteCommand write) |
TcpConnection.PendingWriteFile |
PendingWriteFile(ActorRef commander,
java.lang.String filePath,
long offset,
long count,
Tcp.Event ack,
Tcp.WriteCommand tail) |
void |
postRestart(java.lang.Throwable reason)
User overridable callback: By default it calls
preStart() . |
void |
postStop()
User overridable callback.
|
static void |
preRestart(java.lang.Throwable reason,
scala.Option<java.lang.Object> message) |
static void |
preStart() |
boolean |
pullMode() |
abstract static scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> |
receive() |
void |
resumeReading(TcpConnection.ConnectionInfo info) |
boolean |
safeShutdownOutput() |
ActorRef |
self()
The 'self' field holds the ActorRef for this actor.
|
static ActorRef |
sender() |
void |
signDeathPact(ActorRef actor) |
void |
stopWith(TcpConnection.CloseInformation closeInfo) |
static SupervisorStrategy |
supervisorStrategy() |
void |
suspendReading(TcpConnection.ConnectionInfo info) |
TcpExt |
tcp() |
static void |
unhandled(java.lang.Object message) |
void |
unsignDeathPact() |
scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> |
waitingForRegistration(ChannelRegistration registration,
ActorRef commander)
connection established, waiting for registration from user handler
|
boolean |
writePending() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
aroundPostRestart, aroundPostStop, aroundPreRestart, aroundPreStart, aroundReceive, preRestart, preStart, receive, sender, supervisorStrategy, unhandled
log
public TcpConnection(TcpExt tcp, java.nio.channels.SocketChannel channel, boolean pullMode)
public static scala.Function0<scala.runtime.BoxedUnit> doNothing()
public static java.io.IOException DroppingWriteBecauseWritingIsSuspendedException()
public static java.io.IOException DroppingWriteBecauseQueueIsFullException()
public static final ActorRef sender()
public abstract static scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> receive()
protected static void aroundReceive(scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> receive, java.lang.Object msg)
protected static void aroundPreStart()
protected static void aroundPostStop()
protected static void aroundPreRestart(java.lang.Throwable reason, scala.Option<java.lang.Object> message)
protected static void aroundPostRestart(java.lang.Throwable reason)
public static SupervisorStrategy supervisorStrategy()
public static void preStart() throws java.lang.Exception
java.lang.Exception
public static void preRestart(java.lang.Throwable reason, scala.Option<java.lang.Object> message) throws java.lang.Exception
java.lang.Exception
public static void unhandled(java.lang.Object message)
protected abstract static void akka$actor$Actor$_setter_$context_$eq(ActorContext x$1)
protected abstract static void akka$actor$Actor$_setter_$self_$eq(ActorRef x$1)
public static LoggingAdapter akka$actor$ActorLogging$$_log()
public static void akka$actor$ActorLogging$$_log_$eq(LoggingAdapter x$1)
public static LoggingAdapter log()
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 TcpExt tcp()
public java.nio.channels.SocketChannel channel()
public boolean pullMode()
public TcpConnection.CloseInformation closedMessage()
public void signDeathPact(ActorRef actor)
public void unsignDeathPact()
public boolean writePending()
public scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> waitingForRegistration(ChannelRegistration registration, ActorRef commander)
public scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> connected(TcpConnection.ConnectionInfo info)
public scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> peerSentEOF(TcpConnection.ConnectionInfo info)
public scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> closingWithPendingWrite(TcpConnection.ConnectionInfo info, scala.Option<ActorRef> closeCommander, Tcp.ConnectionClosed closedEvent)
public scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> closing(TcpConnection.ConnectionInfo info, scala.Option<ActorRef> closeCommander)
public scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> handleWriteMessages(TcpConnection.ConnectionInfo info)
public void completeConnect(ChannelRegistration registration, ActorRef commander, scala.collection.immutable.Traversable<Inet.SocketOption> options)
public void suspendReading(TcpConnection.ConnectionInfo info)
public void resumeReading(TcpConnection.ConnectionInfo info)
public void doRead(TcpConnection.ConnectionInfo info, scala.Option<ActorRef> closeCommander)
public void doWrite(TcpConnection.ConnectionInfo info)
public Tcp.ConnectionClosed closeReason()
public void handleClose(TcpConnection.ConnectionInfo info, scala.Option<ActorRef> closeCommander, Tcp.ConnectionClosed closedEvent)
public void doCloseConnection(ActorRef handler, scala.Option<ActorRef> closeCommander, Tcp.ConnectionClosed closedEvent)
public void handleError(ActorRef handler, java.io.IOException exception)
public boolean safeShutdownOutput()
public void abort()
public void stopWith(TcpConnection.CloseInformation closeInfo)
public void postStop()
Actor
public void postRestart(java.lang.Throwable reason)
Actor
preStart()
.postRestart
in interface Actor
reason
- the Throwable that caused the restart to happen
Is called right AFTER restart on the newly created Actor to allow reinitialization after an Actor crash.public TcpConnection.PendingWrite PendingWrite(ActorRef commander, Tcp.WriteCommand write)
public TcpConnection.PendingBufferWrite PendingBufferWrite(ActorRef commander, ByteString data, Tcp.Event ack, Tcp.WriteCommand tail)
public TcpConnection.PendingWriteFile PendingWriteFile(ActorRef commander, java.lang.String filePath, long offset, long count, Tcp.Event ack, Tcp.WriteCommand tail)