|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apfloat.samples.RemoteOperationExecutor
public class RemoteOperationExecutor
Class to call an OperationServer to execute Operations remotely.
| Constructor Summary | |
|---|---|
RemoteOperationExecutor(String host,
int port)
Create a new client that will connect to the server running at the specified host and port. |
|
| Method Summary | ||
|---|---|---|
|
execute(Operation<T> operation)
Execute an operation remotely. |
|
|
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. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RemoteOperationExecutor(String host,
int port)
host - Hostname of the remote server.port - Port of the remote server.| Method Detail |
|---|
public <T> T execute(Operation<T> operation)
execute in interface OperationExecutoroperation - 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 OperationExecutoroperation - The operation to execute remotely.
BackgroundOperation for retrieving the result of the operation later.public int getWeight()
OperationExecutor
getWeight in interface OperationExecutorpublic String getHost()
public int getPort()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||