public class PojoFunctionWrapper
extends java.lang.Object
implements org.apache.geode.cache.execute.Function
POJO
Method
as a (remote) GemFire/Geode Function
.
If the POJO
has a constructor that takes a Map
, and the Function
context
is a Region
, the Region
will be injected.
The delegate class name
, the method name
,
and Method
arguments are part of the Function
invocation, therefore all arguments
must be Serializable
or an alternate serialization strategy must be used.
The delegate Class
must be on the class path of the remote cache(s).Function
,
Serialized FormConstructor and Description |
---|
PojoFunctionWrapper(java.lang.Object target,
java.lang.reflect.Method method) |
PojoFunctionWrapper(java.lang.Object target,
java.lang.reflect.Method method,
java.lang.String id) |
Modifier and Type | Method and Description |
---|---|
void |
execute(org.apache.geode.cache.execute.FunctionContext functionContext) |
int |
getBatchSize() |
java.lang.String |
getId() |
java.util.Collection<org.apache.geode.security.ResourcePermission> |
getRequiredPermissions(java.lang.String regionName) |
boolean |
hasResult() |
protected java.lang.Object |
invokeTargetMethod(java.lang.Object[] args) |
boolean |
isHA() |
protected org.springframework.data.gemfire.function.FunctionArgumentResolver |
newFunctionArgumentResolver(java.lang.reflect.Method method) |
boolean |
optimizeForWrite() |
protected boolean |
resolveHasResult(java.lang.reflect.Method method) |
protected java.lang.String |
resolveId(java.lang.reflect.Method method,
java.lang.String id) |
void |
setBatchSize(int batchSize) |
void |
setHA(boolean HA) |
void |
setHasResult(boolean hasResult) |
void |
setOptimizeForWrite(boolean optimizeForWrite) |
void |
setRequiredPermissions(java.util.Collection<org.apache.geode.security.ResourcePermission> requiredPermissions) |
public PojoFunctionWrapper(java.lang.Object target, java.lang.reflect.Method method)
public PojoFunctionWrapper(java.lang.Object target, java.lang.reflect.Method method, java.lang.String id)
protected org.springframework.data.gemfire.function.FunctionArgumentResolver newFunctionArgumentResolver(java.lang.reflect.Method method)
protected boolean resolveHasResult(java.lang.reflect.Method method)
protected java.lang.String resolveId(java.lang.reflect.Method method, java.lang.String id)
public void setBatchSize(int batchSize)
public int getBatchSize()
public void setHA(boolean HA)
public boolean isHA()
isHA
in interface org.apache.geode.cache.execute.Function
public void setHasResult(boolean hasResult)
public boolean hasResult()
hasResult
in interface org.apache.geode.cache.execute.Function
public java.lang.String getId()
getId
in interface org.apache.geode.cache.execute.Function
getId
in interface org.apache.geode.lang.Identifiable
public void setOptimizeForWrite(boolean optimizeForWrite)
public boolean optimizeForWrite()
optimizeForWrite
in interface org.apache.geode.cache.execute.Function
public void setRequiredPermissions(java.util.Collection<org.apache.geode.security.ResourcePermission> requiredPermissions)
public java.util.Collection<org.apache.geode.security.ResourcePermission> getRequiredPermissions(java.lang.String regionName)
getRequiredPermissions
in interface org.apache.geode.cache.execute.Function
public void execute(org.apache.geode.cache.execute.FunctionContext functionContext)
execute
in interface org.apache.geode.cache.execute.Function
protected final java.lang.Object invokeTargetMethod(java.lang.Object[] args)