站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBoss 4.0.1 sp1 system API Documentation 英文版文档

XMLAttributePersistenceManager (JBoss System API) - JBoss 4.0.1 sp1 system API Documentation 英文版文档


org.jboss.system.pm
Class XMLAttributePersistenceManager

java.lang.Object
  extended byorg.jboss.system.pm.XMLAttributePersistenceManager
All Implemented Interfaces:
org.jboss.mx.persistence.AttributePersistenceManager

public class XMLAttributePersistenceManager
extends Object
implements org.jboss.mx.persistence.AttributePersistenceManager

FileAttributePersistenceManager

Version:
$Revision: 1.3 $
Author:
Dimitris Andreadis

Field Summary
static String AL_ATTRIBUTE_ELEMENT
           
static String AL_DATE_ATTRIBUTE
           
static String AL_FALSE_VALUE
           
static String AL_ID_ATTRIBUTE
           
static String AL_NAME_ATTRIBUTE
           
static String AL_NULL_ATTRIBUTE
           
static String AL_ROOT_ELEMENT
          The XML attribute-list elements and attributes
static String AL_SERIALIZED_ATTRIBUTE
           
static String AL_TRUE_VALUE
           
static String AL_TYPE_ATTRIBUTE
           
static String DATA_DIR_ELEMENT
          The XML configuration element
static String DEFAULT_BASE_DIR
          Default base directory if one not specified
 
Constructor Summary
XMLAttributePersistenceManager()
          Constructs a FileAttributePersistenceManager.
 
Method Summary
 void create(String version, Element config)
          Initializes the AttributePersistenceManager using the supplied configuration element CONFIG_ELEMENT whose content will be probably different for each particular implementation.
 void destroy()
          Releases resources and destroys the AttributePersistenceManager.
 boolean exists(String id)
          Checks if a persistened AttributeList for this particular id exists
 boolean getState()
          Returns true if the AttributePersistenceManager is "in-service" state, i.e.
 String[] listAll()
          Returns a String array with all the saved ids under the configured version tag.
 javax.management.AttributeList load(String id)
          Persists an AttributeList (name/value pair list), under a specified id.
 void remove(String id)
          Removes the persisted AttributeList, if exists
 void removeAll()
          Removes all the persisted data stored under the configured version tag.
 void store(String id, javax.management.AttributeList attrs)
          Uses the specified id to retrieve a previously persisted AttributeList.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DATA_DIR_ELEMENT

public static final String DATA_DIR_ELEMENT
The XML configuration element

See Also:
Constant Field Values

DEFAULT_BASE_DIR

public static final String DEFAULT_BASE_DIR
Default base directory if one not specified

See Also:
Constant Field Values

AL_ROOT_ELEMENT

public static final String AL_ROOT_ELEMENT
The XML attribute-list elements and attributes

See Also:
Constant Field Values

AL_ID_ATTRIBUTE

public static final String AL_ID_ATTRIBUTE
See Also:
Constant Field Values

AL_DATE_ATTRIBUTE

public static final String AL_DATE_ATTRIBUTE
See Also:
Constant Field Values

AL_ATTRIBUTE_ELEMENT

public static final String AL_ATTRIBUTE_ELEMENT
See Also:
Constant Field Values

AL_NAME_ATTRIBUTE

public static final String AL_NAME_ATTRIBUTE
See Also:
Constant Field Values

AL_TYPE_ATTRIBUTE

public static final String AL_TYPE_ATTRIBUTE
See Also:
Constant Field Values

AL_NULL_ATTRIBUTE

public static final String AL_NULL_ATTRIBUTE
See Also:
Constant Field Values

AL_SERIALIZED_ATTRIBUTE

public static final String AL_SERIALIZED_ATTRIBUTE
See Also:
Constant Field Values

AL_TRUE_VALUE

public static final String AL_TRUE_VALUE
See Also:
Constant Field Values

AL_FALSE_VALUE

public static final String AL_FALSE_VALUE
See Also:
Constant Field Values
Constructor Detail

XMLAttributePersistenceManager

public XMLAttributePersistenceManager()
Constructs a FileAttributePersistenceManager.

Method Detail

create

public void create(String version,
                   Element config)
            throws Exception
Initializes the AttributePersistenceManager using the supplied configuration element CONFIG_ELEMENT whose content will be probably different for each particular implementation. The version string is a tag that must be used by the AttributePersistenceManager implementation to make sure that data saved/loaded under different version tags are partitioned. Once created, the configuration of the implementation object cannot change. Calling any other method before create() is executed will result in a IllegalStateException Finally, the implementation should be prepared to receive multiple concurrent calls.

Specified by:
create in interface org.jboss.mx.persistence.AttributePersistenceManager
Parameters:
version - a tag to identify the version
config - XML Element to load arbitrary config
Throws:
Exception - when any error occurs during create

getState

public boolean getState()
Returns true if the AttributePersistenceManager is "in-service" state, i.e. after create() and before destroy() has been called, false otherwise.

Specified by:
getState in interface org.jboss.mx.persistence.AttributePersistenceManager
Returns:
true if in operational state

destroy

public void destroy()
Releases resources and destroys the AttributePersistenceManager. The object is unusable after destroy() has been called. Any call to any method will result to an IllegalStateException.

Specified by:
destroy in interface org.jboss.mx.persistence.AttributePersistenceManager

store

public void store(String id,
                  javax.management.AttributeList attrs)
           throws Exception
Uses the specified id to retrieve a previously persisted AttributeList. If no data can be found under the specified id, a null will be returned.

Specified by:
store in interface org.jboss.mx.persistence.AttributePersistenceManager
Parameters:
id - the key for retrieving the data
Returns:
the data, or null
Throws:
Exception - when an error occurs

load

public javax.management.AttributeList load(String id)
                                    throws Exception
Persists an AttributeList (name/value pair list), under a specified id. The id can be used to retrieve the AttributeList later on. The actual mechanism will differ among implementations.

Specified by:
load in interface org.jboss.mx.persistence.AttributePersistenceManager
Parameters:
id - the key for retrieving the data later on, not null
Throws:
Exception - when data cannot be persisted

exists

public boolean exists(String id)
               throws Exception
Checks if a persistened AttributeList for this particular id exists

Specified by:
exists in interface org.jboss.mx.persistence.AttributePersistenceManager
Parameters:
id - the key of the image
Returns:
true if an image exists; false otherwise
Throws:
Exception - on any error

remove

public void remove(String id)
            throws Exception
Removes the persisted AttributeList, if exists

Specified by:
remove in interface org.jboss.mx.persistence.AttributePersistenceManager
Parameters:
id - the key of the image
Throws:
Exception - when any error occurs

removeAll

public void removeAll()
               throws Exception
Removes all the persisted data stored under the configured version tag.

Specified by:
removeAll in interface org.jboss.mx.persistence.AttributePersistenceManager
Throws:
Exception - when any error occurs

listAll

public String[] listAll()
                 throws Exception
Returns a String array with all the saved ids under the configured version tag.

Specified by:
listAll in interface org.jboss.mx.persistence.AttributePersistenceManager
Returns:
array with all persisted ids
Throws:
Exception - when any error occurs


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.