public class NettyConnection extends Object implements Connection
Constructor and Description |
---|
NettyConnection(Map<String,Object> configuration,
org.jboss.netty.channel.Channel channel,
ConnectionLifeCycleListener listener,
boolean batchingEnabled,
boolean directDeliver) |
Modifier and Type | Method and Description |
---|---|
void |
addReadyListener(ReadyListener listener) |
void |
checkFlushBatchBuffer()
Called periodically to flush any data in the batch buffer
|
void |
close()
Closes the connection.
|
HornetQBuffer |
createBuffer(int size)
Create a new HornetQBuffer of the given size.
|
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. |
HornetQPrincipal |
getDefaultHornetQPrincipal() |
Object |
getID()
returns the unique id of this wire.
|
org.jboss.netty.channel.Channel |
getNettyChannel() |
String |
getRemoteAddress()
Returns a string representation of the remote address this connection is connected to.
|
boolean |
isDirectDeliver() |
void |
removeReadyListener(ReadyListener listener) |
String |
toString() |
void |
write(HornetQBuffer buffer)
writes the buffer to the connection with no flushing or batching
|
void |
write(HornetQBuffer 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.
|
public NettyConnection(Map<String,Object> configuration, org.jboss.netty.channel.Channel channel, ConnectionLifeCycleListener listener, boolean batchingEnabled, boolean directDeliver)
public org.jboss.netty.channel.Channel getNettyChannel()
public void forceClose()
Connection
forceClose
in interface Connection
public void close()
Connection
close
in interface Connection
public HornetQBuffer createBuffer(int size)
Connection
createBuffer
in interface Connection
size
- the size of buffer to createpublic Object getID()
Connection
getID
in interface Connection
public void checkFlushBatchBuffer()
Connection
checkFlushBatchBuffer
in interface Connection
public void write(HornetQBuffer buffer)
Connection
write
in interface Connection
buffer
- the buffer to writepublic void write(HornetQBuffer buffer, boolean flush, boolean batched)
Connection
write
in interface Connection
buffer
- the buffer to writeflush
- whether to flush the buffers onto the wirebatched
- whether the packet is allowed to batched for better performancepublic String getRemoteAddress()
Connection
getRemoteAddress
in interface Connection
public boolean isDirectDeliver()
public void addReadyListener(ReadyListener listener)
addReadyListener
in interface Connection
public void removeReadyListener(ReadyListener listener)
removeReadyListener
in interface Connection
public HornetQPrincipal getDefaultHornetQPrincipal()
getDefaultHornetQPrincipal
in interface Connection
public TransportConfiguration getConnectorConfig()
Connection
TransportConfiguration
to be used to connect to the same target this is
connected to.getConnectorConfig
in interface Connection
Copyright © 2018 JBoss by Red Hat. All rights reserved.