Vinod
Vinod

Reputation: 1086

How to differentiate between softwares/bundles provisioned for a target in ACE

I have 2 bundles A and B, using Apache ACE I have provisioned these bundle to a target in following steps.

  1. Provisioned A (having version 1.0.0) to the target
  2. Provisioned B (having version 1.0.0) to the target
  3. Provisioned B (having version 2.0.0) to the target (upgrade of previous version step 2)

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

Answers (2)

Marcel Offermans
Marcel Offermans

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

Angelo van der Sijpt
Angelo van der Sijpt

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

Related Questions