org.springframework.data.gemfire.function
Class PojoFunctionWrapper

java.lang.Object
  extended by org.springframework.data.gemfire.function.PojoFunctionWrapper
All Implemented Interfaces:
com.gemstone.gemfire.cache.execute.Function, com.gemstone.gemfire.lang.Identifiable, Serializable

public class PojoFunctionWrapper
extends Object
implements com.gemstone.gemfire.cache.execute.Function

Invokes a POJO's given method as a Gemfire remote function. If the POJO has a constructor that takes a Map, and the function context is Region, the region will be injected. The delegate class name, the method name, and the method arguments are part of a remote function invocation, therefore all arguments must be serializable or an alternate serialization method must be used. The delegate class must be the class path of the remote cache(s)

See Also:
Serialized Form

Constructor Summary
PojoFunctionWrapper(Object target, Method method, String id)
           
 
Method Summary
 void execute(com.gemstone.gemfire.cache.execute.FunctionContext functionContext)
           
 String getId()
           
 boolean hasResult()
           
protected  Object invokeTargetMethod(Object[] args)
           
 boolean isHA()
           
 boolean optimizeForWrite()
           
 void setBatchSize(int batchSize)
           
 void setHA(boolean HA)
           
 void setHasResult(boolean hasResult)
           
 void setOptimizeForWrite(boolean optimizeForWrite)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PojoFunctionWrapper

public PojoFunctionWrapper(Object target,
                           Method method,
                           String id)
Method Detail

getId

public String getId()
Specified by:
getId in interface com.gemstone.gemfire.cache.execute.Function
Specified by:
getId in interface com.gemstone.gemfire.lang.Identifiable

hasResult

public boolean hasResult()
Specified by:
hasResult in interface com.gemstone.gemfire.cache.execute.Function

isHA

public boolean isHA()
Specified by:
isHA in interface com.gemstone.gemfire.cache.execute.Function

setHA

public void setHA(boolean HA)

optimizeForWrite

public boolean optimizeForWrite()
Specified by:
optimizeForWrite in interface com.gemstone.gemfire.cache.execute.Function

setOptimizeForWrite

public void setOptimizeForWrite(boolean optimizeForWrite)

setBatchSize

public void setBatchSize(int batchSize)

setHasResult

public void setHasResult(boolean hasResult)

execute

public void execute(com.gemstone.gemfire.cache.execute.FunctionContext functionContext)
Specified by:
execute in interface com.gemstone.gemfire.cache.execute.Function

invokeTargetMethod

protected final Object invokeTargetMethod(Object[] args)