com.crankuptheamps.client
Class TCPTransport
java.lang.Object
com.crankuptheamps.client.TCPTransport
- All Implemented Interfaces:
- Transport
public class TCPTransport
- extends Object
- implements Transport
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
_impl
protected TCPTransportImpl _impl
TCPTransport
public TCPTransport(Protocol protocol,
Properties properties)
TCPTransport
public TCPTransport(Protocol msgType)
constructTransportImpl
protected TCPTransportImpl constructTransportImpl(Protocol protocol,
Properties properties)
setDaemon
public static void setDaemon(boolean daemonThreads)
isDaemon
public static boolean isDaemon()
createTransport
public static TCPTransport createTransport(Protocol messageType)
setMessageHandler
public void setMessageHandler(MessageHandler ml)
- Specified by:
setMessageHandler
in interface Transport
setDisconnectHandler
public void setDisconnectHandler(TransportDisconnectHandler dh)
- Specified by:
setDisconnectHandler
in interface Transport
setExceptionListener
public void setExceptionListener(ExceptionListener exceptionListener)
- Specified by:
setExceptionListener
in interface Transport
setTransportFilter
public void setTransportFilter(TransportFilter filter)
- Description copied from interface:
Transport
- Sets a TransportFilter that filters raw bytes before send and after receive.
- Specified by:
setTransportFilter
in interface Transport
- Parameters:
filter
- A TransportFilter instance such as com.crankuptheamps.client.TransportTraceFilter.
connect
public void connect(URI uri)
throws ConnectionRefusedException,
AlreadyConnectedException,
InvalidURIException
- Specified by:
connect
in interface Transport
- Throws:
ConnectionRefusedException
AlreadyConnectedException
InvalidURIException
close
public void close()
- Specified by:
close
in interface Transport
disconnect
public void disconnect()
- Specified by:
disconnect
in interface Transport
handleCloseEvent
public void handleCloseEvent(int failedVersion_,
String message,
Exception e)
throws DisconnectedException,
RetryOperationException
- Specified by:
handleCloseEvent
in interface Transport
- Throws:
DisconnectedException
RetryOperationException
sendWithoutRetry
public void sendWithoutRetry(Message message)
throws DisconnectedException
- Specified by:
sendWithoutRetry
in interface Transport
- Throws:
DisconnectedException
send
public void send(Message message)
throws DisconnectedException
- Specified by:
send
in interface Transport
- Throws:
DisconnectedException
allocateMessage
public Message allocateMessage()
- Specified by:
allocateMessage
in interface Transport
writeQueueSize
public long writeQueueSize()
throws DisconnectedException
- Specified by:
writeQueueSize
in interface Transport
- Throws:
DisconnectedException
readQueueSize
public long readQueueSize()
throws DisconnectedException
- Specified by:
readQueueSize
in interface Transport
- Throws:
DisconnectedException
flush
public long flush()
throws DisconnectedException
- Specified by:
flush
in interface Transport
- Throws:
DisconnectedException
flush
public long flush(long timeout)
throws DisconnectedException
- Specified by:
flush
in interface Transport
- Throws:
DisconnectedException
socket
public Socket socket()
getVersion
public int getVersion()
- Specified by:
getVersion
in interface Transport
setReadTimeout
public void setReadTimeout(int readTimeout_)
- Specified by:
setReadTimeout
in interface Transport