|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.data.gemfire.GemfireAccessor org.springframework.data.gemfire.GemfireTemplate
public class GemfireTemplate
Helper class that simplifies GemFire data access code and converts GemFireCheckedException
and
GemFireException
into Spring DataAccessException
, following the org.springframework.dao
exception hierarchy.
Region
life-cycle exceptions.
Typically used to implement data access or business logic services that use GemFire within their implementation but
are GemFire-agnostic in their interface. The latter or code calling the latter only have to deal with business
objects, query objects, and org.springframework.dao exceptions.
Field Summary |
---|
Fields inherited from class org.springframework.data.gemfire.GemfireAccessor |
---|
log |
Constructor Summary | |
---|---|
GemfireTemplate()
|
|
GemfireTemplate(Region<K,V> region)
|
Method Summary | ||
---|---|---|
void |
afterPropertiesSet()
|
|
protected
|
createRegionProxy(Region<K,V> region)
Create a close-suppressing proxy for the given GemFire Region . |
|
|
execute(GemfireCallback<T> action)
|
|
|
execute(GemfireCallback<T> action,
boolean exposeNativeRegion)
Execute the action specified by the given action object within a Region. |
|
|
get(K key)
|
|
boolean |
isExposeNativeRegion()
Returns whether to expose the native GemFire Region to GemfireCallback code, or rather a Region proxy. |
|
|
put(K key,
V value)
|
|
|
query(String query)
|
|
|
remove(K key)
|
|
void |
setExposeNativeRegion(boolean exposeNativeRegion)
Sets whether to expose the native Gemfire Region to GemfireCallback code. |
Methods inherited from class org.springframework.data.gemfire.GemfireAccessor |
---|
convertGemFireAccessException, convertGemFireAccessException, convertGemFireQueryException, getRegion, setRegion |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GemfireTemplate()
public GemfireTemplate(Region<K,V> region)
Method Detail |
---|
public void afterPropertiesSet()
afterPropertiesSet
in interface InitializingBean
afterPropertiesSet
in class GemfireAccessor
public void setExposeNativeRegion(boolean exposeNativeRegion)
close
calls.
As there is often a need to cast to a interface, the exposed proxy
implements all interfaces implemented by the original Region
.
If this is not sufficient, turn this flag to "true".
GemfireCallback
public boolean isExposeNativeRegion()
public <K,V> V get(K key)
public <K,V> V put(K key, V value)
public <K,V> V remove(K key)
public <E> SelectResults<E> query(String query)
public <T> T execute(GemfireCallback<T> action) throws DataAccessException
DataAccessException
public <T> T execute(GemfireCallback<T> action, boolean exposeNativeRegion) throws DataAccessException
action
- callback object that specifies the Gemfire actionexposeNativeRegion
- whether to expose the native
GemFire region to callback code
null
DataAccessException
- in case of GemFire errorsprotected <K,V> Region<K,V> createRegionProxy(Region<K,V> region)
Region
.
Called by the execute
method.
region
- the GemFire Region to create a proxy for
Region.close()
,
execute(GemfireCallback, boolean)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |