@@ -19,6 +19,7 @@ focus on core POJO programming and business logic. To this end, {sdg-name} intro
19
19
register the public methods of a POJO class as {data-store-name} Functions along with the ability to invoke registered
20
20
Functions (including remotely) by using annotated interfaces.
21
21
22
+ [[function-implementation-execution]]
22
23
== Implementation Versus Execution
23
24
24
25
There are two separate concerns to address: implementation and execution.
@@ -96,6 +97,7 @@ The Region data should normally be defined as a `Map`, to facilitate unit testin
96
97
if necessary. As shown in the preceding example, it is also valid to pass the `FunctionContext` itself
97
98
or the `ResultSender` if you need to control over how the results are returned to the client.
98
99
100
+ [[function-implementation-annotations]]
99
101
=== Annotations for Function Implementation
100
102
101
103
The following example shows how {sdg-acronym}'s Function annotations are used to expose POJO methods
@@ -159,6 +161,7 @@ The `PojoFunctionWrapper` implements {data-store-name}'s `Function` interface, b
159
161
the target method in its `execute()` method. It also sends the method's return value back to the caller
160
162
by using the `ResultSender`.
161
163
164
+ [[function-implementation-batching-results]]
162
165
=== Batching Results
163
166
164
167
If the return type is an array or `Collection`, then some consideration must be given to how the results are returned.
@@ -170,6 +173,7 @@ TIP: If you need more control of the `ResultSender`, especially if the method it
170
173
to create the `Collection`, you can pass in the `ResultSender` or access it through the `FunctionContext`
171
174
and use it directly within the method to sends results back to the caller.
172
175
176
+ [[function-implementation-annotations-enabling]]
173
177
=== Enabling Annotation Processing
174
178
175
179
In accordance with Spring standards, you must explicitly activate annotation processing for `@GemfireFunction`
@@ -202,6 +206,7 @@ Thus, some of the configuration and concepts should be familiar.
202
206
Generally, a single interface definition maps to multiple Function executions, one corresponding to each method
203
207
defined in the interface.
204
208
209
+ [[function-execution-annotations]]
205
210
=== Annotations for Function Execution
206
211
207
212
To support client-side Function execution, the following {sdg-acronym} Function annotations are provided: `@OnRegion`,
@@ -236,6 +241,7 @@ public interface FunctionExecution {
236
241
By default, the Function ID is the simple (unqualified) method name. The `@FunctionId` annotation can be used
237
242
to bind this invocation to a different Function ID.
238
243
244
+ [[function-execution-annotations-enabling]]
239
245
=== Enabling Annotation Processing
240
246
241
247
The client-side uses Spring's classpath component scanning capability to discover annotated interfaces. To enable
@@ -367,15 +373,15 @@ as follows:
367
373
368
374
[source,xml]
369
375
----
370
- <gfe:cache ... pdx-read-serialized="true"/>
376
+ <gfe:cache pdx-read-serialized="true"/>
371
377
----
372
378
373
379
Alternatively, you can set the `pdx-read-serialized` attribute to `true` for a {data-store-name} cache client application,
374
380
as follows:
375
381
376
382
[source,xml]
377
383
----
378
- <gfe:client-cache ... pdx-read-serialized="true"/>
384
+ <gfe:client-cache pdx-read-serialized="true"/>
379
385
----
380
386
381
387
Doing so causes all values read from the cache (that is, Regions) as well as information passed between client and servers
@@ -429,11 +435,11 @@ to the desired application domain object types defined by the Function method's
429
435
However, this also requires you to explicitly register a {data-store-name} `PdxSerializer` on {data-store-name} servers
430
436
where {sdg-name} Function-annotated POJOs are registered and used, as the following example shows:
431
437
432
- [source,java ]
438
+ [source,xml ]
433
439
----
434
440
<bean id="customPdxSerializer" class="x.y.z.gemfire.serialization.pdx.MyCustomPdxSerializer"/>
435
441
436
- <gfe:cache ... pdx-serializer-ref="customPdxSerializeer" pdx-read-serialized="true"/>
442
+ <gfe:cache pdx-serializer-ref="customPdxSerializeer" pdx-read-serialized="true"/>
437
443
----
438
444
439
445
Alternatively, you can use {data-store-name}'s
@@ -447,8 +453,8 @@ or as one of {data-store-name}'s PDX types, as follows:
447
453
[source,java]
448
454
----
449
455
@GemfireFunction
450
- public Object genericFunction(String value, Object domainObject, PdxInstanceEnum enum ) {
451
- ...
456
+ public Object genericFunction(String value, Object domainObject, PdxInstanceEnum pdxEnum ) {
457
+ // ...
452
458
}
453
459
----
454
460
0 commit comments