|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.infinispan.loaders.decorators.AbstractDelegatingStore
org.infinispan.loaders.decorators.ReadOnlyStore
public class ReadOnlyStore
A decorator that makes the underlying store a CacheLoader, i.e., suppressing all write
methods.
| Constructor Summary | |
|---|---|
ReadOnlyStore(CacheStore delegate)
|
|
| Method Summary | |
|---|---|
void |
clear()
Clears all entries in the store |
void |
commit(GlobalTransaction tx)
Commits a transaction that has been previously prepared. |
void |
fromStream(ObjectInput inputStream)
Writes contents of the stream to the store. |
void |
prepare(List<? extends Modification> list,
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. |
boolean |
remove(Object key)
Removes an entry in the store. |
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). |
void |
store(InternalCacheEntry ed)
Stores an entry |
| Methods inherited from class org.infinispan.loaders.decorators.AbstractDelegatingStore |
|---|
containsKey, getCacheStoreConfig, getConfigurationClass, getDelegate, init, load, load, loadAll, loadAllKeys, removeAll, setDelegate, start, stop, toStream |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ReadOnlyStore(CacheStore delegate)
| Method Detail |
|---|
public void store(InternalCacheEntry ed)
CacheStore
store in interface CacheStorestore in class AbstractDelegatingStoreed - entry to storepublic void fromStream(ObjectInput inputStream)
CacheStoreCacheStore.toStream(java.io.ObjectOutput). While not a
requirement, it is recommended that implementations make use of the StreamingMarshaller
when dealing with the stream to make use of efficient marshalling.
It is imperative that implementations do not close the stream after finishing with it.
It is also recommended that implementations use their own start and end markers on the stream since
other processes may write additional data to the stream after the cache store has written to it. As such, either
markers or some other mechanism to prevent the store from reading too much information should be employed when
writing to the stream in CacheStore.fromStream(java.io.ObjectInput) to prevent data corruption.
It can be assumed that the stream passed in already performs buffering such that the cache store implementation
doesn't have to.
fromStream in interface CacheStorefromStream in class AbstractDelegatingStoreinputStream - stream to read frompublic void clear()
CacheStore
clear in interface CacheStoreclear in class AbstractDelegatingStorepublic boolean remove(Object key)
CacheStore
remove in interface CacheStoreremove in class AbstractDelegatingStorekey - key to remove
public void purgeExpired()
CacheStore
purgeExpired in interface CacheStorepurgeExpired in class AbstractDelegatingStorepublic void commit(GlobalTransaction tx)
CacheStoreCacheStore.prepare(java.util.List, org.infinispan.transaction.xa.GlobalTransaction, boolean). The implementation would
need to deal with this case accordingly. 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 CacheStorecommit in class AbstractDelegatingStoretx - tx to commitpublic void rollback(GlobalTransaction tx)
CacheStoreCacheStore.prepare(java.util.List, org.infinispan.transaction.xa.GlobalTransaction, boolean). The implementation would
need to deal with this case accordingly. 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 CacheStorerollback in class AbstractDelegatingStoretx - tx to roll back
public void prepare(List<? extends Modification> list,
GlobalTransaction tx,
boolean isOnePhase)
CacheStore
prepare in interface CacheStoreprepare in class AbstractDelegatingStorelist - modifications to be appliedtx - transaction identifierisOnePhase - if true, there will not be a commit or rollback phase and changes should be flushed
immediately
|
--> | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||