Service Management Framework
Release 3.1

com.ibm.osg.smf.platform
Interface BundleStorage


public interface BundleStorage

Bundle Storage interface for managing a persistent storage life cycle operation upon a bundle.

This class is used to provide methods to manage a life cycle operation on a bundle in persistent storage. BundleStorage objects are returned by the Platform object and are called by SMF to complete the persistent storage life cycle operation.

For example

      Bundle bundle;
      BundleStorage storage = platform.installBundle(location, source);
      try {
          bundle = storage.modify();

          // 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;
 


Method Summary
 void commit(boolean postpone)
          Commit the change to persistent storage.
 org.osgi.framework.Bundle modify()
          Perform the change to persistent storage.
 void undo()
          Undo the change to persistent storage.
 

Method Detail

modify

public org.osgi.framework.Bundle modify()
                                 throws org.osgi.framework.BundleException
Perform the change to persistent storage.
Returns:
Bundle object for the target bundle.
Throws:
org.osgi.framework.BundleException - If a failure occured modifiying peristent storage.

commit

public void commit(boolean postpone)
            throws org.osgi.framework.BundleException
Commit the change to persistent storage.
Parameters:
postpone - If true, the bundle's persistent storage cannot be immediately reclaimed. This may occur if the bundle is still exporting a package.
Throws:
org.osgi.framework.BundleException - If a failure occured modifiying peristent storage.

undo

public void undo()
          throws org.osgi.framework.BundleException
Undo the change to persistent storage.

This method can be called before calling commit or if commit throws an exception to undo any changes in progress.

Throws:
org.osgi.framework.BundleException - If a failure occured modifiying peristent storage.

Service Management Framework
Release 3.1

Licensed Materials - Property of IBM. (C) Copyright IBM Corp. 2000, 2002 All Rights Reserved. IBM is a registered trademark of IBM Corp.