All Packages Class Hierarchy This Package Previous Next Index
Interface com.sun.jaw.reference.agent.services.RelationSrvIf
- public interface RelationSrvIf
- extends Serializable
Defining Relationships
The relationship service enables relationships between m-beans
to be defined when they are required. The relationships do not
need to be defined in advance. Information on the relationships
between m-beans is not stored with the m-beans themselves, but
is stored with the relationships. A relationship is an m-bean
that implements the Java interface defined in
com.sun.jaw.reference.common.RelationIf. To be able to access the
relationship service, a relationship m-bean must be registered
with the repository.
Model
In Java Dynamic Management Kit, a relationship is defined by:
- A set of roles, for example in a relationship where a
person owns a book, the person and the book are the roles in
the relationship
- A degree which corresponds to the number of required roles
in a relationship
The m-beans involved in a relationship are referred to within
the relationship by their object names.
Implementing a Relationship Service
To implement a relationship service, implement the interface
com.sun.jaw.reference.agent.services.RelationSrvIf.
Using a relationship service, it is possible to:
- Retrieve relationships between m-beans
- Retrieve specific roles within a relationship
- Define new relationships between m-beans
- See Also:
- RelationIf
-
getRelationName(String)
- Generates a unique relation name.
-
performAddRelation(RelationIf, ObjectName)
- Adds an existing relation to the framework.
-
performGetRelations(ObjectName, ObjectName, Integer)
- Gets handles on relations of a given type with a given role.
-
performNewRelation(String, ObjectName, ObjectName[], ObjectName)
- Declares a new relation between a set of objects.
-
purgeRelations()
-
getRelationName
public abstract ObjectName getRelationName(String relClassName)
- Generates a unique relation name.
- Parameters:
- relClassName - The class of the relation.
performAddRelation
public abstract ObjectName performAddRelation(RelationIf rel,
ObjectName relName) throws InstanceAlreadyExistException, InstanceNotFoundException
- Adds an existing relation to the framework.
- Parameters:
- rel - The relation to be added.
- relName - The name of the relation to be added.
- Returns:
- The ObjectName of the instantiated relation.
- Throws: InstanceAlreadyExistException
- Relation already registered
in repository.
- Throws: InstanceNotFoundException
- One or more roles in the relation
are not registered in repository.
performNewRelation
public abstract ObjectName performNewRelation(String relClassName,
ObjectName relName,
ObjectName roleNames[],
ObjectName aLoader) throws InstantiationException, ClassNotFoundException, InvalidPropertyValueException, InstanceAlreadyExistException, InstanceNotFoundException
- Declares a new relation between a set of objects.
- Parameters:
- relClassName - The type of relation to be created.
- roleNames - The object names in the relation to be created.
- relName - The name of the relation to be created.
- aLoader - The class loader to be used.
- Returns:
- The ObjectName of the instantiated relation.
- Throws: InstantiationException
- A new instance of the specified class
could not be created.
- Throws: ClassNotFoundException
- The class to be instantiated could not
be found by the class loader.
- Throws: InvalidPropertyValueException
- The specified value
is not a valid value for the property.
- Throws: InstanceAlreadyExistException
- Relation already
registered in repository.
- Throws: InstanceNotFoundException
- One or more roles in the relation
are not registered in repository.
performGetRelations
public abstract Vector performGetRelations(ObjectName relClassName,
ObjectName roleName,
Integer roleRank) throws InstanceNotFoundException
- Gets handles on relations of a given type with a given role.
- Parameters:
- relClassName - Name of the relation instance.
- roleName - Name of a role in the relation instances.
- roleRank - Which role in the relation.
- Returns:
- The list of selected relations.
- Throws: InstanceNotFoundException
- One or more roles in the relation
are not registered in repository.
purgeRelations
public abstract void purgeRelations()
All Packages Class Hierarchy This Package Previous Next Index