public interface Connection
Modifier and Type | Method and Description |
---|---|
default boolean |
blockUntilWritable(int requiredCapacity,
long timeout,
TimeUnit timeUnit)
Causes the current thread to wait until the connection can enqueue the required capacity unless the specified waiting time elapses.
|
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.
|
TransportConfiguration |
getConnectorConfig()
Generates a
TransportConfiguration to be used to connect to the same target this is
connected to. |
ActiveMQPrincipal |
getDefaultActiveMQPrincipal() |
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 |
setProtocolConnection(RemotingConnection connection) |
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 batched)
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 batched,
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.
|
ActiveMQBuffer createTransportBuffer(int size)
size
- the size of buffer to createRemotingConnection getProtocolConnection()
void setProtocolConnection(RemotingConnection connection)
boolean isWritable(ReadyListener listener)
boolean isOpen()
default boolean blockUntilWritable(int requiredCapacity, long timeout, TimeUnit timeUnit)
requiredCapacity
- the capacity in bytes to be enqueuedtimeout
- the maximum time to waittimeUnit
- the time unit of the timeout argumenttrue
if the connection can enqueue requiredCapacity
bytes, false
otherwiseIllegalStateException
- if the connection is closedvoid fireReady(boolean ready)
void setAutoRead(boolean autoRead)
Object getID()
void write(ActiveMQBuffer buffer, boolean requestFlush)
buffer
- the buffer to writerequestFlush
- whether to request flush onto the wirevoid write(ActiveMQBuffer buffer, boolean flush, boolean batched)
buffer
- the buffer to writeflush
- whether to flush the buffers onto the wirebatched
- whether the packet is allowed to batched for better performancevoid write(ActiveMQBuffer buffer, boolean flush, boolean batched, io.netty.channel.ChannelFutureListener futureListener)
buffer
- the buffer to writeflush
- whether to flush the buffers onto the wirebatched
- whether the packet is allowed to batched for better performancevoid write(ActiveMQBuffer buffer)
buffer
- the buffer to writevoid forceClose()
void close()
String getRemoteAddress()
String getLocalAddress()
void checkFlushBatchBuffer()
TransportConfiguration getConnectorConfig()
TransportConfiguration
to be used to connect to the same target this is
connected to.boolean isDirectDeliver()
ActiveMQPrincipal getDefaultActiveMQPrincipal()
boolean isUsingProtocolHandling()
boolean isSameTarget(TransportConfiguration... configs)
Copyright © 2021 JBoss by Red Hat. All rights reserved.