|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface StorageHook
A StorageHook hooks into the persistent storage loading and saving. A StorageHook gets associated with each BaseData object installed in the adaptor.
A StorageHook extends KeyedElement
, the key used for the element must be the
fully qualified string name of the StorageHook implementation class.
BaseData.getStorageHook(String)
Method Summary | |
---|---|
void |
copy(StorageHook storageHook)
Copies the data from the specified storage hook into this storage hook. |
StorageHook |
create(BaseData bundledata)
Creates an uninitialized storage hook for the specified bundledata. |
boolean |
forgetStartLevelChange(int startlevel)
Gets called by a base data during BundleData.setStartLevel(int) . |
boolean |
forgetStatusChange(int status)
Gets called by a base data during BundleData.setStatus(int) . |
java.util.Dictionary |
getManifest(boolean firstLoad)
Returns the manifest for the data in this storage hook, or null if this hook does not provide the manifest. |
int |
getStorageVersion()
Returns the storage version of this storage hook. |
void |
initialize(java.util.Dictionary manifest)
Initializes this storage hook with the content of the specified bundle manifest. |
StorageHook |
load(BaseData bundledata,
java.io.DataInputStream is)
Creates a new storage hook and loads the data from the specified input stream into the storage hook. |
boolean |
matchDNChain(java.lang.String pattern)
Gets called by a base data during BundleData.matchDNChain(String) . |
void |
save(java.io.DataOutputStream os)
Saves the data from this storage hook into the specified output stream. |
void |
validate()
Validates the data in this storage hook, if the data is invalid then an illegal state exception is thrown |
Methods inherited from interface org.eclipse.osgi.framework.util.KeyedElement |
---|
compare, getKey, getKeyHashCode |
Method Detail |
---|
int getStorageVersion()
StorageHook create(BaseData bundledata) throws BundleException
initialize(Dictionary)
method called to initialize the storage hook.
bundledata
- a base data the created storage hook will be associated with
BundleException
- if any error occursvoid initialize(java.util.Dictionary manifest) throws BundleException
manifest
- the bundle manifest to load into this storage hook
BundleException
- if any error occurscreate(BaseData)
,
copy(StorageHook)
StorageHook load(BaseData bundledata, java.io.DataInputStream is) throws java.io.IOException
It is important that this method and the save(DataOutputStream)
method
stay in sync. This method must be able to successfully read the data saved by the
save(DataOutputStream)
method.
bundledata
- a base data the loaded storage hook will be associated withis
- an input stream used to load the storage hook's data from.
java.io.IOException
- if any error occurssave(DataOutputStream)
void save(java.io.DataOutputStream os) throws java.io.IOException
It is important that this method and the load(BaseData, DataInputStream)
method stay in sync. This method must be able to save data which the
load(BaseData, DataInputStream)
method can ready successfully.
os
- an output stream used to save the storage hook's data from.
java.io.IOException
- if any error occursload(BaseData, DataInputStream)
void copy(StorageHook storageHook)
initialize(Dictionary)
method.
storageHook
- the original storage hook to copy data out of.create(BaseData)
,
initialize(Dictionary)
void validate() throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
- if the data is invalidjava.util.Dictionary getManifest(boolean firstLoad) throws BundleException
firstLoad
- true if this is the very first time this manifest is being loaded.
BundleException
boolean forgetStatusChange(int status)
BundleData.setStatus(int)
.
A base data will call this method for each configured storage hook it
is associated with until one storage hook returns true. If all configured storage
hooks return false then the BaseData will be marked dirty and will cause the
status to be persistently saved.
status
- the new status of the base data
boolean forgetStartLevelChange(int startlevel)
BundleData.setStartLevel(int)
.
A base data will call this method for each configured storage hook it
is associated with until one storage hook returns true. If all configured storage
hooks return false then the BaseData will be marked dirty and will cause the
start level to be persistently saved.
startlevel
- the new startlevel of the base data
boolean matchDNChain(java.lang.String pattern)
BundleData.matchDNChain(String)
.
A base data will call this method for each configured storage hook it
is associated with until one storage hook returns true. If all configured storage
hooks return false value then the BaseAdaptor will return false.
pattern
- the pattern of distinguished name (DN) chains to match
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |