public class BaseStorage extends Object implements SynchronousBundleListener
Modifier and Type | Field and Description |
---|---|
static byte |
BUNDLEDATA_VERSION
The current bundle data version
|
static String |
DELETE_FLAG
the file name for the delete flag.
|
static byte |
EXTENSION_INITIALIZE
flag to indicate a framework extension is being intialized
|
static byte |
EXTENSION_INSTALLED
flag to indicate a framework extension is being installed
|
static byte |
EXTENSION_UNINSTALLED
flag to indicate a framework extension is being uninstalled
|
static byte |
EXTENSION_UPDATED
flag to indicate a framework extension is being updated
|
static int |
TYPE_DIRECTORYBUNDLE
The BundleData is for a bundle exploded in a directory
|
static int |
TYPE_FILEBUNDLE
The BundleData is for a bundle contained in a file (typically jar)
|
Modifier and Type | Method and Description |
---|---|
void |
addProperties(Properties properties) |
void |
bundleChanged(BundleEvent event)
Receives notification that a bundle has had a lifecycle change.
|
void |
compact() |
String |
copyToTempLibrary(BaseData data,
String absolutePath) |
protected BaseData |
createBaseData(long id,
String location) |
BundleFile |
createBundleFile(Object content,
BaseData data) |
void |
frameworkStart(BundleContext fwContext) |
void |
frameworkStop(BundleContext fwContext) |
void |
frameworkStopping(BundleContext fwContext) |
protected Object |
getBundleContent(BaseData bundledata) |
File |
getBundleStoreRoot() |
protected String[] |
getConfiguredExtensions()
Returns a list of configured extensions
|
File |
getDataFile(BaseData data,
String path) |
protected File[] |
getExtensionFiles(BaseData bundleData)
Returns a list of classpath files for an extension bundle
|
File |
getExtractFile(BaseData data,
String path) |
long |
getFreeSpace() |
int |
getInitialBundleStartLevel() |
BaseData[] |
getInstalledBundles() |
String |
getInstallPath() |
long |
getNextBundleId() |
PermissionStorage |
getPermissionStorage() |
StateManager |
getStateManager() |
protected StorageManager |
initFileManager(File baseDir,
String lockMode,
boolean readOnly) |
void |
initialize(BaseAdaptor initAdaptor) |
BundleOperation |
installBundle(String location,
URLConnection source) |
void |
installNativeCode(BaseData data,
String[] nativepaths) |
boolean |
isReadOnly() |
protected BaseData |
loadBaseData(long id,
DataInputStream in) |
Dictionary<String,String> |
loadManifest(BaseData data) |
Dictionary<String,String> |
loadManifest(BaseData bundleData,
boolean firstTime) |
protected void |
processBootExtension(BundleData bundleData,
byte type)
Processes a boot extension bundle
|
protected void |
processExtension(BaseData bundleData,
byte type)
Processes an extension bundle
|
protected void |
processExtExtension(BaseData bundleData,
byte type) |
protected void |
processFrameworkExtension(BaseData bundleData,
byte type)
Processes a framework extension bundle
|
void |
save(BaseData data) |
protected void |
saveBaseData(BaseData bundledata,
DataOutputStream out) |
void |
setInitialBundleStartLevel(int value) |
BundleOperation |
uninstallBundle(BaseData data) |
BundleOperation |
updateBundle(BaseData data,
URLConnection source) |
void |
updateState(BaseData bundleData,
int type)
Updates the state mananager with an updated/installed/uninstalled bundle
|
public static final byte BUNDLEDATA_VERSION
public static final byte EXTENSION_INITIALIZE
public static final byte EXTENSION_INSTALLED
public static final byte EXTENSION_UNINSTALLED
public static final byte EXTENSION_UPDATED
public static final int TYPE_DIRECTORYBUNDLE
public static final int TYPE_FILEBUNDLE
public static final String DELETE_FLAG
public void initialize(BaseAdaptor initAdaptor) throws IOException
IOException
protected StorageManager initFileManager(File baseDir, String lockMode, boolean readOnly) throws IOException
IOException
public boolean isReadOnly()
public void compact()
public long getFreeSpace() throws IOException
IOException
public void installNativeCode(BaseData data, String[] nativepaths) throws BundleException
BundleException
public Dictionary<String,String> loadManifest(BaseData data) throws BundleException
BundleException
public Dictionary<String,String> loadManifest(BaseData bundleData, boolean firstTime) throws BundleException
BundleException
public BaseData[] getInstalledBundles()
public PermissionStorage getPermissionStorage()
public int getInitialBundleStartLevel()
public void setInitialBundleStartLevel(int value)
public void save(BaseData data)
public BundleOperation installBundle(String location, URLConnection source)
public BundleOperation updateBundle(BaseData data, URLConnection source)
public BundleOperation uninstallBundle(BaseData data)
public BundleFile createBundleFile(Object content, BaseData data) throws IOException
IOException
public StateManager getStateManager()
public void frameworkStart(BundleContext fwContext)
public void frameworkStop(BundleContext fwContext)
public void frameworkStopping(BundleContext fwContext)
public void addProperties(Properties properties)
protected void saveBaseData(BaseData bundledata, DataOutputStream out) throws IOException
IOException
protected BaseData loadBaseData(long id, DataInputStream in) throws IOException
IOException
public String getInstallPath()
protected void processExtension(BaseData bundleData, byte type) throws BundleException
bundleData
- the extension bundle datatype
- the type of extension bundleBundleException
- on any errors or if the extension bundle type is not supportedprotected void processFrameworkExtension(BaseData bundleData, byte type) throws BundleException
bundleData
- the extension bundle datatype
- the type of extension bundleBundleException
- on errors or if framework extensions are not supportedprotected void processExtExtension(BaseData bundleData, byte type) throws BundleException
BundleException
protected String[] getConfiguredExtensions()
protected void processBootExtension(BundleData bundleData, byte type) throws BundleException
bundleData
- the extension bundle datatype
- the type of extension bundleBundleException
- on errors or if boot extensions are not supportedpublic File getBundleStoreRoot()
protected File[] getExtensionFiles(BaseData bundleData)
bundleData
- the bundle data for an extension bundlepublic void updateState(BaseData bundleData, int type) throws BundleException
bundleData
- the modified bundletype
- the type of modificationBundleException
public long getNextBundleId()
public void bundleChanged(BundleEvent event)
BundleListener
bundleChanged
in interface BundleListener
event
- The BundleEvent
.public String copyToTempLibrary(BaseData data, String absolutePath) throws IOException
IOException
Copyright © 2007–2018 The Apache Software Foundation. All rights reserved.