|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.osgi.internal.baseadaptor.BaseStorageHook
public class BaseStorageHook
| Field Summary | |
|---|---|
static java.lang.String |
COMPOSITE_BUNDLE
|
static java.lang.String |
COMPOSITE_HEADER
|
static int |
DEL_BUNDLE_STORE
|
static int |
DEL_GENERATION
|
static java.lang.String |
EXTERNAL_LIB_PREFIX
|
static int |
HASHCODE
|
static java.lang.String |
KEY
|
static java.lang.String |
SURROGATE_BUNDLE
|
static char |
VARIABLE_DELIM_CHAR
|
static java.lang.String |
VARIABLE_DELIM_STRING
|
| Constructor Summary | |
|---|---|
BaseStorageHook(BaseStorage storage)
|
|
| Method Summary | |
|---|---|
void |
addProperties(java.util.Properties properties)
Gets called by the adaptor during FrameworkAdaptor.getProperties(). |
boolean |
compare(KeyedElement other)
Compares this element with a specified element |
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. |
FrameworkLog |
createFrameworkLog()
Gets called by the adaptor during FrameworkAdaptor.getFrameworkLog(). |
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). |
void |
frameworkStart(BundleContext context)
Gets called by the adaptor during FrameworkAdaptor.frameworkStart(BundleContext). |
void |
frameworkStop(BundleContext context)
Gets called by the adaptor during FrameworkAdaptor.frameworkStop(BundleContext). |
void |
frameworkStopping(BundleContext context)
Gets called by the adaptor during FrameworkAdaptor.frameworkStopping(BundleContext). |
java.io.File |
getBundleStore()
|
java.io.File |
getDataFile(java.lang.String path)
|
java.lang.String |
getFileName()
|
int |
getGeneration()
|
java.lang.Object |
getKey()
Returns the key for this element |
int |
getKeyHashCode()
Returns the hash code of the key |
java.util.Dictionary<java.lang.String,java.lang.String> |
getManifest(boolean firstLoad)
Returns the manifest for the data in this storage hook, or null if this hook does not provide the manifest. |
java.lang.String[] |
getNativePaths()
|
BaseStorage |
getStorage()
|
int |
getStorageVersion()
Returns the storage version of this storage hook. |
void |
handleRuntimeError(java.lang.Throwable error)
Gets called by the adaptor during FrameworkAdaptor.handleRuntimeError(Throwable). |
void |
initialize(BaseAdaptor adaptor)
Gets called by the adaptor during FrameworkAdaptor.initialize(EventPublisher). |
void |
initialize(java.util.Dictionary<java.lang.String,java.lang.String> manifest)
Initializes this storage hook with the content of the specified bundle manifest. |
void |
installNativePaths(java.lang.String[] installPaths)
|
boolean |
isReference()
|
StorageHook |
load(BaseData target,
java.io.DataInputStream in)
Creates a new storage hook and loads the data from the specified input stream into the storage hook. |
java.net.URLConnection |
mapLocationToURLConnection(java.lang.String location)
Gets called by the adaptor during FrameworkAdaptor.mapLocationToURLConnection(String). |
void |
save(java.io.DataOutputStream out)
Saves the data from this storage hook into the specified output stream. |
void |
setFileName(java.lang.String fileName)
|
void |
setReference(boolean reference)
|
static java.lang.String |
substituteVars(java.lang.String path)
|
void |
validate()
Validates the data in this storage hook, if the data is invalid then an illegal state exception is thrown |
void |
validateNativePaths(java.lang.String[] paths)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String KEY
public static final int HASHCODE
public static final int DEL_BUNDLE_STORE
public static final int DEL_GENERATION
public static final java.lang.String EXTERNAL_LIB_PREFIX
public static final java.lang.String VARIABLE_DELIM_STRING
public static final char VARIABLE_DELIM_CHAR
public static java.lang.String COMPOSITE_HEADER
public static java.lang.String COMPOSITE_BUNDLE
public static java.lang.String SURROGATE_BUNDLE
| Constructor Detail |
|---|
public BaseStorageHook(BaseStorage storage)
| Method Detail |
|---|
public int getStorageVersion()
StorageHook
getStorageVersion in interface StorageHook
public StorageHook create(BaseData bundledata)
throws BundleException
StorageHookStorageHook.initialize(Dictionary) method called to initialize the storage hook.
create in interface StorageHookbundledata - a base data the created storage hook will be associated with
BundleException
public void initialize(java.util.Dictionary<java.lang.String,java.lang.String> manifest)
throws BundleException
StorageHook
initialize in interface StorageHookmanifest - the bundle manifest to load into this storage hook
BundleException - if any error occursStorageHook.create(BaseData),
StorageHook.copy(StorageHook)
public StorageHook load(BaseData target,
java.io.DataInputStream in)
throws java.io.IOException
StorageHook
It is important that this method and the StorageHook.save(DataOutputStream) method
stay in sync. This method must be able to successfully read the data saved by the
StorageHook.save(DataOutputStream) method.
load in interface StorageHooktarget - a base data the loaded storage hook will be associated within - an input stream used to load the storage hook's data from.
java.io.IOException - if any error occursStorageHook.save(DataOutputStream)
public void save(java.io.DataOutputStream out)
throws java.io.IOException
StorageHook
It is important that this method and the StorageHook.load(BaseData, DataInputStream)
method stay in sync. This method must be able to save data which the
StorageHook.load(BaseData, DataInputStream) method can ready successfully.
save in interface StorageHookout - an output stream used to save the storage hook's data from.
java.io.IOException - if any error occursStorageHook.load(BaseData, DataInputStream)public int getKeyHashCode()
KeyedElement
getKeyHashCode in interface KeyedElementpublic boolean compare(KeyedElement other)
KeyedElement
compare in interface KeyedElementother - the element to compare with
public java.lang.Object getKey()
KeyedElement
getKey in interface KeyedElementpublic java.lang.String getFileName()
public int getGeneration()
public java.lang.String[] getNativePaths()
public void installNativePaths(java.lang.String[] installPaths)
throws BundleException
BundleException
public void validateNativePaths(java.lang.String[] paths)
throws BundleException
BundleExceptionpublic boolean isReference()
public java.io.File getBundleStore()
public java.io.File getDataFile(java.lang.String path)
public void setReference(boolean reference)
public void setFileName(java.lang.String fileName)
public void copy(StorageHook storageHook)
StorageHookStorageHook.initialize(Dictionary) method.
copy in interface StorageHookstorageHook - the original storage hook to copy data out of.StorageHook.create(BaseData),
StorageHook.initialize(Dictionary)
public void validate()
throws java.lang.IllegalArgumentException
StorageHook
validate in interface StorageHookjava.lang.IllegalArgumentException - if the data is invalid
public java.util.Dictionary<java.lang.String,java.lang.String> getManifest(boolean firstLoad)
throws BundleException
StorageHook
getManifest in interface StorageHookfirstLoad - true if this is the very first time this manifest is being loaded.
BundleExceptionpublic boolean forgetStatusChange(int status)
StorageHookBundleData.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.
forgetStatusChange in interface StorageHookstatus - the new status of the base data
public boolean forgetStartLevelChange(int startlevel)
StorageHookBundleData.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.
forgetStartLevelChange in interface StorageHookstartlevel - the new startlevel of the base data
public void initialize(BaseAdaptor adaptor)
AdaptorHookFrameworkAdaptor.initialize(EventPublisher).
This method allows an adaptor hook to save the adaptor object for later.
initialize in interface AdaptorHookadaptor - the adaptor object associated with this AdaptorHook.
public void frameworkStart(BundleContext context)
throws BundleException
AdaptorHookFrameworkAdaptor.frameworkStart(BundleContext).
This method allows an adaptor hook to execute code when the framework is starting
(e.g. to register services).
frameworkStart in interface AdaptorHookcontext - the system bundle context
BundleException
public void frameworkStop(BundleContext context)
throws BundleException
AdaptorHookFrameworkAdaptor.frameworkStop(BundleContext).
This method allows an adaptor hook to execute code when the framework is stopped
(e.g. to unregister services).
frameworkStop in interface AdaptorHookcontext - the system bundle context
BundleExceptionpublic void frameworkStopping(BundleContext context)
AdaptorHookFrameworkAdaptor.frameworkStopping(BundleContext).
This method allows an adaptor hook to execute code when the framework is about to start
the shutdown process.
frameworkStopping in interface AdaptorHookcontext - the system bundle contextpublic void addProperties(java.util.Properties properties)
AdaptorHookFrameworkAdaptor.getProperties().
This method allows an adaptor hook to add property values to the adaptor
properties object.
addProperties in interface AdaptorHookproperties - the adaptor properties object.
public java.net.URLConnection mapLocationToURLConnection(java.lang.String location)
throws java.io.IOException
AdaptorHookFrameworkAdaptor.mapLocationToURLConnection(String).
The adaptor will call this method for each configured adaptor hook until one
adaptor hook returns a non-null value. If no adaptor hook returns a non-null value
then the adaptor will perform the default behavior.
mapLocationToURLConnection in interface AdaptorHooklocation - a bundle location string to be converted to a URLConnection
java.io.IOException - if an error occured creating the URLConnectionpublic void handleRuntimeError(java.lang.Throwable error)
AdaptorHookFrameworkAdaptor.handleRuntimeError(Throwable).
The adaptor will call this method for each configured adaptor hook.
handleRuntimeError in interface AdaptorHookerror - the unexpected error that occured.public FrameworkLog createFrameworkLog()
AdaptorHookFrameworkAdaptor.getFrameworkLog().
The adaptor will call this method for each configured adaptor hook until one
adaptor hook returns a non-null value. If no adaptor hook returns a non-null value
then the adaptor will return null.
createFrameworkLog in interface AdaptorHookpublic BaseStorage getStorage()
public static java.lang.String substituteVars(java.lang.String path)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||