Class DefaultAddressedEnvelope<M,​A extends java.net.SocketAddress>

    • Constructor Summary

      Constructors 
      Constructor Description
      DefaultAddressedEnvelope​(M message, A recipient)
      Creates a new instance with the specified message and recipient address.
      DefaultAddressedEnvelope​(M message, A recipient, A sender)
      Creates a new instance with the specified message, recipient address, and sender address.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      M content()
      Returns the message wrapped by this envelope message.
      A recipient()
      Returns the address of the recipient of this message.
      int refCnt()
      Returns the reference count of this object.
      boolean release()
      Decreases the reference count by 1 and deallocates this object if the reference count reaches at 0.
      boolean release​(int decrement)
      Decreases the reference count by the specified decrement and deallocates this object if the reference count reaches at 0.
      AddressedEnvelope<M,​A> retain()
      Increases the reference count by 1.
      AddressedEnvelope<M,​A> retain​(int increment)
      Increases the reference count by the specified increment.
      A sender()
      Returns the address of the sender of this message.
      java.lang.String toString()  
      AddressedEnvelope<M,​A> touch()
      Records the current access location of this object for debugging purposes.
      AddressedEnvelope<M,​A> touch​(java.lang.Object hint)
      Records the current access location of this object with an additional arbitrary information for debugging purposes.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • DefaultAddressedEnvelope

        public DefaultAddressedEnvelope​(M message,
                                        A recipient,
                                        A sender)
        Creates a new instance with the specified message, recipient address, and sender address.
      • DefaultAddressedEnvelope

        public DefaultAddressedEnvelope​(M message,
                                        A recipient)
        Creates a new instance with the specified message and recipient address. The sender address becomes null.
    • Method Detail

      • content

        public M content()
        Description copied from interface: AddressedEnvelope
        Returns the message wrapped by this envelope message.
        Specified by:
        content in interface AddressedEnvelope<M,​A extends java.net.SocketAddress>
      • sender

        public A sender()
        Description copied from interface: AddressedEnvelope
        Returns the address of the sender of this message.
        Specified by:
        sender in interface AddressedEnvelope<M,​A extends java.net.SocketAddress>
      • recipient

        public A recipient()
        Description copied from interface: AddressedEnvelope
        Returns the address of the recipient of this message.
        Specified by:
        recipient in interface AddressedEnvelope<M,​A extends java.net.SocketAddress>
      • refCnt

        public int refCnt()
        Description copied from interface: ReferenceCounted
        Returns the reference count of this object. If 0, it means this object has been deallocated.
        Specified by:
        refCnt in interface ReferenceCounted
      • release

        public boolean release()
        Description copied from interface: ReferenceCounted
        Decreases the reference count by 1 and deallocates this object if the reference count reaches at 0.
        Specified by:
        release in interface ReferenceCounted
        Returns:
        true if and only if the reference count became 0 and this object has been deallocated
      • release

        public boolean release​(int decrement)
        Description copied from interface: ReferenceCounted
        Decreases the reference count by the specified decrement and deallocates this object if the reference count reaches at 0.
        Specified by:
        release in interface ReferenceCounted
        Returns:
        true if and only if the reference count became 0 and this object has been deallocated
      • touch

        public AddressedEnvelope<M,​A> touch​(java.lang.Object hint)
        Description copied from interface: ReferenceCounted
        Records the current access location of this object with an additional arbitrary information for debugging purposes. If this object is determined to be leaked, the information recorded by this operation will be provided to you via ResourceLeakDetector.
        Specified by:
        touch in interface AddressedEnvelope<M,​A extends java.net.SocketAddress>
        Specified by:
        touch in interface ReferenceCounted
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object