Pete Freitag Pete Freitag

Listing loaded OSGI Bundles in Lucee

Updated: September 15, 2021
coldfusionjava

Here's a quick code snippet that will output a list of OSGI java bundles and bundle versions that are loaded / installed on Lucee:

//CFMLEngine
engine = getPageContext().getCFMLFactory().getEngine();

//org.osgi.framework.BundleContext
bundleContext = engine.getBundleContext();

//array of org.osgi.framework.Bundle objects
bundles = bundleContext.getBundles();

for (b in bundles) {
  writeOutput(b.getSymbolicName() & ":" & b.getVersion() & "<br>");
}

Here's a link to run the code on trycf. It was inspired by the "getBundles" action of the cfadmin tag (source).

You might be wondering why not just use the cfadmin tag, well it requires a password for all operations, which makes sense for many of the operations, but I don't think it should be necessary to list the bundles.


Like this? Follow me ↯

Listing loaded OSGI Bundles in Lucee was first published on September 15, 2021.

If you like reading about lucee, osgi, or java then you might also like:

FuseGuard Web App Firewall for ColdFusion

The FuseGuard Web Application Firewall for ColdFusion & CFML is a high performance, customizable engine that blocks various attacks against your ColdFusion applications.

Post a Comment