org.jboss.system.pm
Class NullAttributePersistenceManager

java.lang.Object
  extended byorg.jboss.system.pm.NullAttributePersistenceManager
All Implemented Interfaces:
AttributePersistenceManager (src)

public class NullAttributePersistenceManager
extends java.lang.Object
implements AttributePersistenceManager (src)

NullAttributePersistenceManager.


Constructor Summary
NullAttributePersistenceManager()
           
 
Method Summary
 void create(java.lang.String version, org.w3c.dom.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(java.lang.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.
 java.lang.String[] listAll()
          Returns a String array with all the saved ids under the configured version tag.
 AttributeList (src) load(java.lang.String id)
          Uses the specified id to retrieve a previously persisted AttributeList.
 void remove(java.lang.String id)
          Removes the persisted AttributeList, if exists
 void removeAll()
          Removes all the persisted data stored under the configured version tag.
 void store(java.lang.String id, AttributeList (src)  attrs)
          Persists an AttributeList (name/value pair list), under a specified id.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NullAttributePersistenceManager

public NullAttributePersistenceManager()
Method Detail

create

public void create(java.lang.String version,
                   org.w3c.dom.Element config)
            throws java.lang.Exception
Description copied from interface: AttributePersistenceManager (src)
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.

Specified by:
create in interface AttributePersistenceManager (src)
Parameters:
version - a tag to identify the version
config - XML Element to load arbitrary config
Throws:
java.lang.Exception - when any error occurs during create

getState

public boolean getState()
Description copied from interface: AttributePersistenceManager (src)
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 AttributePersistenceManager (src)
Returns:
true if in operational state

destroy

public void destroy()
Description copied from interface: AttributePersistenceManager (src)
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 AttributePersistenceManager (src)

exists

public boolean exists(java.lang.String id)
               throws java.lang.Exception
Description copied from interface: AttributePersistenceManager (src)
Checks if a persistened AttributeList for this particular id exists

Specified by:
exists in interface AttributePersistenceManager (src)
Parameters:
id - the key of the image
Returns:
true if an image exists; false otherwise
Throws:
java.lang.Exception - on any error

load

public AttributeList (src)  load(java.lang.String id)
                   throws java.lang.Exception
Description copied from interface: AttributePersistenceManager (src)
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:
load in interface AttributePersistenceManager (src)
Parameters:
id - the key for retrieving the data
Returns:
the data, or null
Throws:
java.lang.Exception - when an error occurs

store

public void store(java.lang.String id,
                  AttributeList (src)  attrs)
           throws java.lang.Exception
Description copied from interface: AttributePersistenceManager (src)
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:
store in interface AttributePersistenceManager (src)
Parameters:
id - the key for retrieving the data later on, not null
attrs - the data to be persisted, not null
Throws:
java.lang.Exception - when data cannot be persisted

remove

public void remove(java.lang.String id)
            throws java.lang.Exception
Description copied from interface: AttributePersistenceManager (src)
Removes the persisted AttributeList, if exists

Specified by:
remove in interface AttributePersistenceManager (src)
Parameters:
id - the key of the image
Throws:
java.lang.Exception - when any error occurs

removeAll

public void removeAll()
               throws java.lang.Exception
Description copied from interface: AttributePersistenceManager (src)
Removes all the persisted data stored under the configured version tag.

Specified by:
removeAll in interface AttributePersistenceManager (src)
Throws:
java.lang.Exception - when any error occurs

listAll

public java.lang.String[] listAll()
                           throws java.lang.Exception
Description copied from interface: AttributePersistenceManager (src)
Returns a String array with all the saved ids under the configured version tag.

Specified by:
listAll in interface AttributePersistenceManager (src)
Returns:
array with all persisted ids
Throws:
java.lang.Exception - when any error occurs