GemFire 5.8

com.gemstone.gemfire.cache.execute
Interface Execution


public interface Execution

Provides methods to build the context for the execution of a Function.

Since:
5.8LA
See Also:
FunctionService, Function

Method Summary
 ResultCollector execute(Function function)
          Executes the function instance provided.
 ResultCollector execute(String functionId)
          Executes the function using its id Function.execute(FunctionContext) is called on the instance retrieved using FunctionService.getFunction(String) on the executing member.
 Execution withArgs(Serializable arguments)
          Specifies the user data passed to the function when it is executed.
 Execution withCollector(ResultCollector rs)
          Specifies the ResultCollector that will receive the results after the function has been executed.
 Execution withFilter(Set routingObjects)
          Specifies a data filter of routing objects for selecting the GemFire members to execute the function.
 

Method Detail

withFilter

Execution withFilter(Set routingObjects)
Specifies a data filter of routing objects for selecting the GemFire members to execute the function.

If the filter set is empty the function is executed on all members that have the region defined.

Parameters:
routingObjects - Set defining the data filter to be used for executing the function
Returns:
an Execution with the filter
Throws:
IllegalArgumentException - if filter passed is null.
UnsupportedOperationException - if not called after FunctionService.onRegion(com.gemstone.gemfire.cache.Region)
Since:
5.8LA

withArgs

Execution withArgs(Serializable arguments)
Specifies the user data passed to the function when it is executed. The function can retrieve these arguments using FunctionContext.getArguments()

Parameters:
arguments - user data passed to the function execution
Returns:
an Execution with args
Throws:
IllegalArgumentException - if the input parameter is null
Since:
5.8LA

withCollector

Execution withCollector(ResultCollector rs)
Specifies the ResultCollector that will receive the results after the function has been executed.

Returns:
an Execution with a collector
Throws:
IllegalArgumentException - if ResultCollector is null
Since:
5.8LA
See Also:
ResultCollector

execute

ResultCollector execute(String functionId)
                        throws Exception
Executes the function using its id

Function.execute(FunctionContext) is called on the instance retrieved using FunctionService.getFunction(String) on the executing member.

Parameters:
functionId - the Function.getId() of the function
Returns:
either a default result collector or one specified by withCollector(ResultCollector)
Throws:
Exception - if there is an error during function execution
Since:
5.8LA

execute

ResultCollector execute(Function function)
                        throws Exception
Executes the function instance provided.

Function.execute(FunctionContext) is called on the de-serialized instance on the executing member.

Parameters:
function - instance to execute
Returns:
either a default result collector or one specified by withCollector(ResultCollector)
Throws:
Exception - if there is an error during function execution
Since:
5.8LA

GemFire 5.8

Copyright © 2002-2008 GemStone Systems, Inc. All Rights Reserved.