|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--gumbo.util.AbstractDisposable
|
+--gumbo.util.relation.Relationship
An abstract base class for a set of related and possibly interconnected relations of a given type and purpose. Provides observability of and access to the relationship as a whole.
Note that serialization does not include the relations. This avoids serialization loops when serializing a network of relations (which can cause stack overflow for large networks); and, it is consistent with the notion that relation networks are of interest, not the relationship per se. Thus, during deserialized a relation is is responsible for adding itself to its relationship, using relationship.implAddRelation(). To serialize a relationship and its relations use the writeRelationship() and readRelationship() utilities.
| Constructor Summary | |
Relationship()
Creates an instance. |
|
| Method Summary | |
protected abstract void |
checkRelation(Relation relation)
Called by the system to check added relations and their delegators for compatibility with this relationship. |
ConnectionField.EventOut |
getAddedConnectionOut()
Sends a connection after it is created. |
RelationField.EventOut |
getAddedRelationOut()
Sends a relation after it is added to this relationship. |
java.util.Map |
getRelations()
Returns a singleton immutable view of this relationship's delegator (Object) to relation (Relation) map, with delegators and relations being unique. |
ConnectionField.EventOut |
getRemovingConnectionOut()
Sends a connection before it is destroyed. |
RelationField.EventOut |
getRemovingRelationOut()
Sends a relation before it is removed from this relationship. |
void |
implAddedConnection(Connection connection)
Used by relations to fire relation and relationship connection events after adding a connection. |
void |
implAddRelation(Relation relation)
Used by relations to add themselves to this relationship. |
protected void |
implDispose()
Disposes event routes and clears the relations. |
void |
implRemoveRelation(Relation relation)
Used by relations to remove themselves from this relationship. |
void |
implRemovingConnection(Connection connection)
Used by relations to fire relation and relationship connection events before removing a connection. |
java.lang.String |
toString()
|
| Methods inherited from class gumbo.util.AbstractDisposable |
dispose, isDisposed |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public Relationship()
| Method Detail |
public java.util.Map getRelations()
public final RelationField.EventOut getAddedRelationOut()
public final RelationField.EventOut getRemovingRelationOut()
public final ConnectionField.EventOut getAddedConnectionOut()
public final ConnectionField.EventOut getRemovingConnectionOut()
public final void implAddedConnection(Connection connection)
connection - Snapshot of the connection. Never null.public final void implRemovingConnection(Connection connection)
connection - Snapshot of the connection. Never null.public final void implAddRelation(Relation relation)
relation - Reference to the relation. Never null or duplicate.public void implRemoveRelation(Relation relation)
relation - Reference to the relation. Never null or missing.protected abstract void checkRelation(Relation relation)
relation - The relation. Never null.protected void implDispose()
implDispose in class AbstractDisposablepublic java.lang.String toString()
toString in class java.lang.Object
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||