Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Appendix A. OSGi manifest headers

Appendix A. OSGi manifest headers

Manifest header entries are very significant in OSGi as they dictate behavior for several OSGi services and framework features. The following table includes all header entries used in the book. These are the most commonly used header entries in all existing OSGi specifications at the time of writing.

Header nameDescription
Bundle-ActivationPolicySpecifies how a bundle should be activated when started. This can be used for the lazy activation of a bundle, as explained in chapter 10. Example: Bundle-ActivationPolicy: lazy
Bundle-ActivatorSpecifies the Java class name of the bundle’s activator. Example: Bundle-Activator: com.manning.osgi.BundleActivator
Bundle-BlueprintSpecifies the path of a Blueprint document to be used by the Blueprint container for assembling dependencies in a bundle. This is demonstrated in chapter 13. Example: Bundle-Blueprint: META-INF/blueprint.xml
Bundle-CategorySpecifies a comma-separated list of category names or tags. This can be used to describe a bundle. Example: Bundle-Category: manning, auction-framework
Bundle-ClassPathSpecifies paths within a bundle that are to be used as part of the bundle’s class space. Example: Bundle-ClassPath: /libs/app.jar
Bundle-ContactAddressSpecifies the contact address of the vendor. Example: Bundle-ContactAddress: 123 My Road, CA, my@email.com
Bundle-CopyrightSpecifies the copyright information of the bundle. Example: Bundle-Copyright: Manning© 2011
Bundle-DescriptionSpecifies a user-friendly short description for the bundle. Example: Bundle-Description: Manning's OSGi in Depth Auction Application
Bundle-DocURLSpecifies a URL pointing to a bundle’s documentation. Example: Bundle-DocURL: http://www.manning.com/alves
Bundle-IconSpecifies a URL within the bundle’s JAR file for an image file, useful for a pictorial representation of the bundle. Example: Bundle-Icon: /images/bundle.jpg;size=64
Bundle-LicenseSpecifies license information that can be used to validate the bundle’s usage terms. This can be in some internal format or even a URL. Example: Bundle-License: http://www.manning.com/validate-license.php
Bundle-LocalizationSpecifies the location within the bundle where localization files reside. Example: Bundle-Localization: OSGi-INF/l10n/bundle
Bundle-ManifestVersionSpecifies the OSGi specification to be used. For our purposes, it should be set to 2. Example: Bundle-ManifestVersion: 2
Bundle-NameSpecifies a user-friendly readable name for the bundle. Example: Bundle-Name: auction application
Bundle-NativeCodeSpecifies the native code libraries contained within the bundle. Example: Bundle-NativeCode: /lib/io.dll; osname = Linux
Bundle-RequiredExecutionEnvironmentSpecifies a comma-separated list of execution environments demanded by the bundle. This header has been deprecated in version 4.3 of the OSGi specification. Example: Bundle-RequiredExecutionEnvironment: CDC-1.0/Foundation-1.0
Bundle-SymbolicNameSpecifies the non-localizable identity of the bundle. This header together with the bundle version uniquely identify a bundle. Example: Bundle-SymbolicName: com.manning.osgi.auction
Bundle-UpdateLocationSpecifies a URL where updates for this bundle can be retrieved. An example of how this can be used is in chapter 10. Example: Bundle-UpdateLocation: http://www.manning.com/alves/auction.jar
Bundle-VendorSpecifies a user-friendly description of the bundle’s vendor. Example: Bundle-Vendor: manning
Bundle-VersionSpecifies the version of the bundle. This header together with the symbolic name uniquely identify a bundle. Example: Bundle-Version: 1.0.0.1
DynamicImport-PackageSpecifies a comma-separated list of package names that are imported when needed. This is explained in chapter 4. Example: DynamicImport-Package: com.manning.osgi.*
Export-PackageSpecifies the exported packages of the bundle. Example: Export-Package: com.manning.osgi
Fragment-HostSpecifies the host bundle of this fragment. Example: Fragment-Host: com.manning.osgi.auction; bundle-version="1.0.0.1"
Import-PackageSpecifies the imported packages for this bundle. Example: Import-Package: com.manning.osgi
Provide-CapabilityNew header in OSGi version 4.3 used to specify a generic capability. Example: Provide-Capability: com.cloudprovider; web-access:Boolean=true; cpu:Long=80
Meta-PersistenceSpecifies the path to the persistence unit configuration of a JPA persistence bundle. Chapter 7 explains how JPA is used. Example: Meta-Persistence: META-INF/auction-jpa.xml
Meta-TransactionSpecifies Java classes to be run in a transactional context. This is part of an example explained in chapter 8. Example: Meta-Transaction: com.manning.osgi.MyTransactionalClass
Remote-ServiceSpecifies the endpoint description of a remote service. This is explained in chapter 7. Example: Remote-Service: META-INF/endpoint.xml
Require-BundleSpecifies dependency to another bundle. As explained in chapter 4, this should be avoided. Example: Require-Bundle: com.manning.osgi.auction
Require-CapabilityNew header in OSGi version 4.3 used to specify a dependency on a provided capability. Example: Require-Capability: com.cloudprovider; filter:="(&(web-access)(cpu<90))"



  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial