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:

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:

See Also:
RelationIf

Method Index

 o getRelationName(String)
Generates a unique relation name.
 o performAddRelation(RelationIf, ObjectName)
Adds an existing relation to the framework.
 o performGetRelations(ObjectName, ObjectName, Integer)
Gets handles on relations of a given type with a given role.
 o performNewRelation(String, ObjectName, ObjectName[], ObjectName)
Declares a new relation between a set of objects.
 o purgeRelations()

Methods

 o getRelationName
 public abstract ObjectName getRelationName(String relClassName)
Generates a unique relation name.

Parameters:
relClassName - The class of the relation.
 o 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.
 o 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.
 o 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.
 o purgeRelations
 public abstract void purgeRelations()

All Packages  Class Hierarchy  This Package  Previous  Next  Index