Package akka.remote.artery
Class Association
- java.lang.Object
-
- akka.remote.artery.Association
-
- All Implemented Interfaces:
OutboundContext
public class Association extends java.lang.Object implements OutboundContext
Holds reference to shared state of Association - *access only via helper methods*
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Association.DisabledQueueWrapper$
static class
Association.LazyQueueWrapper
static class
Association.LazyQueueWrapper$
static class
Association.OutboundStreamMatValues
static class
Association.OutboundStreamMatValues$
static class
Association.OutboundStreamStopIdleSignal$
static class
Association.OutboundStreamStopQuarantinedSignal$
static interface
Association.QueueWrapper
static class
Association.QueueWrapperImpl
static class
Association.QueueWrapperImpl$
static class
Association.RemovedQueueWrapper$
static interface
Association.StopSignal
-
Field Summary
Fields Modifier and Type Field Description protected static long
sharedStateOffset
-
Constructor Summary
Constructors Constructor Description Association(ArteryTransport transport, Materializer materializer, Materializer controlMaterializer, Address remoteAddress, InboundControlJunction.ControlMessageSubject controlSubject, WildcardIndex<NotUsed> largeMessageDestinations, WildcardIndex<NotUsed> priorityMessageDestinations, ObjectPool<ReusableOutboundEnvelope> outboundEnvelopePool)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
associate()
Called once after construction when theAssociation
instance wins the CAS in theAssociationRegistry
.AssociationState
associationState()
scala.concurrent.Future<Done>
changeActorRefCompression(CompressionTable<ActorRef> table)
scala.concurrent.Future<Done>
changeClassManifestCompression(CompressionTable<java.lang.String> table)
scala.concurrent.Future<Done>
completeHandshake(UniqueAddress peer)
Materializer
controlMaterializer()
static int
ControlQueueIndex()
InboundControlJunction.ControlMessageSubject
controlSubject()
An outbound operator can listen to control messages via this observer subject.java.util.Queue<OutboundEnvelope>
createQueue(int capacity, int queueIndex)
boolean
isOrdinaryMessageStreamActive()
boolean
isRemovedAfterQuarantined()
boolean
isStreamActive(int queueIndex)
static int
LargeQueueIndex()
UniqueAddress
localAddress()
Materializer
materializer()
static int
OrdinaryQueueIndex()
OutboundControlJunction.OutboundControlIngress
outboundControlIngress()
void
quarantine(java.lang.String reason)
void
quarantine(java.lang.String reason, scala.Option<java.lang.Object> uid, boolean harmless)
Address
remoteAddress()
The outbound address for this association.void
removedAfterQuarantined()
After calling this no messages can be sent with this Association instancevoid
send(java.lang.Object message, OptionVal<ActorRef> sender, OptionVal<RemoteActorRef> recipient)
void
sendControl(ControlMessage message)
An inbound operator can send control message, e.g.int
sendTerminationHint(ActorRef replyTo)
void
setControlIdleKillSwitch(OptionVal<SharedKillSwitch> killSwitch)
ArterySettings
settings()
scala.concurrent.Future<Done>
streamsCompleted()
Exposed for orderly shutdown purposes, can not be trusted except for during shutdown as streams may restart.boolean
swapState(AssociationState oldState, AssociationState newState)
Helper method for access to underlying state via Unsafejava.lang.String
toString()
ArteryTransport
transport()
-
-
-
Constructor Detail
-
Association
public Association(ArteryTransport transport, Materializer materializer, Materializer controlMaterializer, Address remoteAddress, InboundControlJunction.ControlMessageSubject controlSubject, WildcardIndex<NotUsed> largeMessageDestinations, WildcardIndex<NotUsed> priorityMessageDestinations, ObjectPool<ReusableOutboundEnvelope> outboundEnvelopePool)
-
-
Method Detail
-
ControlQueueIndex
public static final int ControlQueueIndex()
-
LargeQueueIndex
public static final int LargeQueueIndex()
-
OrdinaryQueueIndex
public static final int OrdinaryQueueIndex()
-
transport
public ArteryTransport transport()
-
materializer
public Materializer materializer()
-
controlMaterializer
public Materializer controlMaterializer()
-
remoteAddress
public Address remoteAddress()
Description copied from interface:OutboundContext
The outbound address for this association.- Specified by:
remoteAddress
in interfaceOutboundContext
- Returns:
- (undocumented)
-
controlSubject
public InboundControlJunction.ControlMessageSubject controlSubject()
Description copied from interface:OutboundContext
An outbound operator can listen to control messages via this observer subject.- Specified by:
controlSubject
in interfaceOutboundContext
- Returns:
- (undocumented)
-
settings
public ArterySettings settings()
- Specified by:
settings
in interfaceOutboundContext
-
createQueue
public java.util.Queue<OutboundEnvelope> createQueue(int capacity, int queueIndex)
-
changeActorRefCompression
public scala.concurrent.Future<Done> changeActorRefCompression(CompressionTable<ActorRef> table)
-
changeClassManifestCompression
public scala.concurrent.Future<Done> changeClassManifestCompression(CompressionTable<java.lang.String> table)
-
outboundControlIngress
public OutboundControlJunction.OutboundControlIngress outboundControlIngress()
-
localAddress
public UniqueAddress localAddress()
- Specified by:
localAddress
in interfaceOutboundContext
-
swapState
public boolean swapState(AssociationState oldState, AssociationState newState)
Helper method for access to underlying state via Unsafe- Parameters:
oldState
- Previous statenewState
- Next state on transition- Returns:
- Whether the previous state matched correctly
-
associationState
public AssociationState associationState()
- Specified by:
associationState
in interfaceOutboundContext
- Returns:
- Reference to current shared state
-
setControlIdleKillSwitch
public void setControlIdleKillSwitch(OptionVal<SharedKillSwitch> killSwitch)
-
completeHandshake
public scala.concurrent.Future<Done> completeHandshake(UniqueAddress peer)
-
sendControl
public void sendControl(ControlMessage message)
Description copied from interface:OutboundContext
An inbound operator can send control message, e.g. a HandshakeReq, to the remote address of this association. It will be sent over the control sub-channel.- Specified by:
sendControl
in interfaceOutboundContext
- Parameters:
message
- (undocumented)
-
send
public void send(java.lang.Object message, OptionVal<ActorRef> sender, OptionVal<RemoteActorRef> recipient)
-
isOrdinaryMessageStreamActive
public boolean isOrdinaryMessageStreamActive()
- Specified by:
isOrdinaryMessageStreamActive
in interfaceOutboundContext
- Returns:
true
if any of the streams are active (not stopped due to idle)
-
isStreamActive
public boolean isStreamActive(int queueIndex)
-
sendTerminationHint
public int sendTerminationHint(ActorRef replyTo)
-
quarantine
public void quarantine(java.lang.String reason)
- Specified by:
quarantine
in interfaceOutboundContext
-
quarantine
public final void quarantine(java.lang.String reason, scala.Option<java.lang.Object> uid, boolean harmless)
-
removedAfterQuarantined
public void removedAfterQuarantined()
After calling this no messages can be sent with this Association instance
-
isRemovedAfterQuarantined
public boolean isRemovedAfterQuarantined()
-
associate
public void associate()
Called once after construction when theAssociation
instance wins the CAS in theAssociationRegistry
. It will materialize the streams. It is possible to sending (enqueuing) to the association before this method is called.- Throws:
ShuttingDown
- if called while the transport is shutting down
-
streamsCompleted
public scala.concurrent.Future<Done> streamsCompleted()
Exposed for orderly shutdown purposes, can not be trusted except for during shutdown as streams may restart. Will complete successfully even if one of the stream completion futures failed- Returns:
- (undocumented)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-