public class RemoteOperationExecutor extends Object implements OperationExecutor
OperationServer to execute Operations remotely.| Constructor and Description |
|---|
RemoteOperationExecutor(String host,
int port)
Create a new client that will connect to the server
running at the specified host and port.
|
| Modifier and Type | Method and Description |
|---|---|
<T> T |
execute(Operation<T> operation)
Execute an operation remotely.
|
<T> BackgroundOperation<T> |
executeBackground(Operation<T> operation)
Execute an operation remotely.
|
String |
getHost()
Returns the host name.
|
int |
getPort()
Returns the host port.
|
int |
getWeight()
Returns the relative weight of this executor.
|
public RemoteOperationExecutor(String host, int port)
host - Hostname of the remote server.port - Port of the remote server.public <T> T execute(Operation<T> operation)
execute in interface OperationExecutorT - Return value type of the operation.operation - The operation to execute remotely.RuntimeException - In case of network error or if the return value class is unknown.public <T> BackgroundOperation<T> executeBackground(Operation<T> operation)
executeBackground in interface OperationExecutorT - Return value type of the operation.operation - The operation to execute remotely.BackgroundOperation for retrieving the result of the operation later.public int getWeight()
OperationExecutorgetWeight in interface OperationExecutorpublic String getHost()
public int getPort()
Copyright © 2024. All rights reserved.