public interface Transport
extends java.lang.AutoCloseable
Client
instance. There is usually no reason to make direct use of it.
Its functionality is best accessed via the client instance.Modifier and Type | Method and Description |
---|---|
Message |
allocateMessage() |
void |
connect(java.net.URI uri) |
void |
disconnect() |
long |
flush() |
long |
flush(long timeout) |
int |
getVersion() |
void |
handleCloseEvent(int failedVersion_,
java.lang.String message,
java.lang.Exception e) |
long |
readQueueSize() |
void |
send(Message message) |
void |
sendWithoutRetry(Message message) |
void |
setDisconnectHandler(TransportDisconnectHandler dh) |
void |
setExceptionListener(java.beans.ExceptionListener exceptionListener) |
void |
setIdleRunnable(AMPSRunnable runnable)
Sets a
AMPSRunnable that is invoked during idle-time processing for this connection. |
void |
setMessageHandler(MessageHandler ml) |
void |
setReadTimeout(int readTimeoutMillis_) |
void |
setThreadCreatedHandler(ThreadCreatedHandler ml) |
void |
setTransportFilter(TransportFilter filter_)
Sets a TransportFilter that filters raw bytes before send and after receive.
|
long |
writeQueueSize() |
void connect(java.net.URI uri) throws ConnectionRefusedException, AlreadyConnectedException, InvalidURIException
void disconnect()
void setMessageHandler(MessageHandler ml)
void setDisconnectHandler(TransportDisconnectHandler dh)
void setExceptionListener(java.beans.ExceptionListener exceptionListener)
void setThreadCreatedHandler(ThreadCreatedHandler ml)
void send(Message message) throws DisconnectedException
DisconnectedException
void sendWithoutRetry(Message message) throws DisconnectedException
DisconnectedException
Message allocateMessage()
long writeQueueSize() throws DisconnectedException
DisconnectedException
long readQueueSize() throws DisconnectedException
DisconnectedException
long flush() throws DisconnectedException
DisconnectedException
long flush(long timeout) throws DisconnectedException
DisconnectedException
void handleCloseEvent(int failedVersion_, java.lang.String message, java.lang.Exception e) throws DisconnectedException, RetryOperationException
int getVersion()
void setReadTimeout(int readTimeoutMillis_)
void setTransportFilter(TransportFilter filter_)
filter_
- A TransportFilter instance such as com.crankuptheamps.client.TransportTraceFilter.void setIdleRunnable(AMPSRunnable runnable)
AMPSRunnable
that is invoked during idle-time processing for this connection.runnable
- A AMPSRunnable
instance whose run() method is invoked.