uka.patch
Class PartitionedObjectSpace.SubSpace

java.lang.Object
  extended byuka.util.IDConstants
      extended byuka.transport.ObjectSpaceAdapter
          extended byuka.patch.PartitionedObjectSpace.SubSpace
All Implemented Interfaces:
ObjectSpace, Printable, java.io.Serializable, SharedObjectSpace
Enclosing class:
PartitionedObjectSpace

class PartitionedObjectSpace.SubSpace
extends ObjectSpaceAdapter
implements SharedObjectSpace, Printable


Field Summary
(package private)  int rank
           
 
Fields inherited from class uka.transport.ObjectSpaceAdapter
original
 
Fields inherited from class uka.util.IDConstants
FIRST_NEW_ID, FIRST_VALID_ID, INVALID_ID, UNUSED_ID
 
Constructor Summary
PartitionedObjectSpace.SubSpace(int rank)
           
 
Method Summary
 void appendTo(ToString s)
          This method should append the contents of each instance variable of the current object to the given ToString object.
 void checkConsistency(java.util.logging.Logger log)
           
 void clear()
          Clears the object space by removing all identifier assignments.
 int findID(java.lang.Object obj)
          Same as getID(java.lang.Object), but does not assign the object to this object space, if the object was not yet a member.
 int getID(java.lang.Object obj)
          Returns the identifier for a given object.
 IntIterator getNewIDs()
          The creation of new identifiers in calls to getID(java.lang.Object) and setObject(int, java.lang.Object) is logged in a set newIDs.
 IntIterator getNewlySharedIDs()
          If an identifier of this object space becomes shared, it is first inserted into the set newlySharedIDs.
 IntIterator getNewlyUnsharedIDs()
           
 IntIterator getSharedIDs()
          Objects corresponding to identifiers in this object space can eiter be shared or non-shared.
 void includeID(int id)
          Make the object that corresponds to the given identifier part of this object space.
 boolean isAccepted(int id)
          Decides whether an object reference should be blocked during transmission through a MarshalStream/UnmarshalStream pair.
 boolean isIncluded(int id)
          Decides whether the obect that corresponds to the given identifier is part of this object space.
 void resetNewIDs()
          Empties the set newIDs and flushes the information in newlySharedIDs and newlyUnsharedIDs to sharedIDs.
 void setObject(int id, java.lang.Object obj)
          Assigns the given object to an application provided identifier and includes the given object to this object space.
 
Methods inherited from class uka.transport.ObjectSpaceAdapter
getObject, getOriginal, getUsedIDs, isShared, isUsed, remove, resetObject
 
Methods inherited from class uka.util.IDConstants
isNew, isValid, normalizeID, toggleNew
 
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
getObject, getUsedIDs, isShared, isUsed, remove, resetObject
 

Field Detail

rank

final int rank
Constructor Detail

PartitionedObjectSpace.SubSpace

public PartitionedObjectSpace.SubSpace(int rank)
Method Detail

checkConsistency

public void checkConsistency(java.util.logging.Logger log)
Specified by:
checkConsistency in interface SharedObjectSpace

getSharedIDs

public final 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.
See Also:
Distribution#getSharedIDs

getNewIDs

public final 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().

getNewlySharedIDs

public final 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 final IntIterator getNewlyUnsharedIDs()
Specified by:
getNewlyUnsharedIDs in interface SharedObjectSpace
See Also:
SharedObjectSpace.getNewlySharedIDs()

resetNewIDs

public final 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

getID

public int getID(java.lang.Object obj)
Description copied from interface: ObjectSpace
Returns the identifier for a given object. If the object was presented to the ObjectSpace the first time, the #isNew method returns true for the resulting identifier.

Specified by:
getID in interface ObjectSpace
Overrides:
getID in class ObjectSpaceAdapter

findID

public int findID(java.lang.Object obj)
Description copied from interface: ObjectSpace
Same as ObjectSpace.getID(java.lang.Object), but does not assign the object to this object space, if the object was not yet a member.

Specified by:
findID in interface ObjectSpace
Overrides:
findID in class ObjectSpaceAdapter

setObject

public void setObject(int id,
                      java.lang.Object obj)
Description copied from interface: ObjectSpace
Assigns the given object to an application provided identifier and includes the given object to this object space.

Specified by:
setObject in interface ObjectSpace
Overrides:
setObject in class ObjectSpaceAdapter

clear

public void clear()
Description copied from interface: ObjectSpace
Clears the object space by removing all identifier assignments.

Specified by:
clear in interface ObjectSpace
Overrides:
clear in class ObjectSpaceAdapter

isAccepted

public boolean isAccepted(int id)
Description copied from interface: ObjectSpace
Decides whether an object reference should be blocked during transmission through a MarshalStream/UnmarshalStream pair. If a call to ObjectSpace.isAccepted(int) on the ObjectSpace of the sender-side stream returns false for an object identifier, a reference to the corresponding object is blocked (replaced with null).

Specified by:
isAccepted in interface ObjectSpace
Overrides:
isAccepted in class ObjectSpaceAdapter

includeID

public void includeID(int id)
Description copied from interface: ObjectSpace
Make the object that corresponds to the given identifier part of this object space. An object is part of an object space, if the ObjectSpace.isIncluded(int) method returns true for the corresponding identifier. An object can have an assigned identifier in some object space without being part of that object space.

Specified by:
includeID in interface ObjectSpace
Overrides:
includeID in class ObjectSpaceAdapter

isIncluded

public boolean isIncluded(int id)
Description copied from interface: ObjectSpace
Decides whether the obect that corresponds to the given identifier is part of this object space.

Specified by:
isIncluded in interface ObjectSpace
Overrides:
isIncluded in class ObjectSpaceAdapter

appendTo

public void appendTo(ToString s)
Description copied from interface: Printable
This method should append the contents of each instance variable of the current object to the given ToString object. The appended data should be labeled with the name of the corresponding instance variable.

Specified by:
appendTo in interface Printable
See Also:
ToString, ToString.append(String, Object), ToString.append(String, boolean), ToString.append(String, byte), ToString.append(String, int)