| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jboss.mx.persistence.ObjectStreamPersistenceManager
public class ObjectStreamPersistenceManager
Object Stream Persistence Manager.
Persists the MBean to the file system using an Object Stream. Includes code based on examples in Juha's JMX Book.
Object Streams written to disk are admittedly lacking in the area of "long-term", "portable", or "human-readable" persistence. They are fairly straightforward, however. Primarily, this class is useful for demonstration and "quick & dirty" persistence.
| Field Summary | |
|---|---|
| protected  boolean | isLoadingA flag set to true to prevent attribute updates from within load triggering stores. | 
| protected static org.jboss.logging.Logger | log | 
| Constructor Summary | |
|---|---|
| ObjectStreamPersistenceManager() | |
| Method Summary | |
|---|---|
| protected  File | getStoreFile(MBeanInfo metadata,
             boolean createFile) | 
| protected  boolean | isLoading() | 
|  void | load(ModelMBeanInvoker mbean,
     MBeanInfo metadata)deserializes state from the object input stream | 
| protected  void | loadFromMetadata(ModelMBeanInvoker mbean,
                 ModelMBeanInfo metadata)Obtain the attribute values from the metadata and invoke setAttributes on the mbean invoker. | 
| protected  void | setIsLoading(boolean newIsLoading) | 
|  void | store(MBeanInfo metadata)What we need to get here is 1) the persist location, and 2) the entire contents of the mbean. | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
|---|
protected static org.jboss.logging.Logger log
protected boolean isLoading
| Constructor Detail | 
|---|
public ObjectStreamPersistenceManager()
| Method Detail | 
|---|
public void load(ModelMBeanInvoker mbean,
                 MBeanInfo metadata)
          throws MBeanException
load in interface PersistenceManagermbean - metadata - 
MBeanException
public void store(MBeanInfo metadata)
           throws MBeanException
store in interface PersistenceManagermetadata - 
MBeanException
protected void loadFromMetadata(ModelMBeanInvoker mbean,
                                ModelMBeanInfo metadata)
mbean - the invoker and assocaited mbean resourcemetadata - the metadata to use as the attributes value sourceprotected boolean isLoading()
protected void setIsLoading(boolean newIsLoading)
protected File getStoreFile(MBeanInfo metadata,
                            boolean createFile)
                     throws MBeanException
MBeanException| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||