|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.infinispan.loader.AbstractCacheLoader
org.infinispan.loader.AbstractCacheStore
public abstract class AbstractCacheStore
An abstract CacheStore that holds common implementations for some methods
| Constructor Summary | |
|---|---|
AbstractCacheStore()
|
|
| Method Summary | |
|---|---|
protected void |
applyModifications(List<? extends Modification> mods)
|
void |
commit(Transaction tx)
Commits a transaction that has been previously prepared. |
protected Marshaller |
getMarshaller()
|
void |
init(CacheLoaderConfig config,
Cache cache,
Marshaller m)
Used to initialize a cache loader. |
void |
prepare(List<? extends Modification> mods,
Transaction tx,
boolean isOnePhase)
Issues a prepare call with a set of modifications to be applied to the cache store |
void |
purgeExpired()
Purges expired entries from the store. |
protected void |
purgeInternal()
|
void |
removeAll(Set<Object> keys)
Bulk remove operation |
void |
rollback(Transaction tx)
Rolls back a transaction that has been previously prepared This method may be invoked on a transaction for which there is no prior CacheStore.prepare(java.util.List, javax.transaction.Transaction, boolean). |
protected void |
safeClose(InputStream stream)
|
protected void |
safeClose(OutputStream stream)
|
void |
start()
|
void |
stop()
|
| Methods inherited from class org.infinispan.loader.AbstractCacheLoader |
|---|
containsKey |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.infinispan.loader.CacheStore |
|---|
clear, fromStream, remove, store, toStream |
| Methods inherited from interface org.infinispan.loader.CacheLoader |
|---|
containsKey, getConfigurationClass, load, loadAll |
| Constructor Detail |
|---|
public AbstractCacheStore()
| Method Detail |
|---|
public void init(CacheLoaderConfig config,
Cache cache,
Marshaller m)
CacheLoaderCacheLoaderManager when
setting up cache loaders.
init in interface CacheLoaderconfig - the cache loader configuration beancache - cache associated with this cache loader. Implementations may use this to determine cache name when
selecting where refer to state in storage, for example, a different database table name.m - marshaller to use when loading state from a stream, if supported by the implementation.
public void start()
throws CacheLoaderException
start in interface CacheLoaderCacheLoaderException
public void stop()
throws CacheLoaderException
stop in interface CacheLoaderCacheLoaderException
public void purgeExpired()
throws CacheLoaderException
CacheStore
purgeExpired in interface CacheStoreCacheLoaderException - in the event of problems writing to the store
protected void purgeInternal()
throws CacheLoaderException
CacheLoaderException
protected void applyModifications(List<? extends Modification> mods)
throws CacheLoaderException
CacheLoaderException
public void prepare(List<? extends Modification> mods,
Transaction tx,
boolean isOnePhase)
throws CacheLoaderException
CacheStore
prepare in interface CacheStoremods - modifications to be appliedtx - transaction identifierisOnePhase - if true, there will not be a commit or rollback phase and changes should be flushed
immediately
CacheLoaderException - in the event of problems writing to the storepublic void rollback(Transaction tx)
CacheStoreCacheStore.prepare(java.util.List, javax.transaction.Transaction, boolean). The implementation would need to deal with
this case acordingly. Typically, this would be a no-op, after ensuring any resources attached to the transaction
are cleared up.
Also note that this method may be invoked on a thread which is different from the CacheStore.prepare(java.util.List, javax.transaction.Transaction, boolean) invocation. As such, ThreadLocals
should not be relied upon to maintain transaction context.
rollback in interface CacheStoretx - tx to roll back
public void commit(Transaction tx)
throws CacheLoaderException
CacheStoreCacheStore.prepare(java.util.List, javax.transaction.Transaction, boolean). The implementation would need to deal with
this case acordingly. Typically, this would be a no-op, after ensuring any resources attached to the transaction
are cleared up.
Also note that this method may be invoked on a thread which is different from the CacheStore.prepare(java.util.List, javax.transaction.Transaction, boolean) invocation. As such, ThreadLocals
should not be relied upon to maintain transaction context.
commit in interface CacheStoretx - tx to commit
CacheLoaderException - in the event of problems writing to the store
public void removeAll(Set<Object> keys)
throws CacheLoaderException
CacheStore
removeAll in interface CacheStorekeys - to remove
CacheLoaderException - in the event of problems writing to the store
protected final void safeClose(InputStream stream)
throws CacheLoaderException
CacheLoaderException
protected final void safeClose(OutputStream stream)
throws CacheLoaderException
CacheLoaderExceptionprotected Marshaller getMarshaller()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||