akka.remote
Class RemoteTransport

java.lang.Object
  extended by akka.remote.RemoteTransport

public abstract class RemoteTransport
extends java.lang.Object

The remote transport is responsible for sending and receiving messages. Each transport has an address, which it should provide in Serialization.currentTransportAddress (thread-local) while serializing actor references (which might also be part of messages). This address must be available (i.e. fully initialized) by the time the first message is received or when the start() method returns, whatever happens first.


Constructor Summary
RemoteTransport(ExtendedActorSystem system, RemoteActorRefProvider provider)
           
 
Method Summary
abstract  Address address()
          Address to be used in RootActorPath of refs generated for this transport.
 RemoteProtocol.AkkaRemoteProtocol createControlEnvelope(RemoteProtocol.RemoteControlProtocol rcp)
          Returns a newly created AkkaRemoteProtocol with the given control payload.
 RemoteProtocol.AkkaRemoteProtocol createMessageSendEnvelope(RemoteProtocol.RemoteMessageProtocol rmp)
          Returns a newly created AkkaRemoteProtocol with the given message payload.
 RemoteProtocol.RemoteMessageProtocol.Builder createRemoteMessageProtocolBuilder(ActorRef recipient, java.lang.Object message, scala.Option<ActorRef> senderOption)
          Returns a new RemoteMessageProtocol containing the serialized representation of the given parameters.
abstract  LoggingAdapter log()
          A Logger that can be used to log issues that may occur
protected abstract  boolean logRemoteLifeCycleEvents()
          When this method returns true, RemoteLifeCycleEvents will be logged as well as be put onto the eventStream.
 void notifyListeners(RemoteLifeCycleEvent message)
          Default implementation both publishes the message to the eventStream as well as logs it using the system logger
 RemoteActorRefProvider provider()
           
 void receiveMessage(RemoteMessage remoteMessage)
          Call this method with an inbound RemoteMessage and this will take care of security (see: "useUntrustedMode") as well as making sure that the message ends up at its destination (best effort).
abstract  boolean restartClientConnection(Address address)
          Restarts a specific client connected to the supplied remote address, but only if the client is not shut down
abstract  void send(java.lang.Object message, scala.Option<ActorRef> senderOption, akka.remote.RemoteActorRef recipient)
          Sends the given message to the recipient supplying the sender if any
abstract  void shutdown()
          Shuts down the remoting
abstract  boolean shutdownClientConnection(Address address)
          Shuts down a specific client connected to the supplied remote address returns true if successful
abstract  void start()
          Start up the transport, i.e. enable incoming connections.
 ExtendedActorSystem system()
           
 RemoteProtocol.ActorRefProtocol toRemoteActorRefProtocol(ActorRef actor)
          Serializes the ActorRef instance into a Protocol Buffers (protobuf) Message.
 java.lang.String toString()
          Returns this RemoteTransports Address' textual representation
protected abstract  boolean useUntrustedMode()
          When this method returns true, some functionality will be turned off for security purposes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RemoteTransport

public RemoteTransport(ExtendedActorSystem system,
                       RemoteActorRefProvider provider)
Method Detail

system

public ExtendedActorSystem system()

provider

public RemoteActorRefProvider provider()

shutdown

public abstract void shutdown()
Shuts down the remoting


address

public abstract Address address()
Address to be used in RootActorPath of refs generated for this transport.


start

public abstract void start()
Start up the transport, i.e. enable incoming connections.


shutdownClientConnection

public abstract boolean shutdownClientConnection(Address address)
Shuts down a specific client connected to the supplied remote address returns true if successful


restartClientConnection

public abstract boolean restartClientConnection(Address address)
Restarts a specific client connected to the supplied remote address, but only if the client is not shut down


send

public abstract void send(java.lang.Object message,
                          scala.Option<ActorRef> senderOption,
                          akka.remote.RemoteActorRef recipient)
Sends the given message to the recipient supplying the sender if any


notifyListeners

public void notifyListeners(RemoteLifeCycleEvent message)
Default implementation both publishes the message to the eventStream as well as logs it using the system logger


toString

public java.lang.String toString()
Returns this RemoteTransports Address' textual representation

Overrides:
toString in class java.lang.Object

log

public abstract LoggingAdapter log()
A Logger that can be used to log issues that may occur


useUntrustedMode

protected abstract boolean useUntrustedMode()
When this method returns true, some functionality will be turned off for security purposes.


logRemoteLifeCycleEvents

protected abstract boolean logRemoteLifeCycleEvents()
When this method returns true, RemoteLifeCycleEvents will be logged as well as be put onto the eventStream.


createMessageSendEnvelope

public RemoteProtocol.AkkaRemoteProtocol createMessageSendEnvelope(RemoteProtocol.RemoteMessageProtocol rmp)
Returns a newly created AkkaRemoteProtocol with the given message payload.


createControlEnvelope

public RemoteProtocol.AkkaRemoteProtocol createControlEnvelope(RemoteProtocol.RemoteControlProtocol rcp)
Returns a newly created AkkaRemoteProtocol with the given control payload.


toRemoteActorRefProtocol

public RemoteProtocol.ActorRefProtocol toRemoteActorRefProtocol(ActorRef actor)
Serializes the ActorRef instance into a Protocol Buffers (protobuf) Message.


createRemoteMessageProtocolBuilder

public RemoteProtocol.RemoteMessageProtocol.Builder createRemoteMessageProtocolBuilder(ActorRef recipient,
                                                                                       java.lang.Object message,
                                                                                       scala.Option<ActorRef> senderOption)
Returns a new RemoteMessageProtocol containing the serialized representation of the given parameters.


receiveMessage

public void receiveMessage(RemoteMessage remoteMessage)
Call this method with an inbound RemoteMessage and this will take care of security (see: "useUntrustedMode") as well as making sure that the message ends up at its destination (best effort). There is also a fair amount of logging produced by this method, which is good for debugging.