org.springframework.data.gemfire
Interface GemfireCallback<T>


public interface GemfireCallback<T>

Callback interface for GemFire code. To be used with GemfireTemplate's execution methods, often as anonymous classes within a method implementation. A typical implementation will call Region.get/put/query to perform some operations on stored objects.

See Also:
Region

Method Summary
 T doInGemfire(com.gemstone.gemfire.cache.Region<?,?> region)
          Gets called by GemfireTemplate.execute(GemfireCallback).
 

Method Detail

doInGemfire

T doInGemfire(com.gemstone.gemfire.cache.Region<?,?> region)
              throws com.gemstone.gemfire.GemFireCheckedException,
                     com.gemstone.gemfire.GemFireException
Gets called by GemfireTemplate.execute(GemfireCallback). Does not need to care about handling transactions or exceptions. Allows a result object created within the callback to be returned, i.e. a domain object or a collection of domain objects. A thrown custom RuntimeException is treated as an application exception: it gets propagated to the caller of the template.

Parameters:
region - the GemFire Cache Region upon which the operation of this callback will be performed.
Returns:
a result object, or null if no result.
Throws:
com.gemstone.gemfire.GemFireCheckedException - for checked Exceptions occurring in GemFire.
com.gemstone.gemfire.GemFireException - for runtime Exceptions occurring in GemFire.
See Also:
GemfireTemplate, Region