1 package org
.argeo
.slc
.osgi
;
3 import org
.argeo
.slc
.build
.Distribution
;
4 import org
.argeo
.slc
.core
.build
.ResourceDistribution
;
5 import org
.argeo
.slc
.deploy
.DeploymentData
;
6 import org
.argeo
.slc
.deploy
.Module
;
7 import org
.argeo
.slc
.deploy
.TargetData
;
8 import org
.argeo
.slc
.process
.RealizedFlow
;
9 import org
.osgi
.framework
.Bundle
;
10 import org
.osgi
.framework
.Constants
;
12 public class OsgiBundle
implements Module
<ResourceDistribution
> {
14 private String version
;
15 private Distribution distribution
;
17 private Long internalBundleId
;
23 public OsgiBundle(Bundle bundle
) {
24 name
= bundle
.getSymbolicName();
25 version
= bundle
.getHeaders().get(Constants
.BUNDLE_VERSION
).toString();
26 internalBundleId
= bundle
.getBundleId();
29 public OsgiBundle(RealizedFlow realizedFlow
) {
30 name
= realizedFlow
.getModuleName();
31 version
= realizedFlow
.getModuleVersion();
34 public String
getDeployedSystemId() {
35 return name
+ ":" + version
;
38 public DeploymentData
getDeploymentData() {
39 throw new UnsupportedOperationException();
42 public Distribution
getDistribution() {
46 public TargetData
getTargetData() {
47 throw new UnsupportedOperationException();
50 public String
getName() {
54 public String
getVersion() {
58 public void setName(String name
) {
62 public void setVersion(String version
) {
63 this.version
= version
;
66 public void setDistribution(Distribution distribution
) {
67 this.distribution
= distribution
;
71 * To be used for optimization when looking in the bundle context. Can
74 public Long
getInternalBundleId() {
75 return internalBundleId
;
78 /** Only package access for the time being. e.g. from {@link BundlesManager} */
79 void setInternalBundleId(Long internalBundleId
) {
80 this.internalBundleId
= internalBundleId
;