All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.sun.jaw.impl.agent.services.light.RelationSrv

java.lang.Object
   |
   +----com.sun.jaw.impl.agent.services.light.RelationSrv

public class RelationSrv
extends Object
implements RelationSrvIf
This class provides a simple implementation of an relation service. The relation service makes use of the metadata service registered within the Common Management Framework. The implementation can be dynamically loaded into the CMF.

See Also:
RelationSrvIf

Constructor Index

 o RelationSrv()

Method Index

 o getClassVersion()
Returns the version of this class.
 o getRelationName(String)
Generate a unique relation name.
 o initCmf(Framework, ObjectName, boolean, ModificationList)
Initialize the Relation service.
 o performAddRelation(RelationIf, ObjectName)
Add an existing relation to the framework.
 o performGetRelations(ObjectName, ObjectName, Integer)
Get handles on relations of a given type with a given role.
 o performNewRelation(String, ObjectName, ObjectName[], ObjectName)
Declare a new relation between a set of objects.
 o purgeOneRelation(ObjectName)
 o purgeRelations()

Constructors

 o RelationSrv
 public RelationSrv()

Methods

 o initCmf
 public void initCmf(Framework cmf,
                     ObjectName name,
                     boolean db,
                     ModificationList list) throws InstanceAlreadyExistException
Initialize the Relation service. The method will declare the object to the Common Management Framework.
For internal use only.

Parameters:
agent - The core management framework to register the service with.
name - Object name.
db - Indicates if persistent storage is required.
list - The modification list to use for setting up parameters.
Throws: InstanceAlreadyExistException
The m-bean is already registered in the repository.
 o performAddRelation
 public ObjectName performAddRelation(RelationIf rel,
                                      ObjectName relName) throws InstanceNotFoundException, InstanceAlreadyExistException
Add an existing relation to the framework.

Parameters:
rel - the relation to add.
relName - the name of the relation to add.
Returns:
The ObjectName of the instantiated relation.
Throws: InstanceNotFoundException
The specified m-bean was not found in the repository.
Throws: InstanceAlreadyExistException
The m-bean is already registered in the object repository.
 o performNewRelation
 public ObjectName performNewRelation(String relClassName,
                                      ObjectName relName,
                                      ObjectName roleNames[],
                                      ObjectName aLoader) throws InstantiationException, ClassNotFoundException, InvalidPropertyValueException, InstanceAlreadyExistException, InstanceNotFoundException
Declare a new relation between a set of objects.

Parameters:
relClassName - the type of the relation to create.
roleNames - the object names in the relation to create.
relName - the name of the relation to create.
aLoader - a class loader to use.
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
Throws: ClassNotFoundException
class to instantiate not found by the class loader
Throws: InstantiationException
unable to create a new instance of the specified class
Throws: InvalidPropertyValueException
if the number of roles is not equal to the degree of the relation
 o performGetRelations
 public Vector performGetRelations(ObjectName relClassName,
                                   ObjectName roleName,
                                   Integer roleRank) throws InstanceNotFoundException
Get 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 is returned
Throws: InstanceNotFoundException
The m-bean does not exist in the repository.
 o purgeOneRelation
 public boolean purgeOneRelation(ObjectName relName)
 o purgeRelations
 public void purgeRelations()
 o getRelationName
 public ObjectName getRelationName(String className)
Generate a unique relation name.

Parameters:
relClassName - the class of the relation.
 o getClassVersion
 public String getClassVersion()
Returns the version of this class.


All Packages  Class Hierarchy  This Package  Previous  Next  Index