Class BundleCloseable

java.lang.Object
org.openhab.core.test.BundleCloseable
All Implemented Interfaces:
AutoCloseable

@NonNullByDefault public class BundleCloseable extends Object implements AutoCloseable
A wrapper that uninstalls a bundle on close.

This wrapper allows the usage in try-with-resources blocks.

Author:
Markus Rathgeb - Initial contribution
  • Constructor Details

    • BundleCloseable

      public BundleCloseable(org.osgi.framework.Bundle bundle)
  • Method Details

    • close

      public void close() throws org.osgi.framework.BundleException
      Specified by:
      close in interface AutoCloseable
      Throws:
      org.osgi.framework.BundleException
    • bundle

      public org.osgi.framework.Bundle bundle()