public abstract class Transport extends Object implements Runnable, AutoCloseable
| Constructor and Description |
|---|
Transport() |
| Modifier and Type | Method and Description |
|---|---|
Transport |
acquire() |
void |
close() |
boolean |
connect(long timeout)
Connect the transport
|
boolean |
disconnect(boolean hard)
Disconnect the transport
|
boolean |
disconnect(boolean hard,
boolean inUse)
Disconnect the transport
|
boolean |
isDisconnected() |
boolean |
isFailed() |
static int |
readn(InputStream in,
byte[] b,
int off,
int len)
Read bytes from the input stream into a buffer
|
void |
release() |
void |
run() |
<T extends Response> |
sendrecv(Request request,
T response,
Set<RequestParam> params)
Send a request message and recieve response
|
String |
toString() |
public static int readn(InputStream in, byte[] b, int off, int len) throws IOException
in - b - off - len - IOExceptionpublic Transport acquire()
public void close()
close in interface AutoCloseableAutoCloseable.close()public void release()
public boolean isDisconnected()
public boolean isFailed()
public <T extends Response> T sendrecv(Request request, T response, Set<RequestParam> params) throws IOException
request - response - params - IOExceptionpublic boolean connect(long timeout)
throws TransportException
timeout - TransportExceptionpublic boolean disconnect(boolean hard)
throws IOException
hard - IOExceptionpublic boolean disconnect(boolean hard,
boolean inUse)
throws IOException
hard - inUse - whether the caller is holding a usage reference on the transportIOExceptionCopyright © 2018. All rights reserved.