GemFire 5.8

com.gemstone.gemfire.cache.execute
Interface Function

All Superinterfaces:
Serializable
All Known Implementing Classes:
FunctionAdapter

public interface Function
extends Serializable

Defines the interface a user defined function implements.

Since:
5.8LA
See Also:
FunctionAdapter, FunctionService

Method Summary
 Serializable execute(FunctionContext context)
          The method which contain the logic to be executed.
 String getId()
          Return a unique function identifier, used to register the function with FunctionService
 boolean hasResult()
          Specifies whether the function returns a result after execution is complete.
 boolean optimizeForWrite()
          Return true to indicate to GemFire the method requires optimization for writing the targeted FunctionService.onRegion(com.gemstone.gemfire.cache.Region) and any associated routing objects.
 

Method Detail

hasResult

boolean hasResult()
Specifies whether the function returns a result after execution is complete. The method returns false if no result is expected.

If hasResult() returns false, ResultCollector.getResult() throws FunctionException.

If hasResult() returns true, ResultCollector.getResult() blocks and waits for the result of function execution

Returns:
whether this function returns a Result back to the caller.
Since:
5.8LA

execute

Serializable execute(FunctionContext context)
The method which contain the logic to be executed. This method should be thread safe and may be invoked more than once on a given member for a single Execution.

Parameters:
context - data specific to
Returns:
the results of the execution
Since:
5.8LA

getId

String getId()
Return a unique function identifier, used to register the function with FunctionService

Returns:
string identifying this function
Since:
5.8LA

optimizeForWrite

boolean optimizeForWrite()

Return true to indicate to GemFire the method requires optimization for writing the targeted FunctionService.onRegion(com.gemstone.gemfire.cache.Region) and any associated routing objects.

Returning false will optimize for read behavior on the targeted FunctionService.onRegion(com.gemstone.gemfire.cache.Region) and any associated routing objects.

This method is only consulted when invoked as a data dependent function

Returns:
false if the function is read only, otherwise returns false
Since:
5.8LA
See Also:
FunctionService

GemFire 5.8

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