Class TestTransport
- All Implemented Interfaces:
- Transport
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 SummaryNested ClassesModifier and TypeClassDescriptionstatic interfaceDeprecated.Base trait for activities that are logged bypekko.remote.transport.TestTransport.static final classDeprecated.static classDeprecated.static classDeprecated.Shared state amongpekko.remote.transport.TestTransportinstances.static final classDeprecated.static classDeprecated.static final classDeprecated.static classDeprecated.static final classDeprecated.static classDeprecated.static classDeprecated.Test utility to make behavior of functions that return some Future[B] controllable from tests.static final classDeprecated.static classDeprecated.Nested classes/interfaces inherited from interface org.apache.pekko.remote.transport.TransportTransport.ActorAssociationEventListener, Transport.ActorAssociationEventListener$, Transport.AssociationEvent, Transport.AssociationEventListener, Transport.InboundAssociation, Transport.InboundAssociation$, Transport.InvalidAssociationException, Transport.InvalidAssociationException$
- 
Constructor SummaryConstructorsConstructorDescriptionTestTransport(Address localAddress, TestTransport.AssociationRegistry registry, int maximumPayloadBytes, String schemeIdentifier) Deprecated.TestTransport(ExtendedActorSystem system, com.typesafe.config.Config conf) Deprecated.
- 
Method SummaryModifier and TypeMethodDescriptionstatic intDeprecated.static StringDeprecated.scala.concurrent.Future<AssociationHandle>Deprecated.Asynchronously opens a logical duplex link between two Transport Entities over a network.Deprecated.Thepekko.remote.transport.TestTransport.SwitchableLoggedBehaviorfor the associate() method.TestTransport.SwitchableLoggedBehavior<TestAssociationHandle,scala.runtime.BoxedUnit> Deprecated.Thepekko.remote.transport.TestTransport.SwitchableLoggedBehaviorfor the disassociate() method on handles.booleanisResponsibleFor(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>>> Deprecated.Thepekko.remote.transport.TestTransport.SwitchableLoggedBehaviorfor the listen() method.Deprecated.intDeprecated.Defines the maximum size of payload this transport is able to deliver.registry()Deprecated.Deprecated.Returns a string that will be used as the scheme part of the URLs corresponding to this transportscala.concurrent.Future<Object>shutdown()Deprecated.Shuts down the transport layer and releases all the corresponding resources.TestTransport.SwitchableLoggedBehavior<scala.runtime.BoxedUnit,Object> Deprecated.Thepekko.remote.transport.TestTransport.SwitchableLoggedBehaviorfor the shutdown() method.toString()Deprecated.Deprecated.Thepekko.remote.transport.TestTransport.SwitchableLoggedBehaviorfor the write() method on handles.Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.pekko.remote.transport.TransportmanagementCommand
- 
Constructor Details- 
TestTransportpublic TestTransport(Address localAddress, TestTransport.AssociationRegistry registry, int maximumPayloadBytes, String schemeIdentifier) Deprecated.
- 
TestTransportDeprecated.
 
- 
- 
Method Details- 
$lessinit$greater$default$3public static int $lessinit$greater$default$3()Deprecated.
- 
$lessinit$greater$default$4Deprecated.
- 
localAddressDeprecated.
- 
registryDeprecated.
- 
maximumPayloadBytespublic int maximumPayloadBytes()Deprecated.Description copied from interface:TransportDefines 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:
- maximumPayloadBytesin interface- Transport
- Returns:
 
- 
schemeIdentifierDeprecated.Description copied from interface:TransportReturns a string that will be used as the scheme part of the URLs corresponding to this transport- Specified by:
- schemeIdentifierin interface- Transport
- Returns:
- the scheme string
 
- 
isResponsibleForDeprecated.Description copied from interface:TransportA 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:
- isResponsibleForin interface- Transport
- Returns:
- whether the transport instance is responsible to serve communications to the given address.
 
- 
listenBehaviorpublic TestTransport.SwitchableLoggedBehavior<scala.runtime.BoxedUnit,scala.Tuple2<Address, listenBehavior()scala.concurrent.Promise<Transport.AssociationEventListener>>> Deprecated.Thepekko.remote.transport.TestTransport.SwitchableLoggedBehaviorfor the listen() method.
- 
associateBehaviorDeprecated.Thepekko.remote.transport.TestTransport.SwitchableLoggedBehaviorfor the associate() method.
- 
shutdownBehaviorDeprecated.Thepekko.remote.transport.TestTransport.SwitchableLoggedBehaviorfor the shutdown() method.
- 
listenpublic scala.concurrent.Future<scala.Tuple2<Address,scala.concurrent.Promise<Transport.AssociationEventListener>>> listen()Deprecated.Description copied from interface:TransportAsynchronously 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 anpekko.remote.transport.Transport.AssociationEventListener, that listener becomes responsible for handling incoming associations. Until the Promise is not completed, no associations are processed.
- 
associateDeprecated.Description copied from interface:TransportAsynchronously 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 pekko.remote.transport.AssociationHandle. A failed future indicates that the association attempt was unsuccessful. If the exception ispekko.remote.transport.Transport.InvalidAssociationExceptionthen the association request was invalid, and it is impossible to recover.
- 
shutdownDeprecated.Description copied from interface:TransportShuts 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. 
- 
writeBehaviorpublic TestTransport.SwitchableLoggedBehavior<scala.Tuple2<TestAssociationHandle,ByteString>, writeBehavior()Object> Deprecated.Thepekko.remote.transport.TestTransport.SwitchableLoggedBehaviorfor 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.
- 
disassociateBehaviorpublic TestTransport.SwitchableLoggedBehavior<TestAssociationHandle,scala.runtime.BoxedUnit> disassociateBehavior()Deprecated.Thepekko.remote.transport.TestTransport.SwitchableLoggedBehaviorfor the disassociate() method on handles. All handle calls pass through this call.
- 
toStringDeprecated.
 
-