|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectuka.util.IDConstants
uka.transport.ObjectSpaceAdapter
uka.transport.LayeredObjectSpace
This class layers an overlay over some original object space. The layered object space behaves like the original space for identifiers that are part of the original object space at the time of the creation of the layerd object space. New identifier assignments are stored in the overlay space.
Note: It is not possible to stack multiple layered object spaces. The original object space must not be a layered object space. This restriction is necessary, because a layerd object space devides the available identifier range into a lower part for the original space and an upper part for the overlay.
| Field Summary | |
private static int |
FIRST_OVERLAY_ID
|
protected ObjectSpace |
overlay
|
| 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 | |
LayeredObjectSpace(ObjectSpace original)
|
|
LayeredObjectSpace(ObjectSpace original,
ObjectSpace overlay)
|
|
| Method Summary | |
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. |
java.lang.Object |
getObject(int id)
Finds the object for a given identifier. |
ObjectSpace |
getOverlay()
|
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. |
boolean |
isShared(int id)
|
boolean |
isUsed(int id)
Checks whether this object space has an object assigned to the given identifier. |
void |
remove(int id)
Removes the given identifer from this object space. |
void |
resetObject(int id,
java.lang.Object obj)
Reassigns a new object to an existing identifier. |
ObjectSpace |
resetOverlay()
|
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. |
void |
setOverlay(ObjectSpace overlay)
|
| Methods inherited from class uka.transport.ObjectSpaceAdapter |
getOriginal, getUsedIDs |
| 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 |
| Field Detail |
private static final int FIRST_OVERLAY_ID
protected ObjectSpace overlay
| Constructor Detail |
public LayeredObjectSpace(ObjectSpace original)
public LayeredObjectSpace(ObjectSpace original,
ObjectSpace overlay)
| Method Detail |
public final void setOverlay(ObjectSpace overlay)
public final ObjectSpace resetOverlay()
public final ObjectSpace getOverlay()
public int getID(java.lang.Object obj)
ObjectSpaceObjectSpace the first time, the #isNew method returns true for the resulting
identifier.
getID in interface ObjectSpacegetID in class ObjectSpaceAdapterpublic int findID(java.lang.Object obj)
ObjectSpaceObjectSpace.getID(java.lang.Object), but does not assign the object to this
object space, if the object was not yet a member.
findID in interface ObjectSpacefindID in class ObjectSpaceAdapterpublic java.lang.Object getObject(int id)
ObjectSpace
getObject in interface ObjectSpacegetObject in class ObjectSpaceAdapterpublic boolean isUsed(int id)
ObjectSpaceObjectSpace.isUsed(int) returns true
for identifier returned from ObjectSpace.getID(java.lang.Object).
isUsed in interface ObjectSpaceisUsed in class ObjectSpaceAdapterpublic boolean isShared(int id)
isShared in interface ObjectSpaceisShared in class ObjectSpaceAdapter
public void setObject(int id,
java.lang.Object obj)
ObjectSpaceincludes the given object to this object
space.
setObject in interface ObjectSpacesetObject in class ObjectSpaceAdapter
public void resetObject(int id,
java.lang.Object obj)
ObjectSpaceremoving the identifier first and
then reassigning it with ObjectSpace.setObject(int, java.lang.Object). Since
ObjectSpace.setObject(int, java.lang.Object) may be overridden in subclasses to handle
the first assignment of an identifier especially, ObjectSpace.resetObject(int, java.lang.Object) can be used to avoid additional calls to ObjectSpace.setObject(int, java.lang.Object).
resetObject in interface ObjectSpaceresetObject in class ObjectSpaceAdapterpublic void remove(int id)
ObjectSpaceObjectSpace.getID(java.lang.Object) with the object corresponding to the given
identifier as argument will result in a new
identifier.
remove in interface ObjectSpaceremove in class ObjectSpaceAdapterpublic void clear()
ObjectSpace
clear in interface ObjectSpaceclear in class ObjectSpaceAdapterpublic void includeID(int id)
ObjectSpaceObjectSpace.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.
includeID in interface ObjectSpaceincludeID in class ObjectSpaceAdapterpublic boolean isIncluded(int id)
ObjectSpace
isIncluded in interface ObjectSpaceisIncluded in class ObjectSpaceAdapterpublic boolean isAccepted(int id)
ObjectSpaceMarshalStream/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).
isAccepted in interface ObjectSpaceisAccepted in class ObjectSpaceAdapter
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||