1 package org
.argeo
.slc
.osgi
;
3 import org
.argeo
.slc
.build
.Distribution
;
4 import org
.argeo
.slc
.deploy
.DeploymentData
;
5 import org
.argeo
.slc
.deploy
.Module
;
6 import org
.argeo
.slc
.deploy
.TargetData
;
7 import org
.argeo
.slc
.process
.RealizedFlow
;
8 import org
.osgi
.framework
.Bundle
;
9 import org
.osgi
.framework
.Constants
;
11 public class OsgiBundle
implements Module
{
13 private String version
;
14 private Distribution distribution
;
16 private Long internalBundleId
;
22 public OsgiBundle(String name
, String version
) {
24 this.version
= version
;
27 public OsgiBundle(Bundle bundle
) {
28 name
= bundle
.getSymbolicName();
29 version
= bundle
.getHeaders().get(Constants
.BUNDLE_VERSION
).toString();
30 internalBundleId
= bundle
.getBundleId();
33 public OsgiBundle(RealizedFlow realizedFlow
) {
34 name
= realizedFlow
.getModuleName();
35 version
= realizedFlow
.getModuleVersion();
38 public String
getDeployedSystemId() {
39 return name
+ ":" + version
;
42 public DeploymentData
getDeploymentData() {
43 throw new UnsupportedOperationException();
46 public Distribution
getDistribution() {
50 public TargetData
getTargetData() {
51 throw new UnsupportedOperationException();
54 public String
getName() {
58 public String
getVersion() {
62 public void setName(String name
) {
66 public void setVersion(String version
) {
67 this.version
= version
;
70 public void setDistribution(Distribution distribution
) {
71 this.distribution
= distribution
;
75 * To be used for optimization when looking in the bundle context. Can
78 public Long
getInternalBundleId() {
79 return internalBundleId
;
82 /** Only package access for the time being. e.g. from {@link BundlesManager} */
83 void setInternalBundleId(Long internalBundleId
) {
84 this.internalBundleId
= internalBundleId
;