|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.avro.ipc.Transceiver
public abstract class Transceiver
Base transport class used by Requestor
.
Constructor Summary | |
---|---|
Transceiver()
|
Method Summary | |
---|---|
void |
close()
|
Protocol |
getRemote()
Returns the protocol passed to setRemote(Protocol) . |
abstract String |
getRemoteName()
|
boolean |
isConnected()
True if a handshake has been completed for this connection. |
void |
lockChannel()
Acquires an exclusive lock on the transceiver's channel. |
abstract List<ByteBuffer> |
readBuffers()
Called by the default definition of transceive(List) . |
void |
setRemote(Protocol protocol)
Called with the remote protocol when a handshake has been completed. |
List<ByteBuffer> |
transceive(List<ByteBuffer> request)
Called by Requestor.request(String,Object) for two-way messages. |
void |
transceive(List<ByteBuffer> request,
Callback<List<ByteBuffer>> callback)
Called by Requestor.request(String,Object,Callback) for two-way messages using callbacks. |
void |
unlockChannel()
Releases the lock on the transceiver's channel if held by the calling thread. |
abstract void |
writeBuffers(List<ByteBuffer> buffers)
Called by Requestor.request(String,Object) for one-way messages. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Transceiver()
Method Detail |
---|
public abstract String getRemoteName() throws IOException
IOException
public void lockChannel()
public void unlockChannel()
public List<ByteBuffer> transceive(List<ByteBuffer> request) throws IOException
Requestor.request(String,Object)
for two-way messages.
By default calls writeBuffers(List)
followed by
readBuffers()
.
IOException
public void transceive(List<ByteBuffer> request, Callback<List<ByteBuffer>> callback) throws IOException
Requestor.request(String,Object,Callback)
for two-way messages using callbacks.
IOException
public abstract List<ByteBuffer> readBuffers() throws IOException
transceive(List)
.
IOException
public abstract void writeBuffers(List<ByteBuffer> buffers) throws IOException
Requestor.request(String,Object)
for one-way messages.
IOException
public boolean isConnected()
public void setRemote(Protocol protocol)
isConnected()
should return true and #getRemote() should return this
protocol. Does nothing by default.
public Protocol getRemote()
setRemote(Protocol)
. Throws
IllegalStateException by default.
public void close() throws IOException
close
in interface Closeable
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |