public interface PersistenceManager
PersistenceManagerinterface defines the API to be implemented to support persisting configuration data. This interface may be implemented by bundles, which support storing configuration data in different locations.
The Apache Felix Configuration Admin Service bundles provides an implementation of this interface using the platform filesystem to store configuration data.
Implementations of this interface must support loading and storing
java.util.Dictionary objects as defined in section 104.4.2,
Configuration Properties, of the Configuration Admin Service Specification
To make implementations of this interface available to the Configuration
Admin Service they must be registered as service for this interface. The
Configuration Admin Service will consider all registered services plus the
default platform file system based implementation to load configuration data.
To store new configuration data, the persistence manager service with the
highest rank value - the
service.ranking service property - is
used. If no pesistence manager service has been registered, the platfrom
file system based implementation is used.
|Modifier and Type||Method and Description|
Returns an enumeration of all
boolean exists(String pid)
trueif a persisted
Dictionaryexists for the given
pid- The identifier for the dictionary to test.
Dictionary load(String pid) throws IOException
Dictionaryfor the given
Implementations are expected to return dictionary instances which may be
modified by the caller without affecting any underlying data or affecting
future calls to this method with the same PID. In other words the
load(pid) != load(pid) must hold
pid- The identifier for the dictionary to load.
nullbut may be empty.
IOException- If an error occurrs loading the dictionary. An
IOExceptionmust also be thrown if no dictionary exists for the given identifier.
Enumeration getDictionaries() throws IOException
Dictionaryobjects known to this persistence manager.
Implementations of this method are allowed to return lazy enumerations. That is, it is allowable for the enumeration to not return a dictionary if loading it results in an error.
Implementations are expected to return dictionary instances which may be modified by the caller without affecting any underlying data or affecting future calls to this method.
IOException- If an error occurrs getting the dictionaries.
void store(String pid, Dictionary properties) throws IOException
Dictionaryunder the given
The dictionary provided to this method must be considered private to the caller. Any modification by the caller after this method finishes must not influence any internal storage of the provided data. Implementations must not modify the dictionary.
void delete(String pid) throws IOException
Dictionaryfor the given
pid. If such a dictionary does not exist, this method has no effect.
pid- The identifier of the dictionary to delet.
IOException- If an error occurrs deleting the dictionary. This exception must not be thrown if no dictionary with the given identifier exists.
Copyright © 2006–2013 The Apache Software Foundation. All rights reserved.