public class InVMConnection extends Object implements Connection
| Constructor and Description |
|---|
InVMConnection(int serverID,
BufferHandler handler,
BaseConnectionLifeCycleListener listener,
Executor executor) |
InVMConnection(int serverID,
String id,
BufferHandler handler,
BaseConnectionLifeCycleListener listener,
Executor executor) |
InVMConnection(int serverID,
String id,
BufferHandler handler,
BaseConnectionLifeCycleListener listener,
Executor executor,
ActiveMQPrincipal defaultActiveMQPrincipal) |
| Modifier and Type | Method and Description |
|---|---|
void |
checkFlushBatchBuffer()
Called periodically to flush any data in the batch buffer
|
void |
close()
Closes the connection.
|
ActiveMQBuffer |
createTransportBuffer(int size)
Create a new ActiveMQBuffer of the given size.
|
void |
fireReady(boolean ready) |
void |
forceClose()
This should close the internal channel without calling any listeners.
|
int |
getBatchingBufferSize() |
TransportConfiguration |
getConnectorConfig()
Generates a
TransportConfiguration to be used to connect to the same target this is
connected to. |
ActiveMQPrincipal |
getDefaultActiveMQPrincipal() |
Executor |
getExecutor() |
Object |
getID()
returns the unique id of this wire.
|
String |
getLocalAddress()
Returns a string representation of the local address this connection is connected to.
|
RemotingConnection |
getProtocolConnection() |
String |
getRemoteAddress()
Returns a string representation of the remote address this connection is connected to.
|
boolean |
isDirectDeliver() |
boolean |
isOpen() |
boolean |
isSameTarget(TransportConfiguration... configs) |
boolean |
isUsingProtocolHandling()
the InVM Connection has some special handling as it doesn't use Netty ProtocolChannel
we will use this method Instead of using instanceof
|
boolean |
isWritable(ReadyListener listener) |
void |
setAutoRead(boolean autoRead)
This will disable reading from the channel.
|
void |
setDirectDeliver(boolean directDeliver) |
void |
setEnableBufferPooling(boolean enableBufferPooling) |
static void |
setFlushEnabled(boolean enable) |
void |
setProtocolConnection(RemotingConnection connection) |
String |
toString() |
void |
write(ActiveMQBuffer buffer)
writes the buffer to the connection with no flushing or batching
|
void |
write(ActiveMQBuffer buffer,
boolean requestFlush)
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.
|
void |
write(ActiveMQBuffer buffer,
boolean flush,
boolean batch)
writes the buffer to the connection and if flush is true returns only when the buffer has been physically written to the connection.
|
void |
write(ActiveMQBuffer buffer,
boolean flush,
boolean batch,
io.netty.channel.ChannelFutureListener futureListener)
writes the buffer to the connection and if flush is true returns only when the buffer has been physically written to the connection.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitblockUntilWritablepublic InVMConnection(int serverID,
BufferHandler handler,
BaseConnectionLifeCycleListener listener,
Executor executor)
public InVMConnection(int serverID,
String id,
BufferHandler handler,
BaseConnectionLifeCycleListener listener,
Executor executor)
public InVMConnection(int serverID,
String id,
BufferHandler handler,
BaseConnectionLifeCycleListener listener,
Executor executor,
ActiveMQPrincipal defaultActiveMQPrincipal)
public void setEnableBufferPooling(boolean enableBufferPooling)
public void forceClose()
ConnectionforceClose in interface Connectionpublic boolean isWritable(ReadyListener listener)
isWritable in interface Connectionpublic boolean isOpen()
isOpen in interface Connectionpublic void fireReady(boolean ready)
fireReady in interface Connectionpublic RemotingConnection getProtocolConnection()
getProtocolConnection in interface Connectionpublic void setProtocolConnection(RemotingConnection connection)
setProtocolConnection in interface Connectionpublic void close()
Connectionclose in interface Connectionpublic void setAutoRead(boolean autoRead)
ConnectionsetAutoRead in interface Connectionpublic ActiveMQBuffer createTransportBuffer(int size)
ConnectioncreateTransportBuffer in interface Connectionsize - the size of buffer to createpublic Object getID()
ConnectiongetID in interface Connectionpublic void checkFlushBatchBuffer()
ConnectioncheckFlushBatchBuffer in interface Connectionpublic void write(ActiveMQBuffer buffer, boolean requestFlush)
Connectionwrite in interface Connectionbuffer - the buffer to writerequestFlush - whether to request flush onto the wirepublic void write(ActiveMQBuffer buffer)
Connectionwrite in interface Connectionbuffer - the buffer to writepublic void write(ActiveMQBuffer buffer, boolean flush, boolean batch)
Connectionwrite in interface Connectionbuffer - the buffer to writeflush - whether to flush the buffers onto the wirebatch - whether the packet is allowed to batched for better performancepublic void write(ActiveMQBuffer buffer, boolean flush, boolean batch, io.netty.channel.ChannelFutureListener futureListener)
Connectionwrite in interface Connectionbuffer - the buffer to writeflush - whether to flush the buffers onto the wirebatch - whether the packet is allowed to batched for better performancepublic String getRemoteAddress()
ConnectiongetRemoteAddress in interface Connectionpublic String getLocalAddress()
ConnectiongetLocalAddress in interface Connectionpublic int getBatchingBufferSize()
public boolean isUsingProtocolHandling()
ConnectionisUsingProtocolHandling in interface Connectionpublic ActiveMQPrincipal getDefaultActiveMQPrincipal()
getDefaultActiveMQPrincipal in interface Connectionpublic static void setFlushEnabled(boolean enable)
public Executor getExecutor()
public TransportConfiguration getConnectorConfig()
ConnectionTransportConfiguration to be used to connect to the same target this is
connected to.getConnectorConfig in interface Connectionpublic boolean isDirectDeliver()
isDirectDeliver in interface Connectionpublic void setDirectDeliver(boolean directDeliver)
public boolean isSameTarget(TransportConfiguration... configs)
isSameTarget in interface ConnectionCopyright © 2021 JBoss by Red Hat. All rights reserved.