Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
 
 package org.apache.avro.ipc;
 
 import java.util.Map;
 
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.
 
 public class RPCContext {
   
   
   protected Object response;
   protected Exception error;
   private Message message;
  
  
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
 
     if ( == null) {
        = new HashMap<Utf8,ByteBuffer>();
     }
     return ;
   }
   
   void setRequestHandshakeMeta(Map<Utf8,ByteBuffernewmeta) {
      = newmeta;
   }
  
  
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
 
     if ( == null) {
        = new HashMap<Utf8,ByteBuffer>();
     }
     return ;
   }
   
   void setResponseHandshakeMeta(Map<Utf8,ByteBuffernewmeta) {
      = newmeta;
   }
  
  
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
 
   public Map<Utf8,ByteBufferrequestCallMeta() {
     if ( == null) {
        = new HashMap<Utf8,ByteBuffer>();
     }
     return ;
   }
   
   void setRequestCallMeta(Map<Utf8,ByteBuffernewmeta) {
      = newmeta;
   }
  
  
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
 
    if ( == null) {
       = new HashMap<Utf8,ByteBuffer>();
    }
    return ;
  }
  
  void setResponseCallMeta(Map<Utf8,ByteBuffernewmeta) {
     = newmeta;
  }
  
  void setResponse(Object response) {
    this. = response;
    this. = null;
  }
  
  
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
  public Object response() {
    return ;
  }
  
  void setError(Exception error) {
    this. = null;
    this. = 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
  public Exception error() {
    return ;
  }
  
  
Indicates whether an exception was generated at the server

Returns:
true is an exception was generated at the server, or false if not
  public boolean isError() {
    return  != null;
  }
  public void setMessage(Message message) {
    this. = message;    
  }
  
  public Message getMessage() { return ; }
New to GrepCode? Check out our FAQ X