You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by netsameer <ne...@gmail.com> on 2019/01/14 10:04:17 UTC

Provide Require Capability for Composite Subsystem

Hi Team,

Challenge Statement: 
1 - I have a composite subsystem which has a bundle with a provide
capability, the provide capability is mentioned in both the bundle manifest
which is inside the bundle manifest and the subsystem manifest as well.

2. I have a stand alone bundle which requires this capability and mentions
this in standalone bundle manifest.

In case of system migrations, if the Bundle gets deployed before the ESA
subsystem, the bundle does not start as expected and has to be manually
started once the provide capability is deployed.

However, if I mark the subsystem as feature, then, as soon as the subsystem
is deployed, the standalone bundle also goes to active state, the removing
need for manual intervention.

In case if the system is marked as composite instead of a feature subsystem,
the bundle has to be manually started (or via a script which listens to
bundle/subsystem deploy events and then triggers the dependent bundle) . Is
this by design or can we have this feature added to composite subsystems
deployment as well, where dependencies within Subsystems are also resolved
and trigggered automatically or via config.

Bundle Manifest:

Manifest-Version: 1.0
Bnd-LastModified: 1547100076404
Bundle-Activator: msgdispconsumer.ConsumeActivator
Bundle-ManifestVersion: 2
Bundle-Name: msgdispconsumer
Bundle-SymbolicName: msgdispconsumer
Bundle-Version: 1.0.0.201901100601
Created-By: 1.8.0_191 (Oracle Corporation)
*Require-Capability: org.messagedisplaysvc,
osgi.ee;filter:="(&(osgi.ee=JavaSE)
 (version=1.8))"*
Import-Package: org.osgi.framework;version="[1.5,2)"
Private-Package: msgdispconsumer
Tool: Bnd-4.1.0.201810181252


Subsystem Manifest:

Manifest-Version: 1.0
Subsystem-SymbolicName: messagedisplaysvc
Subsystem-Version: 1.0.0
provision-policy: acceptDependencies
Subsystem-Type: osgi.subsystem.composite
Bundle-Name: Message Display Service
*Provide-Capability: org.messagedisplaysvc*
Import-Package: org.osgi.framework

Bundle contained within Subsystem Manifest which is providing the capability

Manifest-Version: 1.0
Bnd-LastModified: 1546341320121
Bundle-Activator: messagedisplaysvc.MsgActivator
Bundle-ManifestVersion: 2
Bundle-Name: messagedisplaysvc
Bundle-SymbolicName: messagedisplaysvc
Bundle-Version: 0.0.0.201901011115
Created-By: 1.8.0_191 (Oracle Corporation)
Import-Package: org.osgi.framework;version="[1.5,2)"
Private-Package: messagedisplaysvc
*Provide-Capability: org.messagedisplaysvc*
Tool: Bnd-4.1.0.201810181252

How do I get these dependencies to auto-wire and go active on deployment
irrespective of the deployment order.

Example: System Maintenance activities where all Subsystem and Bundle are
copied to backup and then redeployed on same or another node, in case the
bundle gets deployed before the provide capability subsystem, the bunde will
not hot/auto deploy to active state.

Thanks!



--
Sent from: http://apache-felix.18485.x6.nabble.com/Apache-Felix-Dev-f4846309.html