public class RemoteCommandClient
extends java.lang.Object
implements java.lang.Runnable
Constructor and Description |
---|
RemoteCommandClient(StreamRemoteConnection connection) |
Modifier and Type | Method and Description |
---|---|
<T> T |
execute(Command<T> command,
long timeout)
Executes the command and waits for the result.
|
void |
registerNotificationListener(RemoteNotificationListener listener)
Registers the given notification listener.
|
void |
run() |
void |
stop()
Stops the client.
|
public RemoteCommandClient(StreamRemoteConnection connection)
public void registerNotificationListener(RemoteNotificationListener listener)
listener
- the notification listener to register.public void run()
run
in interface java.lang.Runnable
public <T> T execute(Command<T> command, long timeout) throws java.io.IOException, java.lang.InterruptedException, java.util.concurrent.TimeoutException
command
- the command to execute.timeout
- the timeout in milliseconds.java.io.IOException
- if an I/O error occurs.java.lang.InterruptedException
java.util.concurrent.TimeoutException
- if the response of the command is not received before timeout.public void stop()