com.sun.jaw.reference.agent.cmf
Class Framework

java.lang.Object
  |
  +--com.sun.jaw.reference.agent.cmf.Framework

public class Framework
extends java.lang.Object

The core management framework.

Every object which is added to a framework becomes manageable: its properties and actions become remotely accessible through the adaptors connected to that framework. This object becomes an m-bean.

m-beans are added to a framework using the addObject methods. An m-bean is identified by its ObjectName. The ObjectName can be specified by the user code or assigned automatically by the framework. The newObject methods instantiate a specified class and add the resulting object in the framework.

An m-beans is unregistered from the framework using the delObject method.

Each time an m-bean is added or removed, the framework sends FrameworkEvent to each FrameworkListener.

By default, the framework instantiates object using its associated class loader (getClassLoader). It is also possible to register a ClassLoader object in the framework and pass its object name to newObject and newDBObject. In this case, the new m-bean is instantiated using that class loader.

A framework object relies on a set of core services:

These core services are interchangeable components. For each service: Repository, metadata and thread allocator services can't be set with a null value (an IllegalArgumentException exception will be thrown).


Constructor Summary
Framework()
          Constructs a framework.
Framework(MoRepSrvIf repository, java.lang.String domain)
          Constructs a framework with the specified repository and domain.
Framework(MoRepSrvIf repository, ThreadAllocatorSrvIf threadAllocator, java.lang.String domain)
          Constructs a framework with the specified repository, thread allocator and domain.
Framework(java.lang.String domain)
          Constructs a framework with the specified domain.
 
Method Summary
 void addDBObject(java.lang.Object object, ObjectName name)
          Adds an m-bean to this framework with persistency.
 void addFrameworkListener(FrameworkListener l)
          Adds the specified FrameworkListener to receive FrameworkEvent.
 ObjectName addObject(java.lang.Object object)
          Names an m-bean and adds it to this framework.
 void addObject(java.lang.Object object, ObjectName name)
          Adds an m-bean to this framework.
 ObjectName addRelation(RelationIf rel, ObjectName relName)
          Adds a new relation instance to this framework.
 boolean contains(java.lang.Object object)
          Checks if an m-bean has been added to the framework.
 boolean contains(ObjectName objectName)
          Checks if an m-bean has been added to the framework.
 void delObject(java.lang.Object object)
          Removes an m-bean from the framework.
 void delObject(ObjectName name)
          Removes an m-bean from the framework.
 void fastDelObject(ObjectName name)
          Removes an m-bean without invoking deleteCmf.
 java.lang.ClassLoader getClassLoader()
          Returns the class loader used by this framework.
 java.lang.String getClassVersion()
          Returns the version of this class.
 java.lang.String getDomain()
          Returns the domain assigned to this framework.
 FilterSrvIf getFilterSrvIf()
          Returns the filtering service used by this framework.
 java.lang.Object getIndexedValue(ObjectName name, java.lang.String property, int pos)
          Gets the value of an indexed property within an m-bean.
 java.lang.Object getIndexedValue(java.lang.Object instance, java.lang.String property, int pos)
          Gets the value of an indexed property within an m-bean.
 java.lang.String getJdmkVersion()
          Returns the version of Java DMK.
 MetaDataSrvIf getMetaDataSrvIf()
          Returns the metadata service used by this framework.
 MoRepSrvIf getMoRepSrvIf()
          Returns the repository service used by this framework.
 java.lang.Integer getNbElements()
          Returns the number of m-beans contained in this framework.
 java.util.Vector getObject(ObjectName name, QueryExp query)
          Returns all the m-beans matching a query.
 java.util.Vector getRelations(ObjectName relClassName, ObjectName roleName, int roleRank)
          Finds the relation instances attached to an m-bean.
 RelationSrvIf getRelationSrvIf()
          Returns the relationship service used by this framework.
 ThreadAllocatorSrvIf getThreadAllocatorSrvIf()
          Returns the thread allocator service used by this framework.
 java.lang.Object getValue(ObjectName name, java.lang.String property)
          Gets the value of a property within an m-bean.
 java.lang.Object getValue(java.lang.Object object, java.lang.String property)
          Gets the value of a property within an m-bean.
 PropertyList getValues(ObjectName name, java.util.Vector propertyIdList)
          Gets the values of several properties within an m-bean.
 java.lang.Object invokePerform(ObjectName objectName, java.lang.String actionName, java.lang.Object[] params, java.lang.String[] sig)
          Invokes an action on an m-bean identified by an object name.
 java.lang.Object invokePerform(java.lang.Object object, java.lang.String actionName, java.lang.Object[] params, java.lang.String[] sig)
          Invokes an action on an m-bean.
 java.lang.Object newDBObject(java.lang.String className, ObjectName objectName, ModificationList list)
          Instantiates and adds an m-bean with persistency.
 java.lang.Object newDBObject(java.lang.String className, ObjectName objectName, ObjectName loaderName, ModificationList list)
          Instantiates and adds an m-bean with persistency and a class loader.
 java.lang.Object newDBObject(java.lang.String className, java.lang.String objectName, ModificationList list)
          Instantiates and adds an m-bean with persistency.
 java.lang.Object newDBObject(java.lang.String className, java.lang.String objectName, ObjectName loaderName, ModificationList list)
          Instantiates and adds an m-bean with persistency and a class loader.
 java.lang.Object newObj(java.lang.String className)
          Instantiates an object without adding it to the framework.
 java.lang.Object newObj(java.lang.String className, ObjectName loaderName)
          Instantiates an object without adding it to the framework.
 java.lang.Object newObject(java.lang.String className, ObjectName objectName, ModificationList list)
          Instantiates and adds an m-bean to the framework.
 java.lang.Object newObject(java.lang.String className, ObjectName objectName, ObjectName loaderName, ModificationList list)
          Instantiates and adds an m-bean using a class loader.
 java.lang.Object newObject(java.lang.String className, java.lang.String objectName, ModificationList list)
          Instantiates and adds an m-bean to the framework.
 java.lang.Object newObject(java.lang.String className, java.lang.String objectName, ObjectName loaderName, ModificationList list)
          Instantiates and adds an m-bean using a class loader.
 ObjectName newRelation(java.lang.String relClassName, ObjectName relName, ObjectName[] roleNames, ObjectName aLoader)
          Instantiates and adds an relation m-bean to this framework.
 void removeFrameworkListener(FrameworkListener l)
          Removes the specified FrameworkListener.
 java.lang.Object retrieveObject(ObjectName name)
          Returns the m-bean with the specified name.
 void setClassLoader(java.lang.ClassLoader cl)
          Sets the class loader to be used by this framework.
 void setFilterSrvIf(FilterSrvIf service)
          Sets the filtering service to be used by this framework.
 java.lang.Object setIndexedValue(ObjectName name, java.lang.String property, java.lang.Object value, java.lang.String op, int pos)
          Sets the value of an indexed property within an m-bean.
 java.lang.Object setIndexedValue(java.lang.Object instance, java.lang.String property, java.lang.Object value, int pos)
          Sets the value of an indexed property within an m-bean.
 void setMetaDataSrvIf(MetaDataSrvIf service)
          Sets the metadata service to be used by this framework.
 void setRelationSrvIf(RelationSrvIf service)
          Sets the relationship service to be used by this framework.
 void setThreadAllocatorSrvIf(ThreadAllocatorSrvIf service)
          Sets the thread allocator service to be used by this framework.
 java.lang.Object setValue(ObjectName name, java.lang.String property, java.lang.Object value, java.lang.String op)
          Sets the value of a property within an m-bean.
 java.lang.Object setValue(java.lang.Object object, java.lang.String property, java.lang.Object value)
          Sets the value of a property within an m-bean.
 PropertyList setValues(ObjectName name, ModificationList modifList)
          Set the value of several properties within an m-bean.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Framework

public Framework()
Constructs a framework. This framework uses the default repository and thread allocator (RepositorySrv and ThreadAllocatorSrv). The domain of this framework is ServiceName.DOMAIN.

Framework

public Framework(java.lang.String domain)
Constructs a framework with the specified domain. This framework uses the default repository and thread allocator (RepositorySrv and ThreadAllocatorSrv). If domain is null, the ServiceName.DOMAIN value is used.
Parameters:
domain - the domain name

Framework

public Framework(MoRepSrvIf repository,
                 java.lang.String domain)
Constructs a framework with the specified repository and domain. This framework uses the default thread allocator (ThreadAllocatorSrv). If domain is null, the ServiceName.DOMAIN value is used.
Parameters:
repository - the repository
domain - the domain

Framework

public Framework(MoRepSrvIf repository,
                 ThreadAllocatorSrvIf threadAllocator,
                 java.lang.String domain)
Constructs a framework with the specified repository, thread allocator and domain. If domain is null, the ServiceName.DOMAIN value is used.
Parameters:
repository - the repository
threadAllocator - the thread allocator
domain - the domain name
Method Detail

getObject

public java.util.Vector getObject(ObjectName name,
                                  QueryExp query)
                           throws InstanceNotFoundException
Returns all the m-beans matching a query.
An m-bean is returned if its object name matches name and query.apply returns true for this m-bean. If query is null, all the m-beans matching name are returned.

getObject(new ObjectName(":"), null) returns all the m-beans in this framework.

The method passes name and query to the repository service and gets the resulting m-beans. If query is not null and the repository service does not support filtering, then query is evaluated using the filter service.

The method throws a ServiceNotFoundException exception if the filter service is required but not available.

Parameters:
name - an object name pattern
query - the query expression to be applied to matching m-beans
Returns:
a vector of NamedObject
Throws:
InstanceNotFoundException - if no m-bean matches the request criteria
See Also:
MoRepSrvIf.isQuerySrv, FilterSrvIf, retrieveObject

contains

public boolean contains(java.lang.Object object)
Checks if an m-bean has been added to the framework. The method checks if the m-bean is registered in the repository service.
Parameters:
object - the m-bean to be checked
Returns:
true if the m-bean is already registered

contains

public boolean contains(ObjectName objectName)
Checks if an m-bean has been added to the framework. Same as contains(Object) but with an ObjectName.
Parameters:
name - the object name of the m-bean to be checked
Returns:
true if the m-bean is already registered.

retrieveObject

public java.lang.Object retrieveObject(ObjectName name)
                                throws InstanceNotFoundException
Returns the m-bean with the specified name.
name must identify only one m-bean. Object names like ":" or "myDomain:" are not permitted.
Throws:
InstanceNotFoundException - if the m-bean does not exist
See Also:
getObject

addObject

public ObjectName addObject(java.lang.Object object)
                     throws InstanceAlreadyExistException
Names an m-bean and adds it to this framework.
The method assigns a default name to the m-bean as follows: Then it registers that m-bean with the repository service and sends a framework event (CREATE_EVT).
Parameters:
object - the m-bean to be added
Returns:
the object name assigned to this m-bean
Throws:
InstanceAlreadyExistException - if the object name is already used.
See Also:
addObject(Object, ObjectName), addDBObject

addObject

public void addObject(java.lang.Object object,
                      ObjectName name)
               throws InstanceAlreadyExistException
Adds an m-bean to this framework.
The method registers the m-bean in the repository service and sends a framework event (CREATE_EVT).
Parameters:
object - the m-bean to be added
name - the object name assigned to this m-bean
Throws:
InstanceAlreadyExistException - if the object name is already used.
See Also:
addObject(Object), addDBObject

addDBObject

public void addDBObject(java.lang.Object object,
                        ObjectName name)
                 throws InstanceAlreadyExistException
Adds an m-bean to this framework with persistency.
The method adds the m-bean in the repository service using the registerDB method and sends a framework event (CREATE_EVT).
If the repository service does not support persistency, the method throws a ServiceNotFound exception.
Parameters:
object - the m-bean to be added
name - the object name assigned to this m-bean
Throws:
InstanceAlreadyExistException - if the object name is already used.
See Also:
addObject(Object), addObject(Object, ObjectName)

newObject

public java.lang.Object newObject(java.lang.String className,
                                  ObjectName objectName,
                                  ModificationList list)
                           throws java.lang.IllegalAccessException,
                                  java.lang.ClassNotFoundException,
                                  java.lang.InstantiationException,
                                  InstanceAlreadyExistException,
                                  java.lang.reflect.InvocationTargetException
Instantiates and adds an m-bean to the framework.
The method instantiates the m-bean using the class loader returned by getClassLoader. Then it calls the m-bean initCmf method if any. If initCmf is not defined, it calls addObject.
The list argument is passed to the initCmf method.
Parameters:
className - the class name of the m-bean
objectName - the object name of the m-bean
list - a modification list for initCmf
Returns:
the newly instantiated m-bean.
Throws:
java.lang.ClassNotFoundException - if the class does not exist
java.lang.InstantiationException - if the instantiation failed
java.lang.reflect.InvocationTargetException - if the constructor or initCmf thrown an exception
java.lang.IllegalAccessException - if the constructor or initCmf cannot be invoked
InstanceAlreadyExistException - if the object name is already used

newDBObject

public java.lang.Object newDBObject(java.lang.String className,
                                    ObjectName objectName,
                                    ModificationList list)
                             throws java.lang.IllegalAccessException,
                                    java.lang.ClassNotFoundException,
                                    java.lang.InstantiationException,
                                    InstanceAlreadyExistException,
                                    java.lang.reflect.InvocationTargetException
Instantiates and adds an m-bean with persistency.
The method instantiates the m-bean using the class loader returned by getClassLoader. Then it calls the m-bean initCmf method if any. If initCmf is not defined, it calls addDBObject.
The list argument is passed to the initCmf method.
Parameters:
className - the m-bean class to be instantiated
objectName - the object name of the m-bean
list - the modification list passed to initCmf
Returns:
the newly instantiated m-bean
Throws:
java.lang.ClassNotFoundException - if the class does not exist
java.lang.InstantiationException - if the instantiation failed
java.lang.reflect.InvocationTargetException - if the constructor or initCmf thrown an exception
java.lang.IllegalAccessException - if the constructor or initCmf cannot be invoked
InstanceAlreadyExistException - if the object name is already used

newDBObject

public java.lang.Object newDBObject(java.lang.String className,
                                    java.lang.String objectName,
                                    ModificationList list)
                             throws java.lang.IllegalAccessException,
                                    java.lang.ClassNotFoundException,
                                    java.lang.InstantiationException,
                                    InstanceAlreadyExistException,
                                    java.lang.reflect.InvocationTargetException
Instantiates and adds an m-bean with persistency.
Same as newDBObject(String, ObjectName, ModificationList) but with an object name expressed as a string.
Parameters:
className - the m-bean class to be instantiated
objectName - the object name of the m-bean
list - the modification list passed to initCmf
Returns:
the newly instantiated m-bean
Throws:
java.lang.ClassNotFoundException - if the class does not exist
java.lang.InstantiationException - if the instantiation failed
java.lang.reflect.InvocationTargetException - if the constructor or initCmf thrown an exception
java.lang.IllegalAccessException - if the constructor or initCmf cannot be invoked
InstanceAlreadyExistException - if the object name is already used

newObject

public java.lang.Object newObject(java.lang.String className,
                                  java.lang.String objectName,
                                  ModificationList list)
                           throws java.lang.IllegalAccessException,
                                  java.lang.ClassNotFoundException,
                                  java.lang.InstantiationException,
                                  InstanceAlreadyExistException,
                                  java.lang.reflect.InvocationTargetException
Instantiates and adds an m-bean to the framework.
Same as newObject(String, ObjectName, ModificationList) but with an object name expressed as a string.
Parameters:
className - the class name of the m-bean
objectName - the object name in string form
list - a modification list for initCmf
Returns:
the newly instantiated m-bean.
Throws:
java.lang.ClassNotFoundException - if the class does not exist
java.lang.InstantiationException - if the instantiation failed
java.lang.reflect.InvocationTargetException - if the constructor or initCmf thrown an exception
java.lang.IllegalAccessException - if the constructor or initCmf cannot be invoked
InstanceAlreadyExistException - if the object name is already used

newObj

public java.lang.Object newObj(java.lang.String className)
                        throws java.lang.IllegalAccessException,
                               java.lang.ClassNotFoundException,
                               java.lang.InstantiationException
Instantiates an object without adding it to the framework.
The method simply instantiates an object using the class loader returned by getClassLoader. It does not register the object in the service repository. It does not send any framework event.
Parameters:
className - the class to be instantiated
Returns:
the newly instantiated object.
Throws:
java.lang.ClassNotFoundException - if the class does not exist
java.lang.InstantiationException - if instantiation has failed
java.lang.IllegalAccessException - if the class constructor is not accessible

newObject

public java.lang.Object newObject(java.lang.String className,
                                  ObjectName objectName,
                                  ObjectName loaderName,
                                  ModificationList list)
                           throws java.lang.IllegalAccessException,
                                  java.lang.ClassNotFoundException,
                                  java.lang.InstantiationException,
                                  InstanceAlreadyExistException,
                                  java.lang.reflect.InvocationTargetException
Instantiates and adds an m-bean using a class loader.
The method instantiates the m-bean using the specified class loader. Then it calls the m-bean initCmf method if any. If initCmf is not defined, it calls addObject.
The list argument is passed to the initCmf method.
Parameters:
className - the class name of the m-bean
objectName - the object name of the m-bean
objectName - the object name of the class loader
list - a modification list for initCmf
Returns:
the newly instantiated m-bean.
Throws:
java.lang.ClassNotFoundException - if the class does not exist
java.lang.InstantiationException - if the instantiation failed
java.lang.reflect.InvocationTargetException - if the constructor or initCmf thrown an exception
java.lang.IllegalAccessException - if the constructor or initCmf cannot be invoked
InstanceAlreadyExistException - if the object name is already used

newDBObject

public java.lang.Object newDBObject(java.lang.String className,
                                    ObjectName objectName,
                                    ObjectName loaderName,
                                    ModificationList list)
                             throws java.lang.IllegalAccessException,
                                    java.lang.ClassNotFoundException,
                                    java.lang.InstantiationException,
                                    InstanceAlreadyExistException,
                                    java.lang.reflect.InvocationTargetException
Instantiates and adds an m-bean with persistency and a class loader.
The method instantiates the m-bean using the specified class loader. Then it calls the m-bean initCmf method if any. If initCmf is not defined, it calls addDBObject.
The list argument is passed to the initCmf method.
Parameters:
className - the m-bean class to be instantiated
objectName - the object name of the m-bean
loaderName - the object name of the class loader
list - the modification list passed to initCmf
Returns:
the newly instantiated m-bean
Throws:
java.lang.ClassNotFoundException - if the class does not exist
java.lang.InstantiationException - if the instantiation failed
java.lang.reflect.InvocationTargetException - if the constructor or initCmf thrown an exception
java.lang.IllegalAccessException - if the constructor or initCmf cannot be invoked
InstanceAlreadyExistException - if the object name is already used

newDBObject

public java.lang.Object newDBObject(java.lang.String className,
                                    java.lang.String objectName,
                                    ObjectName loaderName,
                                    ModificationList list)
                             throws java.lang.IllegalAccessException,
                                    java.lang.ClassNotFoundException,
                                    java.lang.InstantiationException,
                                    InstanceAlreadyExistException,
                                    java.lang.reflect.InvocationTargetException
Instantiates and adds an m-bean with persistency and a class loader.
Same as newDBObject(String, ObjectName, ObjectName, ModificationList) but with an object name expressed as a string.
Parameters:
className - the m-bean class to be instantiated
objectName - the object name of the m-bean
loaderName - the object name of the class loader
list - the modification list passed to initCmf
Returns:
the newly instantiated m-bean
Throws:
java.lang.ClassNotFoundException - if the class does not exist
java.lang.InstantiationException - if the instantiation failed
java.lang.reflect.InvocationTargetException - if the constructor or initCmf thrown an exception
java.lang.IllegalAccessException - if the constructor or initCmf cannot be invoked
InstanceAlreadyExistException - if the object name is already used

newObject

public java.lang.Object newObject(java.lang.String className,
                                  java.lang.String objectName,
                                  ObjectName loaderName,
                                  ModificationList list)
                           throws java.lang.IllegalAccessException,
                                  java.lang.ClassNotFoundException,
                                  java.lang.InstantiationException,
                                  InstanceAlreadyExistException,
                                  java.lang.reflect.InvocationTargetException
Instantiates and adds an m-bean using a class loader.
Same as newObject(String, ObjectName, ObjectName, ModificationList) but with an object name expressed as a string.
Parameters:
className - the class name of the m-bean
objectName - the object name in string form
loaderName - the class loader name
list - a modification list for initCmf
Returns:
the newly instantiated m-bean.
Throws:
java.lang.ClassNotFoundException - if the class does not exist
java.lang.InstantiationException - if the instantiation failed
java.lang.reflect.InvocationTargetException - if the constructor or initCmf thrown an exception
java.lang.IllegalAccessException - if the constructor or initCmf cannot be invoked
InstanceAlreadyExistException - if the object name is already used

newObj

public java.lang.Object newObj(java.lang.String className,
                               ObjectName loaderName)
                        throws java.lang.IllegalAccessException,
                               java.lang.ClassNotFoundException,
                               java.lang.InstantiationException
Instantiates an object without adding it to the framework.
Same as newObj(String) but with a specific class loader.
Parameters:
className - the class to be instantiated
loaderName - the object name of the class loader
Returns:
the newly instantiated object.
Throws:
java.lang.ClassNotFoundException - if the class does not exist
java.lang.InstantiationException - if instantiation has failed
java.lang.IllegalAccessException - if the class constructor is not accessible

delObject

public void delObject(java.lang.Object object)
               throws InstanceNotFoundException,
                      java.lang.reflect.InvocationTargetException
Removes an m-bean from the framework.
The method unregisters the m-bean from the repository service and the associated relations if any. It calls the m-bean deleteCmf method if any. Then it sends an framework event (DELETE_EVT).
Parameters:
object - the m-bean to be removed
Throws:
InstanceNotFoundException - if the m-bean does exist
java.lang.reflect.InvocationTargetException - if the deleteCmf thrown an exception

delObject

public void delObject(ObjectName name)
               throws InstanceNotFoundException,
                      java.lang.reflect.InvocationTargetException
Removes an m-bean from the framework.
Same as delObject(Object) but with an ObjectName.
Parameters:
name - the object name of the m-bean
Throws:
InstanceNotFoundException - if the m-bean does exist
java.lang.reflect.InvocationTargetException - if the deleteCmf thrown an exception

fastDelObject

public void fastDelObject(ObjectName name)
                   throws InstanceNotFoundException,
                          java.lang.reflect.InvocationTargetException
Removes an m-bean without invoking deleteCmf.
Same as delObject(ObjectName) but the m-bean deleteCmf method is not invoked.
Parameters:
name - the object name of the m-bean to be removed
Throws:
InstanceNotFoundException - if the m-bean is not registered
java.lang.reflect.InvocationTargetException - it should not happen... and not be here :(

addRelation

public ObjectName addRelation(RelationIf rel,
                              ObjectName relName)
                       throws InstanceAlreadyExistException,
                              InstanceNotFoundException
Adds a new relation instance to this framework.
The method first checks that a relation service is available, then invokes the RelationSrvIf.performAddRelation method and returns the resulting value. If no relationship service is available the method throws a ServiceNotFoundException.
Parameters:
rel - the relation object to be registered
relName - the object name of the relation or null
Returns:
the object name assigned to the relation.
Throws:
InstanceAlreadyExistException - if the object name is already used
InstanceNotFoundException - if one or more roles are not registered in the framework.

newRelation

public ObjectName newRelation(java.lang.String relClassName,
                              ObjectName relName,
                              ObjectName[] roleNames,
                              ObjectName aLoader)
                       throws java.lang.IllegalAccessException,
                              java.lang.InstantiationException,
                              InstanceAlreadyExistException,
                              java.lang.ClassNotFoundException,
                              InstanceNotFoundException,
                              InvalidPropertyValueException
Instantiates and adds an relation m-bean to this framework.
The method first checks that a relation service is available, then invokes the RelationSrvIf.performNewRelation method and returns the resulting value. If no relationship service is available the method throws a ServiceNotFoundException.
Parameters:
relClassName - the class name of the relation
relName - the object name of the relation
roleNames - the object names for each relation role
aLoader - the class loader to be used
Returns:
the ObjectName of the instantiated relation.
Throws:
java.lang.IllegalAccessException - if the relation class does not exist
InstanceAlreadyExistException - if relName is already used
InstanceNotFoundException - if one or more roles does not exist
java.lang.ClassNotFoundException - if the relation class does not exist
java.lang.InstantiationException - if the instantiation of relClassName failed
InvalidPropertyValueException - if the number of roles is not the expected one

getRelations

public java.util.Vector getRelations(ObjectName relClassName,
                                     ObjectName roleName,
                                     int roleRank)
                              throws InstanceNotFoundException
Finds the relation instances attached to an m-bean.
The method first checks that a relation service is available, then invokes the RelationSrvIf.performGetRelations method and returns the resulting value. If no relationship service is available the method throws a ServiceNotFoundException.
Parameters:
relClassName - class name of the relation
roleName - name of the source m-bean
roleRank - role rank of the source m-bean in the relation
Returns:
a vector containing the selected relations
Throws:
InstanceNotFoundException - if no relation matches the request criteria.

getValue

public java.lang.Object getValue(ObjectName name,
                                 java.lang.String property)
                          throws java.lang.reflect.InvocationTargetException,
                                 PropertyNotFoundException,
                                 InstanceNotFoundException
Gets the value of a property within an m-bean.
The m-bean is identified by its object name. The method behaves like getValue(Object,String).
Parameters:
name - the object name of the m-bean
property - the name of the property
Returns:
the value of the property
Throws:
java.lang.reflect.InvocationTargetException - if the getter of the property thrown an exception
InstanceNotFoundException - if the m-bean doesn't exist
PropertyNotFoundException - if the property doesn't exist

getValue

public java.lang.Object getValue(java.lang.Object object,
                                 java.lang.String property)
                          throws java.lang.reflect.InvocationTargetException,
                                 PropertyNotFoundException
Gets the value of a property within an m-bean.
The method invokes the getter corresponding to the property and returns the resulting value. The getter is retreived using the metadata service.
Parameters:
object - the m-bean
property - the name of the property
Returns:
the value of the property
Throws:
java.lang.reflect.InvocationTargetException - if the getter method thrown an exception
PropertyNotFoundException - if the property doesn't exist
See Also:
getValue(ObjectName,String)

getIndexedValue

public java.lang.Object getIndexedValue(ObjectName name,
                                        java.lang.String property,
                                        int pos)
                                 throws java.lang.reflect.InvocationTargetException,
                                        PropertyNotFoundException,
                                        InstanceNotFoundException
Gets the value of an indexed property within an m-bean.
The m-bean is identified by its object name. The method behaves like getIndexedValue(Object,String,int).
Parameters:
name - the object name of the m-bean
property - the name of the property to be retrieved
pos - the index of the value to be retrieved
Returns:
the value of the retrieved property.
Throws:
java.lang.reflect.InvocationTargetException - if the getter of the property thrown an exception.
InstanceNotFoundException - if the m-bean is not registered
PropertyNotFoundException - if the property does not exist

getIndexedValue

public java.lang.Object getIndexedValue(java.lang.Object instance,
                                        java.lang.String property,
                                        int pos)
                                 throws java.lang.reflect.InvocationTargetException,
                                        PropertyNotFoundException
Gets the value of an indexed property within an m-bean.
The method invokes the getter corresponding to the property and returns the resulting value. The getter is retreived using the metadata service.
Parameters:
name - the object name of the m-bean
property - the name of the property to be retrieved
pos - the index of the value to be retrieved
Returns:
the value of the retrieved property.
Throws:
java.lang.reflect.InvocationTargetException - if the getter thrown an exception.
PropertyNotFoundException - if the property does not exist

getValues

public PropertyList getValues(ObjectName name,
                              java.util.Vector propertyIdList)
                       throws InstanceNotFoundException
Gets the values of several properties within an m-bean.
The method invokes getValue for each property. If getValue throws an exception, the method drops the exception and goes to next the property. Thus the resulting PropertyList may contain less entries than the propertyIdList parameter.
Parameters:
name - the object name of the m-bean
propertyIdList - a vector of String or PropertyName
Returns:
the values of the properties
Throws:
InstanceNotFoundException - if m-bean does not exist

setValue

public java.lang.Object setValue(ObjectName name,
                                 java.lang.String property,
                                 java.lang.Object value,
                                 java.lang.String op)
                          throws java.lang.reflect.InvocationTargetException,
                                 InstanceNotFoundException,
                                 PropertyNotFoundException,
                                 InvalidPropertyValueException,
                                 java.lang.InstantiationException,
                                 java.lang.ClassNotFoundException,
                                 java.lang.IllegalAccessException
Sets the value of a property within an m-bean.
If op is not null, the method instantiates the corresponding operator and applies it to the property. If op is null, the method invokes the setter corresponding to the property. Then it invokes the update method to notify the repository service that the m-bean has changed.
Parameters:
name - the name of the m-bean
property - the name of the property
value - the new value of the property
op - null or the name of class implementing OperatorSrvIf
Returns:
the value of the property that has been set.
Throws:
PropertyNotFoundException - if the property does not exist
java.lang.reflect.InvocationTargetException - if the setter thrown an exception
InvalidPropertyValueException - if the value type does not match the property type
java.lang.IllegalAccessException - ?
InstanceNotFoundException - if the m-bean does not exist
java.lang.ClassNotFoundException - if the operator class does not exist
java.lang.InstantiationException - if the operator instantiation has failed

setValue

public java.lang.Object setValue(java.lang.Object object,
                                 java.lang.String property,
                                 java.lang.Object value)
                          throws java.lang.reflect.InvocationTargetException,
                                 PropertyNotFoundException,
                                 InvalidPropertyValueException
Sets the value of a property within an m-bean.
The method invokes the setter corresponding to the property. The setter is retrieved using the metadata service.
Note that this method does not call the update method of the repository service. To keep the repository service up to date, use setValue(ObjectName,String,Object,String).
Parameters:
object - the m-bean.
property - the property to be set
value - the new value of the property
Returns:
the value of the property that has been set
Throws:
java.lang.reflect.InvocationTargetException - if the setter thrown an exception
PropertyNotFoundException - if the property does not exist
InvalidPropertyValueException - if the value type does not match the property type

setIndexedValue

public java.lang.Object setIndexedValue(ObjectName name,
                                        java.lang.String property,
                                        java.lang.Object value,
                                        java.lang.String op,
                                        int pos)
                                 throws java.lang.IllegalAccessException,
                                        java.lang.reflect.InvocationTargetException,
                                        PropertyNotFoundException,
                                        InstanceNotFoundException,
                                        InvalidPropertyValueException,
                                        java.lang.InstantiationException,
                                        java.lang.ClassNotFoundException
Sets the value of an indexed property within an m-bean.
If op is not null, the method instantiates the corresponding operator and applies it to the property. If op is null, the method invokes the setter corresponding to the property. Then it invokes the update method to notify the repository service that the m-bean has changed.
Parameters:
name - the name of the m-bean
property - the name of the property
value - the new value of the property
op - null or the name of class implementing OperatorSrvIf
pos - the index of the value to be set
Returns:
the value of the property that has been set
Throws:
PropertyNotFoundException - if the property does not exist
java.lang.reflect.InvocationTargetException - if the setter thrown an exception
InvalidPropertyValueException - if the value type does not match the property type
java.lang.IllegalAccessException - ?
InstanceNotFoundException - if the m-bean does not exist
java.lang.ClassNotFoundException - if the operator class does not exist
java.lang.InstantiationException - if the operator instantiation has failed

setIndexedValue

public java.lang.Object setIndexedValue(java.lang.Object instance,
                                        java.lang.String property,
                                        java.lang.Object value,
                                        int pos)
                                 throws java.lang.IllegalAccessException,
                                        java.lang.reflect.InvocationTargetException,
                                        ServiceNotFoundException,
                                        PropertyNotFoundException,
                                        InvalidPropertyValueException
Sets the value of an indexed property within an m-bean.
The method invokes the setter corresponding to the property. The setter is retrieved using the metadata service.
Note that this method does not call the update method of the repository service. To keep the repository service up to date, use setIndexedValue(ObjectName,String,Object,String,int).
Parameters:
object - the m-bean.
property - the property to be set
value - the new value of the property
pos - the index of the value to be set
Returns:
the value that has been set
Throws:
java.lang.reflect.InvocationTargetException - if the setter thrown an exception
PropertyNotFoundException - if the property does not exist
InvalidPropertyValueException - if the value type does not match the property type
java.lang.IllegalAccessException - ?

setValues

public PropertyList setValues(ObjectName name,
                              ModificationList modifList)
                       throws InstanceNotFoundException
Set the value of several properties within an m-bean.
The method calls setValue for each entry in modifList. If setObject throws an exception, the method drops the exception and goes on the next property. Thus the resulting PropertyList may contain less entries than the modifList parameter.
Parameters:
name - the object name of the m-bean
modifList - the list of the properties
Returns:
the values of the properties that were set.
Throws:
InstanceNotFoundException - if the m-bean does not exist

invokePerform

public java.lang.Object invokePerform(ObjectName objectName,
                                      java.lang.String actionName,
                                      java.lang.Object[] params,
                                      java.lang.String[] sig)
                               throws java.lang.reflect.InvocationTargetException,
                                      java.lang.NoSuchMethodException,
                                      InstanceNotFoundException,
                                      java.lang.IllegalAccessException
Invokes an action on an m-bean identified by an object name.
Same behaviour than invokePerform but using an object name to identify the m-bean.
Parameters:
objectName - the object name of the m-bean
actionName - the name of the action
params - the parameters of the action
sig - the signature of the action
Returns:
the result returned by the action
Throws:
InstanceNotFoundException - if the m-bean does not exist
java.lang.reflect.InvocationTargetException - if the action thrown an exception
java.lang.NoSuchMethodException - if the action does not exist
java.lang.IllegalAccessException - if the action is not accessible
See Also:
invokePerform(Object,String,Object[],String[])

invokePerform

public java.lang.Object invokePerform(java.lang.Object object,
                                      java.lang.String actionName,
                                      java.lang.Object[] params,
                                      java.lang.String[] sig)
                               throws java.lang.reflect.InvocationTargetException,
                                      java.lang.NoSuchMethodException,
                                      InstanceNotFoundException,
                                      java.lang.IllegalAccessException
Invokes an action on an m-bean.
The method uses the metadata service to find the m-bean method The signature is a list of parameter types expressed as an array of String.
Parameters:
object - the m-bean
actionName - the name of the action
params - the parameters of the action
sig - the signature of the action
Returns:
the result returned by the action
Throws:
InstanceNotFoundException - if the m-bean does not exist
java.lang.reflect.InvocationTargetException - if the action thrown an exception
java.lang.NoSuchMethodException - if the action does not exist
java.lang.IllegalAccessException - if the action is not accessible

getMoRepSrvIf

public MoRepSrvIf getMoRepSrvIf()
Returns the repository service used by this framework.
By default a framework uses an instance of RepositorySrv. This default can changed by specifying another filter service in the framework constructor. It cannot be changed afterward (there is no setMoRepSrvIf method).
Returns:
The m-bean repository.

getClassLoader

public java.lang.ClassLoader getClassLoader()
Returns the class loader used by this framework.
When the framework instantiates an m-bean, it uses this class loader unless otherwise specified. The null value means the framework uses the system class loader.
Returns:
the class loader

setClassLoader

public void setClassLoader(java.lang.ClassLoader cl)
Sets the class loader to be used by this framework.
If cl is null, the framework will use the system class loader.
Parameters:
cl - the class loader

getMetaDataSrvIf

public MetaDataSrvIf getMetaDataSrvIf()
Returns the metadata service used by this framework.
The method returns null if no metadata service is available. Initialy a framework uses an instance of MetaDataSrv. This default can be changed using setMetaDataSrvIf.
Returns:
the metadata service

setMetaDataSrvIf

public void setMetaDataSrvIf(MetaDataSrvIf service)
Sets the metadata service to be used by this framework.
Parameters:
service - the metadata service
See Also:
getMetaDataSrvIf

getFilterSrvIf

public FilterSrvIf getFilterSrvIf()
Returns the filtering service used by this framework.
This method returns null if no filter service is available. Initialy a framework has no associated filter service. This default can be changed using setFilterSrvIf. The default implementation provided by Java DMK is FilterSrv.
Returns:
the filtering service or null

setFilterSrvIf

public void setFilterSrvIf(FilterSrvIf service)
Sets the filtering service to be used by this framework.
Parameters:
service - the filtering service
See Also:
getFilterSrvIf

getThreadAllocatorSrvIf

public ThreadAllocatorSrvIf getThreadAllocatorSrvIf()
Returns the thread allocator service used by this framework.
Initially a framework uses an instance of ThreadAllocatorSrv. This default can be changed using setThreadAllocatorSrvIf.
Returns:
the thread allocator service

setThreadAllocatorSrvIf

public void setThreadAllocatorSrvIf(ThreadAllocatorSrvIf service)
Sets the thread allocator service to be used by this framework.
Parameters:
service - the thread allocator service
See Also:
getThreadAllocatorSrvIf

getRelationSrvIf

public RelationSrvIf getRelationSrvIf()
Returns the relationship service used by this framework.
The method returns null if no relation service is available. Initialy a framework has no associated relationship service. This default can be changed using setRelationSrvIf. The Java DMK implementation of the relationship service is RelationSrv.
Returns:
the relationship service or null

setRelationSrvIf

public void setRelationSrvIf(RelationSrvIf service)
Sets the relationship service to be used by this framework.
Parameters:
service - the relationship service
See Also:
getRelationSrvIf

getClassVersion

public java.lang.String getClassVersion()
Returns the version of this class.
Returns:
The version of the class.

getDomain

public java.lang.String getDomain()
Returns the domain assigned to this framework.
By default, the domain assigned to a framework is ServiceName.DOMAIN. This default can be changed by specifying another domain in the framework constructor.
Returns:
the assigned domain

getNbElements

public java.lang.Integer getNbElements()
Returns the number of m-beans contained in this framework.
Returns:
the number of m-beans

getJdmkVersion

public java.lang.String getJdmkVersion()
Returns the version of Java DMK.
The method returns the value ServiceName.JDMKVERSION.
Returns:
the version of Java DMK

addFrameworkListener

public void addFrameworkListener(FrameworkListener l)
Adds the specified FrameworkListener to receive FrameworkEvent.
Parameters:
l - the framework listener

removeFrameworkListener

public void removeFrameworkListener(FrameworkListener l)
Removes the specified FrameworkListener.
Parameters:
l - the framework listener