Class TestTransport
- java.lang.Object
-
- akka.remote.transport.TestTransport
-
- All Implemented Interfaces:
Transport
public class TestTransport extends java.lang.Object implements Transport
Deprecated.Classic remoting is deprecated, use Artery. Since 2.6.0.Transport implementation to be used for testing.The TestTransport is basically a shared memory between actor systems. The TestTransport could be programmed to emulate different failure modes of a Transport implementation. TestTransport keeps a log of the activities it was requested to do. This class is not optimized for performance and MUST not be used as an in-memory transport in production systems.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
TestTransport.Activity
Deprecated.Base trait for activities that are logged byTestTransport
.static class
TestTransport.AssociateAttempt
Deprecated.static class
TestTransport.AssociateAttempt$
Deprecated.static class
TestTransport.AssociationRegistry
Deprecated.Shared state amongTestTransport
instances.static class
TestTransport.DisassociateAttempt
Deprecated.static class
TestTransport.DisassociateAttempt$
Deprecated.static class
TestTransport.ListenAttempt
Deprecated.static class
TestTransport.ListenAttempt$
Deprecated.static class
TestTransport.ShutdownAttempt
Deprecated.static class
TestTransport.ShutdownAttempt$
Deprecated.static class
TestTransport.SwitchableLoggedBehavior<A,B>
Deprecated.Test utility to make behavior of functions that return some Future[B] controllable from tests.static class
TestTransport.WriteAttempt
Deprecated.static class
TestTransport.WriteAttempt$
Deprecated.-
Nested classes/interfaces inherited from interface akka.remote.transport.Transport
Transport.ActorAssociationEventListener, Transport.ActorAssociationEventListener$, Transport.AssociationEvent, Transport.AssociationEventListener, Transport.InboundAssociation, Transport.InboundAssociation$, Transport.InvalidAssociationException, Transport.InvalidAssociationException$
-
-
Constructor Summary
Constructors Constructor Description TestTransport(Address localAddress, TestTransport.AssociationRegistry registry, int maximumPayloadBytes, java.lang.String schemeIdentifier)
Deprecated.TestTransport(ExtendedActorSystem system, com.typesafe.config.Config conf)
Deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static int
$lessinit$greater$default$3()
Deprecated.static java.lang.String
$lessinit$greater$default$4()
Deprecated.scala.concurrent.Future<AssociationHandle>
associate(Address remoteAddress)
Deprecated.Asynchronously opens a logical duplex link between two Transport Entities over a network.TestTransport.SwitchableLoggedBehavior<Address,AssociationHandle>
associateBehavior()
Deprecated.TheTestTransport.SwitchableLoggedBehavior
for the associate() method.TestTransport.SwitchableLoggedBehavior<TestAssociationHandle,scala.runtime.BoxedUnit>
disassociateBehavior()
Deprecated.TheTestTransport.SwitchableLoggedBehavior
for the disassociate() method on handles.boolean
isResponsibleFor(Address address)
Deprecated.A function that decides whether the specific transport instance is responsible for delivering to a given address.scala.concurrent.Future<scala.Tuple2<Address,scala.concurrent.Promise<Transport.AssociationEventListener>>>
listen()
Deprecated.Asynchronously attempts to setup the transport layer to listen and accept incoming associations.TestTransport.SwitchableLoggedBehavior<scala.runtime.BoxedUnit,scala.Tuple2<Address,scala.concurrent.Promise<Transport.AssociationEventListener>>>
listenBehavior()
Deprecated.TheTestTransport.SwitchableLoggedBehavior
for the listen() method.Address
localAddress()
Deprecated.int
maximumPayloadBytes()
Deprecated.Defines the maximum size of payload this transport is able to deliver.TestTransport.AssociationRegistry
registry()
Deprecated.java.lang.String
schemeIdentifier()
Deprecated.Returns a string that will be used as the scheme part of the URLs corresponding to this transportscala.concurrent.Future<java.lang.Object>
shutdown()
Deprecated.Shuts down the transport layer and releases all the corresponding resources.TestTransport.SwitchableLoggedBehavior<scala.runtime.BoxedUnit,java.lang.Object>
shutdownBehavior()
Deprecated.TheTestTransport.SwitchableLoggedBehavior
for the shutdown() method.java.lang.String
toString()
Deprecated.TestTransport.SwitchableLoggedBehavior<scala.Tuple2<TestAssociationHandle,ByteString>,java.lang.Object>
writeBehavior()
Deprecated.TheTestTransport.SwitchableLoggedBehavior
for the write() method on handles.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface akka.remote.transport.Transport
managementCommand
-
-
-
-
Constructor Detail
-
TestTransport
public TestTransport(Address localAddress, TestTransport.AssociationRegistry registry, int maximumPayloadBytes, java.lang.String schemeIdentifier)
Deprecated.
-
TestTransport
public TestTransport(ExtendedActorSystem system, com.typesafe.config.Config conf)
Deprecated.
-
-
Method Detail
-
$lessinit$greater$default$3
public static int $lessinit$greater$default$3()
Deprecated.
-
$lessinit$greater$default$4
public static java.lang.String $lessinit$greater$default$4()
Deprecated.
-
localAddress
public Address localAddress()
Deprecated.
-
registry
public final TestTransport.AssociationRegistry registry()
Deprecated.
-
maximumPayloadBytes
public int maximumPayloadBytes()
Deprecated.Description copied from interface:Transport
Defines the maximum size of payload this transport is able to deliver. All transports MUST support at least 32kBytes (32000 octets) of payload, but some MAY support larger sizes.- Specified by:
maximumPayloadBytes
in interfaceTransport
- Returns:
-
schemeIdentifier
public java.lang.String schemeIdentifier()
Deprecated.Description copied from interface:Transport
Returns a string that will be used as the scheme part of the URLs corresponding to this transport- Specified by:
schemeIdentifier
in interfaceTransport
- Returns:
- the scheme string
-
isResponsibleFor
public boolean isResponsibleFor(Address address)
Deprecated.Description copied from interface:Transport
A function that decides whether the specific transport instance is responsible for delivering to a given address. The function must be thread-safe and non-blocking.The purpose of this function is to resolve cases when the scheme part of an URL is not enough to resolve the correct transport i.e. multiple instances of the same transport implementation are loaded. These cases arise when - the same transport, but with different configurations is used for different remote systems - a transport is able to serve one address only (hardware protocols, e.g. Serial port) and multiple instances are needed to be loaded for different endpoints.
- Specified by:
isResponsibleFor
in interfaceTransport
- Returns:
- whether the transport instance is responsible to serve communications to the given address.
-
listenBehavior
public TestTransport.SwitchableLoggedBehavior<scala.runtime.BoxedUnit,scala.Tuple2<Address,scala.concurrent.Promise<Transport.AssociationEventListener>>> listenBehavior()
Deprecated.TheTestTransport.SwitchableLoggedBehavior
for the listen() method.
-
associateBehavior
public TestTransport.SwitchableLoggedBehavior<Address,AssociationHandle> associateBehavior()
Deprecated.TheTestTransport.SwitchableLoggedBehavior
for the associate() method.
-
shutdownBehavior
public TestTransport.SwitchableLoggedBehavior<scala.runtime.BoxedUnit,java.lang.Object> shutdownBehavior()
Deprecated.TheTestTransport.SwitchableLoggedBehavior
for the shutdown() method.
-
listen
public scala.concurrent.Future<scala.Tuple2<Address,scala.concurrent.Promise<Transport.AssociationEventListener>>> listen()
Deprecated.Description copied from interface:Transport
Asynchronously attempts to setup the transport layer to listen and accept incoming associations. The result of the attempt is wrapped by a Future returned by this method. The pair contained in the future contains a Promise for an ActorRef. By completing this Promise with anTransport.AssociationEventListener
, that listener becomes responsible for handling incoming associations. Until the Promise is not completed, no associations are processed.
-
associate
public scala.concurrent.Future<AssociationHandle> associate(Address remoteAddress)
Deprecated.Description copied from interface:Transport
Asynchronously opens a logical duplex link between two Transport Entities over a network. It could be backed by a real transport-layer connection (TCP), more lightweight connections provided over datagram protocols (UDP with additional services), substreams of multiplexed connections (SCTP) or physical links (serial port).This call returns a future of an
AssociationHandle
. A failed future indicates that the association attempt was unsuccessful. If the exception isTransport.InvalidAssociationException
then the association request was invalid, and it is impossible to recover.- Specified by:
associate
in interfaceTransport
- Parameters:
remoteAddress
- The address of the remote transport entity.- Returns:
- A status instance representing failure or a success containing an
AssociationHandle
-
shutdown
public scala.concurrent.Future<java.lang.Object> shutdown()
Deprecated.Description copied from interface:Transport
Shuts down the transport layer and releases all the corresponding resources. Shutdown is asynchronous signalling the end of the shutdown by completing the returned future.The transport SHOULD try flushing pending writes before becoming completely closed.
-
writeBehavior
public TestTransport.SwitchableLoggedBehavior<scala.Tuple2<TestAssociationHandle,ByteString>,java.lang.Object> writeBehavior()
Deprecated.TheTestTransport.SwitchableLoggedBehavior
for the write() method on handles. All handle calls pass through this call. Please note, that write operations return a Boolean synchronously, so altering the behavior via pushDelayed will turn write to a blocking operation -- use of pushDelayed therefore is not recommended.
-
disassociateBehavior
public TestTransport.SwitchableLoggedBehavior<TestAssociationHandle,scala.runtime.BoxedUnit> disassociateBehavior()
Deprecated.TheTestTransport.SwitchableLoggedBehavior
for the disassociate() method on handles. All handle calls pass through this call.
-
toString
public java.lang.String toString()
Deprecated.- Overrides:
toString
in classjava.lang.Object
-
-