Class InVMConnection

    • Method Detail

      • 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
      • isOpen

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

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

        public void close()
        Description copied from interface: Connection
        Closes the connection.
        Specified by:
        close 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 id
      • 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
      • getRemoteAddress

        public String getRemoteAddress()
        Description copied from interface: Connection
        Returns a string representation of the remote address this connection is connected to.
        Specified by:
        getRemoteAddress in interface Connection
        Returns:
        the remote address
      • 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
        Returns:
      • setFlushEnabled

        public static void setFlushEnabled​(boolean enable)
      • getExecutor

        public Executor getExecutor()
      • setDirectDeliver

        public void setDirectDeliver​(boolean directDeliver)