|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.osgi.baseadaptor.BaseData
public class BaseData
The BundleData implementation used by the BaseAdaptor.
BaseAdaptor,
BundleData,
StorageHook,
ClassLoadingHook| Field Summary | |
|---|---|
protected BundleFile |
bundleFile
|
protected String |
fileName
|
protected Collection<String> |
loadedNativeCode
|
protected Dictionary<String,String> |
manifest
|
| Fields inherited from interface org.eclipse.osgi.framework.adaptor.BundleData |
|---|
TYPE_BOOTCLASSPATH_EXTENSION, TYPE_COMPOSITEBUNDLE, TYPE_EXTCLASSPATH_EXTENSION, TYPE_FRAGMENT, TYPE_FRAMEWORK_EXTENSION, TYPE_SINGLETON, TYPE_SURROGATEBUNDLE |
| Constructor Summary | |
|---|---|
BaseData(long id,
BaseAdaptor adaptor)
Constructs a new BaseData with the specified id for the specified adaptor |
|
| Method Summary | |
|---|---|
void |
close()
Close all resources for this BundleData |
BundleClassLoader |
createClassLoader(ClassLoaderDelegate delegate,
BundleProtectionDomain domain,
String[] bundleclasspath)
This method calls all the configured class loading hooks ClassLoadingHook.createClassLoader(ClassLoader, ClassLoaderDelegate, BundleProtectionDomain, BaseData, String[])
methods until on returns a non-null value. |
String |
findLibrary(String libname)
This method calls each configured classloading hook ClassLoadingHook.findLibrary(BaseData, String) method
until the first one returns a non-null value. |
Enumeration<URL> |
findLocalResources(String path)
Finds local resources by searching the class path of this bundle data. |
String |
getActivator()
Returns the Bundle-Activator for this BundleData as specified in the bundle manifest file. |
BaseAdaptor |
getAdaptor()
Returns the adaptor for this BaseData |
Bundle |
getBundle()
Returns the bundle object of this BaseData |
BundleFile |
getBundleFile()
Returns the BundleFile for this BaseData. |
BundleFile |
getBundleFile(Object content,
boolean base)
|
long |
getBundleID()
Get the BundleData bundle ID. |
String[] |
getClassPath()
Returns the Bundle-ClassPath for this BundleData as specified in the bundle manifest file. |
String |
getClassPathString()
|
File |
getDataFile(String path)
Return the bundle data directory. |
String |
getDynamicImports()
Returns the DynamicImport-Package for this BundleData as specified in the bundle manifest file. |
URL |
getEntry(String path)
Gets a URL to the bundle entry specified by path. |
Enumeration<String> |
getEntryPaths(String path)
Gets all of the bundle entries that exist under the specified path. |
String |
getExecutionEnvironment()
Returns the Bundle-RequiredExecutionEnvironment for this BundleData as specified in the bundle manifest file. |
File |
getExtractFile(String path)
Gets called by BundleFile during BundleFile.getFile(String, boolean). |
long |
getLastModified()
Get the last time this BundleData was modified. |
String |
getLocation()
Get the BundleData Location. |
Dictionary<String,String> |
getManifest()
Return the Dictionary of manifest headers for the BundleData. |
int |
getStartLevel()
Returns the start level metadata for this BundleData. |
int |
getStatus()
Returns the status metadata for this BundleData. |
StorageHook |
getStorageHook(String key)
Returns the storage hook which is keyed by the specified key |
StorageHook[] |
getStorageHooks()
Returns all the storage hooks associated with this BaseData |
String |
getSymbolicName()
Returns the Bundle-SymbolicName for this BundleData as specified in the bundle manifest file. |
int |
getType()
Returns the type of bundle this BundleData is for. |
Version |
getVersion()
Returns the Bundle-Version for this BundleData as specified in the bundle manifest file. |
void |
installNativeCode(String[] nativepaths)
Installs the native code paths for this BundleData. |
boolean |
isDirty()
Returns true if this bundledata is dirty |
void |
open()
Open the BundleData. |
void |
save()
Persistently stores all the metadata for this BundleData |
void |
setActivator(String activator)
Sets the activator of this BaseData |
void |
setBundle(Bundle bundle)
Sets the Bundle object for this BundleData. |
void |
setBundleFile(Object content,
BundleFile bundleFile)
|
void |
setClassPathString(String classpath)
|
void |
setDirty(boolean dirty)
Sets the dirty flag for this BaseData |
void |
setDynamicImports(String dynamicImports)
Sets the dynamic imports of this BaseData |
void |
setExecutionEnvironment(String executionEnvironment)
Sets the execution environment of this BaseData |
void |
setFileName(String fileName)
This is only used to support PDE source lookup. |
void |
setLastModified(long lastModified)
Sets the last modified time stamp of this bundledata |
void |
setLocation(String location)
Sets the location of this bundledata |
void |
setStartLevel(int value)
This method calls each configured storage hook StorageHook.forgetStartLevelChange(int) method. |
void |
setStatus(int value)
This method calls each configured storage hook StorageHook.forgetStatusChange(int) method. |
void |
setStorageHooks(StorageHook[] storageHooks)
Sets the instance storage hooks for this base data. |
void |
setSymbolicName(String symbolicName)
Sets the symbolic name of this BaseData |
void |
setType(int type)
Sets the type of this BaseData |
void |
setVersion(Version version)
Sets the version of this BaseData |
String |
toString()
Return a string representation of the bundle that can be used in debug messages. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected BundleFile bundleFile
protected Dictionary<String,String> manifest
protected String fileName
protected Collection<String> loadedNativeCode
| Constructor Detail |
|---|
public BaseData(long id,
BaseAdaptor adaptor)
id - the id of the BaseDataadaptor - the adaptor of the BaseData| Method Detail |
|---|
public BundleClassLoader createClassLoader(ClassLoaderDelegate delegate,
BundleProtectionDomain domain,
String[] bundleclasspath)
ClassLoadingHook.createClassLoader(ClassLoader, ClassLoaderDelegate, BundleProtectionDomain, BaseData, String[])
methods until on returns a non-null value. If none of the class loading hooks returns a non-null value
then the default classloader implementation is used.
createClassLoader in interface BundleDatadelegate - The ClassLoaderDelegate to delegate to.domain - The BundleProtectionDomain to use when defining a class.bundleclasspath - An array of bundle classpaths to use to create this
classloader. This is specified by the Bundle-ClassPath manifest entry.
BundleData.createClassLoader(ClassLoaderDelegate, BundleProtectionDomain, String[])public final URL getEntry(String path)
BundleDataURL to the bundle entry specified by path.
This method must not use the BundleClassLoader to find the
bundle entry since the ClassLoader will delegate to find the resource.
getEntry in interface BundleDatapath - The bundle entry path.
Bundle.getEntry(String)public final Enumeration<String> getEntryPaths(String path)
BundleData
getEntryPaths("/META-INF")
This will return all entries from the /META-INF directory of the bundle.
getEntryPaths in interface BundleDatapath - The path to a directory in the bundle.
Bundle.getEntryPaths(String path)public String findLibrary(String libname)
ClassLoadingHook.findLibrary(BaseData, String) method
until the first one returns a non-null value.
findLibrary in interface BundleDatalibname - The name of the library to find the absolute path to.
BundleData.findLibrary(String)
public void installNativeCode(String[] nativepaths)
throws BundleException
BundleData
installNativeCode in interface BundleDatanativepaths - The array of native code paths to install for
the bundle.
BundleException - If any error occurs during install.public File getDataFile(String path)
BundleData
getDataFile in interface BundleDataBundleContext.getDataFile(String)
public Dictionary<String,String> getManifest()
throws BundleException
BundleData
getManifest in interface BundleDataBundleException - if an error occurred while reading the
bundle manifest data.public long getBundleID()
BundleData
getBundleID in interface BundleDatapublic final String getLocation()
BundleData
getLocation in interface BundleDatapublic final void setLocation(String location)
location - the location of this bundledatapublic final long getLastModified()
BundleData
getLastModified in interface BundleDatapublic final void setLastModified(long lastModified)
lastModified - the last modified time stamp of this bundledata
public void close()
throws IOException
BundleData
close in interface BundleDataIOException - If an error occurs closing.
public void open()
throws IOException
BundleData
open in interface BundleDataIOException - If an error occurs opening.public final void setBundle(Bundle bundle)
BundleData
setBundle in interface BundleDatabundle - The Bundle Object for this BundleData.public final Bundle getBundle()
getBundle in interface BundleReferencepublic int getStartLevel()
BundleData
getStartLevel in interface BundleDatapublic int getStatus()
BundleData
getStatus in interface BundleDatapublic void setStartLevel(int value)
StorageHook.forgetStartLevelChange(int) method.
If one returns true then this bundledata is not marked dirty.
setStartLevel in interface BundleDatavalue - the start level metadataBundleData.setStartLevel(int)public void setStatus(int value)
StorageHook.forgetStatusChange(int) method.
If one returns true then this bundledata is not marked dirty.
setStatus in interface BundleDatavalue - the status metadata.BundleData.setStatus(int)
public void save()
throws IOException
BundleData
save in interface BundleDataIOExceptionpublic boolean isDirty()
public void setDirty(boolean dirty)
dirty - the dirty flagpublic final String getSymbolicName()
BundleData
getSymbolicName in interface BundleDatapublic final void setSymbolicName(String symbolicName)
symbolicName - the symbolic namepublic final Version getVersion()
BundleData
getVersion in interface BundleDatapublic final void setVersion(Version version)
version - the versionpublic final int getType()
BundleData
getType in interface BundleDatapublic final void setType(int type)
type - the type
public final String[] getClassPath()
throws BundleException
BundleData
getClassPath in interface BundleDataBundleExceptionpublic String getClassPathString()
public void setClassPathString(String classpath)
public final String getActivator()
BundleData
getActivator in interface BundleDatapublic final void setActivator(String activator)
activator - the activatorpublic final String getExecutionEnvironment()
BundleData
getExecutionEnvironment in interface BundleDatapublic void setExecutionEnvironment(String executionEnvironment)
executionEnvironment - the execution environmentpublic final String getDynamicImports()
BundleData
getDynamicImports in interface BundleDatapublic void setDynamicImports(String dynamicImports)
dynamicImports - the dynamic importspublic final BaseAdaptor getAdaptor()
public BundleFile getBundleFile()
throws IllegalArgumentException
BaseAdaptor.createBundleFile(Object, BaseData) method is called.
IllegalArgumentException
public BundleFile getBundleFile(Object content,
boolean base)
public void setBundleFile(Object content,
BundleFile bundleFile)
public StorageHook getStorageHook(String key)
key - the key of the storage hook to get
public void setStorageHooks(StorageHook[] storageHooks)
storageHooks - the storage hook to addpublic StorageHook[] getStorageHooks()
public File getExtractFile(String path)
BundleFile.getFile(String, boolean). This method
will allocate a File object where content of the specified path may be
stored for the current generation of the base data. The returned File object may
not exist if the content has not previously be stored.
path - the path to the content to extract from the base data
public void setFileName(String fileName)
fileName - an absolute path string to the base bundle file.public String toString()
toString in class Objectpublic Enumeration<URL> findLocalResources(String path)
BundleData
findLocalResources in interface BundleDatapath - the requested resource name.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||