|
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||
java.lang.Objectav.tob.TheRelation.Tie<T>
T - class of the tied objectpublic class TheRelation.Tie<T extends TheObject>
This is the root class for all ties.
This is defined as the inner class of TheRelation so that
application defined subclasses will be able to obtain the outer relation
object when handling killingTargetNotify() and
targetKilledNotify() notifications.
See the Object-Relation-Kin Model.
| Field Summary | |
|---|---|
T |
o
The tied object |
| Constructor Summary | |
|---|---|
TheRelation.Tie(T o)
Construct a tie. |
|
| Method Summary | ||
|---|---|---|
|
asKin()
This doesn't provide type safety but to enable generic casts for subclasses of TheRelation |
|
T |
getO()
Get the related object of this kin. |
|
TheRelation |
getR()
Get the source relation object of this kin. |
|
protected void |
killingTargetNotify()
Override this method to perform custom validation against admissibility for the tied object to be killed. |
|
protected void |
targetKilledNotify()
Override this method to get notified when tied object get actually killed. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public final T extends TheObject o
| Constructor Detail |
|---|
public TheRelation.Tie(T o)
throws NullPointerException,
ObjectNotBornException
o - the object to be tied, must be a born object
NullPointerException - if o is null
ObjectNotBornException - if o is not born| Method Detail |
|---|
public <R extends TheRelation> Kin<R,T> asKin()
TheRelation
R - must be assignable from the outer relation object
enclosing this tie instance
public TheRelation getR()
Kin
getR in interface Kin<TheRelation,T extends TheObject>public T getO()
Kin
getO in interface Kin<TheRelation,T extends TheObject>o.
protected void killingTargetNotify()
throws ObjectDependedException
The default handling will try killing the outer relation object at this point, iff the outer relation doesn't have any persistent fields itself, and has no more than 2 tie fields (which means it only serves for connection between two objects or is just a dummy indicator, so should be get rid of as the connected object be killed).
Note: To enable this behavior, there has to be at least one kin field
defined at class of the tied object, which take this tie field as one
of its self roles (specified with IAm or implied by type).
And this method will be invoked the same number of times as the
number of such kin fields.
ObjectDependedExceptionprotected void targetKilledNotify()
null.
Note: To enable this behavior, there has to be at least one kin field
defined at class of the tied object, which take this tie field as one
of its self roles (specified with IAm or implied by type).
And this method will be invoked the same number of times as the
number of such kin fields.
|
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||