public abstract class AbstractTransportAdapter extends java.lang.Object implements Transport, SchemeAugmenter
Transport.ActorAssociationEventListener, Transport.ActorAssociationEventListener$, Transport.AssociationEvent, Transport.AssociationEventListener, Transport.InboundAssociation, Transport.InboundAssociation$, Transport.InvalidAssociationException, Transport.InvalidAssociationException$
Constructor and Description |
---|
AbstractTransportAdapter(Transport wrappedTransport,
scala.concurrent.ExecutionContext ec) |
Modifier and Type | Method and Description |
---|---|
scala.concurrent.Future<AssociationHandle> |
associate(Address remoteAddress)
Asynchronously opens a logical duplex link between two Transport Entities over a network.
|
Address |
boundAddress()
INTERNAL API
|
scala.concurrent.ExecutionContext |
ec() |
protected abstract void |
interceptAssociate(Address remoteAddress,
scala.concurrent.Promise<AssociationHandle> statusPromise) |
protected abstract scala.concurrent.Future<Transport.AssociationEventListener> |
interceptListen(Address listenAddress,
scala.concurrent.Future<Transport.AssociationEventListener> listenerFuture) |
boolean |
isResponsibleFor(Address address)
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()
Asynchronously attempts to setup the transport layer to listen and accept incoming associations.
|
protected abstract int |
maximumOverhead() |
int |
maximumPayloadBytes()
Defines the maximum size of payload this transport is able to deliver.
|
java.lang.String |
schemeIdentifier()
Returns a string that will be used as the scheme part of the URLs corresponding to this transport
|
scala.concurrent.Future<java.lang.Object> |
shutdown()
Shuts down the transport layer and releases all the corresponding resources.
|
protected Transport |
wrappedTransport() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
managementCommand
addedSchemeIdentifier, augmentScheme, augmentScheme, removeScheme, removeScheme
public AbstractTransportAdapter(Transport wrappedTransport, scala.concurrent.ExecutionContext ec)
protected Transport wrappedTransport()
public scala.concurrent.ExecutionContext ec()
protected abstract int maximumOverhead()
protected abstract scala.concurrent.Future<Transport.AssociationEventListener> interceptListen(Address listenAddress, scala.concurrent.Future<Transport.AssociationEventListener> listenerFuture)
protected abstract void interceptAssociate(Address remoteAddress, scala.concurrent.Promise<AssociationHandle> statusPromise)
public java.lang.String schemeIdentifier()
Transport
schemeIdentifier
in interface Transport
public boolean isResponsibleFor(Address address)
Transport
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.
isResponsibleFor
in interface Transport
address
- (undocumented)public int maximumPayloadBytes()
Transport
maximumPayloadBytes
in interface Transport
public scala.concurrent.Future<scala.Tuple2<Address,scala.concurrent.Promise<Transport.AssociationEventListener>>> listen()
Transport
Transport.AssociationEventListener
, that
listener becomes responsible for handling incoming associations. Until the Promise is not completed, no associations
are processed.
public Address boundAddress()
public scala.concurrent.Future<AssociationHandle> associate(Address remoteAddress)
Transport
This call returns a future of an AssociationHandle
. A failed future indicates that
the association attempt was unsuccessful. If the exception is Transport.InvalidAssociationException
then the association request was invalid, and it is impossible to recover.
associate
in interface Transport
remoteAddress
- The address of the remote transport entity.AssociationHandle
public scala.concurrent.Future<java.lang.Object> shutdown()
Transport
The transport SHOULD try flushing pending writes before becoming completely closed.