Class GemfireOnRegionFunctionTemplate

java.lang.Object
org.springframework.data.gemfire.function.execution.GemfireOnRegionFunctionTemplate
All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean, GemfireFunctionOperations, GemfireOnRegionOperations

public class GemfireOnRegionFunctionTemplate extends Object implements GemfireOnRegionOperations
An AbstractFunctionTemplate implementation for executing a Function on a target Region.
See Also:
  • Constructor Details

    • GemfireOnRegionFunctionTemplate

      public GemfireOnRegionFunctionTemplate(org.apache.geode.cache.Region<?,?> region)
      Constructs a new instance of the GemfireOnRegionFunctionTemplate initialized with the given Region.
      Parameters:
      region - Region on which the Function will be executed.
      Throws:
      IllegalArgumentException - if Region is null.
      See Also:
      • Region
  • Method Details

    • getFunctionExecution

      protected org.springframework.data.gemfire.function.execution.OnRegionFunctionExecution getFunctionExecution()
    • getRegion

      protected org.apache.geode.cache.Region<?,?> getRegion()
    • 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
    • executeWithNoResult

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

      public void afterPropertiesSet() throws Exception
      Specified by:
      afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
      Throws:
      Exception
    • execute

      public <T> Iterable<T> execute(org.apache.geode.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(org.apache.geode.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
    • 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
    • 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.
    • 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:
    • execute

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

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

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

      public void setResultCollector(org.apache.geode.cache.execute.ResultCollector<?,?> resultCollector)
    • getResultCollector

      public org.apache.geode.cache.execute.ResultCollector<?,?> getResultCollector()
    • setTimeout

      public void setTimeout(long timeout)
    • getTimeout

      public long getTimeout()