public abstract class GemfireFunctionUtils extends Object
Function
.Function
,
FunctionService
,
GemfireFunction
Constructor and Description |
---|
GemfireFunctionUtils() |
Modifier and Type | Method and Description |
---|---|
static int |
getAnnotationParameterPosition(Method method,
Class<?> targetAnnotationType,
Class<?>[] requiredTypes)
Determine the order position of a an annotated method parameter
|
static Optional<String> |
getGemfireFunctionId(Method method)
Null-safe operation used to determine the GemFire/Geode
Function.getId() Function ID}
of a given GemfireFunction annotated POJO Method . |
static boolean |
isGemfireFunction(Method method)
|
static boolean |
isMatchingGemfireFunction(Method method,
String functionId)
Determines whether the given
Method is a POJO, GemfireFunction annotated Method
having an ID matching the given functionId . |
static void |
registerFunctionForPojoMethod(Class<?> type,
String functionId)
|
static void |
registerFunctionForPojoMethod(Object target,
Method method,
AnnotationAttributes gemfireFunctionAttributes,
boolean overwrite)
Wrap the
target object and method in a GemFire/Geode Function
and register the Function with the FunctionService . |
static void |
registerFunctionForPojoMethod(Object target,
Method method,
boolean overwrite)
|
static void |
registerFunctionForPojoMethod(Object target,
String functionId)
|
public static boolean isGemfireFunction(Method method)
method
- Method
to evaluate.Method
on a POJO represents a SDG GemfireFunction
.GemfireFunction
,
Method
public static boolean isMatchingGemfireFunction(Method method, String functionId)
Method
is a POJO, GemfireFunction
annotated Method
having an ID matching the given functionId
.method
- Method
to evaluate.functionId
- String
containing the ID
to match.Method
is a POJO, GemfireFunction
annotated
Method
with the given functionId
.getGemfireFunctionId(Method)
,
Method
public static Optional<String> getGemfireFunctionId(Method method)
Function.getId()
Function ID}
of a given GemfireFunction
annotated POJO Method
.
If the Method
is not null and annotated with GemfireFunction
then this method
tries to determine the Function.getId()
from the GemfireFunction.id()
attribute.
If the GemfireFunction.id()
attribute was not explicitly set, then the Method.getName()
is returned as the Function ID
.method
- GemfireFunction
annotated POJO Method
containing the implementation
of the GemFire/Geode Function
.Function ID
of the given Method
,
or an empty Optional
if the Method
is not a GemFire/Geode Function
.GemfireFunction
,
Method
,
isGemfireFunction(Method)
public static void registerFunctionForPojoMethod(Class<?> type, String functionId)
method
with the given Function ID
on an object
of the given type
as a Function
and register it with the FunctionService
.type
- target type
to evaluate; must not be null.functionId
- String
containing the Function.getId()
identifying the Method
on the target type
to bind as a Function
.IllegalArgumentException
- if type
is null.registerFunctionForPojoMethod(Object, Method, AnnotationAttributes, boolean)
,
isMatchingGemfireFunction(Method, String)
public static void registerFunctionForPojoMethod(Object target, String functionId)
method
with the given Function ID
on the given target
as a Function
and register it with the FunctionService
.target
- target object
to evaluate; must not be null.functionId
- String
containing the Function.getId()
identifying the Method
on the target object
to bind as a Function
.IllegalArgumentException
- if target
is null.registerFunctionForPojoMethod(Object, Method, AnnotationAttributes, boolean)
,
isMatchingGemfireFunction(Method, String)
public static void registerFunctionForPojoMethod(Object target, Method method, boolean overwrite)
target
- target object
to evaluate; must not be null.method
- Method
on target
bound as a Function
.overwrite
- if true, will replace any existing Function
having the same ID
.IllegalArgumentException
- if target
is null or the given Method
is not a GemfireFunction
.registerFunctionForPojoMethod(Object, Method, AnnotationAttributes, boolean)
,
isGemfireFunction(Method)
public static void registerFunctionForPojoMethod(Object target, Method method, AnnotationAttributes gemfireFunctionAttributes, boolean overwrite)
target object
and method
in a GemFire/Geode Function
and register the Function
with the FunctionService
.target
- target object
.method
- Method
bound to a Function
.gemfireFunctionAttributes
- GemfireFunction
annotation attributes
.overwrite
- if true, will replace any existing Function
having the same ID.public static int getAnnotationParameterPosition(Method method, Class<?> targetAnnotationType, Class<?>[] requiredTypes)
method
- the Method
instancetargetAnnotationType
- the annotationrequiredTypes
- an array of valid parameter types for the annotationCopyright © 2011–2023 Pivotal Software, Inc.. All rights reserved.