org.hornetq.spi.core.remoting
Interface Connection


public interface Connection

The connection used by a channel to write data to.

Version:
$Revision$
Author:
Tim Fox

Method Summary
 void addReadyListener(ReadyListener listener)
           
 void checkFlushBatchBuffer()
          Called periodically to flush any data in the batch buffer
 void close()
          Closes the connection.
 org.hornetq.api.core.HornetQBuffer createBuffer(int size)
          Create a new HornetQBuffer of the given size.
 TransportConfiguration getConnectorConfig()
          Generates a TransportConfiguration to be used to connect to the same target this is connected to.
 org.hornetq.core.security.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.
 void removeReadyListener(ReadyListener listener)
           
 void write(org.hornetq.api.core.HornetQBuffer buffer)
          writes the buffer to the connection with no flushing or batching
 void write(org.hornetq.api.core.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.
 

Method Detail

createBuffer

org.hornetq.api.core.HornetQBuffer createBuffer(int size)
Create a new HornetQBuffer of the given size.

Parameters:
size - the size of buffer to create
Returns:
the new buffer.

getID

Object getID()
returns the unique id of this wire.

Returns:
the id

write

void write(org.hornetq.api.core.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.

Parameters:
buffer - the buffer to write
flush - whether to flush the buffers onto the wire
batched - whether the packet is allowed to batched for better performance

write

void write(org.hornetq.api.core.HornetQBuffer buffer)
writes the buffer to the connection with no flushing or batching

Parameters:
buffer - the buffer to write

close

void close()
Closes the connection.


getRemoteAddress

String getRemoteAddress()
Returns a string representation of the remote address this connection is connected to.

Returns:
the remote address

checkFlushBatchBuffer

void checkFlushBatchBuffer()
Called periodically to flush any data in the batch buffer


addReadyListener

void addReadyListener(ReadyListener listener)

removeReadyListener

void removeReadyListener(ReadyListener listener)

getConnectorConfig

TransportConfiguration getConnectorConfig()
Generates a TransportConfiguration to be used to connect to the same target this is connected to.

Returns:

getDefaultHornetQPrincipal

org.hornetq.core.security.HornetQPrincipal getDefaultHornetQPrincipal()


Copyright © 2012 JBoss, a division of Red Hat. All Rights Reserved.