Class RpcResponseMessage
java.lang.Object
com.jme3.network.AbstractMessage
com.jme3.network.service.rpc.msg.RpcResponseMessage
- All Implemented Interfaces:
Message
Used internally to send an RPC call's response back to
the caller.
- Author:
- Paul Speed
-
Constructor Summary
ConstructorsConstructorDescriptionCreates an empty RPC response message for serialization.RpcResponseMessage(long msgId, Object result) Creates a successful RPC response message.RpcResponseMessage(long msgId, Throwable t) Creates a failed RPC response message. -
Method Summary
Modifier and TypeMethodDescriptiongetError()Returns the serialized error text, if any.longReturns the RPC response message id.Returns the invocation result.Returns the serialized throwable, if present.static booleanisSerializable(Throwable error) Returns whether the throwable chain can be serialized directly.toString()Methods inherited from class AbstractMessage
isReliable, setReliable
-
Constructor Details
-
RpcResponseMessage
public RpcResponseMessage()Creates an empty RPC response message for serialization. -
RpcResponseMessage
Creates a successful RPC response message.- Parameters:
msgId- the response message idresult- the invocation result
-
RpcResponseMessage
Creates a failed RPC response message.- Parameters:
msgId- the response message idt- the error raised while processing the invocation
-
-
Method Details
-
isSerializable
Returns whether the throwable chain can be serialized directly.- Parameters:
error- the throwable to inspect- Returns:
- true if the throwable chain is serializable
-
getMessageId
public long getMessageId()Returns the RPC response message id.- Returns:
- the response message id
-
getResult
-
getError
Returns the serialized error text, if any.- Returns:
- the serialized error text, or
null
-
getThrowable
Returns the serialized throwable, if present.- Returns:
- the serialized throwable, or
null
-
toString
-