public interface BundleOperation
This class is used to provide methods to manage a life cycle operation on a bundle in persistent storage. BundleOperation objects are returned by the FrameworkAdaptor object and are called by OSGi to complete the persistent storage life cycle operation.
For example
Bundle bundle; BundleOperation storage = adaptor.installBundle(location, source); try { bundle = storage.begin(); // Perform some implementation specific work // which may fail. storage.commit(false); // bundle has been successfully installed } catch (BundleException e) { storage.undo(); throw e; // rethrow the error } return bundle;
Clients may implement this interface.
Modifier and Type | Method and Description |
---|---|
BundleData |
begin()
Begin the operation on the bundle (install, update, uninstall).
|
void |
commit(boolean postpone)
Commit the operation performed.
|
void |
undo()
Undo the change to persistent storage.
|
BundleData begin() throws BundleException
BundleException
- If a failure occured modifiying peristent storage.void commit(boolean postpone) throws BundleException
postpone
- If true, the bundle's persistent
storage cannot be immediately reclaimed. This may occur if the
bundle is still exporting a package.BundleException
- If a failure occured modifiying peristent storage.void undo() throws BundleException
This method can be called before calling commit or if commit throws an exception to undo any changes in progress.
BundleException
- If a failure occured modifiying peristent storage.Copyright © 2007–2018 The Apache Software Foundation. All rights reserved.