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()
When an object implementing interface
Runnable is used to create a thread, starting
the thread causes the object's run method to be called in that separately executing
thread. |
void |
stop()
Stops the client.
|
public RemoteCommandClient(StreamRemoteConnection connection)
public <T> T execute(Command<T> command, long timeout) throws IOException, InterruptedException, TimeoutException
command
- the command to execute.timeout
- the timeout in milliseconds.IOException
- if an I/O error occurs.InterruptedException
TimeoutException
- if the response of the command is not received before timeout.public void registerNotificationListener(RemoteNotificationListener listener)
listener
- the notification listener to register.public void run()
Runnable
Runnable
is used to create a thread, starting
the thread causes the object's run
method to be called in that separately executing
thread.
The general contract of the method run
is that it may take any action whatsoever.
run
in interface Runnable
Thread.run()
public void stop()