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

AttributePersistenceManager (JBoss/JMX API) - JBoss 4.0.1 sp1 jmx API Documentation 英文版文档


org.jboss.mx.persistence
Interface AttributePersistenceManager


public interface AttributePersistenceManager

AttributePersistenceManager interface. Implementations of this interface are created by an MBean service that acts as factory and a manager for the active AttributePersistenceManager implementation The DelegatingPersistenceManager will contact the MBean to get an AttributePersistenceManager implementation. In this way, the Persistence Manager can be controlled externally as an MBean.

Version:
$Revision: 1.2 $
Author:
Dimitris Andreadis

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.
 AttributeList load(String id)
          Uses the specified id to retrieve a previously persisted AttributeList.
 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, AttributeList attrs)
          Persists an AttributeList (name/value pair list), under a specified id.
 

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. It can be null or empty to indicate that no particular version tag is required. 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.

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.

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.


exists

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

Parameters:
id - the key of the image
Returns:
true if an image exists; false otherwise
Throws:
Exception - on any error

load

public AttributeList load(String id)
                   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.

Parameters:
id - the key for retrieving the data
Returns:
the data, or null
Throws:
Exception - when an error occurs

store

public void store(String id,
                  AttributeList attrs)
           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.

Parameters:
id - the key for retrieving the data later on, not null
attrs - the data to be persisted, not null
Throws:
Exception - when data cannot be persisted

remove

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

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.

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.

Returns:
array with all persisted ids
Throws:
Exception - when any error occurs


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