org.apfloat.samples
Interface OperationExecutor

All Known Implementing Classes:
LocalOperationExecutor, RemoteOperationExecutor

public interface OperationExecutor

Interface for implementing objects that can execute Operations. An operation can e.g. be executed locally or remotely.


Method Summary
 java.lang.Object execute(Operation operation)
          Executes some code, returning a value.
 BackgroundOperation executeBackground(Operation operation)
          Starts executing some code in the background.
 int getWeight()
          Returns the relative weight of this executor.
 

Method Detail

execute

public java.lang.Object execute(Operation operation)
Executes some code, returning a value.

Parameters:
operation - The operation to execute.
Returns:
Return value of the operation.

executeBackground

public BackgroundOperation executeBackground(Operation operation)
Starts executing some code in the background.

Parameters:
operation - The operation to execute in the background.
Returns:
An object for retrieving the result of the operation later.

getWeight

public int getWeight()
Returns the relative weight of this executor. The weights of different operation executors can be used to distribute work more equally.

Returns:
The relative weight of this operation executor.