1 /* 2 * Copyright (c) OSGi Alliance (2000, 2018). All Rights Reserved. 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package org.osgi.framework; 18 19 import org.osgi.annotation.versioning.ProviderType; 20 import org.osgi.framework.hooks.bundle.CollisionHook; 21 import org.osgi.framework.launch.Framework; 22 23 /** 24 * Defines standard names for the OSGi environment system properties, service 25 * properties, and Manifest header attribute keys. 26 * 27 * <p> 28 * The values associated with these keys are of type {@code String}, unless 29 * otherwise indicated. 30 * 31 * @since 1.1 32 * @author $Id: 41e648afb56767a610f279a9c7effef47dfcbf2e $ 33 */ 34 @ProviderType 35 public interface Constants { 36 /** 37 * Location identifier of the OSGi <i>system bundle </i>, which is defined 38 * to be "System Bundle". 39 */ 40 String SYSTEM_BUNDLE_LOCATION = "System Bundle"; 41 42 /** 43 * Alias for the symbolic name of the OSGi <i>system bundle </i>. It is 44 * defined to be "system.bundle". 45 * 46 * @since 1.3 47 */ 48 String SYSTEM_BUNDLE_SYMBOLICNAME = "system.bundle"; 49 50 /** 51 * Identifier of the OSGi <i>system bundle </i>, which is defined to be 52 * {@code 0}. 53 * 54 * @since 1.8 55 */ 56 long SYSTEM_BUNDLE_ID = 0L; 57 58 /** 59 * Manifest header identifying the bundle's category. 60 * <p> 61 * The header value may be retrieved from the {@code Dictionary} object 62 * returned by the {@code Bundle.getHeaders} method. 63 */ 64 String BUNDLE_CATEGORY = "Bundle-Category"; 65 66 /** 67 * Manifest header identifying a list of directories and embedded JAR files, 68 * which are bundle resources used to extend the bundle's classpath. 69 * 70 * <p> 71 * The header value may be retrieved from the {@code Dictionary} object 72 * returned by the {@code Bundle.getHeaders} method. 73 */ 74 String BUNDLE_CLASSPATH = "Bundle-ClassPath"; 75 76 /** 77 * Manifest header identifying the bundle's copyright information. 78 * <p> 79 * The header value may be retrieved from the {@code Dictionary} object 80 * returned by the {@code Bundle.getHeaders} method. 81 */ 82 String BUNDLE_COPYRIGHT = "Bundle-Copyright"; 83 84 /** 85 * Manifest header containing a brief description of the bundle's 86 * functionality. 87 * <p> 88 * The header value may be retrieved from the {@code Dictionary} object 89 * returned by the {@code Bundle.getHeaders} method. 90 */ 91 String BUNDLE_DESCRIPTION = "Bundle-Description"; 92 93 /** 94 * Manifest header identifying the bundle's name. 95 * <p> 96 * The header value may be retrieved from the {@code Dictionary} object 97 * returned by the {@code Bundle.getHeaders} method. 98 */ 99 String BUNDLE_NAME = "Bundle-Name"; 100 101 /** 102 * Manifest header identifying a number of hardware environments and the 103 * native language code libraries that the bundle is carrying for each of 104 * these environments. 105 * 106 * <p> 107 * The header value may be retrieved from the {@code Dictionary} object 108 * returned by the {@code Bundle.getHeaders} method. 109 */ 110 String BUNDLE_NATIVECODE = "Bundle-NativeCode"; 111 112 /** 113 * Manifest header identifying the packages that the bundle offers to the 114 * Framework for export. 115 * 116 * <p> 117 * The header value may be retrieved from the {@code Dictionary} object 118 * returned by the {@code Bundle.getHeaders} method. 119 */ 120 String EXPORT_PACKAGE = "Export-Package"; 121 122 /** 123 * Manifest header identifying the fully qualified class names of the 124 * services that the bundle may register (used for informational purposes 125 * only). 126 * 127 * <p> 128 * The header value may be retrieved from the {@code Dictionary} object 129 * returned by the {@code Bundle.getHeaders} method. 130 * 131 * @deprecated As of 1.2. 132 */ 133 String EXPORT_SERVICE = "Export-Service"; 134 135 /** 136 * Manifest header identifying the packages on which the bundle depends. 137 * 138 * <p> 139 * The header value may be retrieved from the {@code Dictionary} object 140 * returned by the {@code Bundle.getHeaders} method. 141 */ 142 String IMPORT_PACKAGE = "Import-Package"; 143 144 /** 145 * Manifest header identifying the packages that the bundle may dynamically 146 * import during execution. 147 * 148 * <p> 149 * The header value may be retrieved from the {@code Dictionary} object 150 * returned by the {@code Bundle.getHeaders} method. 151 * 152 * @since 1.2 153 */ 154 String DYNAMICIMPORT_PACKAGE = "DynamicImport-Package"; 155 156 /** 157 * Manifest header identifying the fully qualified class names of the 158 * services that the bundle requires (used for informational purposes only). 159 * 160 * <p> 161 * The header value may be retrieved from the {@code Dictionary} object 162 * returned by the {@code Bundle.getHeaders} method. 163 * 164 * @deprecated As of 1.2. 165 */ 166 String IMPORT_SERVICE = "Import-Service"; 167 168 /** 169 * Manifest header identifying the bundle's vendor. 170 * 171 * <p> 172 * The header value may be retrieved from the {@code Dictionary} object 173 * returned by the {@code Bundle.getHeaders} method. 174 */ 175 String BUNDLE_VENDOR = "Bundle-Vendor"; 176 177 /** 178 * Manifest header identifying the bundle's version. 179 * 180 * <p> 181 * The header value may be retrieved from the {@code Dictionary} object 182 * returned by the {@code Bundle.getHeaders} method. 183 */ 184 String BUNDLE_VERSION = "Bundle-Version"; 185 186 /** 187 * Manifest header identifying the bundle's documentation URL, from which 188 * further information about the bundle may be obtained. 189 * 190 * <p> 191 * The header value may be retrieved from the {@code Dictionary} object 192 * returned by the {@code Bundle.getHeaders} method. 193 */ 194 String BUNDLE_DOCURL = "Bundle-DocURL"; 195 196 /** 197 * Manifest header identifying the contact address where problems with the 198 * bundle may be reported; for example, an email address. 199 * 200 * <p> 201 * The header value may be retrieved from the {@code Dictionary} object 202 * returned by the {@code Bundle.getHeaders} method. 203 */ 204 String BUNDLE_CONTACTADDRESS = "Bundle-ContactAddress"; 205 206 /** 207 * Manifest header identifying the bundle's activator class. 208 * 209 * <p> 210 * If present, this header specifies the name of the bundle resource class 211 * that implements the {@code BundleActivator} interface and whose 212 * {@code start} and {@code stop} methods are called by the Framework when 213 * the bundle is started and stopped, respectively. 214 * 215 * <p> 216 * The header value may be retrieved from the {@code Dictionary} object 217 * returned by the {@code Bundle.getHeaders} method. 218 */ 219 String BUNDLE_ACTIVATOR = "Bundle-Activator"; 220 221 /** 222 * Manifest header identifying the extension bundle's activator class. 223 * 224 * <p> 225 * If present, this header specifies the name of the extension bundle 226 * resource class that implements the {@code BundleActivator} interface and 227 * whose {@code start} and {@code stop} methods are called by the Framework 228 * when the Framework is initialized and shutdown, respectively. 229 * 230 * @since 1.8 231 */ 232 String EXTENSION_BUNDLE_ACTIVATOR = "ExtensionBundle-Activator"; 233 234 /** 235 * Manifest header identifying the location from which a new bundle version 236 * is obtained during a bundle update operation. 237 * 238 * <p> 239 * The header value may be retrieved from the {@code Dictionary} object 240 * returned by the {@code Bundle.getHeaders} method. 241 */ 242 String BUNDLE_UPDATELOCATION = "Bundle-UpdateLocation"; 243 244 /** 245 * Manifest header attribute identifying the version of a package specified 246 * in the Export-Package or Import-Package manifest header. 247 * 248 * @deprecated As of 1.3. This has been replaced by 249 * {@link #VERSION_ATTRIBUTE}. 250 */ 251 String PACKAGE_SPECIFICATION_VERSION = "specification-version"; 252 253 /** 254 * Manifest header attribute identifying the processor required to run 255 * native bundle code specified in the Bundle-NativeCode manifest header). 256 * 257 * <p> 258 * The attribute value is encoded in the Bundle-NativeCode manifest header 259 * like: 260 * 261 * <pre> 262 * Bundle-NativeCode: http.so ; processor=x86 ... 263 * </pre> 264 * 265 * @see #BUNDLE_NATIVECODE 266 */ 267 String BUNDLE_NATIVECODE_PROCESSOR = "processor"; 268 269 /** 270 * Manifest header attribute identifying the operating system required to 271 * run native bundle code specified in the Bundle-NativeCode manifest 272 * header). 273 * <p> 274 * The attribute value is encoded in the Bundle-NativeCode manifest header 275 * like: 276 * 277 * <pre> 278 * Bundle-NativeCode: http.so ; osname=Linux ... 279 * </pre> 280 * 281 * @see #BUNDLE_NATIVECODE 282 */ 283 String BUNDLE_NATIVECODE_OSNAME = "osname"; 284 285 /** 286 * Manifest header attribute identifying the operating system version 287 * required to run native bundle code specified in the Bundle-NativeCode 288 * manifest header). 289 * <p> 290 * The attribute value is encoded in the Bundle-NativeCode manifest header 291 * like: 292 * 293 * <pre> 294 * Bundle-NativeCode: http.so ; osversion="2.34" ... 295 * </pre> 296 * 297 * @see #BUNDLE_NATIVECODE 298 */ 299 String BUNDLE_NATIVECODE_OSVERSION = "osversion"; 300 301 /** 302 * Manifest header attribute identifying the language in which the native 303 * bundle code is written specified in the Bundle-NativeCode manifest 304 * header. See ISO 639 for possible values. 305 * <p> 306 * The attribute value is encoded in the Bundle-NativeCode manifest header 307 * like: 308 * 309 * <pre> 310 * Bundle-NativeCode: http.so ; language=nl_be ... 311 * </pre> 312 * 313 * @see #BUNDLE_NATIVECODE 314 */ 315 String BUNDLE_NATIVECODE_LANGUAGE = "language"; 316 317 /** 318 * Manifest header identifying the required execution environment for the 319 * bundle. The service platform may run this bundle if any of the execution 320 * environments named in this header matches one of the execution 321 * environments it implements. 322 * 323 * <p> 324 * The header value may be retrieved from the {@code Dictionary} object 325 * returned by the {@code Bundle.getHeaders} method. 326 * 327 * @since 1.2 328 * @deprecated As of 1.6. Replaced by the {@code osgi.ee} capability. 329 */ 330 String BUNDLE_REQUIREDEXECUTIONENVIRONMENT = "Bundle-RequiredExecutionEnvironment"; 331 332 /** 333 * Manifest header identifying the bundle's symbolic name. 334 * 335 * <p> 336 * The header value may be retrieved from the {@code Dictionary} object 337 * returned by the {@code Bundle.getHeaders} method. 338 * 339 * @since 1.3 340 */ 341 String BUNDLE_SYMBOLICNAME = "Bundle-SymbolicName"; 342 343 /** 344 * Manifest header directive identifying whether a bundle is a singleton. 345 * The default value is {@code false}. 346 * 347 * <p> 348 * The directive value is encoded in the Bundle-SymbolicName manifest header 349 * like: 350 * 351 * <pre> 352 * Bundle-SymbolicName: com.acme.module.test; singleton:=true 353 * </pre> 354 * 355 * @see #BUNDLE_SYMBOLICNAME 356 * @since 1.3 357 */ 358 String SINGLETON_DIRECTIVE = "singleton"; 359 360 /** 361 * Manifest header directive identifying if and when a fragment may attach 362 * to a host bundle. The default value is 363 * {@link #FRAGMENT_ATTACHMENT_ALWAYS always}. 364 * 365 * <p> 366 * The directive value is encoded in the Bundle-SymbolicName manifest header 367 * like: 368 * 369 * <pre> 370 * Bundle-SymbolicName: com.acme.module.test; fragment-attachment:="never" 371 * </pre> 372 * 373 * @see #BUNDLE_SYMBOLICNAME 374 * @see #FRAGMENT_ATTACHMENT_ALWAYS 375 * @see #FRAGMENT_ATTACHMENT_RESOLVETIME 376 * @see #FRAGMENT_ATTACHMENT_NEVER 377 * @since 1.3 378 */ 379 String FRAGMENT_ATTACHMENT_DIRECTIVE = "fragment-attachment"; 380 381 /** 382 * Manifest header directive value identifying a fragment attachment type of 383 * always. A fragment attachment type of always indicates that fragments are 384 * allowed to attach to the host bundle at any time (while the host is 385 * resolved or during the process of resolving the host bundle). 386 * 387 * <p> 388 * The directive value is encoded in the Bundle-SymbolicName manifest header 389 * like: 390 * 391 * <pre> 392 * Bundle-SymbolicName: com.acme.module.test; fragment-attachment:="always" 393 * </pre> 394 * 395 * @see #FRAGMENT_ATTACHMENT_DIRECTIVE 396 * @since 1.3 397 */ 398 String FRAGMENT_ATTACHMENT_ALWAYS = "always"; 399 400 /** 401 * Manifest header directive value identifying a fragment attachment type of 402 * resolve-time. A fragment attachment type of resolve-time indicates that 403 * fragments are allowed to attach to the host bundle only during the 404 * process of resolving the host bundle. 405 * 406 * <p> 407 * The directive value is encoded in the Bundle-SymbolicName manifest header 408 * like: 409 * 410 * <pre> 411 * Bundle-SymbolicName: com.acme.module.test; 412 * fragment-attachment:="resolve-time" 413 * </pre> 414 * 415 * @see #FRAGMENT_ATTACHMENT_DIRECTIVE 416 * @since 1.3 417 */ 418 String FRAGMENT_ATTACHMENT_RESOLVETIME = "resolve-time"; 419 420 /** 421 * Manifest header directive value identifying a fragment attachment type of 422 * never. A fragment attachment type of never indicates that no fragments 423 * are allowed to attach to the host bundle at any time. 424 * 425 * <p> 426 * The directive value is encoded in the Bundle-SymbolicName manifest header 427 * like: 428 * 429 * <pre> 430 * Bundle-SymbolicName: com.acme.module.test; fragment-attachment:="never" 431 * </pre> 432 * 433 * @see #FRAGMENT_ATTACHMENT_DIRECTIVE 434 * @since 1.3 435 */ 436 String FRAGMENT_ATTACHMENT_NEVER = "never"; 437 438 /** 439 * Manifest header identifying the base name of the bundle's localization 440 * entries. 441 * 442 * <p> 443 * The header value may be retrieved from the {@code Dictionary} object 444 * returned by the {@code Bundle.getHeaders} method. 445 * 446 * @see #BUNDLE_LOCALIZATION_DEFAULT_BASENAME 447 * @since 1.3 448 */ 449 String BUNDLE_LOCALIZATION = "Bundle-Localization"; 450 451 /** 452 * Default value for the {@code Bundle-Localization} manifest header. 453 * 454 * @see #BUNDLE_LOCALIZATION 455 * @since 1.3 456 */ 457 String BUNDLE_LOCALIZATION_DEFAULT_BASENAME = "OSGI-INF/l10n/bundle"; 458 459 /** 460 * Manifest header identifying the symbolic names of other bundles required 461 * by the bundle. 462 * 463 * <p> 464 * The header value may be retrieved from the {@code Dictionary} object 465 * returned by the {@code Bundle.getHeaders} method. 466 * 467 * @since 1.3 468 */ 469 String REQUIRE_BUNDLE = "Require-Bundle"; 470 471 /** 472 * Manifest header attribute identifying a range of versions for a bundle 473 * specified in the {@code Require-Bundle} or {@code Fragment-Host} manifest 474 * headers. The default value is {@code 0.0.0}. 475 * 476 * <p> 477 * The attribute value is encoded in the Require-Bundle manifest header 478 * like: 479 * 480 * <pre> 481 * Require-Bundle: com.acme.module.test; bundle-version="1.1" 482 * Require-Bundle: com.acme.module.test; bundle-version="[1.0,2.0)" 483 * </pre> 484 * 485 * <p> 486 * The bundle-version attribute value uses a mathematical interval notation 487 * to specify a range of bundle versions. A bundle-version attribute value 488 * specified as a single version means a version range that includes any 489 * bundle version greater than or equal to the specified version. 490 * 491 * @see #REQUIRE_BUNDLE 492 * @since 1.3 493 */ 494 String BUNDLE_VERSION_ATTRIBUTE = "bundle-version"; 495 496 /** 497 * Manifest header identifying the symbolic name of another bundle for which 498 * that the bundle is a fragment. 499 * 500 * <p> 501 * The header value may be retrieved from the {@code Dictionary} object 502 * returned by the {@code Bundle.getHeaders} method. 503 * 504 * @since 1.3 505 */ 506 String FRAGMENT_HOST = "Fragment-Host"; 507 508 /** 509 * Manifest header attribute is used for selection by filtering based upon 510 * system properties. 511 * 512 * <p> 513 * The attribute value is encoded in manifest headers like: 514 * 515 * <pre> 516 * Bundle-NativeCode: libgtk.so; selection-filter="(ws=gtk)"; ... 517 * </pre> 518 * 519 * @see #BUNDLE_NATIVECODE 520 * @since 1.3 521 */ 522 String SELECTION_FILTER_ATTRIBUTE = "selection-filter"; 523 524 /** 525 * Manifest header identifying the bundle manifest version. A bundle 526 * manifest may express the version of the syntax in which it is written by 527 * specifying a bundle manifest version. Bundles exploiting OSGi Release 4, 528 * or later, syntax must specify a bundle manifest version. 529 * <p> 530 * The bundle manifest version defined by OSGi Release 4 or, more 531 * specifically, by version 1.3 of the OSGi Core Specification is "2". 532 * 533 * <p> 534 * The header value may be retrieved from the {@code Dictionary} object 535 * returned by the {@code Bundle.getHeaders} method. 536 * 537 * @since 1.3 538 */ 539 String BUNDLE_MANIFESTVERSION = "Bundle-ManifestVersion"; 540 541 /** 542 * Manifest header attribute identifying the version of a package specified 543 * in the Export-Package or Import-Package manifest header. 544 * 545 * <p> 546 * The attribute value is encoded in the Export-Package or Import-Package 547 * manifest header like: 548 * 549 * <pre> 550 * Export-Package: org.osgi.framework; version="1.1" 551 * </pre> 552 * 553 * @see #EXPORT_PACKAGE 554 * @see #IMPORT_PACKAGE 555 * @since 1.3 556 */ 557 String VERSION_ATTRIBUTE = "version"; 558 559 /** 560 * Manifest header attribute identifying the symbolic name of a bundle that 561 * exports a package specified in the Import-Package manifest header. 562 * 563 * <p> 564 * The attribute value is encoded in the Import-Package manifest header 565 * like: 566 * 567 * <pre> 568 * Import-Package: org.osgi.framework; 569 * bundle-symbolic-name="com.acme.module.test" 570 * </pre> 571 * 572 * @see #IMPORT_PACKAGE 573 * @since 1.3 574 */ 575 String BUNDLE_SYMBOLICNAME_ATTRIBUTE = "bundle-symbolic-name"; 576 577 /** 578 * Manifest header directive identifying the resolution type in the 579 * Import-Package, Require-Bundle or Require-Capability manifest header. The 580 * default value is {@link #RESOLUTION_MANDATORY mandatory}. 581 * 582 * <p> 583 * The directive value is encoded in the Import-Package, Require-Bundle or 584 * Require-Capability manifest header like: 585 * 586 * <pre> 587 * Import-Package: org.osgi.framework; resolution:="optional" 588 * Require-Bundle: com.acme.module.test; resolution:="optional" 589 * Require-Capability: com.acme.capability; resolution:="optional" 590 * </pre> 591 * 592 * @see #IMPORT_PACKAGE 593 * @see #REQUIRE_BUNDLE 594 * @see #REQUIRE_CAPABILITY 595 * @see #RESOLUTION_MANDATORY 596 * @see #RESOLUTION_OPTIONAL 597 * @since 1.3 598 */ 599 String RESOLUTION_DIRECTIVE = "resolution"; 600 601 /** 602 * Manifest header directive value identifying a mandatory resolution type. 603 * A mandatory resolution type indicates that the import package, require 604 * bundle or require capability must be resolved when the bundle is 605 * resolved. If such an import, require bundle or require capability cannot 606 * be resolved, the module fails to resolve. 607 * 608 * <p> 609 * The directive value is encoded in the Import-Package, Require-Bundle or 610 * Require-Capability manifest header like: 611 * 612 * <pre> 613 * Import-Package: org.osgi.framework; resolution:="mandatory" 614 * Require-Bundle: com.acme.module.test; resolution:="mandatory" 615 * Require-Capability: com.acme.capability; resolution:="mandatory" 616 * </pre> 617 * 618 * @see #RESOLUTION_DIRECTIVE 619 * @since 1.3 620 */ 621 String RESOLUTION_MANDATORY = "mandatory"; 622 623 /** 624 * Manifest header directive value identifying an optional resolution type. 625 * An optional resolution type indicates that the import, require bundle or 626 * require capability is optional and the bundle may be resolved without the 627 * import, require bundle or require capability being resolved. If the 628 * import, require bundle or require capability is not resolved when the 629 * bundle is resolved, the import, require bundle or require capability may 630 * not be resolved until the bundle is refreshed. 631 * 632 * <p> 633 * The directive value is encoded in the Import-Package, Require-Bundle or 634 * Require-Capability manifest header like: 635 * 636 * <pre> 637 * Import-Package: org.osgi.framework; resolution:="optional" 638 * Require-Bundle: com.acme.module.test; resolution:="optional" 639 * Require-Capability: com.acme.capability; resolution:="optional" 640 * </pre> 641 * 642 * @see #RESOLUTION_DIRECTIVE 643 * @since 1.3 644 */ 645 String RESOLUTION_OPTIONAL = "optional"; 646 647 /** 648 * Manifest header directive identifying a list of packages that an exported 649 * package or provided capability uses. 650 * 651 * <p> 652 * The directive value is encoded in the Export-Package or 653 * Provide-Capability manifest header like: 654 * 655 * <pre> 656 * Export-Package: org.osgi.util.tracker; uses:="org.osgi.framework" 657 * Provide-Capability: com.acme.capability; uses:="com.acme.service" 658 * </pre> 659 * 660 * @see #EXPORT_PACKAGE 661 * @see #PROVIDE_CAPABILITY 662 * @since 1.3 663 */ 664 String USES_DIRECTIVE = "uses"; 665 666 /** 667 * Manifest header directive identifying a list of classes to include in the 668 * exported package. 669 * 670 * <p> 671 * This directive is used by the Export-Package manifest header to identify 672 * a list of classes of the specified package which must be allowed to be 673 * exported. The directive value is encoded in the Export-Package manifest 674 * header like: 675 * 676 * <pre> 677 * Export-Package: org.osgi.framework; include:="MyClass*" 678 * </pre> 679 * 680 * <p> 681 * This directive is also used by the Bundle-ActivationPolicy manifest 682 * header to identify the packages from which class loads will trigger lazy 683 * activation. The directive value is encoded in the Bundle-ActivationPolicy 684 * manifest header like: 685 * 686 * <pre> 687 * Bundle-ActivationPolicy: lazy; include:="org.osgi.framework" 688 * </pre> 689 * 690 * @see #EXPORT_PACKAGE 691 * @see #BUNDLE_ACTIVATIONPOLICY 692 * @since 1.3 693 */ 694 String INCLUDE_DIRECTIVE = "include"; 695 696 /** 697 * Manifest header directive identifying a list of classes to exclude in the 698 * exported package.. 699 * <p> 700 * This directive is used by the Export-Package manifest header to identify 701 * a list of classes of the specified package which must not be allowed to 702 * be exported. The directive value is encoded in the Export-Package 703 * manifest header like: 704 * 705 * <pre> 706 * Export-Package: org.osgi.framework; exclude:="*Impl" 707 * </pre> 708 * 709 * <p> 710 * This directive is also used by the Bundle-ActivationPolicy manifest 711 * header to identify the packages from which class loads will not trigger 712 * lazy activation. The directive value is encoded in the 713 * Bundle-ActivationPolicy manifest header like: 714 * 715 * <pre> 716 * Bundle-ActivationPolicy: lazy; exclude:="org.osgi.framework" 717 * </pre> 718 * 719 * @see #EXPORT_PACKAGE 720 * @see #BUNDLE_ACTIVATIONPOLICY 721 * @since 1.3 722 */ 723 String EXCLUDE_DIRECTIVE = "exclude"; 724 725 /** 726 * Manifest header directive identifying names of matching attributes which 727 * must be specified by matching Import-Package statements in the 728 * Export-Package manifest header. 729 * 730 * <p> 731 * The directive value is encoded in the Export-Package manifest header 732 * like: 733 * 734 * <pre> 735 * Export-Package: org.osgi.framework; mandatory:="bundle-symbolic-name" 736 * </pre> 737 * 738 * @see #EXPORT_PACKAGE 739 * @since 1.3 740 */ 741 String MANDATORY_DIRECTIVE = "mandatory"; 742 743 /** 744 * Manifest header directive identifying the visibility of a required bundle 745 * in the Require-Bundle manifest header. The default value is 746 * {@link #VISIBILITY_PRIVATE private}. 747 * 748 * <p> 749 * The directive value is encoded in the Require-Bundle manifest header 750 * like: 751 * 752 * <pre> 753 * Require-Bundle: com.acme.module.test; visibility:="reexport" 754 * </pre> 755 * 756 * @see #REQUIRE_BUNDLE 757 * @see #VISIBILITY_PRIVATE 758 * @see #VISIBILITY_REEXPORT 759 * @since 1.3 760 */ 761 String VISIBILITY_DIRECTIVE = "visibility"; 762 763 /** 764 * Manifest header directive value identifying a private visibility type. A 765 * private visibility type indicates that any packages that are exported by 766 * the required bundle are not made visible on the export signature of the 767 * requiring bundle. 768 * 769 * <p> 770 * The directive value is encoded in the Require-Bundle manifest header 771 * like: 772 * 773 * <pre> 774 * Require-Bundle: com.acme.module.test; visibility:="private" 775 * </pre> 776 * 777 * @see #VISIBILITY_DIRECTIVE 778 * @since 1.3 779 */ 780 String VISIBILITY_PRIVATE = "private"; 781 782 /** 783 * Manifest header directive value identifying a reexport visibility type. A 784 * reexport visibility type indicates any packages that are exported by the 785 * required bundle are re-exported by the requiring bundle. Any arbitrary 786 * matching attributes with which they were exported by the required bundle 787 * are deleted. 788 * <p> 789 * The directive value is encoded in the Require-Bundle manifest header 790 * like: 791 * 792 * <pre> 793 * Require-Bundle: com.acme.module.test; visibility:="reexport" 794 * </pre> 795 * 796 * @see #VISIBILITY_DIRECTIVE 797 * @since 1.3 798 */ 799 String VISIBILITY_REEXPORT = "reexport"; 800 801 /** 802 * Manifest header directive identifying the type of the extension fragment. 803 * 804 * <p> 805 * The directive value is encoded in the Fragment-Host manifest header like: 806 * 807 * <pre> 808 * Fragment-Host: system.bundle; extension:="framework" 809 * </pre> 810 * 811 * <p> 812 * The default value is {@link #EXTENSION_FRAMEWORK framework}. 813 * 814 * @see #FRAGMENT_HOST 815 * @see #EXTENSION_FRAMEWORK 816 * @since 1.3 817 */ 818 String EXTENSION_DIRECTIVE = "extension"; 819 820 /** 821 * Manifest header directive value identifying the type of extension 822 * fragment. An extension fragment type of framework indicates that the 823 * extension fragment is to be loaded by the framework's class loader. 824 * 825 * <p> 826 * The directive value is encoded in the Fragment-Host manifest header like: 827 * 828 * <pre> 829 * Fragment-Host: system.bundle; extension:="framework" 830 * </pre> 831 * 832 * @see #EXTENSION_DIRECTIVE 833 * @since 1.3 834 */ 835 String EXTENSION_FRAMEWORK = "framework"; 836 837 /** 838 * Manifest header directive value identifying the type of extension 839 * fragment. An extension fragment type of bootclasspath indicates that the 840 * extension fragment is to be loaded by the boot class loader. 841 * <p> 842 * The directive value is encoded in the Fragment-Host manifest header like: 843 * 844 * <pre> 845 * Fragment-Host: system.bundle; extension:="bootclasspath" 846 * </pre> 847 * 848 * @see #EXTENSION_DIRECTIVE 849 * @since 1.3 850 * @deprecated As of 1.9. 851 */ 852 String EXTENSION_BOOTCLASSPATH = "bootclasspath"; 853 854 /** 855 * Manifest header identifying the bundle's activation policy. 856 * <p> 857 * The header value may be retrieved from the {@code Dictionary} object 858 * returned by the {@code Bundle.getHeaders} method. 859 * 860 * @since 1.4 861 * @see #ACTIVATION_LAZY 862 * @see #INCLUDE_DIRECTIVE 863 * @see #EXCLUDE_DIRECTIVE 864 */ 865 String BUNDLE_ACTIVATIONPOLICY = "Bundle-ActivationPolicy"; 866 867 /** 868 * Bundle activation policy declaring the bundle must be activated when the 869 * first class load is made from the bundle. 870 * <p> 871 * A bundle with the lazy activation policy that is started with the 872 * {@link Bundle#START_ACTIVATION_POLICY START_ACTIVATION_POLICY} option 873 * will wait in the {@link Bundle#STARTING STARTING} state until the first 874 * class load from the bundle occurs. The bundle will then be activated 875 * before the class is returned to the requester. 876 * <p> 877 * The activation policy value is specified as in the 878 * Bundle-ActivationPolicy manifest header like: 879 * 880 * <pre> 881 * Bundle-ActivationPolicy: lazy 882 * </pre> 883 * 884 * @see #BUNDLE_ACTIVATIONPOLICY 885 * @see Bundle#start(int) 886 * @see Bundle#START_ACTIVATION_POLICY 887 * @since 1.4 888 */ 889 String ACTIVATION_LAZY = "lazy"; 890 891 /** 892 * Framework environment property identifying the Framework version. 893 * 894 * <p> 895 * The value of this property may be retrieved by calling the 896 * {@code BundleContext.getProperty} method. 897 */ 898 String FRAMEWORK_VERSION = "org.osgi.framework.version"; 899 900 /** 901 * Framework environment property identifying the Framework implementation 902 * vendor. 903 * 904 * <p> 905 * The value of this property may be retrieved by calling the 906 * {@code BundleContext.getProperty} method. 907 */ 908 String FRAMEWORK_VENDOR = "org.osgi.framework.vendor"; 909 910 /** 911 * Framework launching property identifying the Framework implementation 912 * language (see ISO 639 for possible values). 913 * 914 * <p> 915 * The value of this property may be retrieved by calling the 916 * {@code BundleContext.getProperty} method. 917 */ 918 String FRAMEWORK_LANGUAGE = "org.osgi.framework.language"; 919 920 /** 921 * Framework launching property identifying the Framework host-computer's 922 * operating system. 923 * 924 * <p> 925 * The value of this property may be retrieved by calling the 926 * {@code BundleContext.getProperty} method. 927 */ 928 String FRAMEWORK_OS_NAME = "org.osgi.framework.os.name"; 929 930 /** 931 * Framework launching property identifying the Framework host-computer's 932 * operating system version number. 933 * 934 * <p> 935 * The value of this property may be retrieved by calling the 936 * {@code BundleContext.getProperty} method. 937 */ 938 String FRAMEWORK_OS_VERSION = "org.osgi.framework.os.version"; 939 940 /** 941 * Framework launching property identifying the Framework host-computer's 942 * processor name. 943 * 944 * <p> 945 * The value of this property may be retrieved by calling the 946 * {@code BundleContext.getProperty} method. 947 */ 948 String FRAMEWORK_PROCESSOR = "org.osgi.framework.processor"; 949 950 /** 951 * Framework launching property identifying execution environments provided 952 * by the Framework. 953 * 954 * <p> 955 * The value of this property may be retrieved by calling the 956 * {@code BundleContext.getProperty} method. 957 * 958 * @since 1.2 959 * @deprecated As of 1.6. Replaced by the {@code osgi.ee} capability. 960 */ 961 String FRAMEWORK_EXECUTIONENVIRONMENT = "org.osgi.framework.executionenvironment"; 962 963 /** 964 * Framework launching property identifying packages for which the Framework 965 * must delegate class loading to the parent class loader of the bundle. 966 * 967 * <p> 968 * The value of this property may be retrieved by calling the 969 * {@code BundleContext.getProperty} method. 970 * 971 * @see #FRAMEWORK_BUNDLE_PARENT 972 * @since 1.3 973 */ 974 String FRAMEWORK_BOOTDELEGATION = "org.osgi.framework.bootdelegation"; 975 976 /** 977 * Framework launching property identifying packages which the system bundle 978 * must export. 979 * 980 * <p> 981 * If this property is not specified then the framework must calculate a 982 * reasonable default value for the current execution environment. 983 * 984 * <p> 985 * The value of this property may be retrieved by calling the 986 * {@code BundleContext.getProperty} method. 987 * 988 * @since 1.3 989 */ 990 String FRAMEWORK_SYSTEMPACKAGES = "org.osgi.framework.system.packages"; 991 992 /** 993 * Framework launching property identifying extra packages which the system 994 * bundle must export from the current execution environment. 995 * 996 * <p> 997 * This property is useful for configuring extra system packages in addition 998 * to the system packages calculated by the framework. 999 * 1000 * <p> 1001 * The value of this property may be retrieved by calling the 1002 * {@code BundleContext.getProperty} method. 1003 * 1004 * @see #FRAMEWORK_SYSTEMPACKAGES 1005 * @since 1.5 1006 */ 1007 String FRAMEWORK_SYSTEMPACKAGES_EXTRA = "org.osgi.framework.system.packages.extra"; 1008 1009 /** 1010 * Framework environment property identifying whether the Framework supports 1011 * framework extension bundles. 1012 * 1013 * <p> 1014 * As of version 1.4, the value of this property must be {@code true}. The 1015 * Framework must support framework extension bundles. 1016 * 1017 * <p> 1018 * The value of this property may be retrieved by calling the 1019 * {@code BundleContext.getProperty} method. 1020 * 1021 * @since 1.3 1022 */ 1023 String SUPPORTS_FRAMEWORK_EXTENSION = "org.osgi.supports.framework.extension"; 1024 1025 /** 1026 * Framework environment property identifying whether the Framework supports 1027 * bootclasspath extension bundles. 1028 * 1029 * <p> 1030 * If the value of this property is {@code true}, then the Framework 1031 * supports bootclasspath extension bundles. The default value is 1032 * {@code false}. 1033 * <p> 1034 * The value of this property may be retrieved by calling the 1035 * {@code BundleContext.getProperty} method. 1036 * 1037 * @since 1.3 1038 */ 1039 String SUPPORTS_BOOTCLASSPATH_EXTENSION = "org.osgi.supports.bootclasspath.extension"; 1040 1041 /** 1042 * Framework environment property identifying whether the Framework supports 1043 * fragment bundles. 1044 * 1045 * <p> 1046 * As of version 1.4, the value of this property must be {@code true}. The 1047 * Framework must support fragment bundles. 1048 * <p> 1049 * The value of this property may be retrieved by calling the 1050 * {@code BundleContext.getProperty} method. 1051 * 1052 * @since 1.3 1053 */ 1054 String SUPPORTS_FRAMEWORK_FRAGMENT = "org.osgi.supports.framework.fragment"; 1055 1056 /** 1057 * Framework environment property identifying whether the Framework supports 1058 * the {@link #REQUIRE_BUNDLE Require-Bundle} manifest header. 1059 * 1060 * <p> 1061 * As of version 1.4, the value of this property must be {@code true}. The 1062 * Framework must support the {@code Require-Bundle} manifest header. 1063 * <p> 1064 * The value of this property may be retrieved by calling the 1065 * {@code BundleContext.getProperty} method. 1066 * 1067 * @since 1.3 1068 */ 1069 String SUPPORTS_FRAMEWORK_REQUIREBUNDLE = "org.osgi.supports.framework.requirebundle"; 1070 1071 /** 1072 * Framework launching property specifying the type of security manager the 1073 * framework must use. If not specified then the framework will not set the 1074 * VM security manager. 1075 * 1076 * @see #FRAMEWORK_SECURITY_OSGI 1077 * @since 1.5 1078 */ 1079 String FRAMEWORK_SECURITY = "org.osgi.framework.security"; 1080 1081 /** 1082 * Specifies that a security manager that supports all security aspects of 1083 * the OSGi core specification including postponed conditions must be 1084 * installed. 1085 * 1086 * <p> 1087 * If this value is specified and there is a security manager already 1088 * installed, then a {@code SecurityException} must be thrown when the 1089 * Framework is initialized. 1090 * 1091 * @see #FRAMEWORK_SECURITY 1092 * @since 1.5 1093 */ 1094 String FRAMEWORK_SECURITY_OSGI = "osgi"; 1095 1096 /** 1097 * Framework launching property specifying the persistent storage area used 1098 * by the framework. The value of this property must be a valid file path in 1099 * the file system to a directory. If the specified directory does not exist 1100 * then the framework will create the directory. If the specified path 1101 * exists but is not a directory or if the framework fails to create the 1102 * storage directory, then framework initialization must fail. The framework 1103 * is free to use this directory as it sees fit. This area can not be shared 1104 * with anything else. 1105 * <p> 1106 * If this property is not set, the framework should use a reasonable 1107 * platform default for the persistent storage area. 1108 * 1109 * @since 1.5 1110 */ 1111 String FRAMEWORK_STORAGE = "org.osgi.framework.storage"; 1112 1113 /** 1114 * Framework launching property specifying if and when the persistent 1115 * storage area for the framework should be cleaned. If this property is not 1116 * set, then the framework storage area must not be cleaned. 1117 * 1118 * @see #FRAMEWORK_STORAGE_CLEAN_ONFIRSTINIT 1119 * @since 1.5 1120 */ 1121 String FRAMEWORK_STORAGE_CLEAN = "org.osgi.framework.storage.clean"; 1122 1123 /** 1124 * Specifies that the framework storage area must be cleaned before the 1125 * framework is initialized for the first time. Subsequent inits, starts or 1126 * updates of the framework will not result in cleaning the framework 1127 * storage area. 1128 * 1129 * @since 1.5 1130 */ 1131 String FRAMEWORK_STORAGE_CLEAN_ONFIRSTINIT = "onFirstInit"; 1132 1133 /** 1134 * Framework launching property specifying a comma separated list of 1135 * additional library file extensions that must be used when a bundle's 1136 * class loader is searching for native libraries. If this property is not 1137 * set, then only the library name returned by 1138 * {@code System.mapLibraryName(String)} will be used to search. This is 1139 * needed for certain operating systems which allow more than one extension 1140 * for a library. For example, AIX allows library extensions of {@code .a} 1141 * and {@code .so}, but {@code System.mapLibraryName(String)} will only 1142 * return names with the {@code .a} extension. 1143 * 1144 * @since 1.5 1145 */ 1146 String FRAMEWORK_LIBRARY_EXTENSIONS = "org.osgi.framework.library.extensions"; 1147 1148 /** 1149 * Framework launching property specifying an optional OS specific command 1150 * to set file permissions on extracted native code. On some operating 1151 * systems, it is required that native libraries be set to executable. This 1152 * optional property allows you to specify the command. For example, on a 1153 * UNIX style OS, this property could have the following value. 1154 * 1155 * <pre> 1156 * chmod +rx ${abspath} 1157 * </pre> 1158 * 1159 * The <code>${abspath}</code> is used by the framework to substitute the 1160 * actual absolute file path. 1161 * 1162 * @since 1.5 1163 */ 1164 String FRAMEWORK_EXECPERMISSION = "org.osgi.framework.command.execpermission"; 1165 1166 /** 1167 * Specified the substitution string for the absolute path of a file. 1168 * 1169 * @see #FRAMEWORK_EXECPERMISSION 1170 * @since 1.6 1171 */ 1172 String FRAMEWORK_COMMAND_ABSPATH = "abspath"; 1173 1174 /** 1175 * Framework launching property specifying the trust repositories used by 1176 * the framework. The value is a {@code java.io.File.pathSeparator} 1177 * separated list of valid file paths to files that contain key stores. Key 1178 * stores of type {@code JKS} must be supported and other key store types 1179 * may be supported. The framework will use the key stores as trust 1180 * repositories to authenticate certificates of trusted signers. The key 1181 * stores are only used as read-only trust repositories to access public 1182 * keys. No passwords are required to access the key stores' public keys. 1183 * <p> 1184 * Note that framework implementations are allowed to use other trust 1185 * repositories in addition to the trust repositories specified by this 1186 * property. How these other trust repositories are configured and populated 1187 * is implementation specific. 1188 * 1189 * @since 1.5 1190 */ 1191 String FRAMEWORK_TRUST_REPOSITORIES = "org.osgi.framework.trust.repositories"; 1192 1193 /** 1194 * Framework launching property specifying the current windowing system. The 1195 * framework should provide a reasonable default if this is not set. 1196 * 1197 * @since 1.5 1198 */ 1199 String FRAMEWORK_WINDOWSYSTEM = "org.osgi.framework.windowsystem"; 1200 1201 /** 1202 * Framework launching property specifying the beginning start level of the 1203 * framework. 1204 * 1205 * @see "Core Specification, Starting the Framework." 1206 * @since 1.5 1207 */ 1208 String FRAMEWORK_BEGINNING_STARTLEVEL = "org.osgi.framework.startlevel.beginning"; 1209 1210 /** 1211 * Framework launching property specifying the parent class loader type for 1212 * all bundle class loaders. Default value is 1213 * {@link #FRAMEWORK_BUNDLE_PARENT_BOOT boot}. 1214 * 1215 * @see #FRAMEWORK_BUNDLE_PARENT_BOOT 1216 * @see #FRAMEWORK_BUNDLE_PARENT_EXT 1217 * @see #FRAMEWORK_BUNDLE_PARENT_APP 1218 * @see #FRAMEWORK_BUNDLE_PARENT_FRAMEWORK 1219 * @since 1.5 1220 */ 1221 String FRAMEWORK_BUNDLE_PARENT = "org.osgi.framework.bundle.parent"; 1222 1223 /** 1224 * Specifies to use of the boot class loader as the parent class loader for 1225 * all bundle class loaders. 1226 * 1227 * @since 1.5 1228 * @see #FRAMEWORK_BUNDLE_PARENT 1229 */ 1230 String FRAMEWORK_BUNDLE_PARENT_BOOT = "boot"; 1231 1232 /** 1233 * Specifies to use the extension class loader as the parent class loader 1234 * for all bundle class loaders. 1235 * 1236 * @since 1.5 1237 * @see #FRAMEWORK_BUNDLE_PARENT 1238 */ 1239 String FRAMEWORK_BUNDLE_PARENT_EXT = "ext"; 1240 1241 /** 1242 * Specifies to use the application class loader as the parent class loader 1243 * for all bundle class loaders. Depending on how the framework is launched, 1244 * this may refer to the same class loader as 1245 * {@link #FRAMEWORK_BUNDLE_PARENT_FRAMEWORK}. 1246 * 1247 * @since 1.5 1248 * @see #FRAMEWORK_BUNDLE_PARENT 1249 */ 1250 String FRAMEWORK_BUNDLE_PARENT_APP = "app"; 1251 1252 /** 1253 * Specifies to use the framework class loader as the parent class loader 1254 * for all bundle class loaders. The framework class loader is the class 1255 * loader used to load the framework implementation. Depending on how the 1256 * framework is launched, this may refer to the same class loader as 1257 * {@link #FRAMEWORK_BUNDLE_PARENT_APP}. 1258 * 1259 * @since 1.5 1260 * @see #FRAMEWORK_BUNDLE_PARENT 1261 */ 1262 String FRAMEWORK_BUNDLE_PARENT_FRAMEWORK = "framework"; 1263 1264 /* 1265 * Service properties. 1266 */ 1267 1268 /** 1269 * Service property identifying all of the class names under which a service 1270 * was registered in the Framework. The value of this property must be of 1271 * type {@code String[]}. 1272 * 1273 * <p> 1274 * This property is set by the Framework when a service is registered. 1275 */ 1276 String OBJECTCLASS = "objectClass"; 1277 1278 /** 1279 * Service property identifying a service's registration number. The value 1280 * of this property must be of type {@code Long}. 1281 * 1282 * <p> 1283 * The value of this property is assigned by the Framework when a service is 1284 * registered. The Framework assigns a unique, non-negative value that is 1285 * larger than all previously assigned values since the Framework was 1286 * started. These values are NOT persistent across restarts of the 1287 * Framework. 1288 */ 1289 String SERVICE_ID = "service.id"; 1290 1291 /** 1292 * Service property identifying a service's persistent identifier. 1293 * 1294 * <p> 1295 * This property may be supplied in the {@code properties} 1296 * {@code Dictionary} object passed to the 1297 * {@code BundleContext.registerService} method. The value of this property 1298 * must be of type {@code String}, {@code String[]}, or {@code Collection} 1299 * of {@code String}. 1300 * 1301 * <p> 1302 * A service's persistent identifier uniquely identifies the service and 1303 * persists across multiple Framework invocations. 1304 * 1305 * <p> 1306 * By convention, every bundle has its own unique namespace, starting with 1307 * the bundle's identifier (see {@link Bundle#getBundleId()}) and followed 1308 * by a dot (.). A bundle may use this as the prefix of the persistent 1309 * identifiers for the services it registers. 1310 */ 1311 String SERVICE_PID = "service.pid"; 1312 1313 /** 1314 * Service property identifying a service's ranking number. 1315 * 1316 * <p> 1317 * This property may be supplied in the {@code properties 1318 * Dictionary} object passed to the {@code BundleContext.registerService} 1319 * method. The value of this property must be of type {@code Integer}. 1320 * 1321 * <p> 1322 * The service ranking is used by the Framework to determine the <i>natural 1323 * order</i> of services, see {@link ServiceReference#compareTo(Object)}, 1324 * and the <i>default</i> service to be returned from a call to the 1325 * {@link BundleContext#getServiceReference(Class)} or 1326 * {@link BundleContext#getServiceReference(String)} method. 1327 * 1328 * <p> 1329 * The default ranking is zero (0). A service with a ranking of 1330 * {@code Integer.MAX_VALUE} is very likely to be returned as the default 1331 * service, whereas a service with a ranking of {@code Integer.MIN_VALUE} is 1332 * very unlikely to be returned. 1333 * 1334 * <p> 1335 * If the supplied property value is not of type {@code Integer}, it is 1336 * deemed to have a ranking value of zero. 1337 */ 1338 String SERVICE_RANKING = "service.ranking"; 1339 1340 /** 1341 * Service property identifying a service's vendor. 1342 * 1343 * <p> 1344 * This property may be supplied in the properties {@code Dictionary} object 1345 * passed to the {@code BundleContext.registerService} method. 1346 */ 1347 String SERVICE_VENDOR = "service.vendor"; 1348 1349 /** 1350 * Service property identifying a service's description. 1351 * 1352 * <p> 1353 * This property may be supplied in the properties {@code Dictionary} object 1354 * passed to the {@code BundleContext.registerService} method. 1355 */ 1356 String SERVICE_DESCRIPTION = "service.description"; 1357 1358 /** 1359 * Service property identifying the {@link Bundle#getBundleId() bundle id} 1360 * of the {@link ServiceReference#getBundle() bundle registering the 1361 * service}. 1362 * 1363 * <p> 1364 * This property is set by the Framework when a service is registered. The 1365 * value of this property must be of type {@code Long}. 1366 * 1367 * @since 1.8 1368 */ 1369 String SERVICE_BUNDLEID = "service.bundleid"; 1370 1371 /** 1372 * Service property identifying a service's scope. 1373 * 1374 * <p> 1375 * This property is set by the Framework when a service is registered. If 1376 * the registered object implements {@link PrototypeServiceFactory}, then 1377 * the value of this service property will be {@link #SCOPE_PROTOTYPE}. 1378 * Otherwise, if the registered object implements {@link ServiceFactory}, 1379 * then the value of this service property will be {@link #SCOPE_BUNDLE}. 1380 * Otherwise, the value of this service property will be 1381 * {@link #SCOPE_SINGLETON}. 1382 * 1383 * @since 1.8 1384 * @see #SCOPE_SINGLETON 1385 * @see #SCOPE_BUNDLE 1386 * @see #SCOPE_PROTOTYPE 1387 */ 1388 String SERVICE_SCOPE = "service.scope"; 1389 1390 /** 1391 * Service scope is singleton. All bundles using the service receive the 1392 * same service object. 1393 * 1394 * @since 1.8 1395 * @see #SERVICE_SCOPE 1396 */ 1397 String SCOPE_SINGLETON = "singleton"; 1398 1399 /** 1400 * Service scope is bundle. Each bundle using the service receives a 1401 * customized service object. 1402 * 1403 * @since 1.8 1404 * @see #SERVICE_SCOPE 1405 */ 1406 String SCOPE_BUNDLE = "bundle"; 1407 1408 /** 1409 * Service scope is prototype. Each bundle using the service receives either 1410 * a customized service object or can request multiple customized service 1411 * objects via {@link ServiceObjects}. 1412 * 1413 * @since 1.8 1414 * @see #SERVICE_SCOPE 1415 */ 1416 String SCOPE_PROTOTYPE = "prototype"; 1417 1418 /** 1419 * Framework environment property identifying the Framework's universally 1420 * unique identifier (UUID). A UUID represents a 128-bit value. A new UUID 1421 * is generated by the {@link Framework#init()} method each time a framework 1422 * is initialized. The value of this property must conform to the UUID 1423 * string representation specified in <a 1424 * href="http://www.ietf.org/rfc/rfc4122.txt">RFC 4122</a>. 1425 * 1426 * <p> 1427 * The value of this property may be retrieved by calling the 1428 * {@code BundleContext.getProperty} method. 1429 * 1430 * @since 1.6 1431 */ 1432 String FRAMEWORK_UUID = "org.osgi.framework.uuid"; 1433 1434 /** 1435 * Service property identifying the configuration types supported by a 1436 * distribution provider. Registered by the distribution provider on one of 1437 * its services to indicate the supported configuration types. 1438 * 1439 * <p> 1440 * The value of this property must be of type {@code String}, 1441 * {@code String[]}, or {@code Collection} of {@code String}. 1442 * 1443 * @since 1.6 1444 * @see "Remote Services Specification" 1445 */ 1446 String REMOTE_CONFIGS_SUPPORTED = "remote.configs.supported"; 1447 1448 /** 1449 * Service property identifying the intents supported by a distribution 1450 * provider. Registered by the distribution provider on one of its services 1451 * to indicate the vocabulary of implemented intents. 1452 * 1453 * <p> 1454 * The value of this property must be of type {@code String}, 1455 * {@code String[]}, or {@code Collection} of {@code String}. 1456 * 1457 * @since 1.6 1458 * @see "Remote Services Specification" 1459 */ 1460 String REMOTE_INTENTS_SUPPORTED = "remote.intents.supported"; 1461 1462 /** 1463 * Service property identifying the configuration types that should be used 1464 * to export the service. Each configuration type represents the 1465 * configuration parameters for an endpoint. A distribution provider should 1466 * create an endpoint for each configuration type that it supports. 1467 * 1468 * <p> 1469 * This property may be supplied in the {@code properties} 1470 * {@code Dictionary} object passed to the 1471 * {@code BundleContext.registerService} method. The value of this property 1472 * must be of type {@code String}, {@code String[]}, or {@code Collection} 1473 * of {@code String}. 1474 * 1475 * @since 1.6 1476 * @see "Remote Services Specification" 1477 */ 1478 String SERVICE_EXPORTED_CONFIGS = "service.exported.configs"; 1479 1480 /** 1481 * Service property identifying the intents that the distribution provider 1482 * must implement to distribute the service. Intents listed in this property 1483 * are reserved for intents that are critical for the code to function 1484 * correctly, for example, ordering of messages. These intents should not be 1485 * configurable. 1486 * 1487 * <p> 1488 * This property may be supplied in the {@code properties} 1489 * {@code Dictionary} object passed to the 1490 * {@code BundleContext.registerService} method. The value of this property 1491 * must be of type {@code String}, {@code String[]}, or {@code Collection} 1492 * of {@code String}. 1493 * 1494 * @since 1.6 1495 * @see "Remote Services Specification" 1496 */ 1497 String SERVICE_EXPORTED_INTENTS = "service.exported.intents"; 1498 1499 /** 1500 * Service property identifying the extra intents that the distribution 1501 * provider must implement to distribute the service. This property is 1502 * merged with the {@code service.exported.intents} property before the 1503 * distribution provider interprets the listed intents; it has therefore the 1504 * same semantics but the property should be configurable so the 1505 * administrator can choose the intents based on the topology. Bundles 1506 * should therefore make this property configurable, for example through the 1507 * Configuration Admin service. 1508 * 1509 * <p> 1510 * This property may be supplied in the {@code properties} 1511 * {@code Dictionary} object passed to the 1512 * {@code BundleContext.registerService} method. The value of this property 1513 * must be of type {@code String}, {@code String[]}, or {@code Collection} 1514 * of {@code String}. 1515 * 1516 * @since 1.6 1517 * @see "Remote Services Specification" 1518 */ 1519 String SERVICE_EXPORTED_INTENTS_EXTRA = "service.exported.intents.extra"; 1520 1521 /** 1522 * Service property marking the service for export. It defines the 1523 * interfaces under which this service can be exported. This list must be a 1524 * subset of the types under which the service was registered. The single 1525 * value of an asterisk ({@code '*'} \u002A) indicates all the interface 1526 * types under which the service was registered excluding the non-interface 1527 * types. It is strongly recommended to only export interface types and not 1528 * concrete classes due to the complexity of creating proxies for some type 1529 * of concrete classes. 1530 * 1531 * <p> 1532 * This property may be supplied in the {@code properties} 1533 * {@code Dictionary} object passed to the 1534 * {@code BundleContext.registerService} method. The value of this property 1535 * must be of type {@code String}, {@code String[]}, or {@code Collection} 1536 * of {@code String}. 1537 * 1538 * @since 1.6 1539 * @see "Remote Services Specification" 1540 */ 1541 String SERVICE_EXPORTED_INTERFACES = "service.exported.interfaces"; 1542 1543 /** 1544 * Service property identifying the service as imported. This service 1545 * property must be set by a distribution provider to any value when it 1546 * registers the endpoint proxy as an imported service. A bundle can use 1547 * this property to filter out imported services. 1548 * 1549 * <p> 1550 * The value of this property may be of any type. 1551 * 1552 * @since 1.6 1553 * @see "Remote Services Specification" 1554 */ 1555 String SERVICE_IMPORTED = "service.imported"; 1556 1557 /** 1558 * Service property identifying the configuration types used to import the 1559 * service. Any associated properties for this configuration types must be 1560 * properly mapped to the importing system. For example, a URL in these 1561 * properties must point to a valid resource when used in the importing 1562 * framework. If multiple configuration types are listed in this property, 1563 * then they must be synonyms for exactly the same remote endpoint that is 1564 * used to export this service. 1565 * 1566 * <p> 1567 * The value of this property must be of type {@code String}, 1568 * {@code String[]}, or {@code Collection} of {@code String}. 1569 * 1570 * @since 1.6 1571 * @see "Remote Services Specification" 1572 * @see #SERVICE_EXPORTED_CONFIGS 1573 */ 1574 String SERVICE_IMPORTED_CONFIGS = "service.imported.configs"; 1575 1576 /** 1577 * Service property identifying the intents that this service implement. 1578 * This property has a dual purpose: 1579 * <ul> 1580 * <li>A bundle can use this service property to notify the distribution 1581 * provider that these intents are already implemented by the exported 1582 * service object.</li> 1583 * <li>A distribution provider must use this property to convey the combined 1584 * intents of: the exporting service, the intents that the exporting 1585 * distribution provider adds, and the intents that the importing 1586 * distribution provider adds.</li> 1587 * </ul> 1588 * 1589 * To export a service, a distribution provider must expand any qualified 1590 * intents. Both the exporting and importing distribution providers must 1591 * recognize all intents before a service can be distributed. 1592 * 1593 * <p> 1594 * The value of this property must be of type {@code String}, 1595 * {@code String[]}, or {@code Collection} of {@code String}. 1596 * 1597 * @since 1.6 1598 * @see "Remote Services Specification" 1599 */ 1600 String SERVICE_INTENTS = "service.intents"; 1601 1602 /** 1603 * Manifest header identifying the capabilities that the bundle offers to 1604 * provide to other bundles. 1605 * 1606 * <p> 1607 * The header value may be retrieved from the {@code Dictionary} object 1608 * returned by the {@code Bundle.getHeaders} method. 1609 * 1610 * @since 1.6 1611 */ 1612 String PROVIDE_CAPABILITY = "Provide-Capability"; 1613 1614 /** 1615 * Manifest header identifying the capabilities on which the bundle depends. 1616 * 1617 * <p> 1618 * The header value may be retrieved from the {@code Dictionary} object 1619 * returned by the {@code Bundle.getHeaders} method. 1620 * 1621 * @since 1.6 1622 */ 1623 String REQUIRE_CAPABILITY = "Require-Capability"; 1624 1625 /** 1626 * Manifest header directive identifying the effective time of the provided 1627 * capability. The default value is {@link #EFFECTIVE_RESOLVE resolve}. 1628 * 1629 * <p> 1630 * The directive value is encoded in the Provide-Capability manifest header 1631 * like: 1632 * 1633 * <pre> 1634 * Provide-Capability: com.acme.capability; effective:="resolve" 1635 * </pre> 1636 * 1637 * @see #PROVIDE_CAPABILITY 1638 * @see #EFFECTIVE_RESOLVE 1639 * @see #EFFECTIVE_ACTIVE 1640 * @since 1.6 1641 */ 1642 String EFFECTIVE_DIRECTIVE = "effective"; 1643 1644 /** 1645 * Manifest header directive value identifying a capability that is 1646 * effective at resolve time. Capabilities with an effective time of resolve 1647 * are the only capabilities which are processed by the resolver. 1648 * 1649 * <p> 1650 * The directive value is encoded in the Provide-Capability manifest header 1651 * like: 1652 * 1653 * <pre> 1654 * Provide-Capability: com.acme.capability; effective:="resolve" 1655 * </pre> 1656 * 1657 * @see #EFFECTIVE_DIRECTIVE 1658 * @since 1.6 1659 */ 1660 String EFFECTIVE_RESOLVE = "resolve"; 1661 1662 /** 1663 * Manifest header directive value identifying a capability that is 1664 * effective at active time. Capabilities with an effective time of active 1665 * are ignored by the resolver. 1666 * 1667 * <p> 1668 * The directive value is encoded in the Provide-Capability manifest header 1669 * like: 1670 * 1671 * <pre> 1672 * Provide-Capability: com.acme.capability; effective:="active" 1673 * </pre> 1674 * 1675 * @see #EFFECTIVE_DIRECTIVE 1676 * @since 1.6 1677 */ 1678 String EFFECTIVE_ACTIVE = "active"; 1679 1680 /** 1681 * Manifest header directive identifying the capability filter specified in 1682 * the Require-Capability manifest header. 1683 * 1684 * <p> 1685 * The directive value is encoded in the Require-Capability manifest header 1686 * like: 1687 * 1688 * <pre> 1689 * Require-Capability: com.acme.capability; filter:="(someattr=somevalue)" 1690 * </pre> 1691 * 1692 * @see #REQUIRE_CAPABILITY 1693 * @since 1.6 1694 */ 1695 String FILTER_DIRECTIVE = "filter"; 1696 1697 /** 1698 * Framework launching property identifying capabilities which the system 1699 * bundle must provide. 1700 * 1701 * <p> 1702 * If this property is not specified then the framework must calculate a 1703 * reasonable default value for the current execution environment. 1704 * 1705 * <p> 1706 * The value of this property may be retrieved by calling the 1707 * {@code BundleContext.getProperty} method. 1708 * 1709 * @since 1.6 1710 */ 1711 String FRAMEWORK_SYSTEMCAPABILITIES = "org.osgi.framework.system.capabilities"; 1712 1713 /** 1714 * Framework launching property identifying extra capabilities which the 1715 * system bundle must additionally provide. 1716 * 1717 * <p> 1718 * This property is useful for configuring extra system capabilities in 1719 * addition to the system capabilities calculated by the framework. 1720 * 1721 * <p> 1722 * The value of this property may be retrieved by calling the 1723 * {@code BundleContext.getProperty} method. 1724 * 1725 * @see #FRAMEWORK_SYSTEMCAPABILITIES 1726 * @since 1.6 1727 */ 1728 String FRAMEWORK_SYSTEMCAPABILITIES_EXTRA = "org.osgi.framework.system.capabilities.extra"; 1729 1730 /** 1731 * Framework launching property specifying whether multiple bundles having 1732 * the same {@link #BUNDLE_SYMBOLICNAME symbolic name} and 1733 * {@link #BUNDLE_VERSION version} may be installed. 1734 * 1735 * <p> 1736 * Default value is {@link #FRAMEWORK_BSNVERSION_MANAGED managed} in this 1737 * release of the specification. This default may change in a future 1738 * specification release. Therefore, code must not assume the default 1739 * behavior is {@code managed} and should interrogate the value of this 1740 * property to determine the behavior. 1741 * 1742 * <p> 1743 * The value of this property may be retrieved by calling the 1744 * {@code BundleContext.getProperty} method. 1745 * 1746 * @see #FRAMEWORK_BSNVERSION_MULTIPLE 1747 * @see #FRAMEWORK_BSNVERSION_SINGLE 1748 * @see #FRAMEWORK_BSNVERSION_MANAGED 1749 * @since 1.6 1750 */ 1751 String FRAMEWORK_BSNVERSION = "org.osgi.framework.bsnversion"; 1752 1753 /** 1754 * Specifies the framework will allow multiple bundles to be installed 1755 * having the same symbolic name and version. 1756 * 1757 * @since 1.6 1758 * @see #FRAMEWORK_BSNVERSION 1759 */ 1760 String FRAMEWORK_BSNVERSION_MULTIPLE = "multiple"; 1761 1762 /** 1763 * Specifies the framework will only allow a single bundle to be installed 1764 * for a given symbolic name and version. It will be an error to install a 1765 * bundle or update a bundle to have the same symbolic name and version as 1766 * another installed bundle. 1767 * 1768 * @since 1.6 1769 * @see #FRAMEWORK_BSNVERSION 1770 * @see BundleException#DUPLICATE_BUNDLE_ERROR 1771 */ 1772 String FRAMEWORK_BSNVERSION_SINGLE = "single"; 1773 1774 /** 1775 * Specifies the framework must consult the {@link CollisionHook bundle 1776 * collision hook} services to determine if it will be an error to install a 1777 * bundle or update a bundle to have the same symbolic name and version as 1778 * another installed bundle. If no bundle collision hook services are 1779 * registered, then it will be an error to install a bundle or update a 1780 * bundle to have the same symbolic name and version as another installed 1781 * bundle. 1782 * 1783 * @since 1.7 1784 * @see #FRAMEWORK_BSNVERSION 1785 * @see BundleException#DUPLICATE_BUNDLE_ERROR 1786 */ 1787 String FRAMEWORK_BSNVERSION_MANAGED = "managed"; 1788 1789 /** 1790 * Manifest header identifying the bundle's icon URLs. 1791 * 1792 * <p> 1793 * The header value may be retrieved from the {@code Dictionary} object 1794 * returned by the {@code Bundle.getHeaders} method. 1795 * 1796 * @since 1.8 1797 */ 1798 String BUNDLE_ICON = "Bundle-Icon"; 1799 1800 /** 1801 * Manifest header identifying the bundle's license information. 1802 * 1803 * <p> 1804 * The header value may be retrieved from the {@code Dictionary} object 1805 * returned by the {@code Bundle.getHeaders} method. 1806 * 1807 * @since 1.8 1808 */ 1809 String BUNDLE_LICENSE = "Bundle-License"; 1810 1811 /** 1812 * Manifest header identifying the bundle's developers. 1813 * <p> 1814 * The header value may be retrieved from the {@code Dictionary} object 1815 * returned by the {@code Bundle.getHeaders} method. 1816 * 1817 * @since 1.9 1818 */ 1819 String BUNDLE_DEVELOPERS = "Bundle-Developers"; 1820 1821 /** 1822 * Manifest header identifying the bundle's software configuration 1823 * management system. 1824 * <p> 1825 * The header value may be retrieved from the {@code Dictionary} object 1826 * returned by the {@code Bundle.getHeaders} method. 1827 * 1828 * @since 1.9 1829 */ 1830 String BUNDLE_SCM = "Bundle-SCM"; 1831 1832 /** 1833 * Service property identifying the monotonically increasing change count of 1834 * a service. 1835 * <p> 1836 * A service may optional provide this property to indicate there has been a 1837 * change in some data provided by the service. The change count must be 1838 * incremented with a positive value every time the data provided by the 1839 * service is changed. The service announces the modified change count by 1840 * updating its service properties with the new value for this service 1841 * property. 1842 * <p> 1843 * The value of this property must be of type {@code Long}. 1844 * 1845 * @since 1.9 1846 */ 1847 String SERVICE_CHANGECOUNT = "service.changecount"; 1848 1849 /** 1850 * Intent supported by Remote Services implementations that support Basic 1851 * Remote Services as defined for the {@code osgi.basic} intent. 1852 * 1853 * @since 1.9 1854 */ 1855 String INTENT_BASIC = "osgi.basic"; 1856 1857 /** 1858 * Intent supported by Remote Service implementations that support 1859 * Asynchronous Remote Services as defined for the {@code osgi.async} 1860 * intent. 1861 * 1862 * @since 1.9 1863 */ 1864 String INTENT_ASYNC = "osgi.async"; 1865 1866 /** 1867 * Intent supported by Remote Service implementation that provide 1868 * confidential communications as defined for the {@code osgi.confidential} 1869 * intent. 1870 * 1871 * @since 1.9 1872 */ 1873 String INTENT_CONFIDENTIAL = "osgi.confidential"; 1874 1875 /** 1876 * Intent supported by Remote Service implementations that provide private 1877 * communications as defined for the {@code osgi.private} intent. 1878 * 1879 * @since 1.9 1880 */ 1881 String INTENT_PRIVATE = "osgi.private"; 1882 } 1883