com.hazelcast.spi.impl
Class NormalResponse

java.lang.Object
  extended by com.hazelcast.spi.impl.Response
      extended by com.hazelcast.spi.impl.NormalResponse
All Implemented Interfaces:
DataSerializable, IdentifiedDataSerializable

public class NormalResponse
extends Response

A NormalResponse is send when an Operation needs to return a value. This response value can a 'normal' value, but it can also contain the exception thrown.

Currently there is a limitation in the design that needs to be dealt with in the future: there is no distinction made between an exception thrown or an exception returned as a regular value. In such a case, Hazelcast will always rethrow the exception.

The NormalResponse contains the actual 'value' but also the callid of that operation and the backup count. Based on the backup count, the invoker of the operation knows when all the backups have completed.

Author:
mdogan 4/10/13

Field Summary
 
Fields inherited from class com.hazelcast.spi.impl.Response
callId, urgent
 
Constructor Summary
NormalResponse()
           
NormalResponse(Object value, long callId, int backupCount, boolean urgent)
           
 
Method Summary
 int getBackupCount()
           
 int getId()
          Returns type identifier for this class.
 Object getValue()
           
 void readData(ObjectDataInput in)
          Reads fields from the input stream
 String toString()
           
 void writeData(ObjectDataOutput out)
          Writes object fields to output stream
 
Methods inherited from class com.hazelcast.spi.impl.Response
getCallId, getFactoryId, isUrgent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NormalResponse

public NormalResponse()

NormalResponse

public NormalResponse(Object value,
                      long callId,
                      int backupCount,
                      boolean urgent)
Method Detail

getValue

public Object getValue()

getBackupCount

public int getBackupCount()

getId

public int getId()
Description copied from interface: IdentifiedDataSerializable
Returns type identifier for this class. Id should be unique per DataSerializableFactory.

Returns:
type id

writeData

public void writeData(ObjectDataOutput out)
               throws IOException
Description copied from interface: DataSerializable
Writes object fields to output stream

Specified by:
writeData in interface DataSerializable
Overrides:
writeData in class Response
Parameters:
out - output
Throws:
IOException

readData

public void readData(ObjectDataInput in)
              throws IOException
Description copied from interface: DataSerializable
Reads fields from the input stream

Specified by:
readData in interface DataSerializable
Overrides:
readData in class Response
Parameters:
in - input
Throws:
IOException

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2015 Hazelcast, Inc.. All Rights Reserved.