Gemfire JavaDocs_test
Package org.apache.geode.connectors.jdbc
Class JdbcWriter<K,V>
- java.lang.Object
-
- org.apache.geode.connectors.jdbc.internal.AbstractJdbcCallback
-
- org.apache.geode.connectors.jdbc.JdbcWriter<K,V>
-
- All Implemented Interfaces:
CacheCallback
,CacheWriter<K,V>
,Declarable
@Experimental public class JdbcWriter<K,V> extends org.apache.geode.connectors.jdbc.internal.AbstractJdbcCallback implements CacheWriter<K,V>
This class provides synchronous write through to a data source using JDBC.- Since:
- Geode 1.4
-
-
Constructor Summary
Constructors Constructor Description JdbcWriter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
beforeCreate(EntryEvent<K,V> event)
Called before an entry is created.void
beforeDestroy(EntryEvent<K,V> event)
Called before an entry is destroyed.void
beforeRegionClear(RegionEvent<K,V> event)
Called before a region is cleared.void
beforeRegionDestroy(RegionEvent<K,V> event)
Called before a region is destroyed.void
beforeUpdate(EntryEvent<K,V> event)
Called before an entry is updated.-
Methods inherited from class org.apache.geode.connectors.jdbc.internal.AbstractJdbcCallback
checkInitialized, eventCanBeIgnored, getSqlHandler
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.geode.cache.CacheCallback
close
-
Methods inherited from interface org.apache.geode.cache.Declarable
init, initialize
-
-
-
-
Method Detail
-
beforeUpdate
public void beforeUpdate(EntryEvent<K,V> event) throws CacheWriterException
Description copied from interface:CacheWriter
Called before an entry is updated. The entry update is initiated by aput
or aget
that causes the loader to update an existing entry. The entry previously existed in the cache where the operation was initiated, although the old value may have been null. The entry being updated may or may not exist in the local cache where the CacheWriter is installed.- Specified by:
beforeUpdate
in interfaceCacheWriter<K,V>
- Parameters:
event
- an EntryEvent that provides information about the operation in progress- Throws:
CacheWriterException
- if thrown will abort the operation in progress, and the exception will be propagated back to caller that initiated the operation- See Also:
Region.put(Object, Object)
,Region.get(Object)
-
beforeCreate
public void beforeCreate(EntryEvent<K,V> event) throws CacheWriterException
Description copied from interface:CacheWriter
Called before an entry is created. Entry creation is initiated by acreate
, aput
, or aget
. TheCacheWriter
can determine whether this value comes from aget
or not by evaluating theOperation
'sOperation.isLoad()
method. The entry being created may already exist in the local cache where thisCacheWriter
is installed, but it does not yet exist in the cache where the operation was initiated.- Specified by:
beforeCreate
in interfaceCacheWriter<K,V>
- Parameters:
event
- an EntryEvent that provides information about the operation in progress- Throws:
CacheWriterException
- if thrown will abort the operation in progress, and the exception will be propagated back to caller that initiated the operation- See Also:
Region.create(Object, Object)
,Region.put(Object, Object)
,Region.get(Object)
-
beforeDestroy
public void beforeDestroy(EntryEvent<K,V> event) throws CacheWriterException
Description copied from interface:CacheWriter
Called before an entry is destroyed. The entry being destroyed may or may not exist in the local cache where the CacheWriter is installed. This method is not called as a result of expiration orRegion.localDestroy(Object)
.- Specified by:
beforeDestroy
in interfaceCacheWriter<K,V>
- Parameters:
event
- an EntryEvent that provides information about the operation in progress- Throws:
CacheWriterException
- if thrown will abort the operation in progress, and the exception will be propagated back to caller that initiated the operation- See Also:
Region.destroy(Object)
-
beforeRegionDestroy
public void beforeRegionDestroy(RegionEvent<K,V> event) throws CacheWriterException
Description copied from interface:CacheWriter
Called before a region is destroyed. TheCacheWriter
will not additionally be called for each entry that is destroyed in the region as a result of a region destroy. If the region's subregions haveCacheWriter
s installed, then they will be called for the cascading subregion destroys. This method is not called as a result ofRegion.close()
,Cache.close(boolean)
, orRegion.localDestroyRegion()
. However, theRegion.close()
method is invoked regardless of whether a region is destroyed locally. A non-local region destroy results in an invocation of this method is followed by an invocation ofRegion.close()
.WARNING: This method should not destroy or create any regions itself or a deadlock will occur.
- Specified by:
beforeRegionDestroy
in interfaceCacheWriter<K,V>
- Parameters:
event
- a RegionEvent that provides information about the operation- Throws:
CacheWriterException
- if thrown, will abort the operation in progress, and the exception will be propagated back to the caller that initiated the operation- See Also:
Region.destroyRegion()
-
beforeRegionClear
public void beforeRegionClear(RegionEvent<K,V> event) throws CacheWriterException
Description copied from interface:CacheWriter
Called before a region is cleared. TheCacheWriter
will not additionally be called for each entry that is cleared in the region as a result of a region clear.WARNING: This method should not clear/destroy any regions
- Specified by:
beforeRegionClear
in interfaceCacheWriter<K,V>
- Parameters:
event
- a RegionEvent that provides information about the operation- Throws:
CacheWriterException
- if thrown, will abort the operation in progress, and the exception will be propagated back to the caller that initiated the operation- See Also:
Region.clear()
-
-