Package aQute.remote.util
Class JMXBundleDeployer
java.lang.Object
aQute.remote.util.JMXBundleDeployer
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongGets the current list of installed bsns, compares it to the bsn provided.org.osgi.framework.dto.BundleDTO[]Calls osgi.core bundleState MBean listBundles operationvoiduninstall(long id) Calls through directly to the OSGi frameworks MBean uninstallBundle operationvoidUninstall a bundle by passing in its Bundle-SymbolicName.
-
Constructor Details
-
JMXBundleDeployer
public JMXBundleDeployer() -
JMXBundleDeployer
public JMXBundleDeployer(int port) -
JMXBundleDeployer
-
-
Method Details
-
deploy
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 deploybundle- 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
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
Calls through directly to the OSGi frameworks MBean uninstallBundle operation- Parameters:
id- id of bundle to uninstall- Throws:
Exception
-