T - public abstract class LocalStoreBase<T,PK,S extends Store<T,PK,S>> extends AbstractStore<T,PK,S>
| Modifier and Type | Class and Description |
|---|---|
static class |
LocalStoreBase.Config<T,PK,S extends Store<T,PK,S>>
Store configuration.
|
AbstractStore.ExtractorTask<V>, AbstractStore.IndexizationTask<V>, AbstractStore.QueryCallable<V>, AbstractStore.QueryItemCallable<V>, AbstractStore.QueryMultipleCallable<V>, AbstractStore.RemoveTask, AbstractStore.SelectorTask, AbstractStore.UpdateCallable, AbstractStore.ValueSelectorTask<V>| Modifier and Type | Field and Description |
|---|---|
protected LocalStoreBase.Config<T,PK,S> |
config |
| Modifier | Constructor and Description |
|---|---|
protected |
LocalStoreBase(LocalStoreBase.Config<T,PK,S> config) |
| Modifier and Type | Method and Description |
|---|---|
protected Map<S,Map<Extractor<T,? super PK,S>,? super PK>> |
createCache() |
protected abstract S |
createDeputy()
Creates a store which encapsulates current call state (e.g.
|
protected Store.Handle<T,PK,S> |
createHandle(T obj,
PK primaryKey,
Map<S,Map<Extractor<T,? super PK,S>,? super PK>> cache,
Predicate<T,S>[] validators)
Creates handle.
|
protected <V,ST extends T> |
createIndex(Predicate<T,S> predicate,
Extractor<ST,V,S> extractor,
Index.Type type,
boolean ordered,
Comparator<V> comparator) |
protected Collection<Store.Handle<T,PK,S>> |
createIndexCollection(boolean unique,
boolean ordered,
Comparator<T> comparator)
Creates collection for index entries
|
protected ReadWriteLock |
createMasterLock() |
protected ExecutorService |
getExecutorService() |
protected Collection<AbstractIndex<T,? extends T,PK,?,S>> |
getIndices() |
protected Collection<Store.Handle<T,PK,S>> |
getNoPkStore()
Store for the mode without primary key or pkStore values collection.
|
protected Map<PK,Store.Handle<T,PK,S>> |
getPkStore() |
Extractor<T,PK,S> |
getPrimaryKeyExtractor()
If primary key is set, then the store shall use equals on the
value returned from the primaryKeyExtractor
instead of equals on the object to compare objects for removal and update (put).
|
protected void |
handleIndexAsynchException(Exception e) |
protected void |
onRemoved(int removed)
If there is a lot of cleared handles this method posts a task to compact store collections..
|
Lock |
readLock() |
protected void |
updateIndices(Store.Handle<T,PK,S> handle,
boolean isNew)
To make it visible to LocalHandle.
|
Lock |
writeLock() |
addIndex, clear, createHandle, createLiveView, createView, get, get, getAll, getByPrimaryKey, getHandles, getMultiple, iterator, put, query, query, queryAll, queryMultiple, remove, remove, removeByPrimaryKey, updateclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreateUnmodifiableFacadeprotected LocalStoreBase(LocalStoreBase.Config<T,PK,S> config)
protected Map<PK,Store.Handle<T,PK,S>> getPkStore()
getPkStore in class AbstractStore<T,PK,S extends Store<T,PK,S>>protected Collection<Store.Handle<T,PK,S>> getNoPkStore()
AbstractStoregetNoPkStore in class AbstractStore<T,PK,S extends Store<T,PK,S>>protected ExecutorService getExecutorService()
getExecutorService in class AbstractStore<T,PK,S extends Store<T,PK,S>>protected Store.Handle<T,PK,S> createHandle(T obj, PK primaryKey, Map<S,Map<Extractor<T,? super PK,S>,? super PK>> cache, Predicate<T,S>[] validators)
AbstractStorecreateHandle in class AbstractStore<T,PK,S extends Store<T,PK,S>>protected Collection<Store.Handle<T,PK,S>> createIndexCollection(boolean unique, boolean ordered, Comparator<T> comparator)
AbstractStorecreateIndexCollection in class AbstractStore<T,PK,S extends Store<T,PK,S>>unique - Collection should be unique (set)ordered - Collection should be ordered by the comparator or by natural order.protected Map<S,Map<Extractor<T,? super PK,S>,? super PK>> createCache()
createCache in class AbstractStore<T,PK,S extends Store<T,PK,S>>protected ReadWriteLock createMasterLock()
createMasterLock in class AbstractStore<T,PK,S extends Store<T,PK,S>>protected void onRemoved(int removed)
public Extractor<T,PK,S> getPrimaryKeyExtractor()
Storeprotected Collection<AbstractIndex<T,? extends T,PK,?,S>> getIndices()
getIndices in class AbstractStore<T,PK,S extends Store<T,PK,S>>protected <V,ST extends T> AbstractIndex<T,ST,PK,V,S> createIndex(Predicate<T,S> predicate, Extractor<ST,V,S> extractor, Index.Type type, boolean ordered, Comparator<V> comparator)
createIndex in class AbstractStore<T,PK,S extends Store<T,PK,S>>protected void handleIndexAsynchException(Exception e)
protected void updateIndices(Store.Handle<T,PK,S> handle, boolean isNew)
updateIndices in class AbstractStore<T,PK,S extends Store<T,PK,S>>protected abstract S createDeputy()
AbstractStorecreateDeputy in class AbstractStore<T,PK,S extends Store<T,PK,S>>