org.springframework.data.gemfire.function.execution
Class GemfireOnRegionFunctionTemplate

java.lang.Object
  extended by org.springframework.data.gemfire.function.execution.GemfireOnRegionFunctionTemplate
All Implemented Interfaces:
GemfireFunctionOperations, GemfireOnRegionOperations

public class GemfireOnRegionFunctionTemplate
extends Object
implements GemfireOnRegionOperations


Field Summary
protected  org.apache.commons.logging.Log log
           
protected  com.gemstone.gemfire.cache.execute.ResultCollector<?,?> resultCollector
           
protected  long timeout
           
 
Constructor Summary
GemfireOnRegionFunctionTemplate(com.gemstone.gemfire.cache.Region<?,?> region)
          Constructs an instance of the GemFireOnRegionFunctionTemplate with the given GemFire Cache Region.
 
Method Summary
protected
<T> Iterable<T>
execute(org.springframework.data.gemfire.function.execution.AbstractFunctionExecution execution)
           
protected
<T> Iterable<T>
execute(org.springframework.data.gemfire.function.execution.AbstractFunctionExecution execution, boolean returnResult)
           
<T> Iterable<T>
execute(com.gemstone.gemfire.cache.execute.Function function, Object... args)
          Execute an unregistered GemFire Function with the given arguments.
<T> Iterable<T>
execute(com.gemstone.gemfire.cache.execute.Function function, Set<?> keys, Object... args)
           
<T> T
execute(GemfireFunctionCallback<T> callback)
          Execute a GemFire Function using a native GemFire Execution instance.
<T> Iterable<T>
execute(String functionId, Object... args)
          Execute a GemFire Function registered with the given ID.
<T> Iterable<T>
execute(String functionId, Set<?> keys, Object... args)
           
protected
<T> T
executeAndExtract(org.springframework.data.gemfire.function.execution.AbstractFunctionExecution execution)
           
<T> T
executeAndExtract(com.gemstone.gemfire.cache.execute.Function function, Object... args)
          Execute an unregistered GemFire Function with the expected singleton result.
<T> T
executeAndExtract(String functionId, Object... args)
          Execute a GemFire Function registered with an ID and with an expected singleton result
<T> T
executeAndextract(String functionId, Set<?> keys, Object... args)
           
 void executeWithNoResult(String functionId, Object... args)
          Execute a GemFire Function registered with the given ID having no return value.
 void executeWithNoResult(String functionId, Set<?> keys, Object... args)
           
protected  org.springframework.data.gemfire.function.execution.AbstractFunctionExecution getFunctionExecution()
           
 com.gemstone.gemfire.cache.execute.ResultCollector<?,?> getResultCollector()
           
 void setResultCollector(com.gemstone.gemfire.cache.execute.ResultCollector<?,?> resultCollector)
           
 void setTimeout(long timeout)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.springframework.data.gemfire.function.execution.GemfireFunctionOperations
execute, execute, execute, executeAndExtract, executeAndExtract, executeWithNoResult
 

Field Detail

log

protected org.apache.commons.logging.Log log

timeout

protected long timeout

resultCollector

protected volatile com.gemstone.gemfire.cache.execute.ResultCollector<?,?> resultCollector
Constructor Detail

GemfireOnRegionFunctionTemplate

public GemfireOnRegionFunctionTemplate(com.gemstone.gemfire.cache.Region<?,?> region)
Constructs an instance of the GemFireOnRegionFunctionTemplate with the given GemFire Cache Region.

Parameters:
region - the GemFire Cache Region upon which the Function will be executed.
See Also:
Region
Method Detail

execute

public <T> Iterable<T> execute(com.gemstone.gemfire.cache.execute.Function function,
                               Set<?> keys,
                               Object... args)
Specified by:
execute in interface GemfireOnRegionOperations

execute

public <T> Iterable<T> execute(String functionId,
                               Set<?> keys,
                               Object... args)
Specified by:
execute in interface GemfireOnRegionOperations

executeAndextract

public <T> T executeAndextract(String functionId,
                               Set<?> keys,
                               Object... args)
Specified by:
executeAndextract in interface GemfireOnRegionOperations

getFunctionExecution

protected org.springframework.data.gemfire.function.execution.AbstractFunctionExecution getFunctionExecution()

executeWithNoResult

public void executeWithNoResult(String functionId,
                                Set<?> keys,
                                Object... args)
Specified by:
executeWithNoResult in interface GemfireOnRegionOperations

execute

public <T> Iterable<T> execute(com.gemstone.gemfire.cache.execute.Function function,
                               Object... args)
Description copied from interface: GemfireFunctionOperations
Execute an unregistered GemFire Function with the given arguments.

Specified by:
execute in interface GemfireFunctionOperations
Type Parameters:
T - type parameter specifying the result type of the Function execution.
Parameters:
function - the GemFire Function object to execute.
args - an array of Object arguments to the Function call.
Returns:
the contents of the ResultsCollector.

executeAndExtract

public <T> T executeAndExtract(com.gemstone.gemfire.cache.execute.Function function,
                               Object... args)
Description copied from interface: GemfireFunctionOperations
Execute an unregistered GemFire Function with the expected singleton result.

Specified by:
executeAndExtract in interface GemfireFunctionOperations
Type Parameters:
T - type parameter specifying the result type of the Function execution.
Parameters:
function - the GemFire Function object.
args - an array of Object arguments to the Function call.
Returns:
the first item in the ResultsCollector.
See Also:
Function

execute

public <T> Iterable<T> execute(String functionId,
                               Object... args)
Description copied from interface: GemfireFunctionOperations
Execute a GemFire Function registered with the given ID.

Specified by:
execute in interface GemfireFunctionOperations
Type Parameters:
T - type parameter specifying the result type of the Function execution.
Parameters:
functionId - the ID under which the GemFire function is registered.
args - an array of Object arguments to the Function call.
Returns:
the results

executeWithNoResult

public void executeWithNoResult(String functionId,
                                Object... args)
Description copied from interface: GemfireFunctionOperations
Execute a GemFire Function registered with the given ID having no return value.

Specified by:
executeWithNoResult in interface GemfireFunctionOperations
Parameters:
functionId - the ID under which the GemFire function is registered.
args - an array of Object arguments to the Function call.

executeAndExtract

public <T> T executeAndExtract(String functionId,
                               Object... args)
Description copied from interface: GemfireFunctionOperations
Execute a GemFire Function registered with an ID and with an expected singleton result

Specified by:
executeAndExtract in interface GemfireFunctionOperations
Type Parameters:
T - type parameter specifying the result type of the Function execution.
Parameters:
functionId - the ID under which the GemFire function is registered.
args - an array of Object arguments to the Function call.
Returns:
the first item in the results collector

execute

public <T> T execute(GemfireFunctionCallback<T> callback)
Description copied from interface: GemfireFunctionOperations
Execute a GemFire Function using a native GemFire Execution instance.

Specified by:
execute in interface GemfireFunctionOperations
Type Parameters:
T - type parameter specifying the result type of the Function execution.
Parameters:
callback - a callback providing the execution instance.
Returns:
the Function execution result.
See Also:
GemfireFunctionCallback

execute

protected <T> Iterable<T> execute(org.springframework.data.gemfire.function.execution.AbstractFunctionExecution execution)

execute

protected <T> Iterable<T> execute(org.springframework.data.gemfire.function.execution.AbstractFunctionExecution execution,
                                  boolean returnResult)

executeAndExtract

protected <T> T executeAndExtract(org.springframework.data.gemfire.function.execution.AbstractFunctionExecution execution)

setTimeout

public void setTimeout(long timeout)

setResultCollector

public void setResultCollector(com.gemstone.gemfire.cache.execute.ResultCollector<?,?> resultCollector)

getResultCollector

public com.gemstone.gemfire.cache.execute.ResultCollector<?,?> getResultCollector()