public class InVMConnection extends Object implements Connection
Modifier and Type | Field and Description |
---|---|
static boolean |
flushEnabled |
Constructor and Description |
---|
InVMConnection(Acceptor acceptor,
int serverID,
BufferHandler handler,
ConnectionLifeCycleListener listener,
Executor executor) |
InVMConnection(Acceptor acceptor,
int serverID,
String id,
BufferHandler handler,
ConnectionLifeCycleListener listener,
Executor executor) |
InVMConnection(Acceptor acceptor,
int serverID,
String id,
BufferHandler handler,
ConnectionLifeCycleListener listener,
Executor executor,
HornetQPrincipal defaultHornetQPrincipal) |
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 |
disableFlush() |
int |
getBatchingBufferSize() |
TransportConfiguration |
getConnectorConfig()
Generates a
TransportConfiguration to be use to connect to the
same target this is connect to |
HornetQPrincipal |
getDefaultHornetQPrincipal() |
Executor |
getExecutor() |
Object |
getID()
returns the unique id of this wire.
|
String |
getRemoteAddress()
returns a string representation of the remote address this connection is connected to.
|
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 batch)
writes the buffer to the connection and if flush is true returns only when the buffer has been physically written to the connection.
|
public InVMConnection(Acceptor acceptor, int serverID, BufferHandler handler, ConnectionLifeCycleListener listener, Executor executor)
public InVMConnection(Acceptor acceptor, int serverID, String id, BufferHandler handler, ConnectionLifeCycleListener listener, Executor executor)
public InVMConnection(Acceptor acceptor, int serverID, String id, BufferHandler handler, ConnectionLifeCycleListener listener, Executor executor, HornetQPrincipal defaultHornetQPrincipal)
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 batch)
Connection
write
in interface Connection
buffer
- the buffer to writeflush
- whether to flush the buffers onto the wirebatch
- whether the packet is allowed to batched for better performancepublic String getRemoteAddress()
Connection
getRemoteAddress
in interface Connection
public int getBatchingBufferSize()
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 void disableFlush()
public Executor getExecutor()
public TransportConfiguration getConnectorConfig()
TransportConfiguration
to be use to connect to the
same target this is connect togetConnectorConfig
in interface Connection
Copyright © 2012 JBoss by Red Hat. All Rights Reserved.