public class GetEntryFunction extends Object implements com.gemstone.gemfire.cache.execute.Function, com.gemstone.gemfire.cache.Declarable
To register this function declaratively in a GFE peer, server, or client process, add the following to the cache.xml file:
"
On the Java client, the function should be invoked by the String methodId, rather than by passing-in an actual instance of the function (this would cause the function itself to be serialized and sent to the invocation target, which is only useful for dynamically created functions or functions not previously registered on the server).
| Modifier and Type | Field and Description |
|---|---|
static String |
ID
The well-known String function identifier used to make invocations.
|
| Constructor and Description |
|---|
GetEntryFunction() |
| Modifier and Type | Method and Description |
|---|---|
void |
execute(com.gemstone.gemfire.cache.execute.FunctionContext context)
Returns the Entry Value that corresponds with the given Key (as passed-in via the function Filter).
|
String |
getId()
Return the well-known String function identifier used to make invocations.
|
boolean |
hasResult()
True as we always return the Entry Value (or null if not found).
|
void |
init(Properties properties)
Required by Declarable Interface, but not used in this case as all resources, context, and inputs provided at invocation time.
|
boolean |
isHA()
Enables automated re-tries if the invocation fails from the caller's perspective (for example, if the
remote server or a connection fails mid-execution).
|
boolean |
optimizeForWrite()
Returning TRUE instructs GemFire to always invoke the function on the node that owns the Primary copy of
the Entry Key filter passed into the function invocation.
|
public static final String ID
public void execute(com.gemstone.gemfire.cache.execute.FunctionContext context)
execute in interface com.gemstone.gemfire.cache.execute.Functionpublic String getId()
getId in interface com.gemstone.gemfire.cache.execute.FunctiongetId in interface com.gemstone.gemfire.lang.Identifiable<String>public boolean optimizeForWrite()
optimizeForWrite in interface com.gemstone.gemfire.cache.execute.Functionpublic boolean isHA()
isHA in interface com.gemstone.gemfire.cache.execute.Functionpublic boolean hasResult()
hasResult in interface com.gemstone.gemfire.cache.execute.Functionpublic void init(Properties properties)
init in interface com.gemstone.gemfire.cache.DeclarableCopyright © 2010-2015 Pivotal Software, Inc. All rights reserved.