Package org.jgroups.util
Class Rsp<T>
- java.lang.Object
-
- org.jgroups.util.Rsp<T>
-
public class Rsp<T> extends java.lang.ObjectClass that represents a response from a communication
-
-
Field Summary
Fields Modifier and Type Field Description protected byteflagsprotected static byteIS_EXCEPTIONSet when the value is an exceptionprotected static byteRECEIVEDFlag that represents whether the response was receivedprotected static byteSUSPECTEDFlag that represents whether the sender of the response was suspectedprotected static byteUNREACHABLEIf true, the sender (below) could not be reached, e.g.protected java.lang.ObjectvalueThe value from the response (or the exception)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)java.lang.ThrowablegetException()TgetValue()booleanhasException()inthashCode()voidreadIn(Rsp<T> other)Rsp<T>setException(java.lang.Throwable t)Rsp<T>setReceived()booleansetSuspected()booleansetUnreachable()Rsp<T>setValue(T val)java.lang.StringtoString()booleanwasReceived()booleanwasSuspected()booleanwasUnreachable()
-
-
-
Field Detail
-
RECEIVED
protected static final byte RECEIVED
Flag that represents whether the response was received- See Also:
- Constant Field Values
-
SUSPECTED
protected static final byte SUSPECTED
Flag that represents whether the sender of the response was suspected- See Also:
- Constant Field Values
-
UNREACHABLE
protected static final byte UNREACHABLE
If true, the sender (below) could not be reached, e.g. if a site was down (only used by RELAY2)- See Also:
- Constant Field Values
-
IS_EXCEPTION
protected static final byte IS_EXCEPTION
Set when the value is an exception- See Also:
- Constant Field Values
-
flags
protected byte flags
-
value
protected java.lang.Object value
The value from the response (or the exception)
-
-
Constructor Detail
-
Rsp
public Rsp()
-
Rsp
public Rsp(T retval)
-
Rsp
public Rsp(java.lang.Throwable t)
-
-
Method Detail
-
getValue
public T getValue()
-
hasException
public boolean hasException()
-
getException
public java.lang.Throwable getException()
-
wasReceived
public boolean wasReceived()
-
wasSuspected
public boolean wasSuspected()
-
setSuspected
public boolean setSuspected()
-
wasUnreachable
public boolean wasUnreachable()
-
setUnreachable
public boolean setUnreachable()
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-