java.lang.Object
org.apache.activemq.artemis.core.remoting.impl.invm.InVMConnection
All Implemented Interfaces:
Connection

public class InVMConnection extends Object implements Connection
  • Constructor Details

  • Method Details

    • setEnableBufferPooling

      public void setEnableBufferPooling(boolean enableBufferPooling)
    • forceClose

      public void forceClose()
      Description copied from interface: Connection
      This should close the internal channel without calling any listeners. This is to avoid a situation where the broker is busy writing on an internal thread. This should close the socket releasing any pending threads.
      Specified by:
      forceClose in interface Connection
    • isWritable

      public boolean isWritable(ReadyListener listener)
      Specified by:
      isWritable in interface Connection
    • isOpen

      public boolean isOpen()
      Specified by:
      isOpen in interface Connection
    • fireReady

      public void fireReady(boolean ready)
      Specified by:
      fireReady in interface Connection
    • getProtocolConnection

      public RemotingConnection getProtocolConnection()
      Specified by:
      getProtocolConnection in interface Connection
    • setProtocolConnection

      public void setProtocolConnection(RemotingConnection connection)
      Specified by:
      setProtocolConnection in interface Connection
    • close

      public void close()
      Description copied from interface: Connection
      Closes the connection.
      Specified by:
      close in interface Connection
    • disconnect

      public void disconnect()
      Specified by:
      disconnect in interface Connection
    • setAutoRead

      public void setAutoRead(boolean autoRead)
      Description copied from interface: Connection
      This will disable reading from the channel. This is basically the same as blocking the reading.
      Specified by:
      setAutoRead in interface Connection
    • createTransportBuffer

      public ActiveMQBuffer createTransportBuffer(int size)
      Description copied from interface: Connection
      Create a new ActiveMQBuffer of the given size.
      Specified by:
      createTransportBuffer in interface Connection
      Parameters:
      size - the size of buffer to create
      Returns:
      the new buffer
    • getID

      public Object getID()
      Description copied from interface: Connection
      Returns the unique id of this wire.
      Specified by:
      getID in interface Connection
      Returns:
      the unique id of this wire
    • checkFlushBatchBuffer

      public void checkFlushBatchBuffer()
      Description copied from interface: Connection
      Called periodically to flush any data in the batch buffer
      Specified by:
      checkFlushBatchBuffer in interface Connection
    • write

      public void write(ActiveMQBuffer buffer, boolean requestFlush)
      Description copied from interface: Connection
      writes the buffer to the connection and if flush is true request to flush the buffer (and any previous un-flushed ones) into the wire.
      Specified by:
      write in interface Connection
      Parameters:
      buffer - the buffer to write
      requestFlush - whether to request flush onto the wire
    • write

      public void write(ActiveMQBuffer buffer)
      Description copied from interface: Connection
      writes the buffer to the connection with no flushing or batching
      Specified by:
      write in interface Connection
      Parameters:
      buffer - the buffer to write
    • write

      public void write(ActiveMQBuffer buffer, boolean flush, boolean batch)
      Description copied from interface: Connection
      writes the buffer to the connection and if flush is true returns only when the buffer has been physically written to the connection.
      Specified by:
      write in interface Connection
      Parameters:
      buffer - the buffer to write
      flush - whether to flush the buffers onto the wire
      batch - whether the packet is allowed to batched for better performance
    • write

      public void write(ActiveMQBuffer buffer, boolean flush, boolean batch, io.netty.channel.ChannelFutureListener futureListener)
      Description copied from interface: Connection
      writes the buffer to the connection and if flush is true returns only when the buffer has been physically written to the connection.
      Specified by:
      write in interface Connection
      Parameters:
      buffer - the buffer to write
      flush - whether to flush the buffers onto the wire
      batch - whether the packet is allowed to batched for better performance
    • getEventLoop

      public io.netty.channel.EventLoop getEventLoop()
      Specified by:
      getEventLoop in interface Connection
    • getRemoteAddress

      public String getRemoteAddress()
      Description copied from interface: Connection
      Returns the string representation of the remote address this connection is connected to.
      Specified by:
      getRemoteAddress in interface Connection
      Returns:
      the string representation of the remote address this connection is connected to
    • getLocalAddress

      public String getLocalAddress()
      Description copied from interface: Connection
      Returns a string representation of the local address this connection is connected to. This is useful when the server is configured at 0.0.0.0 (or multiple IPs). This will give you the actual IP that's being used.
      Specified by:
      getLocalAddress in interface Connection
      Returns:
      the local address
    • getBatchingBufferSize

      public int getBatchingBufferSize()
    • isUsingProtocolHandling

      public boolean isUsingProtocolHandling()
      Description copied from interface: Connection
      the InVM Connection has some special handling as it doesn't use Netty ProtocolChannel we will use this method Instead of using instanceof
      Specified by:
      isUsingProtocolHandling in interface Connection
    • getDefaultActiveMQPrincipal

      public ActiveMQPrincipal getDefaultActiveMQPrincipal()
      Specified by:
      getDefaultActiveMQPrincipal in interface Connection
    • setFlushEnabled

      public static void setFlushEnabled(boolean enable)
    • getExecutor

      public Executor getExecutor()
    • getConnectorConfig

      public TransportConfiguration getConnectorConfig()
      Description copied from interface: Connection
      Generates a TransportConfiguration to be used to connect to the same target this is connected to.
      Specified by:
      getConnectorConfig in interface Connection
      Returns:
      TransportConfiguration
    • isDirectDeliver

      public boolean isDirectDeliver()
      Specified by:
      isDirectDeliver in interface Connection
    • setDirectDeliver

      public void setDirectDeliver(boolean directDeliver)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • isSameTarget

      public boolean isSameTarget(TransportConfiguration... configs)
      Specified by:
      isSameTarget in interface Connection