Reputation: 1086
I have 2 bundles A and B, using Apache ACE I have provisioned these bundle to a target in following steps.
When I access (http://localhost:8080/deployment/gatewayid/versions)
I get following result
1.0.0
2.0.0
3.0.0
How will the management agent figure out which version belongs to which software?
Upvotes: 0
Views: 106
Reputation: 3323
Every time the set of configured artifacts for a target changes, ACE will create a new version for a target. To actually see what is in a version, the management agent on the target needs to fetch the version. The deployment package you then get contains all the metadata you need (ie. a list of artifacts and their versions).
Upvotes: 1
Reputation: 3641
When running in the same OSGi framework as your target bundles, you can use the BundleContext to get to the bundles, and ask them for their installed versions. Something like,
for (Bundle b : bundleContext) {
System.out.println("Found bundle " + b.getSymbolicName() + " in version " + b.getVersion());
}
If you also need to know whether this bundle has been installed from a deployment package, you can ask it for its getLocation()
; this will start with osgi-dp:
, as per the Deployment Admin spec.
Upvotes: 0