org.apache.avro.ipc
Class RPCContext

java.lang.Object
  extended by org.apache.avro.ipc.RPCContext

public class RPCContext
extends Object

This class represents the context of an RPC call or RPC handshake. Designed to provide information to RPC plugin writers, this class encapsulates information about the rpc exchange, including handshake and call metadata.


Field Summary
protected  AvroRemoteException error
           
protected  Map<Utf8,ByteBuffer> requestCallMeta
           
protected  Map<Utf8,ByteBuffer> requestHandshakeMeta
           
protected  Object response
           
protected  Map<Utf8,ByteBuffer> responseCallMeta
           
protected  Map<Utf8,ByteBuffer> responseHandshakeMeta
           
 
Constructor Summary
RPCContext()
           
 
Method Summary
 AvroRemoteException error()
          The exception generated at the server, or null if no such exception has occured
 boolean isError()
          Indicates whether an exception was generated at the server
 Map<Utf8,ByteBuffer> requestCallMeta()
          This is an access method for the per-call state provided by the client to the server.
 Map<Utf8,ByteBuffer> requestHandshakeMeta()
          This is an access method for the handshake state provided by the client to the server.
 Object response()
          The response object generated at the server, if it exists.
 Map<Utf8,ByteBuffer> responseCallMeta()
          This is an access method for the per-call state provided by the server back to the client.
 Map<Utf8,ByteBuffer> responseHandshakeMeta()
          This is an access method for the handshake state provided by the server back to the client
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

requestHandshakeMeta

protected Map<Utf8,ByteBuffer> requestHandshakeMeta

responseHandshakeMeta

protected Map<Utf8,ByteBuffer> responseHandshakeMeta

requestCallMeta

protected Map<Utf8,ByteBuffer> requestCallMeta

responseCallMeta

protected Map<Utf8,ByteBuffer> responseCallMeta

response

protected Object response

error

protected AvroRemoteException error
Constructor Detail

RPCContext

public RPCContext()
Method Detail

requestHandshakeMeta

public Map<Utf8,ByteBuffer> requestHandshakeMeta()
This is an access method for the handshake state provided by the client to the server.

Returns:
a map representing handshake state from the client to the server

responseHandshakeMeta

public Map<Utf8,ByteBuffer> responseHandshakeMeta()
This is an access method for the handshake state provided by the server back to the client

Returns:
a map representing handshake state from the server to the client

requestCallMeta

public Map<Utf8,ByteBuffer> requestCallMeta()
This is an access method for the per-call state provided by the client to the server.

Returns:
a map representing per-call state from the client to the server

responseCallMeta

public Map<Utf8,ByteBuffer> responseCallMeta()
This is an access method for the per-call state provided by the server back to the client.

Returns:
a map representing per-call state from the server to the client

response

public Object response()
The response object generated at the server, if it exists. If an exception was generated, this will be null.

Returns:
the response created by this RPC, no null if an exception was generated

error

public AvroRemoteException error()
The exception generated at the server, or null if no such exception has occured

Returns:
the exception generated at the server, or null if no such exception

isError

public boolean isError()
Indicates whether an exception was generated at the server

Returns:
true is an exception was generated at the server, or false if not


Copyright © 2009 The Apache Software Foundation