uka.transport
Class DefaultSharedObjectSpace
java.lang.Object
uka.util.IDConstants
uka.util.IDMap
uka.transport.DefaultObjectSpace
uka.transport.DefaultSharedObjectSpace
- All Implemented Interfaces:
- ObjectSpace, Printable, java.io.Serializable, SharedObjectSpace
- public class DefaultSharedObjectSpace
- extends DefaultObjectSpace
- implements SharedObjectSpace
- See Also:
- Serialized Form
| Methods inherited from class uka.util.IDMap |
appendTo, clear, dump, findID, get, getHash, getIndexForHash, getIndexForID, getObject, getObjects, getSize, getUsedIDs, isUsed, rawFindID, remove, resetObject, setObject |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface uka.transport.ObjectSpace |
clear, findID, getID, getObject, getUsedIDs, includeID, isAccepted, isIncluded, isShared, isUsed, remove, resetObject, setObject |
sharedIDs
IntSet sharedIDs
newIDs
transient IntSet newIDs
DefaultSharedObjectSpace
public DefaultSharedObjectSpace()
initTransient
private void initTransient()
set
protected void set(int id,
java.lang.Object obj)
- Description copied from class:
IDMap
- Access to the underlying
IDMap.idToObject array is
encapsulated through the IDMap.set(int, java.lang.Object) and IDMap.get(int)
methods. Subclasses may use this hooks to add functionality
whenever an object is stored or retrieved.
- Overrides:
set in class IDMap
getSharedIDs
public IntIterator getSharedIDs()
- Description copied from interface:
SharedObjectSpace
Objects corresponding to identifiers in this object space
can eiter be shared or non-shared. If an object is consedered
shared or non-shared depends on the concrete object space.
Operation on this object space (inclusion of objects, adding
objects to sub-spaces, and so on) never modify the set of
shared identifiers directly. Instead, the two journals newlySharedIDs and newlyUnsharedIDs are updated. These
journals are flushed into the shared identifier set via a call
to SharedObjectSpace.resetNewIDs().
- Specified by:
getSharedIDs in interface SharedObjectSpace
- Returns:
- an iterator over currently shared identifiers.
getNewlySharedIDs
public IntIterator getNewlySharedIDs()
- Description copied from interface:
SharedObjectSpace
- If an identifier of this object space becomes shared, it is
first inserted into the set
newlySharedIDs. A call to SharedObjectSpace.resetNewIDs() flushes this
information to sharedIDs.
- Specified by:
getNewlySharedIDs in interface SharedObjectSpace
- Returns:
- an iterator over all newly shared identifiers in this
object space.
getNewlyUnsharedIDs
public IntIterator getNewlyUnsharedIDs()
- Specified by:
getNewlyUnsharedIDs in interface SharedObjectSpace
- See Also:
SharedObjectSpace.getNewlySharedIDs()
getNewIDs
public IntIterator getNewIDs()
- Description copied from interface:
SharedObjectSpace
- The creation of new identifiers in calls to
ObjectSpace.getID(java.lang.Object) and
ObjectSpace.setObject(int, java.lang.Object) is logged in a set newIDs.
- Specified by:
getNewIDs in interface SharedObjectSpace
- Returns:
- an iterator over all identifiers that have been
assigned in this object space after the last call to
SharedObjectSpace.resetNewIDs().
resetNewIDs
public void resetNewIDs()
- Description copied from interface:
SharedObjectSpace
- Empties the set
newIDs and flushes the
information in newlySharedIDs and
newlyUnsharedIDs to sharedIDs.
- Specified by:
resetNewIDs in interface SharedObjectSpace
restoreBeforeReadObject
protected void restoreBeforeReadObject()
throws java.io.IOException,
java.lang.ClassNotFoundException
- Overrides:
restoreBeforeReadObject in class IDMap
- Throws:
java.io.IOException
java.lang.ClassNotFoundException
restoreAfterUnmarshal
private void restoreAfterUnmarshal()
throws java.lang.ClassNotFoundException,
java.io.IOException
- Throws:
java.lang.ClassNotFoundException
java.io.IOException
readObject
private void readObject(java.io.ObjectInputStream s)
throws java.io.IOException,
java.lang.ClassNotFoundException
- Throws:
java.io.IOException
java.lang.ClassNotFoundException
checkConsistency
public void checkConsistency(java.util.logging.Logger log)
- Specified by:
checkConsistency in interface SharedObjectSpace