|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.infinispan.loaders.AbstractCacheLoader
org.infinispan.loaders.AbstractCacheStore
public abstract class AbstractCacheStore
An abstract CacheStore that holds common implementations for some methods
| Field Summary | |
|---|---|
protected boolean |
multiThreadedPurge
|
protected ExecutorService |
purgerService
|
| Fields inherited from class org.infinispan.loaders.AbstractCacheLoader |
|---|
cache, marshaller |
| Constructor Summary | |
|---|---|
AbstractCacheStore()
|
|
| Method Summary | |
|---|---|
protected void |
applyModifications(List<? extends Modification> mods)
|
void |
commit(GlobalTransaction tx)
Commits a transaction that has been previously prepared. |
CacheStoreConfig |
getCacheStoreConfig()
Returns the configuration object associated to this cache store config. |
protected int |
getConcurrencyLevel()
|
protected StreamingMarshaller |
getMarshaller()
|
void |
init(CacheLoaderConfig config,
Cache<?,?> cache,
StreamingMarshaller m)
Used to initialize a cache loader. |
void |
prepare(List<? extends Modification> mods,
GlobalTransaction 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 abstract void |
purgeInternal()
|
void |
removeAll(Set<Object> keys)
Bulk remove operation |
void |
rollback(GlobalTransaction 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, org.infinispan.transaction.xa.GlobalTransaction, boolean). |
protected void |
safeClose(InputStream stream)
|
protected void |
safeClose(OutputStream stream)
|
void |
start()
|
void |
stop()
|
protected boolean |
supportsMultiThreadedPurge()
|
| Methods inherited from class org.infinispan.loaders.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.loaders.CacheStore |
|---|
clear, fromStream, remove, store, toStream |
| Methods inherited from interface org.infinispan.loaders.CacheLoader |
|---|
containsKey, getConfigurationClass, load, load, loadAll, loadAllKeys |
| Field Detail |
|---|
protected ExecutorService purgerService
protected boolean multiThreadedPurge
| Constructor Detail |
|---|
public AbstractCacheStore()
| Method Detail |
|---|
public void init(CacheLoaderConfig config,
Cache<?,?> cache,
StreamingMarshaller m)
throws CacheLoaderException
CacheLoaderCacheLoaderManager
when setting up cache loaders.
init in interface CacheLoaderinit in class AbstractCacheLoaderconfig - 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.
CacheLoaderExceptionprotected final int getConcurrencyLevel()
public void start()
throws CacheLoaderException
start in interface CacheLoaderCacheLoaderExceptionprotected boolean supportsMultiThreadedPurge()
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 abstract void purgeInternal()
throws CacheLoaderException
CacheLoaderException
protected void applyModifications(List<? extends Modification> mods)
throws CacheLoaderException
CacheLoaderException
public void prepare(List<? extends Modification> mods,
GlobalTransaction 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(GlobalTransaction tx)
CacheStoreCacheStore.prepare(java.util.List, org.infinispan.transaction.xa.GlobalTransaction, 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, org.infinispan.transaction.xa.GlobalTransaction, boolean) invocation. As such, ThreadLocals should not be relied upon to maintain transaction context.
rollback in interface CacheStoretx - tx to roll backpublic CacheStoreConfig getCacheStoreConfig()
CacheStore
getCacheStoreConfig in interface CacheStore
public void commit(GlobalTransaction tx)
throws CacheLoaderException
CacheStoreCacheStore.prepare(java.util.List, org.infinispan.transaction.xa.GlobalTransaction, 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, org.infinispan.transaction.xa.GlobalTransaction, 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 StreamingMarshaller getMarshaller()
|
Google Analytics | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||