Class Association

  • All Implemented Interfaces:
    OutboundContext

    public class Association
    extends java.lang.Object
    implements OutboundContext
    INTERNAL API

    Thread-safe, mutable holder for association state. Main entry point for remote destined message to a specific remote address.

    • Field Detail

      • sharedStateOffset

        protected static final long sharedStateOffset
    • Method Detail

      • ControlQueueIndex

        public static final int ControlQueueIndex()
      • LargeQueueIndex

        public static final int LargeQueueIndex()
      • OrdinaryQueueIndex

        public static final int OrdinaryQueueIndex()
      • controlMaterializer

        public Materializer controlMaterializer()
      • createQueue

        public java.util.Queue<OutboundEnvelope> createQueue​(int capacity,
                                                             int queueIndex)
      • changeClassManifestCompression

        public scala.concurrent.Future<Done> changeClassManifestCompression​(CompressionTable<java.lang.String> table)
      • swapState

        public boolean swapState​(AssociationState oldState,
                                 AssociationState newState)
        Helper method for access to underlying state via Unsafe

        Parameters:
        oldState - Previous state
        newState - Next state on transition
        Returns:
        Whether the previous state matched correctly
      • 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 interface OutboundContext
        Parameters:
        message - (undocumented)
      • isOrdinaryMessageStreamActive

        public boolean isOrdinaryMessageStreamActive()
        Specified by:
        isOrdinaryMessageStreamActive in interface OutboundContext
        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 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 the Association instance wins the CAS in the AssociationRegistry. 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 class java.lang.Object