|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.sun.jaw.impl.agent.services.persistent.PersistentPropertySrv
This class provides a simple implementation of persistent m-bean properties.
The service analyzes an m-bean for information on all its read/write properties. The values of these properties are either extracted from the m-bean and saved in a text file (property file) or extracted from a property file and set in the m-bean. Non-null property values are saved in a property file using the following format: [Property name]=[Property value].
The properties of an m-bean must adhere to the following rules:
Properties
,
PropertyDescriptor
,
java.beans.Introspector
, Serialized FormField Summary | |
protected Framework |
cmf
Reference to the Framework. |
Constructor Summary | |
PersistentPropertySrv()
Default constructor. |
Method Summary | |
protected java.util.Properties |
allocateProperties(java.lang.Object object)
Allocates the m-bean's properties and populates a Properties object with the infromation. |
protected void |
applyProperties(java.util.Properties prpty,
java.lang.Object object)
Allocates the m-bean's properties and sets the properties as defined by the Properties object. |
void |
initCmf(Framework cmf,
ObjectName name,
boolean db,
ModificationList list)
For JDMK internal use only. |
void |
loadProperties(java.lang.Object object,
java.lang.String file)
Loads and sets object properties from a property file. |
protected java.util.Properties |
loadPropertyFile(java.lang.String file)
Loads the properties from the specified file and populates a Properties object with the information. |
void |
performLoadProperties(ObjectName name,
java.lang.String file)
Loads and sets m-bean properties from a property file. |
void |
performSaveProperties(ObjectName name,
java.lang.String file)
Analyzes and saves m-bean properties to a property file. |
void |
saveProperties(java.lang.Object object,
java.lang.String file)
Analyzes and saves object properties to a property file. |
protected void |
savePropertyFile(java.util.Properties prpty,
java.lang.String file)
Saves the Properties object to the specified file. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
protected Framework cmf
Constructor Detail |
public PersistentPropertySrv()
Method Detail |
public void performSaveProperties(ObjectName name, java.lang.String file) throws InstanceNotFoundException, java.io.IOException
name
- The object name of the object to be analyzed for properties.file
- The property file to save the property values in.public void performLoadProperties(ObjectName name, java.lang.String file) throws InstanceNotFoundException, java.io.IOException, java.io.FileNotFoundException
name
- The object name of the object to be analyzed for properties.file
- The property file to load the property values from.public void saveProperties(java.lang.Object object, java.lang.String file) throws java.io.IOException
object
- The object to be analyzed for properties.file
- The property file to save the property values in.public void loadProperties(java.lang.Object object, java.lang.String file) throws java.io.IOException, java.io.FileNotFoundException
object
- The object to be analyzed for properties.file
- The property file to load the property values from.public void initCmf(Framework cmf, ObjectName name, boolean db, ModificationList list) throws InstanceAlreadyExistException
Initializes the persistent property service.
cmf
- 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.protected java.util.Properties allocateProperties(java.lang.Object object)
object
- The object to be analyzed for properties.protected void applyProperties(java.util.Properties prpty, java.lang.Object object)
prpty
- The Properties object containing a list of properties and values.object
- The object to be set with the property values.protected void savePropertyFile(java.util.Properties prpty, java.lang.String file) throws java.io.IOException
prpty
- The Properties object containing a list of properties and values.file
- The property file to save the property values in.protected java.util.Properties loadPropertyFile(java.lang.String file) throws java.io.IOException, java.io.FileNotFoundException
file
- The property file to load the property values from.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |