|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.avro.ipc.Transceiver
org.apache.avro.ipc.NettyTransceiver
public class NettyTransceiver
A Netty-based Transceiver implementation.
| Constructor Summary | |
|---|---|
NettyTransceiver(InetSocketAddress addr)
Creates a NettyTransceiver, and attempts to connect to the given address. |
|
NettyTransceiver(InetSocketAddress addr,
org.jboss.netty.channel.ChannelFactory channelFactory)
Creates a NettyTransceiver, and attempts to connect to the given address. |
|
| Method Summary | |
|---|---|
void |
close()
|
Protocol |
getRemote()
Returns the protocol passed to Transceiver.setRemote(Protocol). |
String |
getRemoteName()
|
boolean |
isConnected()
True if a handshake has been completed for this connection. |
void |
lockChannel()
Netty channels are thread-safe, so there is no need to acquire locks. |
List<ByteBuffer> |
readBuffers()
Called by the default definition of Transceiver.transceive(List). |
void |
setRemote(Protocol protocol)
Called with the remote protocol when a handshake has been completed. |
List<ByteBuffer> |
transceive(List<ByteBuffer> request)
Override as non-synchronized method because the method is thread safe. |
void |
transceive(List<ByteBuffer> request,
Callback<List<ByteBuffer>> callback)
Called by Requestor.request(String,Object,Callback) for two-way messages using callbacks. |
void |
unlockChannel()
Netty channels are thread-safe, so there is no need to acquire locks. |
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 NettyTransceiver(InetSocketAddress addr)
throws IOException
addr - the address to connect to.
IOException - if an error occurs connecting to the given address.
public NettyTransceiver(InetSocketAddress addr,
org.jboss.netty.channel.ChannelFactory channelFactory)
throws IOException
addr - the address to connect to.channelFactory - the factory to use to create a new Netty Channel.
IOException - if an error occurs connecting to the given address.| Method Detail |
|---|
public void lockChannel()
lockChannel in class Transceiverpublic void unlockChannel()
unlockChannel in class Transceiverpublic void close()
close in interface Closeableclose in class Transceiver
public String getRemoteName()
throws IOException
getRemoteName in class TransceiverIOException
public List<ByteBuffer> transceive(List<ByteBuffer> request)
throws IOException
transceive in class TransceiverIOException
public void transceive(List<ByteBuffer> request,
Callback<List<ByteBuffer>> callback)
throws IOException
TransceiverRequestor.request(String,Object,Callback) for two-way messages using callbacks.
transceive in class TransceiverIOException
public void writeBuffers(List<ByteBuffer> buffers)
throws IOException
TransceiverRequestor.request(String,Object) for one-way messages.
writeBuffers in class TransceiverIOException
public List<ByteBuffer> readBuffers()
throws IOException
TransceiverTransceiver.transceive(List).
readBuffers in class TransceiverIOExceptionpublic Protocol getRemote()
TransceiverTransceiver.setRemote(Protocol). Throws
IllegalStateException by default.
getRemote in class Transceiverpublic boolean isConnected()
Transceiver
isConnected in class Transceiverpublic void setRemote(Protocol protocol)
TransceiverTransceiver.isConnected() should return true and #getRemote() should return this
protocol. Does nothing by default.
setRemote in class Transceiver
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||