Class BufferAddressedEnvelope<A extends SocketAddress,​T extends BufferAddressedEnvelope<A,​T>>

  • Type Parameters:
    A - The type of socket address used for recipient and sender.
    T - The concrete sub-type of this class, used for implementing send().
    All Implemented Interfaces:
    AddressedEnvelope<io.netty5.buffer.Buffer,​A>, io.netty5.util.Resource<T>, AutoCloseable
    Direct Known Subclasses:
    DatagramPacket, DefaultBufferAddressedEnvelope

    public abstract class BufferAddressedEnvelope<A extends SocketAddress,​T extends BufferAddressedEnvelope<A,​T>>
    extends DefaultAddressedEnvelope<io.netty5.buffer.Buffer,​A>
    implements io.netty5.util.Resource<T>
    Base class for addressed envelopes that have Buffer instances as messages.
    • Constructor Detail

      • BufferAddressedEnvelope

        protected BufferAddressedEnvelope​(io.netty5.buffer.Buffer message,
                                          A recipient,
                                          A sender)
      • BufferAddressedEnvelope

        protected BufferAddressedEnvelope​(io.netty5.buffer.Buffer message,
                                          A recipient)
    • Method Detail

      • send

        public io.netty5.util.Send<T> send()
        Specified by:
        send in interface io.netty5.util.Resource<A extends SocketAddress>
      • replace

        public abstract T replace​(io.netty5.buffer.Buffer content)
        Create a new addressed envelope instance, that has the same recipient and sender as this one, but the given content.
        Parameters:
        content - The contents of the returned addressed envelope instance.
        Returns:
        An addressed envelope instance that has the same recipient and sender as this one, but the given content.
      • close

        public void close()
        Specified by:
        close in interface AutoCloseable
        Specified by:
        close in interface io.netty5.util.Resource<A extends SocketAddress>
      • isAccessible

        public boolean isAccessible()
        Specified by:
        isAccessible in interface io.netty5.util.Resource<A extends SocketAddress>