public class NettyConnection extends Object implements Connection
| Constructor and Description |
|---|
NettyConnection(Map<String,Object> configuration,
Acceptor acceptor,
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 this connection.
|
HornetQBuffer |
createBuffer(int size)
Create a new HornetQBuffer of the given size.
|
void |
fireReady(boolean ready) |
TransportConfiguration |
getConnectorConfig()
Generates a
TransportConfiguration to be use to connect to the
same target this is connect to |
HornetQPrincipal |
getDefaultHornetQPrincipal() |
Object |
getID()
returns the unique id of this wire.
|
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, Acceptor acceptor, org.jboss.netty.channel.Channel channel, ConnectionLifeCycleListener listener, boolean batchingEnabled, boolean directDeliver)
public void close()
Connectionclose in interface Connectionpublic HornetQBuffer createBuffer(int size)
ConnectioncreateBuffer in interface Connectionsize - the size of buffer to createpublic Object getID()
ConnectiongetID in interface Connectionpublic void checkFlushBatchBuffer()
ConnectioncheckFlushBatchBuffer in interface Connectionpublic void write(HornetQBuffer buffer)
Connectionwrite in interface Connectionbuffer - the buffer to writepublic void write(HornetQBuffer buffer, boolean flush, boolean batched)
Connectionwrite in interface Connectionbuffer - the buffer to writeflush - whether to flush the buffers onto the wirebatched - whether the packet is allowed to batched for better performancepublic String getRemoteAddress()
ConnectiongetRemoteAddress in interface Connectionpublic boolean isDirectDeliver()
public void addReadyListener(ReadyListener listener)
addReadyListener in interface Connectionpublic void removeReadyListener(ReadyListener listener)
removeReadyListener in interface Connectionpublic HornetQPrincipal getDefaultHornetQPrincipal()
getDefaultHornetQPrincipal in interface Connectionpublic void fireReady(boolean ready)
public TransportConfiguration getConnectorConfig()
TransportConfiguration to be use to connect to the
same target this is connect togetConnectorConfig in interface ConnectionCopyright © 2012 JBoss by Red Hat. All Rights Reserved.