| org.jboss.mx.persistence.AttributePersistenceManager
AttributePersistenceManager | public interface AttributePersistenceManager (Code) | | 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.
author: Dimitris Andreadis version: $Revision: 57200 $ |
Method Summary | |
public 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.
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. | public void | destroy() Releases resources and destroys the AttributePersistenceManager. | public boolean | exists(String id) | public boolean | getState() Returns true if the AttributePersistenceManager
is "in-service" state, i.e. | public String[] | listAll() Returns a String array with all the saved ids
under the configured version tag. | public AttributeList | load(String id) Uses the specified id to retrieve a previously persisted
AttributeList. | public void | remove(String id) | public void | removeAll() Removes all the persisted data stored under
the configured version tag. | public void | store(String id, AttributeList attrs) Persists an AttributeList (name/value pair list),
under a specified id. |
create | public void create(String version, Element config) throws Exception(Code) | | 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 Parameters: config - XML Element to load arbitrary config throws: Exception - when any error occurs during create |
destroy | public void destroy()(Code) | | 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(Code) | | Checks if a persistened AttributeList for this particular
id exists
Parameters: id - the key of the image true if an image exists; false otherwise throws: Exception - on any error |
getState | public boolean getState()(Code) | | Returns true if the AttributePersistenceManager
is "in-service" state, i.e. after create() and
before destroy() has been called, false otherwise.
true if in operational state |
listAll | public String[] listAll() throws Exception(Code) | | Returns a String array with all the saved ids
under the configured version tag.
array with all persisted ids throws: Exception - when any error occurs |
load | public AttributeList load(String id) throws Exception(Code) | | 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 the data, or null throws: Exception - when an error occurs |
remove | public void remove(String id) throws Exception(Code) | | 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(Code) | | Removes all the persisted data stored under
the configured version tag.
throws: Exception - when any error occurs |
store | public void store(String id, AttributeList attrs) throws Exception(Code) | | 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 Parameters: attrs - the data to be persisted, not null throws: Exception - when data cannot be persisted |
|
|