Class TransportMessage

java.lang.Object
org.elasticsearch.transport.TransportMessage
All Implemented Interfaces:
Writeable, RefCounted
Direct Known Subclasses:
TransportRequest, TransportResponse

public abstract class TransportMessage extends Object implements Writeable, RefCounted
  • Constructor Details

    • TransportMessage

      public TransportMessage()
      Constructs a new empty transport message
    • TransportMessage

      public TransportMessage(StreamInput in)
      Constructs a new transport message with the data from the StreamInput. This is currently a no-op
  • Method Details

    • remoteAddress

      public void remoteAddress(InetSocketAddress remoteAddress)
    • remoteAddress

      @Nullable public InetSocketAddress remoteAddress()
    • incRef

      public void incRef()
      Specified by:
      incRef in interface RefCounted
    • tryIncRef

      public boolean tryIncRef()
      Specified by:
      tryIncRef in interface RefCounted
    • decRef

      public boolean decRef()
      Note that the lifetime of an outbound TransportMessage lasts at least until it has been fully sent over the network, and it may be closed on a network thread in a context in which there's a risk of stack overflows if on close it calls back into the network layer in a manner that might end up nesting too deeply. When in doubt, dispatch any further work onto a separate thread.
      Specified by:
      decRef in interface RefCounted
    • hasReferences

      public boolean hasReferences()
      Specified by:
      hasReferences in interface RefCounted