Class JMXBundleDeployer

java.lang.Object
aQute.remote.util.JMXBundleDeployer

public class JMXBundleDeployer extends Object
This class will try to connect to a remote OSGi framework using JMX and will deploy a bundle for you, by deploy, that means install the bundle if it doesn't existing in the remote runtime or update the bundle if it already exists. For the actual JMX connection it will use a port if you tell it to, or if not, it will try to use the JDK's attach API and search for the OSGi framework JMX beans. For the JDK attach API, beware, assumptions about the Oracle JDK directory layout have been made.
  • Constructor Details

    • JMXBundleDeployer

      public JMXBundleDeployer()
    • JMXBundleDeployer

      public JMXBundleDeployer(int port)
    • JMXBundleDeployer

      public JMXBundleDeployer(String serviceURL)
  • Method Details

    • deploy

      public long deploy(String bsn, File bundle) throws Exception
      Gets the current list of installed bsns, compares it to the bsn provided. If bsn doesn't exist, then install it. If it does exist then update it.
      Parameters:
      bsn - Bundle-SymbolicName of bundle you are wanting to deploy
      bundle - the bundle
      Returns:
      the id of the updated or installed bundle
      Throws:
      Exception
    • listBundles

      public org.osgi.framework.dto.BundleDTO[] listBundles()
      Calls osgi.core bundleState MBean listBundles operation
      Returns:
      array of bundles in framework
    • uninstall

      public void uninstall(String bsn) throws Exception
      Uninstall a bundle by passing in its Bundle-SymbolicName. If bundle doesn't exist, this is a NOP.
      Parameters:
      bsn - bundle symbolic name
      Throws:
      Exception
    • uninstall

      public void uninstall(long id) throws Exception
      Calls through directly to the OSGi frameworks MBean uninstallBundle operation
      Parameters:
      id - id of bundle to uninstall
      Throws:
      Exception