Runtime Links

Runtime links are the complement of behavioral links that holds the information and methods that are only valid at runtime.

There are several methods in the RTLink class, all of them related to the metaobject and activation mechanism. We will review them in this section.

public void setMetaobject(Object aObject, Object aMetaobject)

Sets the metaobject for this link, for the given object. If the link has scope object, then this object should be the object for which to change the metaobject; if the link has scope class, it should be the class object for which to change the metaobject; if the link has a global scope, this parameter is ignored, and can be null.

public void setMetaobject(Object aMetaobject)

Sets the metaobject for this link, assuming this link has global scope.

public void resetMetaobject(Object aObject)

Resets the metaobject (in case the link has lazy initialization). If the link has scope object, then this object should be the object for which to reset the metaobject; if the link has scope class, it should be the class object for which to reset the metaobject; if the link has a global scope, this parameter is ignored, and can be null.

public void resetMetaobject()

Resets the metaobject (in case the link has lazy initialization), assuming this link has global scope.

public Object getMetaobject(Object aObject)

Returns the metaobject for this link, for the given object. This method triggers initialization if the link has lazy initialization and it is null. If the link has scope object, then this object should be the object for which to get the metaobject; if the link has scope class, it should be the class object for which to get the metaobject; if the link has a global scope, this parameter is ignored, and can be null.

public Object getMetaobject()

Returns the metaobject for this link, assuming this link has global. This method triggers initialization if the link has lazy initialization and it is null.

public Object getMetaobject0(Object aObject)

Same as getMetaobject(java.lang.Object), except that it never triggers metaobject initialization (hence, it may return null).

public void setActiveForLink(Active aActive)

Sets the activation condition at the link level.

public void setActiveForClass(Class aClass, Active aActive)

Sets the activation condition, at the class level, for the given class. This method will automatically set activation at the link level to Active.SUB.

public void setActiveForObject(Object aObject, Active aActive)

Sets the activation condition, at the object level, for the given object. This method will automatically set activation at both the link and class levels to Active.SUB.

public Active getActiveForLink()

Returns the link-level activation condition.

public Active getActiveForClass(Class aClass)

Returns the class-level activation condition, for the given class.

public Active getActiveForObject(Object aObject)

Returns the object-level activation condition, for the given object.

public boolean isInitialized()

Returns true if this runtime link object is initialized (meaning at least one class involved in the link has been loaded and this runtime link object is operational).