From 112d490c5f303ffb14534fe5479b720b8f043020 Mon Sep 17 00:00:00 2001 From: costin Date: Sun, 18 Jul 2010 20:31:02 +0300 Subject: [PATCH] add section on GemfireTemplate + Callback --- docs/src/docbkx/reference/data.xml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/docs/src/docbkx/reference/data.xml b/docs/src/docbkx/reference/data.xml index 1a407a59..5d9816fb 100644 --- a/docs/src/docbkx/reference/data.xml +++ b/docs/src/docbkx/reference/data.xml @@ -21,6 +21,35 @@ +
+ <classname>GemfireTemplate</classname> + + As with many other high-level abstractions provided by the Spring Framework and related projects, Spring GemFire provides a template that plays a central role + when working with the GemFire API. The class provides several one-liner methods, for popular operations but also the ability to execute code + against the native GemFire API without having to deal with exceptions for example through the GemfireCallback. + + The template class requires a GemFire Region instance and once configured is thread-safe and should be reused across multiple classes: + + ]]> + + Once the template is configured, one can use it alongside GemfireCallback to work directly with the GemFire Region, + without having to deal with exceptions, threading or resource management: + + + >() { + public Iterable doInGemfire(Region reg) throws GemFireCheckedException, GemFireException { + // working against a Region of String + Region region = reg; + + region.put("1", "one"); + region.put("3", "three"); + + // should return 1 + return region.query("length < 5).size(); + } +});]]> + +
Transaction Management