Package com.j_spaces.core.cache
Class TemplateCacheInfo
java.lang.Object
com.j_spaces.core.cache.TemplateCacheInfo
- All Implemented Interfaces:
IHashEntry<Object,,IStoredList<TemplateCacheInfo>> ILeasedEntryCacheInfo,ICollection<TemplateCacheInfo>,IObjectInfo<TemplateCacheInfo>,IStoredList<TemplateCacheInfo>,IStoredListIterator<TemplateCacheInfo>,IObjectsList
public class TemplateCacheInfo
extends Object
implements ILeasedEntryCacheInfo, IStoredList<TemplateCacheInfo>, IStoredListIterator<TemplateCacheInfo>, IObjectInfo<TemplateCacheInfo>
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionadd(TemplateCacheInfo subject) Store an element in the list.addUnlocked(TemplateCacheInfo subject) Store an element in the list, while the SL is unlocked .booleanChecks whether it contains the specified element.voidDump list content, used for Debug.establishListScan(boolean random_scan) establish a scan position.voidCalled by an outside scan that wants to quit the scan and return the slholder to the resource pool.intgetHashCode(int id) getHead()Returns the first element in the list (fifo)intgetKey(int id) intReturns the value of the first element in the list (fifo)Gets the subject pointed to by the cursor's scan.getValue(int id) booleanhasNext()voidinitBackRefs(int numOfIndexes) booleanSets an indication that this StoredList is invalid.booleanbooleanbooleanisEmpty()Returns true if this list is empty, i.e.booleanis the list an iterator or basic list ?booleanis it an actual multi object container.booleanbooleanbooleannext()Returns the next element in the scan order.booleanreturn true if we can save iterator creation and get a single entryvoidrelease()Release of this SLHolder resourcevoidvoidremove()voidremove(IObjectInfo oi) Remove an element described by ObjectInfo.booleanGiven an element scan the list, find it and remove it.voidRemove an element described by ObjectInfo, while the SL is unlocked.voidsetLatestIndexCreationNumber(int val) voidsetLeaseManagerListRefAndPosition(IStoredList<Object> entriesList, IObjectInfo<Object> entryPos) voidsetSubject(TemplateCacheInfo subject) Sets the subject pointed to by the cursor's scan.intsize()Returns the amount of elements in the StoredList.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.j_spaces.kernel.ICollection
establishListScan
-
Field Details
-
m_BackRefs
-
m_TemplateHolder
-
-
Constructor Details
-
TemplateCacheInfo
-
-
Method Details
-
initBackRefs
public void initBackRefs(int numOfIndexes) -
setLeaseManagerListRefAndPosition
public void setLeaseManagerListRefAndPosition(IStoredList<Object> entriesList, IObjectInfo<Object> entryPos) - Specified by:
setLeaseManagerListRefAndPositionin interfaceILeasedEntryCacheInfo
-
getLeaseManagerListRef
- Specified by:
getLeaseManagerListRefin interfaceILeasedEntryCacheInfo
-
getLeaseManagerPosition
- Specified by:
getLeaseManagerPositionin interfaceILeasedEntryCacheInfo
-
isConnectedToLeaseManager
public boolean isConnectedToLeaseManager()- Specified by:
isConnectedToLeaseManagerin interfaceILeasedEntryCacheInfo
-
isSameLeaseManagerRef
- Specified by:
isSameLeaseManagerRefin interfaceILeasedEntryCacheInfo
-
isBlobStoreEntry
public boolean isBlobStoreEntry()- Specified by:
isBlobStoreEntryin interfaceILeasedEntryCacheInfo
-
getObjectStoredInLeaseManager
- Specified by:
getObjectStoredInLeaseManagerin interfaceILeasedEntryCacheInfo
-
getLatestIndexCreationNumber
public int getLatestIndexCreationNumber() -
setLatestIndexCreationNumber
public void setLatestIndexCreationNumber(int val) -
getHead
Description copied from interface:IStoredListReturns the first element in the list (fifo)- Specified by:
getHeadin interfaceIStoredList<TemplateCacheInfo>- Returns:
- the head of the list
-
getObjectFromHead
Description copied from interface:IStoredListReturns the value of the first element in the list (fifo)- Specified by:
getObjectFromHeadin interfaceIStoredList<TemplateCacheInfo>- Returns:
- the value of the head of the list
-
freeSLHolder
Description copied from interface:IStoredListCalled by an outside scan that wants to quit the scan and return the slholder to the resource pool.- Specified by:
freeSLHolderin interfaceIStoredList<TemplateCacheInfo>- Parameters:
slh- Holder resource to return to pool; can benull.
-
remove
Description copied from interface:IStoredListRemove an element described by ObjectInfo. [Tail] - .. - [beforeOi] - [oi] - [afterOi] - .. - [Head]- Specified by:
removein interfaceIStoredList<TemplateCacheInfo>- Parameters:
oi- an existing element between Tail and Head
-
removeUnlocked
Description copied from interface:IStoredListRemove an element described by ObjectInfo, while the SL is unlocked. [Tail] - .. - [beforeOi] - [oi] - [afterOi] - .. - [Head]- Specified by:
removeUnlockedin interfaceIStoredList<TemplateCacheInfo>- Parameters:
oi- an existing element between Tail and Head
-
invalidate
public boolean invalidate()Description copied from interface:IStoredListSets an indication that this StoredList is invalid. if isEmpty() returns true, the indication is set; otherwise the indication remains false. Called by PersistentGC when scanning for empty StoredList that can be garbage collected.- Specified by:
invalidatein interfaceIStoredList<TemplateCacheInfo>- Returns:
trueif StoredList was set to invalid;falseotherwise.
-
dump
Description copied from interface:IStoredListDump list content, used for Debug.- Specified by:
dumpin interfaceIStoredList<TemplateCacheInfo>- Parameters:
logger- logger to usemsg- message to add in log
-
size
public int size()Description copied from interface:ICollectionReturns the amount of elements in the StoredList.- Specified by:
sizein interfaceICollection<TemplateCacheInfo>- Returns:
- size of the StoredList
- See Also:
-
isEmpty
public boolean isEmpty()Description copied from interface:ICollectionReturns true if this list is empty, i.e. has no elements. [Tail] - [Head]- Specified by:
isEmptyin interfaceICollection<TemplateCacheInfo>- Returns:
trueif list is empty;falseotherwise.
-
establishListScan
Description copied from interface:ICollectionestablish a scan position. if random scan is supported we select a random position; otherwise we return the first resource by scanning from head to tail.- Specified by:
establishListScanin interfaceICollection<TemplateCacheInfo>- Parameters:
random_scan-trueenable random scan;falsestart from head.- Returns:
- a Holder for this scan. This Resource should be released if scan ended prematurely.
-
next
Description copied from interface:ICollectionReturns the next element in the scan order. Calling this method until it returns null, will return each element as part of theSLHolders subject.- Specified by:
nextin interfaceICollection<TemplateCacheInfo>- Parameters:
slh- Holder representing a pivot position.- Returns:
- the next pivot position in this scan;
nullif reached end of scan.
-
add
Description copied from interface:ICollectionStore an element in the list. New elements are inserted at the tail.- Specified by:
addin interfaceICollection<TemplateCacheInfo>- Parameters:
subject- element to store.- Returns:
- an information node representing the inserted element;
nullif StoredList has been invalidated.
-
addUnlocked
Description copied from interface:IStoredListStore an element in the list, while the SL is unlocked . New elements are inserted at the tail.- Specified by:
addUnlockedin interfaceIStoredList<TemplateCacheInfo>- Parameters:
subject- element to store.- Returns:
- an information node representing the inserted element;
nullif StoredList has been invalidated.
-
removeByObject
Description copied from interface:ICollectionGiven an element scan the list, find it and remove it.- Specified by:
removeByObjectin interfaceICollection<TemplateCacheInfo>- Parameters:
obj- element to remove- Returns:
trueif object was removed;falseotherwise (if element wasn't found)
-
contains
Description copied from interface:ICollectionChecks whether it contains the specified element.- Specified by:
containsin interfaceICollection<TemplateCacheInfo>- Parameters:
obj- the element to search for- Returns:
trueif element exists in the StoredList;falseotherwise.
-
setSubject
Description copied from interface:IStoredListIteratorSets the subject pointed to by the cursor's scan.- Specified by:
setSubjectin interfaceIObjectInfo<TemplateCacheInfo>- Specified by:
setSubjectin interfaceIStoredListIterator<TemplateCacheInfo>- Parameters:
subject- The subject to set.
-
getSubject
Description copied from interface:IStoredListIteratorGets the subject pointed to by the cursor's scan.- Specified by:
getSubjectin interfaceIObjectInfo<TemplateCacheInfo>- Specified by:
getSubjectin interfaceIStoredListIterator<TemplateCacheInfo>- Returns:
- Returns the subject.
-
isMultiObjectCollection
public boolean isMultiObjectCollection()Description copied from interface:ICollectionis it an actual multi object container.- Specified by:
isMultiObjectCollectionin interfaceICollection<TemplateCacheInfo>- Returns:
trueif its an actual list;falseotherwise
-
optimizeScanForSingleObject
public boolean optimizeScanForSingleObject()return true if we can save iterator creation and get a single entry- Specified by:
optimizeScanForSingleObjectin interfaceIStoredList<TemplateCacheInfo>- Returns:
- true if we can optimize
-
getHashCode
public int getHashCode(int id) - Specified by:
getHashCodein interfaceIHashEntry<Object,IStoredList<TemplateCacheInfo>>
-
getKey
- Specified by:
getKeyin interfaceIHashEntry<Object,IStoredList<TemplateCacheInfo>>
-
getValue
- Specified by:
getValuein interfaceIHashEntry<Object,IStoredList<TemplateCacheInfo>>
-
isNativeHashEntry
public boolean isNativeHashEntry()- Specified by:
isNativeHashEntryin interfaceIHashEntry<Object,IStoredList<TemplateCacheInfo>> - Returns:
trueif this is a native hashmap entry
-
release
public void release()Description copied from interface:IStoredListIteratorRelease of this SLHolder resource- Specified by:
releasein interfaceIStoredListIterator<TemplateCacheInfo>- See Also:
-
isMultiValueIterator
public boolean isMultiValueIterator() -
releaseScan
public void releaseScan() -
getIndexPos
public int getIndexPos() -
hasNext
public boolean hasNext() -
next
-
remove
public void remove() -
isIterator
public boolean isIterator()Description copied from interface:IObjectsListis the list an iterator or basic list ?- Specified by:
isIteratorin interfaceIObjectsList
-