Interface PersistenceObjectRegistry
- All Superinterfaces:
Cloneable<PersistenceObjectRegistry>
,PersistenceObjectIdLookup
,PersistenceObjectLookup
,PersistenceSwizzlingLookup
- All Known Implementing Classes:
DefaultObjectRegistry
,ViewerObjectRegistryDisabled
public interface PersistenceObjectRegistry extends PersistenceSwizzlingLookup, Cloneable<PersistenceObjectRegistry>
A registry type for biunique associations of arbitrary objects with ids.
-
Method Summary
Modifier and Type Method Description long
capacity()
void
clear()
Clears all entries except those that are essential for a correctly executed program (e.g.void
clearAll()
Clears all entries, including those that are essential for a correctly executed program (e.g.PersistenceObjectRegistry
Clone()
Useful forPersistenceContextDispatcher
.boolean
consolidate()
Consolidate internal data structures, e.g.boolean
containsObjectId(long objectId)
XGettingTable<String,? extends HashStatistics>
createHashStatistics()
boolean
ensureCapacity(long capacity)
Makes sure the internal storage structure is prepared to provide acapacity()
of at least the passed capacity value.float
hashDensity()
int
hashRange()
boolean
isEmpty()
boolean
isValid(long objectId, Object object)
<A extends PersistenceAcceptor>
AiterateEntries(A acceptor)
Object
lookupObject(long objectId)
long
lookupObjectId(Object object)
long
minimumCapacity()
static DefaultObjectRegistry
New()
Object
optionalRegisterObject(long objectId, Object object)
boolean
processLiveObjectIds(ObjectIdsProcessor processor)
boolean
registerConstant(long objectId, Object constant)
boolean
registerObject(long objectId, Object object)
Set_long
selectLiveObjectIds(Set_long objectIdsBaseSet)
boolean
setConfiguration(float hashDensity, long minimumCapacity)
boolean
setHashDensity(float hashDensity)
boolean
setMinimumCapacity(long minimumCapacity)
long
size()
void
truncate()
Truncates all entries except those that are essential for a correctly executed program (e.g.void
truncateAll()
Truncates all entries, including those that are essential for a correctly executed program (e.g.void
validate(long objectId, Object object)
-
Method Details
-
Clone
PersistenceObjectRegistry Clone()Useful forPersistenceContextDispatcher
.- Specified by:
Clone
in interfaceCloneable<PersistenceObjectRegistry>
- Returns:
- A Clone of this instance as described in
Cloneable
.
-
lookupObjectId
- Specified by:
lookupObjectId
in interfacePersistenceObjectIdLookup
-
lookupObject
- Specified by:
lookupObject
in interfacePersistenceObjectLookup
-
isValid
-
validate
-
containsObjectId
boolean containsObjectId(long objectId) -
iterateEntries
-
size
long size() -
isEmpty
boolean isEmpty() -
hashRange
int hashRange() -
hashDensity
float hashDensity() -
minimumCapacity
long minimumCapacity() -
capacity
long capacity()- Returns:
- the current size potential before a (maybe costly) rebuild becomes necessary.
-
setHashDensity
boolean setHashDensity(float hashDensity) -
setMinimumCapacity
boolean setMinimumCapacity(long minimumCapacity) -
setConfiguration
boolean setConfiguration(float hashDensity, long minimumCapacity) -
ensureCapacity
boolean ensureCapacity(long capacity)Makes sure the internal storage structure is prepared to provide acapacity()
of at least the passed capacity value.- Parameters:
capacity
- the new minimum capacity- Returns:
- whether a rebuild of internal storage structures was necessary.
-
registerObject
-
optionalRegisterObject
-
registerConstant
-
consolidate
boolean consolidate()Consolidate internal data structures, e.g. by removing orphan entries and empty hash chains. Depending on the implementation and the size of the registry, this can take a considerable amount of time.- Returns:
- whether a rebuild was required.
-
clear
void clear()Clears all entries except those that are essential for a correctly executed program (e.g. constants).
Clearing means to leave the current capacity as it is and just to actually clear its entries.NOTE:
This method is currently only intended to be used for testing since calling it can cause inconsistencies if there still exist uncleared lazy references. -
clearAll
void clearAll()Clears all entries, including those that are essential for a correctly executed program (e.g. constants), effectively leaving a completely empty registry.
Clearing means to leave the current capacity as it is and just to actually clear its entries.NOTE:
This method is currently only intended to be used for testing since calling it can cause inconsistencies if there still exist uncleared lazy references. -
truncate
void truncate()Truncates all entries except those that are essential for a correctly executed program (e.g. constants). Truncating means to quickly empty the registry by reinitializing the internal storage structures with a new and minimal capacity.NOTE:
This method is currently only intended to be used for testing since calling it can cause inconsistencies if there still exist uncleared lazy references. -
truncateAll
void truncateAll()Truncates all entries, including those that are essential for a correctly executed program (e.g. constants), effectively leaving a completely empty registry.
Truncating means to quickly empty the registry by reinitializing the internal storage structures with a new and minimal capacity.NOTE:
This method is currently only intended to be used for testing since calling it can cause inconsistencies if there still exist uncleared lazy references. -
createHashStatistics
XGettingTable<String,? extends HashStatistics> createHashStatistics() -
processLiveObjectIds
- Parameters:
processor
- the object id processor- Returns:
true
on success,false
if lock rejected.
-
selectLiveObjectIds
- Parameters:
objectIdsBaseSet
- the ids to select- Returns:
- null if lock rejected
-
New
-