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 classAssociation.DisabledQueueWrapper$static classAssociation.LazyQueueWrapperstatic classAssociation.LazyQueueWrapper$static classAssociation.OutboundStreamMatValuesstatic classAssociation.OutboundStreamMatValues$static classAssociation.OutboundStreamStopIdleSignal$static classAssociation.OutboundStreamStopQuarantinedSignal$static interfaceAssociation.QueueWrapperstatic classAssociation.QueueWrapperImplstatic classAssociation.QueueWrapperImpl$static classAssociation.RemovedQueueWrapper$static interfaceAssociation.StopSignal
-
Field Summary
Fields Modifier and Type Field Description protected static longsharedStateOffset
-
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 voidassociate()Called once after construction when theAssociationinstance wins the CAS in theAssociationRegistry.AssociationStateassociationState()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)MaterializercontrolMaterializer()static intControlQueueIndex()InboundControlJunction.ControlMessageSubjectcontrolSubject()An outbound operator can listen to control messages via this observer subject.java.util.Queue<OutboundEnvelope>createQueue(int capacity, int queueIndex)booleanisOrdinaryMessageStreamActive()booleanisRemovedAfterQuarantined()booleanisStreamActive(int queueIndex)static intLargeQueueIndex()UniqueAddresslocalAddress()Materializermaterializer()static intOrdinaryQueueIndex()OutboundControlJunction.OutboundControlIngressoutboundControlIngress()voidquarantine(java.lang.String reason)voidquarantine(java.lang.String reason, scala.Option<java.lang.Object> uid, boolean harmless)AddressremoteAddress()The outbound address for this association.voidremovedAfterQuarantined()After calling this no messages can be sent with this Association instancevoidsend(java.lang.Object message, OptionVal<ActorRef> sender, OptionVal<RemoteActorRef> recipient)voidsendControl(ControlMessage message)An inbound operator can send control message, e.g.intsendTerminationHint(ActorRef replyTo)voidsetControlIdleKillSwitch(OptionVal<SharedKillSwitch> killSwitch)ArterySettingssettings()scala.concurrent.Future<Done>streamsCompleted()Exposed for orderly shutdown purposes, can not be trusted except for during shutdown as streams may restart.booleanswapState(AssociationState oldState, AssociationState newState)Helper method for access to underlying state via Unsafejava.lang.StringtoString()ArteryTransporttransport()
-
-
-
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:OutboundContextThe outbound address for this association.- Specified by:
remoteAddressin interfaceOutboundContext- Returns:
- (undocumented)
-
controlSubject
public InboundControlJunction.ControlMessageSubject controlSubject()
Description copied from interface:OutboundContextAn outbound operator can listen to control messages via this observer subject.- Specified by:
controlSubjectin interfaceOutboundContext- Returns:
- (undocumented)
-
settings
public ArterySettings settings()
- Specified by:
settingsin 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:
localAddressin 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:
associationStatein 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:OutboundContextAn 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:
sendControlin interfaceOutboundContext- Parameters:
message- (undocumented)
-
send
public void send(java.lang.Object message, OptionVal<ActorRef> sender, OptionVal<RemoteActorRef> recipient)
-
isOrdinaryMessageStreamActive
public boolean isOrdinaryMessageStreamActive()
- Specified by:
isOrdinaryMessageStreamActivein interfaceOutboundContext- Returns:
trueif 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:
quarantinein 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 theAssociationinstance 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:
toStringin classjava.lang.Object
-
-