Difference between revisions of "OSGi Concepts Bundles"

From CDOT Wiki
Jump to: navigation, search
(def bundle)
(Headers)
Line 24: Line 24:
 
Require-Bundle: cs.ecl.osgi.simple.bookfinder;bundle-version="1.0.0"
 
Require-Bundle: cs.ecl.osgi.simple.bookfinder;bundle-version="1.0.0"
 
</pre>
 
</pre>
 +
 +
# Indendification: '''Bundle-SymbolicName''' & '''Bundle-Version''' (Example: cs.ecl.osgi.simple.bookfinderservice & 1.0.0.qualifier)
 +
# Capabilities: '''Export-Package''' (Example: cs.ecl.osgi.simple.bookfinderservice)
 +
# Requirements: Import-Package and/or Require-Bundle (Example: org.osgi.framework;version="1.3.0")
 +
# Anatomy: '''Bundle-ManifestVersion, Bundle-Name, Bundle-Activator, Bundle-RequiredExecutionEnvironment'''

Revision as of 08:50, 20 January 2011

What is a Bundle?

Definitions:

1. A bundle is a component that can be identified, can express its requirements and capabilities and has a specific anatomy.


Bundle = JAR file + MANIFEST.MF file

An example of a MANIFEST.MF

Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Book Finder Service
Bundle-SymbolicName: cs.ecl.osgi.simple.bookfinderservice
Bundle-Version: 1.0.0.qualifier
Bundle-Activator: cs.ecl.osgi.simple.bookfinderservice.Activator
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Import-Package: org.osgi.framework;version="1.3.0"
Bundle-Vendor: Seneca College -  Eclipse Course
Export-Package: cs.ecl.osgi.simple.bookfinderservice
Require-Bundle: cs.ecl.osgi.simple.bookfinder;bundle-version="1.0.0"
  1. Indendification: Bundle-SymbolicName & Bundle-Version (Example: cs.ecl.osgi.simple.bookfinderservice & 1.0.0.qualifier)
  2. Capabilities: Export-Package (Example: cs.ecl.osgi.simple.bookfinderservice)
  3. Requirements: Import-Package and/or Require-Bundle (Example: org.osgi.framework;version="1.3.0")
  4. Anatomy: Bundle-ManifestVersion, Bundle-Name, Bundle-Activator, Bundle-RequiredExecutionEnvironment