|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.sun.jaw.reference.agent.cmf.Framework
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:
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 |
public Framework()
public Framework(java.lang.String domain)
domain
is null,
the ServiceName.DOMAIN
value is used.domain
- the domain namepublic Framework(MoRepSrvIf repository, java.lang.String domain)
domain
is null,
the ServiceName.DOMAIN
value is used.repository
- the repositorydomain
- the domainpublic Framework(MoRepSrvIf repository, ThreadAllocatorSrvIf threadAllocator, java.lang.String domain)
domain
is null,
the ServiceName.DOMAIN
value is used.repository
- the repositorythreadAllocator
- the thread allocatordomain
- the domain nameMethod Detail |
public java.util.Vector getObject(ObjectName name, QueryExp query) throws InstanceNotFoundException
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.
name
- an object name patternquery
- the query expression to be applied to matching m-beanspublic boolean contains(java.lang.Object object)
object
- the m-bean to be checkedpublic boolean contains(ObjectName objectName)
name
- the object name of the m-bean to be checkedpublic java.lang.Object retrieveObject(ObjectName name) throws InstanceNotFoundException
name
must identify only one m-bean.
Object names like ":"
or "myDomain:"
are not permitted.public ObjectName addObject(java.lang.Object object) throws InstanceAlreadyExistException
object
- the m-bean to be addedpublic void addObject(java.lang.Object object, ObjectName name) throws InstanceAlreadyExistException
object
- the m-bean to be addedname
- the object name assigned to this m-beanpublic void addDBObject(java.lang.Object object, ObjectName name) throws InstanceAlreadyExistException
object
- the m-bean to be addedname
- the object name assigned to this m-beanpublic 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
initCmf
method if any.
If initCmf
is not defined, it calls
addObject.
list
argument is passed to the initCmf
method.className
- the class name of the m-beanobjectName
- the object name of the m-beanlist
- a modification list for initCmf
initCmf
thrown an exceptioninitCmf
cannot be invokedpublic 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
initCmf
method if any.
If initCmf
is not defined, it calls
addDBObject.
list
argument is passed to the initCmf
method.className
- the m-bean class to be instantiatedobjectName
- the object name of the m-beanlist
- the modification list passed to initCmf
initCmf
thrown an exceptioninitCmf
cannot be invokedpublic 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
className
- the m-bean class to be instantiatedobjectName
- the object name of the m-beanlist
- the modification list passed to initCmf
initCmf
thrown an exceptioninitCmf
cannot be invokedpublic 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
className
- the class name of the m-beanobjectName
- the object name in string formlist
- a modification list for initCmf
initCmf
thrown an exceptioninitCmf
cannot be invokedpublic java.lang.Object newObj(java.lang.String className) throws java.lang.IllegalAccessException, java.lang.ClassNotFoundException, java.lang.InstantiationException
className
- the class to be instantiatedpublic 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
initCmf
method if any.
If initCmf
is not defined, it calls
addObject.
list
argument is passed to the initCmf
method.className
- the class name of the m-beanobjectName
- the object name of the m-beanobjectName
- the object name of the class loaderlist
- a modification list for initCmf
initCmf
thrown an exceptioninitCmf
cannot be invokedpublic 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
initCmf
method if any.
If initCmf
is not defined, it calls
addDBObject.
list
argument is passed to the initCmf
method.className
- the m-bean class to be instantiatedobjectName
- the object name of the m-beanloaderName
- the object name of the class loaderlist
- the modification list passed to initCmf
initCmf
thrown an exceptioninitCmf
cannot be invokedpublic 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
className
- the m-bean class to be instantiatedobjectName
- the object name of the m-beanloaderName
- the object name of the class loaderlist
- the modification list passed to initCmf
initCmf
thrown an exceptioninitCmf
cannot be invokedpublic 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
className
- the class name of the m-beanobjectName
- the object name in string formloaderName
- the class loader namelist
- a modification list for initCmf
initCmf
thrown an exceptioninitCmf
cannot be invokedpublic java.lang.Object newObj(java.lang.String className, ObjectName loaderName) throws java.lang.IllegalAccessException, java.lang.ClassNotFoundException, java.lang.InstantiationException
className
- the class to be instantiatedloaderName
- the object name of the class loaderpublic void delObject(java.lang.Object object) throws InstanceNotFoundException, java.lang.reflect.InvocationTargetException
deleteCmf
method if any.
Then it sends an framework event
(DELETE_EVT).object
- the m-bean to be removedpublic void delObject(ObjectName name) throws InstanceNotFoundException, java.lang.reflect.InvocationTargetException
name
- the object name of the m-beanpublic void fastDelObject(ObjectName name) throws InstanceNotFoundException, java.lang.reflect.InvocationTargetException
deleteCmf
.
deleteCmf
method is not invoked.name
- the object name of the m-bean to be removedpublic ObjectName addRelation(RelationIf rel, ObjectName relName) throws InstanceAlreadyExistException, InstanceNotFoundException
rel
- the relation object to be registeredrelName
- the object name of the relation or nullpublic 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
relClassName
- the class name of the relationrelName
- the object name of the relationroleNames
- the object names for each relation roleaLoader
- the class loader to be usedrelName
is already usedrelClassName
failedpublic java.util.Vector getRelations(ObjectName relClassName, ObjectName roleName, int roleRank) throws InstanceNotFoundException
relClassName
- class name of the relationroleName
- name of the source m-beanroleRank
- role rank of the source m-bean in the relationpublic java.lang.Object getValue(ObjectName name, java.lang.String property) throws java.lang.reflect.InvocationTargetException, PropertyNotFoundException, InstanceNotFoundException
getValue(Object,String)
.name
- the object name of the m-beanproperty
- the name of the propertypublic java.lang.Object getValue(java.lang.Object object, java.lang.String property) throws java.lang.reflect.InvocationTargetException, PropertyNotFoundException
object
- the m-beanproperty
- the name of the propertygetValue(ObjectName,String)
public java.lang.Object getIndexedValue(ObjectName name, java.lang.String property, int pos) throws java.lang.reflect.InvocationTargetException, PropertyNotFoundException, InstanceNotFoundException
getIndexedValue(Object,String,int)
.name
- the object name of the m-beanproperty
- the name of the property to be retrievedpos
- the index of the value to be retrievedpublic java.lang.Object getIndexedValue(java.lang.Object instance, java.lang.String property, int pos) throws java.lang.reflect.InvocationTargetException, PropertyNotFoundException
name
- the object name of the m-beanproperty
- the name of the property to be retrievedpos
- the index of the value to be retrievedpublic PropertyList getValues(ObjectName name, java.util.Vector propertyIdList) throws InstanceNotFoundException
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.name
- the object name of the m-beanpropertyIdList
- a vector of String
or PropertyNamepublic 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
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.name
- the name of the m-beanproperty
- the name of the propertyvalue
- the new value of the propertyop
- null or the name of class implementing
OperatorSrvIfpublic java.lang.Object setValue(java.lang.Object object, java.lang.String property, java.lang.Object value) throws java.lang.reflect.InvocationTargetException, PropertyNotFoundException, InvalidPropertyValueException
setValue(ObjectName,String,Object,String)
.object
- the m-bean.property
- the property to be setvalue
- the new value of the propertypublic 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
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.name
- the name of the m-beanproperty
- the name of the propertyvalue
- the new value of the propertyop
- null or the name of class implementing
OperatorSrvIfpos
- the index of the value to be setpublic 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
setIndexedValue(ObjectName,String,Object,String,int)
.object
- the m-bean.property
- the property to be setvalue
- the new value of the propertypos
- the index of the value to be setpublic PropertyList setValues(ObjectName name, ModificationList modifList) throws InstanceNotFoundException
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.name
- the object name of the m-beanmodifList
- the list of the propertiespublic 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
objectName
- the object name of the m-beanactionName
- the name of the actionparams
- the parameters of the actionsig
- the signature of the actioninvokePerform(Object,String,Object[],String[])
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
actionName
,
sig
.
String
.object
- the m-beanactionName
- the name of the actionparams
- the parameters of the actionsig
- the signature of the actionpublic MoRepSrvIf getMoRepSrvIf()
setMoRepSrvIf
method).public java.lang.ClassLoader getClassLoader()
public void setClassLoader(java.lang.ClassLoader cl)
null
, the framework will use the
system class loader.cl
- the class loaderpublic MetaDataSrvIf getMetaDataSrvIf()
MetaDataSrv
.
This default can be changed using setMetaDataSrvIf.public void setMetaDataSrvIf(MetaDataSrvIf service)
service
- the metadata servicepublic FilterSrvIf getFilterSrvIf()
public void setFilterSrvIf(FilterSrvIf service)
service
- the filtering servicepublic ThreadAllocatorSrvIf getThreadAllocatorSrvIf()
public void setThreadAllocatorSrvIf(ThreadAllocatorSrvIf service)
service
- the thread allocator servicepublic RelationSrvIf getRelationSrvIf()
public void setRelationSrvIf(RelationSrvIf service)
service
- the relationship servicepublic java.lang.String getClassVersion()
public java.lang.String getDomain()
public java.lang.Integer getNbElements()
public java.lang.String getJdmkVersion()
public void addFrameworkListener(FrameworkListener l)
FrameworkListener
to receive
FrameworkEvent
.l
- the framework listenerpublic void removeFrameworkListener(FrameworkListener l)
l
- the framework listener
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |