public class RpcConnection
extends java.lang.Object
Constructor and Description |
---|
RpcConnection(MessageConnection connection)
Creates a new RpcConnection for the specified network connection.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
callAndWait(byte channel,
short objId,
short procId,
java.lang.Object... args)
Performs a remote procedure call with the specified arguments and waits
for the response.
|
void |
callAsync(byte channel,
short objId,
short procId,
java.lang.Object... args)
Performs a remote procedure call with the specified arguments but does
not wait for a response.
|
void |
close()
Clears any pending synchronous calls causing them to
throw an exception with the message "Closing connection".
|
void |
handleMessage(RpcCallMessage msg)
Called internally when an RpcCallMessage is received from
the remote connection.
|
void |
handleMessage(RpcResponseMessage msg)
Called internally when an RpcResponseMessage is received from
the remote connection.
|
void |
registerHandler(short objId,
RpcHandler handler)
Register a handler that can be called by the other end
of the connection using the specified object ID.
|
void |
removeHandler(short objId,
RpcHandler handler)
Removes a previously registered handler for the specified
object ID.
|
protected void |
send(byte channel,
RpcResponseMessage msg) |
public RpcConnection(MessageConnection connection)
public void close()
public java.lang.Object callAndWait(byte channel, short objId, short procId, java.lang.Object... args)
public void callAsync(byte channel, short objId, short procId, java.lang.Object... args)
public void registerHandler(short objId, RpcHandler handler)
public void removeHandler(short objId, RpcHandler handler)
protected void send(byte channel, RpcResponseMessage msg)
public void handleMessage(RpcCallMessage msg)
public void handleMessage(RpcResponseMessage msg)