Package org.apache.geode.cache.execute
Interface FunctionContext<T1>
- All Known Subinterfaces:
RegionFunctionContext
public interface FunctionContext<T1>
Defines the execution context of a
Function. It is required by the
Function.execute(FunctionContext) to execute a Function on a particular member.
A context can be data dependent or data independent. For data dependent functions refer to
RegionFunctionContext
This interface is implemented by GemFire. Instances of it will be passed in to
Function.execute(FunctionContext).
- Since:
- GemFire 6.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionReturns the arguments provided to this function execution.getCache()Returns the identifier of the function.default Stringa convenience method to get the name of the member this function executes on.If available, returns the principal that has been authenticated to execute this function.<T2> ResultSender<T2>Returns the ResultSender which is used to add the ability for an execute method to send a single result back, or break its result into multiple pieces and send each piece back to the calling thread's ResultCollector.booleanReturns a boolean to identify whether this is a re-execute.
-
Method Details
-
getArguments
T1 getArguments()Returns the arguments provided to this function execution. These are the arguments specified by the caller usingExecution.setArguments(Object)- Returns:
- the arguments or null if there are no arguments
- Since:
- GemFire 6.0
-
getFunctionId
String getFunctionId()Returns the identifier of the function.- Returns:
- a unique identifier
- Since:
- GemFire 6.0
- See Also:
-
getResultSender
Returns the ResultSender which is used to add the ability for an execute method to send a single result back, or break its result into multiple pieces and send each piece back to the calling thread's ResultCollector. The returned ResultSender is only valid for the duration of the function call. If the Function needs to return a result, the result should be sent before the function exits.- Type Parameters:
T2- the type handled by the returnedResultSender- Returns:
- the
ResultSenderassociated with thisFunctionContext - Since:
- GemFire 6.0
-
isPossibleDuplicate
boolean isPossibleDuplicate()Returns a boolean to identify whether this is a re-execute. Returns true if it is a re-execute else returns false- Returns:
- a boolean (true) to identify whether it is a re-execute (else false)
- Since:
- GemFire 6.5
- See Also:
-
getCache
Cache getCache() -
getMemberName
a convenience method to get the name of the member this function executes on. call this function once in your function execution to avoid performance issues.- Returns:
- member name or id if name is blank
-
getPrincipal
Object getPrincipal()If available, returns the principal that has been authenticated to execute this function. This will always be null if theLegacySecurityServiceis in use.- Returns:
- the principal that has been authenticated
-