Mercurial > projects > dwt2
comparison org.eclipse.osgi/osgi/src/org/osgi/framework/Bundle.d @ 105:bbe49769ec18
...
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sun, 08 Nov 2009 12:42:30 +0100 |
parents | 0628aaa2996c |
children |
comparison
equal
deleted
inserted
replaced
104:88652073d1c2 | 105:bbe49769ec18 |
---|---|
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
15 * See the License for the specific language governing permissions and | 15 * See the License for the specific language governing permissions and |
16 * limitations under the License. | 16 * limitations under the License. |
17 */ | 17 */ |
18 | 18 |
19 // Port to the D programming language: | |
20 // Frank Benoit <benoit@tionex.de> | |
19 module org.osgi.framework.Bundle; | 21 module org.osgi.framework.Bundle; |
20 | 22 |
21 import java.lang.all; | 23 import java.lang.all; |
22 | 24 |
23 // import java.io.IOException; | 25 import org.osgi.framework.BundleException; // packageimport |
24 // import java.io.InputStream; | 26 import org.osgi.framework.ServiceReference; // packageimport |
25 // import java.net.URL; | 27 import org.osgi.framework.BundleContext; // packageimport |
26 // import java.util.Dictionary; | 28 |
27 // import java.util.Enumeration; | 29 import java.io.IOException; |
30 import java.io.InputStream; | |
31 import java.net.URL; | |
32 import java.util.Dictionary; | |
33 import java.util.Enumeration; | |
28 | 34 |
29 /** | 35 /** |
30 * An installed bundle in the Framework. | 36 * An installed bundle in the Framework. |
31 * | 37 * |
32 * <p> | 38 * <p> |
79 * <code>Bundle</code> object may still be available and used for | 85 * <code>Bundle</code> object may still be available and used for |
80 * introspection. | 86 * introspection. |
81 * <p> | 87 * <p> |
82 * The value of <code>UNINSTALLED</code> is 0x00000001. | 88 * The value of <code>UNINSTALLED</code> is 0x00000001. |
83 */ | 89 */ |
84 public static const int UNINSTALLED = 0x00000001; | 90 public static final int UNINSTALLED = 0x00000001; |
85 | 91 |
86 /** | 92 /** |
87 * The bundle is installed but not yet resolved. | 93 * The bundle is installed but not yet resolved. |
88 * | 94 * |
89 * <p> | 95 * <p> |
95 * code dependencies and move the bundle to the <code>RESOLVED</code> | 101 * code dependencies and move the bundle to the <code>RESOLVED</code> |
96 * state. | 102 * state. |
97 * <p> | 103 * <p> |
98 * The value of <code>INSTALLED</code> is 0x00000002. | 104 * The value of <code>INSTALLED</code> is 0x00000002. |
99 */ | 105 */ |
100 public static const int INSTALLED = 0x00000002; | 106 public static final int INSTALLED = 0x00000002; |
101 | 107 |
102 /** | 108 /** |
103 * The bundle is resolved and is able to be started. | 109 * The bundle is resolved and is able to be started. |
104 * | 110 * |
105 * <p> | 111 * <p> |
122 * <code>RESOLVED</code> state before it can be started. The Framework may | 128 * <code>RESOLVED</code> state before it can be started. The Framework may |
123 * attempt to resolve a bundle at any time. | 129 * attempt to resolve a bundle at any time. |
124 * <p> | 130 * <p> |
125 * The value of <code>RESOLVED</code> is 0x00000004. | 131 * The value of <code>RESOLVED</code> is 0x00000004. |
126 */ | 132 */ |
127 public static const int RESOLVED = 0x00000004; | 133 public static final int RESOLVED = 0x00000004; |
128 | 134 |
129 /** | 135 /** |
130 * The bundle is in the process of starting. | 136 * The bundle is in the process of starting. |
131 * | 137 * |
132 * <p> | 138 * <p> |
142 * bundle may remain in this state for some time until the activation is | 148 * bundle may remain in this state for some time until the activation is |
143 * triggered. | 149 * triggered. |
144 * <p> | 150 * <p> |
145 * The value of <code>STARTING</code> is 0x00000008. | 151 * The value of <code>STARTING</code> is 0x00000008. |
146 */ | 152 */ |
147 public static const int STARTING = 0x00000008; | 153 public static final int STARTING = 0x00000008; |
148 | 154 |
149 /** | 155 /** |
150 * The bundle is in the process of stopping. | 156 * The bundle is in the process of stopping. |
151 * | 157 * |
152 * <p> | 158 * <p> |
156 * <code>BundleActivator.stop</code> method completes the bundle is | 162 * <code>BundleActivator.stop</code> method completes the bundle is |
157 * stopped and must move to the <code>RESOLVED</code> state. | 163 * stopped and must move to the <code>RESOLVED</code> state. |
158 * <p> | 164 * <p> |
159 * The value of <code>STOPPING</code> is 0x00000010. | 165 * The value of <code>STOPPING</code> is 0x00000010. |
160 */ | 166 */ |
161 public static const int STOPPING = 0x00000010; | 167 public static final int STOPPING = 0x00000010; |
162 | 168 |
163 /** | 169 /** |
164 * The bundle is now running. | 170 * The bundle is now running. |
165 * | 171 * |
166 * <p> | 172 * <p> |
167 * A bundle is in the <code>ACTIVE</code> state when it has been | 173 * A bundle is in the <code>ACTIVE</code> state when it has been |
168 * successfully started and activated. | 174 * successfully started and activated. |
169 * <p> | 175 * <p> |
170 * The value of <code>ACTIVE</code> is 0x00000020. | 176 * The value of <code>ACTIVE</code> is 0x00000020. |
171 */ | 177 */ |
172 public static const int ACTIVE = 0x00000020; | 178 public static final int ACTIVE = 0x00000020; |
173 | 179 |
174 /** | 180 /** |
175 * The bundle start operation is transient and the persistent autostart | 181 * The bundle start operation is transient and the persistent autostart |
176 * setting of the bundle is not modified. | 182 * setting of the bundle is not modified. |
177 * | 183 * |
182 * modified. | 188 * modified. |
183 * | 189 * |
184 * @since 1.4 | 190 * @since 1.4 |
185 * @see #start(int) | 191 * @see #start(int) |
186 */ | 192 */ |
187 public static const int START_TRANSIENT = 0x00000001; | 193 public static final int START_TRANSIENT = 0x00000001; |
188 | 194 |
189 /** | 195 /** |
190 * The bundle start operation must activate the bundle according to the | 196 * The bundle start operation must activate the bundle according to the |
191 * bundle's declared | 197 * bundle's declared |
192 * {@link Constants#BUNDLE_ACTIVATIONPOLICY activation policy}. | 198 * {@link Constants#BUNDLE_ACTIVATIONPOLICY activation policy}. |
198 * | 204 * |
199 * @since 1.4 | 205 * @since 1.4 |
200 * @see Constants#BUNDLE_ACTIVATIONPOLICY | 206 * @see Constants#BUNDLE_ACTIVATIONPOLICY |
201 * @see #start(int) | 207 * @see #start(int) |
202 */ | 208 */ |
203 public static const int START_ACTIVATION_POLICY = 0x00000002; | 209 public static final int START_ACTIVATION_POLICY = 0x00000002; |
204 | 210 |
205 /** | 211 /** |
206 * The bundle stop is transient and the persistent autostart setting of the | 212 * The bundle stop is transient and the persistent autostart setting of the |
207 * bundle is not modified. | 213 * bundle is not modified. |
208 * | 214 * |
349 * @throws java.lang.SecurityException If the caller does not have the | 355 * @throws java.lang.SecurityException If the caller does not have the |
350 * appropriate <code>AdminPermission[this,EXECUTE]</code>, and | 356 * appropriate <code>AdminPermission[this,EXECUTE]</code>, and |
351 * the Java Runtime Environment supports permissions. | 357 * the Java Runtime Environment supports permissions. |
352 * @since 1.4 | 358 * @since 1.4 |
353 */ | 359 */ |
354 public void start(int options); | 360 public void start(int options) ; |
355 | 361 |
356 /** | 362 /** |
357 * Starts this bundle with no options. | 363 * Starts this bundle with no options. |
358 * | 364 * |
359 * <p> | 365 * <p> |
368 * @throws java.lang.SecurityException If the caller does not have the | 374 * @throws java.lang.SecurityException If the caller does not have the |
369 * appropriate <code>AdminPermission[this,EXECUTE]</code>, and | 375 * appropriate <code>AdminPermission[this,EXECUTE]</code>, and |
370 * the Java Runtime Environment supports permissions. | 376 * the Java Runtime Environment supports permissions. |
371 * @see #start(int) | 377 * @see #start(int) |
372 */ | 378 */ |
373 public void start(); | 379 public void start() ; |
374 | 380 |
375 /** | 381 /** |
376 * Stops this bundle. | 382 * Stops this bundle. |
377 * | 383 * |
378 * <p> | 384 * <p> |
446 * @throws java.lang.SecurityException If the caller does not have the | 452 * @throws java.lang.SecurityException If the caller does not have the |
447 * appropriate <code>AdminPermission[this,EXECUTE]</code>, and | 453 * appropriate <code>AdminPermission[this,EXECUTE]</code>, and |
448 * the Java Runtime Environment supports permissions. | 454 * the Java Runtime Environment supports permissions. |
449 * @since 1.4 | 455 * @since 1.4 |
450 */ | 456 */ |
451 public void stop(int options); | 457 public void stop(int options) ; |
452 | 458 |
453 /** | 459 /** |
454 * Stops this bundle with no options. | 460 * Stops this bundle with no options. |
455 * | 461 * |
456 * <p> | 462 * <p> |
463 * @throws java.lang.SecurityException If the caller does not have the | 469 * @throws java.lang.SecurityException If the caller does not have the |
464 * appropriate <code>AdminPermission[this,EXECUTE]</code>, and | 470 * appropriate <code>AdminPermission[this,EXECUTE]</code>, and |
465 * the Java Runtime Environment supports permissions. | 471 * the Java Runtime Environment supports permissions. |
466 * @see #start(int) | 472 * @see #start(int) |
467 */ | 473 */ |
468 public void stop(); | 474 public void stop() ; |
469 | 475 |
470 /** | 476 /** |
471 * Updates this bundle. | 477 * Updates this bundle. |
472 * | 478 * |
473 * <p> | 479 * <p> |
550 * both the current bundle and the updated bundle, and the Java | 556 * both the current bundle and the updated bundle, and the Java |
551 * Runtime Environment supports permissions. | 557 * Runtime Environment supports permissions. |
552 * @see #stop() | 558 * @see #stop() |
553 * @see #start() | 559 * @see #start() |
554 */ | 560 */ |
555 public void update(); | 561 public void update() ; |
556 | 562 |
557 // /** | 563 /** |
558 // * Updates this bundle from an <code>InputStream</code>. | 564 * Updates this bundle from an <code>InputStream</code>. |
559 // * | 565 * |
560 // * <p> | 566 * <p> |
561 // * This method performs all the steps listed in <code>Bundle.update()</code>, | 567 * This method performs all the steps listed in <code>Bundle.update()</code>, |
562 // * except the new version of this bundle must be read from the supplied | 568 * except the new version of this bundle must be read from the supplied |
563 // * <code>InputStream</code>, rather than a <code>URL</code>. | 569 * <code>InputStream</code>, rather than a <code>URL</code>. |
564 // * <p> | 570 * <p> |
565 // * This method must always close the <code>InputStream</code> when it is | 571 * This method must always close the <code>InputStream</code> when it is |
566 // * done, even if an exception is thrown. | 572 * done, even if an exception is thrown. |
567 // * | 573 * |
568 // * @param in The <code>InputStream</code> from which to read the new | 574 * @param in The <code>InputStream</code> from which to read the new |
569 // * bundle. | 575 * bundle. |
570 // * @throws BundleException If the provided stream cannot be read or the | 576 * @throws BundleException If the provided stream cannot be read or the |
571 // * update fails. | 577 * update fails. |
572 // * @throws java.lang.IllegalStateException If this bundle has been | 578 * @throws java.lang.IllegalStateException If this bundle has been |
573 // * uninstalled or this bundle tries to change its own state. | 579 * uninstalled or this bundle tries to change its own state. |
574 // * @throws java.lang.SecurityException If the caller does not have the | 580 * @throws java.lang.SecurityException If the caller does not have the |
575 // * appropriate <code>AdminPermission[this,LIFECYCLE]</code> for | 581 * appropriate <code>AdminPermission[this,LIFECYCLE]</code> for |
576 // * both the current bundle and the updated bundle, and the Java | 582 * both the current bundle and the updated bundle, and the Java |
577 // * Runtime Environment supports permissions. | 583 * Runtime Environment supports permissions. |
578 // * @see #update() | 584 * @see #update() |
579 // */ | 585 */ |
580 // public void update(InputStream in_); | 586 public void update(InputStream in_) ; |
581 // | 587 |
582 // /** | 588 /** |
583 // * Uninstalls this bundle. | 589 * Uninstalls this bundle. |
584 // * | 590 * |
585 // * <p> | 591 * <p> |
586 // * This method causes the Framework to notify other bundles that this bundle | 592 * This method causes the Framework to notify other bundles that this bundle |
587 // * is being uninstalled, and then puts this bundle into the | 593 * is being uninstalled, and then puts this bundle into the |
588 // * <code>UNINSTALLED</code> state. The Framework must remove any resources | 594 * <code>UNINSTALLED</code> state. The Framework must remove any resources |
589 // * related to this bundle that it is able to remove. | 595 * related to this bundle that it is able to remove. |
590 // * | 596 * |
591 // * <p> | 597 * <p> |
592 // * If this bundle has exported any packages, the Framework must continue to | 598 * If this bundle has exported any packages, the Framework must continue to |
593 // * make these packages available to their importing bundles until the | 599 * make these packages available to their importing bundles until the |
594 // * <code>PackageAdmin.refreshPackages</code> method has been called or the | 600 * <code>PackageAdmin.refreshPackages</code> method has been called or the |
595 // * Framework is relaunched. | 601 * Framework is relaunched. |
596 // * | 602 * |
597 // * <p> | 603 * <p> |
598 // * The following steps are required to uninstall a bundle: | 604 * The following steps are required to uninstall a bundle: |
599 // * <ol> | 605 * <ol> |
600 // * <li>If this bundle's state is <code>UNINSTALLED</code> then an | 606 * <li>If this bundle's state is <code>UNINSTALLED</code> then an |
601 // * <code>IllegalStateException</code> is thrown. | 607 * <code>IllegalStateException</code> is thrown. |
602 // * | 608 * |
603 // * <li>If this bundle's state is <code>ACTIVE</code>, | 609 * <li>If this bundle's state is <code>ACTIVE</code>, |
604 // * <code>STARTING</code> or <code>STOPPING</code>, this bundle is | 610 * <code>STARTING</code> or <code>STOPPING</code>, this bundle is |
605 // * stopped as described in the <code>Bundle.stop</code> method. If | 611 * stopped as described in the <code>Bundle.stop</code> method. If |
606 // * <code>Bundle.stop</code> throws an exception, a Framework event of type | 612 * <code>Bundle.stop</code> throws an exception, a Framework event of type |
607 // * {@link FrameworkEvent#ERROR} is fired containing the exception. | 613 * {@link FrameworkEvent#ERROR} is fired containing the exception. |
608 // * | 614 * |
609 // * <li>This bundle's state is set to <code>UNINSTALLED</code>. | 615 * <li>This bundle's state is set to <code>UNINSTALLED</code>. |
610 // * | 616 * |
611 // * <li>A bundle event of type {@link BundleEvent#UNINSTALLED} is fired. | 617 * <li>A bundle event of type {@link BundleEvent#UNINSTALLED} is fired. |
612 // * | 618 * |
613 // * <li>This bundle and any persistent storage area provided for this bundle | 619 * <li>This bundle and any persistent storage area provided for this bundle |
614 // * by the Framework are removed. | 620 * by the Framework are removed. |
615 // * </ol> | 621 * </ol> |
616 // * | 622 * |
617 // * <b>Preconditions </b> | 623 * <b>Preconditions </b> |
618 // * <ul> | 624 * <ul> |
619 // * <li><code>getState()</code> not in {<code>UNINSTALLED</code>}. | 625 * <li><code>getState()</code> not in {<code>UNINSTALLED</code>}. |
620 // * </ul> | 626 * </ul> |
621 // * <b>Postconditions, no exceptions thrown </b> | 627 * <b>Postconditions, no exceptions thrown </b> |
622 // * <ul> | 628 * <ul> |
623 // * <li><code>getState()</code> in {<code>UNINSTALLED</code>}. | 629 * <li><code>getState()</code> in {<code>UNINSTALLED</code>}. |
624 // * <li>This bundle has been uninstalled. | 630 * <li>This bundle has been uninstalled. |
625 // * </ul> | 631 * </ul> |
626 // * <b>Postconditions, when an exception is thrown </b> | 632 * <b>Postconditions, when an exception is thrown </b> |
627 // * <ul> | 633 * <ul> |
628 // * <li><code>getState()</code> not in {<code>UNINSTALLED</code>}. | 634 * <li><code>getState()</code> not in {<code>UNINSTALLED</code>}. |
629 // * <li>This Bundle has not been uninstalled. | 635 * <li>This Bundle has not been uninstalled. |
630 // * </ul> | 636 * </ul> |
631 // * | 637 * |
632 // * @throws BundleException If the uninstall failed. This can occur if | 638 * @throws BundleException If the uninstall failed. This can occur if |
633 // * another thread is attempting to change this bundle's state and | 639 * another thread is attempting to change this bundle's state and |
634 // * does not complete in a timely manner. | 640 * does not complete in a timely manner. |
635 // * @throws java.lang.IllegalStateException If this bundle has been | 641 * @throws java.lang.IllegalStateException If this bundle has been |
636 // * uninstalled or this bundle tries to change its own state. | 642 * uninstalled or this bundle tries to change its own state. |
637 // * @throws java.lang.SecurityException If the caller does not have the | 643 * @throws java.lang.SecurityException If the caller does not have the |
638 // * appropriate <code>AdminPermission[this,LIFECYCLE]</code>, and | 644 * appropriate <code>AdminPermission[this,LIFECYCLE]</code>, and |
639 // * the Java Runtime Environment supports permissions. | 645 * the Java Runtime Environment supports permissions. |
640 // * @see #stop() | 646 * @see #stop() |
641 // */ | 647 */ |
642 // public void uninstall(); | 648 public void uninstall() ; |
643 // | 649 |
644 // /** | 650 /** |
645 // * Returns this bundle's Manifest headers and values. This method returns | 651 * Returns this bundle's Manifest headers and values. This method returns |
646 // * all the Manifest headers and values from the main section of this | 652 * all the Manifest headers and values from the main section of this |
647 // * bundle's Manifest file; that is, all lines prior to the first blank line. | 653 * bundle's Manifest file; that is, all lines prior to the first blank line. |
648 // * | 654 * |
649 // * <p> | 655 * <p> |
650 // * Manifest header names are case-insensitive. The methods of the returned | 656 * Manifest header names are case-insensitive. The methods of the returned |
651 // * <code>Dictionary</code> object must operate on header names in a | 657 * <code>Dictionary</code> object must operate on header names in a |
652 // * case-insensitive manner. | 658 * case-insensitive manner. |
653 // * | 659 * |
654 // * If a Manifest header value starts with "%", it must be | 660 * If a Manifest header value starts with "%", it must be |
655 // * localized according to the default locale. | 661 * localized according to the default locale. |
656 // * | 662 * |
657 // * <p> | 663 * <p> |
658 // * For example, the following Manifest headers and values are included if | 664 * For example, the following Manifest headers and values are included if |
659 // * they are present in the Manifest file: | 665 * they are present in the Manifest file: |
660 // * | 666 * |
661 // * <pre> | 667 * <pre> |
662 // * Bundle-Name | 668 * Bundle-Name |
663 // * Bundle-Vendor | 669 * Bundle-Vendor |
664 // * Bundle-Version | 670 * Bundle-Version |
665 // * Bundle-Description | 671 * Bundle-Description |
666 // * Bundle-DocURL | 672 * Bundle-DocURL |
667 // * Bundle-ContactAddress | 673 * Bundle-ContactAddress |
668 // * </pre> | 674 * </pre> |
669 // * | 675 * |
670 // * <p> | 676 * <p> |
671 // * This method must continue to return Manifest header information while | 677 * This method must continue to return Manifest header information while |
672 // * this bundle is in the <code>UNINSTALLED</code> state. | 678 * this bundle is in the <code>UNINSTALLED</code> state. |
673 // * | 679 * |
674 // * @return A <code>Dictionary</code> object containing this bundle's | 680 * @return A <code>Dictionary</code> object containing this bundle's |
675 // * Manifest headers and values. | 681 * Manifest headers and values. |
676 // * | 682 * |
677 // * @throws java.lang.SecurityException If the caller does not have the | 683 * @throws java.lang.SecurityException If the caller does not have the |
678 // * appropriate <code>AdminPermission[this,METADATA]</code>, and | 684 * appropriate <code>AdminPermission[this,METADATA]</code>, and |
679 // * the Java Runtime Environment supports permissions. | 685 * the Java Runtime Environment supports permissions. |
680 // * | 686 * |
681 // * @see Constants#BUNDLE_LOCALIZATION | 687 * @see Constants#BUNDLE_LOCALIZATION |
682 // */ | 688 */ |
683 // public Dictionary getHeaders(); | 689 public Dictionary getHeaders(); |
684 // | 690 |
685 // /** | 691 /** |
686 // * Returns this bundle's unique identifier. This bundle is assigned a unique | 692 * Returns this bundle's unique identifier. This bundle is assigned a unique |
687 // * identifier by the Framework when it was installed in the OSGi | 693 * identifier by the Framework when it was installed in the OSGi |
688 // * environment. | 694 * environment. |
689 // * | 695 * |
690 // * <p> | 696 * <p> |
691 // * A bundle's unique identifier has the following attributes: | 697 * A bundle's unique identifier has the following attributes: |
692 // * <ul> | 698 * <ul> |
693 // * <li>Is unique and persistent. | 699 * <li>Is unique and persistent. |
694 // * <li>Is a <code>long</code>. | 700 * <li>Is a <code>long</code>. |
695 // * <li>Its value is not reused for another bundle, even after a bundle is | 701 * <li>Its value is not reused for another bundle, even after a bundle is |
696 // * uninstalled. | 702 * uninstalled. |
697 // * <li>Does not change while a bundle remains installed. | 703 * <li>Does not change while a bundle remains installed. |
698 // * <li>Does not change when a bundle is updated. | 704 * <li>Does not change when a bundle is updated. |
699 // * </ul> | 705 * </ul> |
700 // * | 706 * |
701 // * <p> | 707 * <p> |
702 // * This method must continue to return this bundle's unique identifier while | 708 * This method must continue to return this bundle's unique identifier while |
703 // * this bundle is in the <code>UNINSTALLED</code> state. | 709 * this bundle is in the <code>UNINSTALLED</code> state. |
704 // * | 710 * |
705 // * @return The unique identifier of this bundle. | 711 * @return The unique identifier of this bundle. |
706 // */ | 712 */ |
707 // public long getBundleId(); | 713 public long getBundleId(); |
708 // | 714 |
709 // /** | 715 /** |
710 // * Returns this bundle's location identifier. | 716 * Returns this bundle's location identifier. |
711 // * | 717 * |
712 // * <p> | 718 * <p> |
713 // * The location identifier is the location passed to | 719 * The location identifier is the location passed to |
714 // * <code>BundleContext.installBundle</code> when a bundle is installed. | 720 * <code>BundleContext.installBundle</code> when a bundle is installed. |
715 // * The location identifier does not change while this bundle remains | 721 * The location identifier does not change while this bundle remains |
716 // * installed, even if this bundle is updated. | 722 * installed, even if this bundle is updated. |
717 // * | 723 * |
718 // * <p> | 724 * <p> |
719 // * This method must continue to return this bundle's location identifier | 725 * This method must continue to return this bundle's location identifier |
720 // * while this bundle is in the <code>UNINSTALLED</code> state. | 726 * while this bundle is in the <code>UNINSTALLED</code> state. |
721 // * | 727 * |
722 // * @return The string representation of this bundle's location identifier. | 728 * @return The string representation of this bundle's location identifier. |
723 // * @throws java.lang.SecurityException If the caller does not have the | 729 * @throws java.lang.SecurityException If the caller does not have the |
724 // * appropriate <code>AdminPermission[this,METADATA]</code>, and | 730 * appropriate <code>AdminPermission[this,METADATA]</code>, and |
725 // * the Java Runtime Environment supports permissions. | 731 * the Java Runtime Environment supports permissions. |
726 // */ | 732 */ |
727 // public String getLocation(); | 733 public String getLocation(); |
728 // | 734 |
729 // /** | 735 /** |
730 // * Returns this bundle's <code>ServiceReference</code> list for all | 736 * Returns this bundle's <code>ServiceReference</code> list for all |
731 // * services it has registered or <code>null</code> if this bundle has no | 737 * services it has registered or <code>null</code> if this bundle has no |
732 // * registered services. | 738 * registered services. |
733 // * | 739 * |
734 // * <p> | 740 * <p> |
735 // * If the Java runtime supports permissions, a <code>ServiceReference</code> | 741 * If the Java runtime supports permissions, a <code>ServiceReference</code> |
736 // * object to a service is included in the returned list only if the caller | 742 * object to a service is included in the returned list only if the caller |
737 // * has the <code>ServicePermission</code> to get the service using at | 743 * has the <code>ServicePermission</code> to get the service using at |
738 // * least one of the named classes the service was registered under. | 744 * least one of the named classes the service was registered under. |
739 // * | 745 * |
740 // * <p> | 746 * <p> |
741 // * The list is valid at the time of the call to this method, however, as the | 747 * The list is valid at the time of the call to this method, however, as the |
742 // * Framework is a very dynamic environment, services can be modified or | 748 * Framework is a very dynamic environment, services can be modified or |
743 // * unregistered at anytime. | 749 * unregistered at anytime. |
744 // * | 750 * |
745 // * @return An array of <code>ServiceReference</code> objects or | 751 * @return An array of <code>ServiceReference</code> objects or |
746 // * <code>null</code>. | 752 * <code>null</code>. |
747 // * @throws java.lang.IllegalStateException If this bundle has been | 753 * @throws java.lang.IllegalStateException If this bundle has been |
748 // * uninstalled. | 754 * uninstalled. |
749 // * @see ServiceRegistration | 755 * @see ServiceRegistration |
750 // * @see ServiceReference | 756 * @see ServiceReference |
751 // * @see ServicePermission | 757 * @see ServicePermission |
752 // */ | 758 */ |
753 // public ServiceReference[] getRegisteredServices(); | 759 public ServiceReference[] getRegisteredServices(); |
754 // | 760 |
755 // /** | 761 /** |
756 // * Returns this bundle's <code>ServiceReference</code> list for all | 762 * Returns this bundle's <code>ServiceReference</code> list for all |
757 // * services it is using or returns <code>null</code> if this bundle is not | 763 * services it is using or returns <code>null</code> if this bundle is not |
758 // * using any services. A bundle is considered to be using a service if its | 764 * using any services. A bundle is considered to be using a service if its |
759 // * use count for that service is greater than zero. | 765 * use count for that service is greater than zero. |
760 // * | 766 * |
761 // * <p> | 767 * <p> |
762 // * If the Java Runtime Environment supports permissions, a | 768 * If the Java Runtime Environment supports permissions, a |
763 // * <code>ServiceReference</code> object to a service is included in the | 769 * <code>ServiceReference</code> object to a service is included in the |
764 // * returned list only if the caller has the <code>ServicePermission</code> | 770 * returned list only if the caller has the <code>ServicePermission</code> |
765 // * to get the service using at least one of the named classes the service | 771 * to get the service using at least one of the named classes the service |
766 // * was registered under. | 772 * was registered under. |
767 // * <p> | 773 * <p> |
768 // * The list is valid at the time of the call to this method, however, as the | 774 * The list is valid at the time of the call to this method, however, as the |
769 // * Framework is a very dynamic environment, services can be modified or | 775 * Framework is a very dynamic environment, services can be modified or |
770 // * unregistered at anytime. | 776 * unregistered at anytime. |
771 // * | 777 * |
772 // * @return An array of <code>ServiceReference</code> objects or | 778 * @return An array of <code>ServiceReference</code> objects or |
773 // * <code>null</code>. | 779 * <code>null</code>. |
774 // * @throws java.lang.IllegalStateException If this bundle has been | 780 * @throws java.lang.IllegalStateException If this bundle has been |
775 // * uninstalled. | 781 * uninstalled. |
776 // * @see ServiceReference | 782 * @see ServiceReference |
777 // * @see ServicePermission | 783 * @see ServicePermission |
778 // */ | 784 */ |
779 // public ServiceReference[] getServicesInUse(); | 785 public ServiceReference[] getServicesInUse(); |
780 // | 786 |
781 // /** | 787 /** |
782 // * Determines if this bundle has the specified permissions. | 788 * Determines if this bundle has the specified permissions. |
783 // * | 789 * |
784 // * <p> | 790 * <p> |
785 // * If the Java Runtime Environment does not support permissions, this method | 791 * If the Java Runtime Environment does not support permissions, this method |
786 // * always returns <code>true</code>. | 792 * always returns <code>true</code>. |
787 // * <p> | 793 * <p> |
788 // * <code>permission</code> is of type <code>Object</code> to avoid | 794 * <code>permission</code> is of type <code>Object</code> to avoid |
789 // * referencing the <code>java.security.Permission</code> class directly. | 795 * referencing the <code>java.security.Permission</code> class directly. |
790 // * This is to allow the Framework to be implemented in Java environments | 796 * This is to allow the Framework to be implemented in Java environments |
791 // * which do not support permissions. | 797 * which do not support permissions. |
792 // * | 798 * |
793 // * <p> | 799 * <p> |
794 // * If the Java Runtime Environment does support permissions, this bundle and | 800 * If the Java Runtime Environment does support permissions, this bundle and |
795 // * all its resources including embedded JAR files, belong to the same | 801 * all its resources including embedded JAR files, belong to the same |
796 // * <code>java.security.ProtectionDomain</code>; that is, they must share | 802 * <code>java.security.ProtectionDomain</code>; that is, they must share |
797 // * the same set of permissions. | 803 * the same set of permissions. |
798 // * | 804 * |
799 // * @param permission The permission to verify. | 805 * @param permission The permission to verify. |
800 // * | 806 * |
801 // * @return <code>true</code> if this bundle has the specified permission | 807 * @return <code>true</code> if this bundle has the specified permission |
802 // * or the permissions possessed by this bundle imply the specified | 808 * or the permissions possessed by this bundle imply the specified |
803 // * permission; <code>false</code> if this bundle does not have the | 809 * permission; <code>false</code> if this bundle does not have the |
804 // * specified permission or <code>permission</code> is not an | 810 * specified permission or <code>permission</code> is not an |
805 // * <code>instanceof</code> <code>java.security.Permission</code>. | 811 * <code>instanceof</code> <code>java.security.Permission</code>. |
806 // * | 812 * |
807 // * @throws java.lang.IllegalStateException If this bundle has been | 813 * @throws java.lang.IllegalStateException If this bundle has been |
808 // * uninstalled. | 814 * uninstalled. |
809 // */ | 815 */ |
810 // public bool hasPermission(Object permission); | 816 public bool hasPermission(Object permission); |
811 // | 817 |
812 // /** | 818 /** |
813 // * Find the specified resource from this bundle. | 819 * Find the specified resource from this bundle. |
814 // * | 820 * |
815 // * This bundle's class loader is called to search for the specified | 821 * This bundle's class loader is called to search for the specified |
816 // * resource. If this bundle's state is <code>INSTALLED</code>, this | 822 * resource. If this bundle's state is <code>INSTALLED</code>, this |
817 // * method must attempt to resolve this bundle before attempting to get the | 823 * method must attempt to resolve this bundle before attempting to get the |
818 // * specified resource. If this bundle cannot be resolved, then only this | 824 * specified resource. If this bundle cannot be resolved, then only this |
819 // * bundle must be searched for the specified resource. Imported packages | 825 * bundle must be searched for the specified resource. Imported packages |
820 // * cannot be searched when this bundle has not been resolved. If this bundle | 826 * cannot be searched when this bundle has not been resolved. If this bundle |
821 // * is a fragment bundle then <code>null</code> is returned. | 827 * is a fragment bundle then <code>null</code> is returned. |
822 // * | 828 * |
823 // * @param name The name of the resource. See | 829 * @param name The name of the resource. See |
824 // * <code>java.lang.ClassLoader.getResource</code> for a description | 830 * <code>java.lang.ClassLoader.getResource</code> for a description |
825 // * of the format of a resource name. | 831 * of the format of a resource name. |
826 // * @return A URL to the named resource, or <code>null</code> if the | 832 * @return A URL to the named resource, or <code>null</code> if the |
827 // * resource could not be found or if this bundle is a fragment | 833 * resource could not be found or if this bundle is a fragment |
828 // * bundle or if the caller does not have the appropriate | 834 * bundle or if the caller does not have the appropriate |
829 // * <code>AdminPermission[this,RESOURCE]</code>, and the Java | 835 * <code>AdminPermission[this,RESOURCE]</code>, and the Java |
830 // * Runtime Environment supports permissions. | 836 * Runtime Environment supports permissions. |
831 // * | 837 * |
832 // * @since 1.1 | 838 * @since 1.1 |
833 // * @throws java.lang.IllegalStateException If this bundle has been | 839 * @throws java.lang.IllegalStateException If this bundle has been |
834 // * uninstalled. | 840 * uninstalled. |
835 // * @see #getEntry | 841 * @see #getEntry |
836 // * @see #findEntries | 842 * @see #findEntries |
837 // */ | 843 */ |
838 // public URL getResource(String name); | 844 public URL getResource(String name); |
839 // | 845 |
840 // /** | 846 /** |
841 // * Returns this bundle's Manifest headers and values localized to the | 847 * Returns this bundle's Manifest headers and values localized to the |
842 // * specified locale. | 848 * specified locale. |
843 // * | 849 * |
844 // * <p> | 850 * <p> |
845 // * This method performs the same function as | 851 * This method performs the same function as |
846 // * <code>Bundle.getHeaders()</code> except the manifest header values are | 852 * <code>Bundle.getHeaders()</code> except the manifest header values are |
847 // * localized to the specified locale. | 853 * localized to the specified locale. |
848 // * | 854 * |
849 // * <p> | 855 * <p> |
850 // * If a Manifest header value starts with "%", it must be | 856 * If a Manifest header value starts with "%", it must be |
851 // * localized according to the specified locale. If a locale is specified and | 857 * localized according to the specified locale. If a locale is specified and |
852 // * cannot be found, then the header values must be returned using the | 858 * cannot be found, then the header values must be returned using the |
853 // * default locale. Localizations are searched for in the following order: | 859 * default locale. Localizations are searched for in the following order: |
854 // * | 860 * |
855 // * <pre> | 861 * <pre> |
856 // * bn + "_" + Ls + "_" + Cs + "_" + Vs | 862 * bn + "_" + Ls + "_" + Cs + "_" + Vs |
857 // * bn + "_" + Ls + "_" + Cs | 863 * bn + "_" + Ls + "_" + Cs |
858 // * bn + "_" + Ls | 864 * bn + "_" + Ls |
859 // * bn + "_" + Ld + "_" + Cd + "_" + Vd | 865 * bn + "_" + Ld + "_" + Cd + "_" + Vd |
860 // * bn + "_" + Ld + "_" + Cd | 866 * bn + "_" + Ld + "_" + Cd |
861 // * bn + "_" + Ld | 867 * bn + "_" + Ld |
862 // * bn | 868 * bn |
863 // * </pre> | 869 * </pre> |
864 // * | 870 * |
865 // * Where <code>bn</code> is this bundle's localization basename, | 871 * Where <code>bn</code> is this bundle's localization basename, |
866 // * <code>Ls</code>, <code>Cs</code> and <code>Vs</code> are the | 872 * <code>Ls</code>, <code>Cs</code> and <code>Vs</code> are the |
867 // * specified locale (language, country, variant) and <code>Ld</code>, | 873 * specified locale (language, country, variant) and <code>Ld</code>, |
868 // * <code>Cd</code> and <code>Vd</code> are the default locale (language, | 874 * <code>Cd</code> and <code>Vd</code> are the default locale (language, |
869 // * country, variant). | 875 * country, variant). |
870 // * | 876 * |
871 // * If <code>null</code> is specified as the locale string, the header | 877 * If <code>null</code> is specified as the locale string, the header |
872 // * values must be localized using the default locale. If the empty string | 878 * values must be localized using the default locale. If the empty string |
873 // * ("") is specified as the locale string, the header values must | 879 * ("") is specified as the locale string, the header values must |
874 // * not be localized and the raw (unlocalized) header values, including any | 880 * not be localized and the raw (unlocalized) header values, including any |
875 // * leading "%", must be returned. | 881 * leading "%", must be returned. |
876 // * | 882 * |
877 // * <p> | 883 * <p> |
878 // * This method must continue to return Manifest header information while | 884 * This method must continue to return Manifest header information while |
879 // * this bundle is in the <code>UNINSTALLED</code> state, however the | 885 * this bundle is in the <code>UNINSTALLED</code> state, however the |
880 // * header values must only be available in the raw and default locale | 886 * header values must only be available in the raw and default locale |
881 // * values. | 887 * values. |
882 // * | 888 * |
883 // * @param locale The locale name into which the header values are to be | 889 * @param locale The locale name into which the header values are to be |
884 // * localized. If the specified locale is <code>null</code> then the | 890 * localized. If the specified locale is <code>null</code> then the |
885 // * locale returned by <code>java.util.Locale.getDefault</code> is | 891 * locale returned by <code>java.util.Locale.getDefault</code> is |
886 // * used. If the specified locale is the empty string, this method | 892 * used. If the specified locale is the empty string, this method |
887 // * will return the raw (unlocalized) manifest headers including any | 893 * will return the raw (unlocalized) manifest headers including any |
888 // * leading "%". | 894 * leading "%". |
889 // * @return A <code>Dictionary</code> object containing this bundle's | 895 * @return A <code>Dictionary</code> object containing this bundle's |
890 // * Manifest headers and values. | 896 * Manifest headers and values. |
891 // * | 897 * |
892 // * @throws java.lang.SecurityException If the caller does not have the | 898 * @throws java.lang.SecurityException If the caller does not have the |
893 // * appropriate <code>AdminPermission[this,METADATA]</code>, and | 899 * appropriate <code>AdminPermission[this,METADATA]</code>, and |
894 // * the Java Runtime Environment supports permissions. | 900 * the Java Runtime Environment supports permissions. |
895 // * | 901 * |
896 // * @see #getHeaders() | 902 * @see #getHeaders() |
897 // * @see Constants#BUNDLE_LOCALIZATION | 903 * @see Constants#BUNDLE_LOCALIZATION |
898 // * @since 1.3 | 904 * @since 1.3 |
899 // */ | 905 */ |
900 // public Dictionary getHeaders(String locale); | 906 public Dictionary getHeaders(String locale); |
901 // | 907 |
902 // /** | 908 /** |
903 // * Returns the symbolic name of this bundle as specified by its | 909 * Returns the symbolic name of this bundle as specified by its |
904 // * <code>Bundle-SymbolicName</code> manifest header. The name must be | 910 * <code>Bundle-SymbolicName</code> manifest header. The name must be |
905 // * unique, it is recommended to use a reverse domain name naming convention | 911 * unique, it is recommended to use a reverse domain name naming convention |
906 // * like that used for java packages. If this bundle does not have a | 912 * like that used for java packages. If this bundle does not have a |
907 // * specified symbolic name then <code>null</code> is returned. | 913 * specified symbolic name then <code>null</code> is returned. |
908 // * | 914 * |
909 // * <p> | 915 * <p> |
910 // * This method must continue to return this bundle's symbolic name while | 916 * This method must continue to return this bundle's symbolic name while |
911 // * this bundle is in the <code>UNINSTALLED</code> state. | 917 * this bundle is in the <code>UNINSTALLED</code> state. |
912 // * | 918 * |
913 // * @return The symbolic name of this bundle. | 919 * @return The symbolic name of this bundle. |
914 // * @since 1.3 | 920 * @since 1.3 |
915 // */ | 921 */ |
916 // public String getSymbolicName(); | 922 public String getSymbolicName(); |
917 // | 923 |
918 // /** | 924 /** |
919 // * Loads the specified class using this bundle's classloader. | 925 * Loads the specified class using this bundle's classloader. |
920 // * | 926 * |
921 // * <p> | 927 * <p> |
922 // * If this bundle is a fragment bundle then this method must throw a | 928 * If this bundle is a fragment bundle then this method must throw a |
923 // * <code>ClassNotFoundException</code>. | 929 * <code>ClassNotFoundException</code>. |
924 // * | 930 * |
925 // * <p> | 931 * <p> |
926 // * If this bundle's state is <code>INSTALLED</code>, this method must | 932 * If this bundle's state is <code>INSTALLED</code>, this method must |
927 // * attempt to resolve this bundle before attempting to load the class. | 933 * attempt to resolve this bundle before attempting to load the class. |
928 // * | 934 * |
929 // * <p> | 935 * <p> |
930 // * If this bundle cannot be resolved, a Framework event of type | 936 * If this bundle cannot be resolved, a Framework event of type |
931 // * {@link FrameworkEvent#ERROR} is fired containing a | 937 * {@link FrameworkEvent#ERROR} is fired containing a |
932 // * <code>BundleException</code> with details of the reason this bundle | 938 * <code>BundleException</code> with details of the reason this bundle |
933 // * could not be resolved. This method must then throw a | 939 * could not be resolved. This method must then throw a |
934 // * <code>ClassNotFoundException</code>. | 940 * <code>ClassNotFoundException</code>. |
935 // * | 941 * |
936 // * <p> | 942 * <p> |
937 // * If this bundle's state is <code>UNINSTALLED</code>, then an | 943 * If this bundle's state is <code>UNINSTALLED</code>, then an |
938 // * <code>IllegalStateException</code> is thrown. | 944 * <code>IllegalStateException</code> is thrown. |
939 // * | 945 * |
940 // * @param name The name of the class to load. | 946 * @param name The name of the class to load. |
941 // * @return The Class object for the requested class. | 947 * @return The Class object for the requested class. |
942 // * @throws java.lang.ClassNotFoundException If no such class can be found or | 948 * @throws java.lang.ClassNotFoundException If no such class can be found or |
943 // * if this bundle is a fragment bundle or if the caller does not | 949 * if this bundle is a fragment bundle or if the caller does not |
944 // * have the appropriate <code>AdminPermission[this,CLASS]</code>, | 950 * have the appropriate <code>AdminPermission[this,CLASS]</code>, |
945 // * and the Java Runtime Environment supports permissions. | 951 * and the Java Runtime Environment supports permissions. |
946 // * @throws java.lang.IllegalStateException If this bundle has been | 952 * @throws java.lang.IllegalStateException If this bundle has been |
947 // * uninstalled. | 953 * uninstalled. |
948 // * @since 1.3 | 954 * @since 1.3 |
949 // */ | 955 */ |
950 // public Class loadClass(String name) throws ClassNotFoundException; | 956 public Class loadClass(String name) ; |
951 // | 957 |
952 // /** | 958 /** |
953 // * Find the specified resources from this bundle. | 959 * Find the specified resources from this bundle. |
954 // * | 960 * |
955 // * This bundle's class loader is called to search for the specified | 961 * This bundle's class loader is called to search for the specified |
956 // * resources. If this bundle's state is <code>INSTALLED</code>, this | 962 * resources. If this bundle's state is <code>INSTALLED</code>, this |
957 // * method must attempt to resolve this bundle before attempting to get the | 963 * method must attempt to resolve this bundle before attempting to get the |
958 // * specified resources. If this bundle cannot be resolved, then only this | 964 * specified resources. If this bundle cannot be resolved, then only this |
959 // * bundle must be searched for the specified resources. Imported packages | 965 * bundle must be searched for the specified resources. Imported packages |
960 // * cannot be searched when a bundle has not been resolved. If this bundle is | 966 * cannot be searched when a bundle has not been resolved. If this bundle is |
961 // * a fragment bundle then <code>null</code> is returned. | 967 * a fragment bundle then <code>null</code> is returned. |
962 // * | 968 * |
963 // * @param name The name of the resource. See | 969 * @param name The name of the resource. See |
964 // * <code>java.lang.ClassLoader.getResources</code> for a | 970 * <code>java.lang.ClassLoader.getResources</code> for a |
965 // * description of the format of a resource name. | 971 * description of the format of a resource name. |
966 // * @return An enumeration of URLs to the named resources, or | 972 * @return An enumeration of URLs to the named resources, or |
967 // * <code>null</code> if the resource could not be found or if this | 973 * <code>null</code> if the resource could not be found or if this |
968 // * bundle is a fragment bundle or if the caller does not have the | 974 * bundle is a fragment bundle or if the caller does not have the |
969 // * appropriate <code>AdminPermission[this,RESOURCE]</code>, and | 975 * appropriate <code>AdminPermission[this,RESOURCE]</code>, and |
970 // * the Java Runtime Environment supports permissions. | 976 * the Java Runtime Environment supports permissions. |
971 // * | 977 * |
972 // * @since 1.3 | 978 * @since 1.3 |
973 // * @throws java.lang.IllegalStateException If this bundle has been | 979 * @throws java.lang.IllegalStateException If this bundle has been |
974 // * uninstalled. | 980 * uninstalled. |
975 // * @throws java.io.IOException If there is an I/O error. | 981 * @throws java.io.IOException If there is an I/O error. |
976 // */ | 982 */ |
977 // public Enumeration getResources(String name) throws IOException; | 983 public Enumeration getResources(String name) ; |
978 // | 984 |
979 // /** | 985 /** |
980 // * Returns an Enumeration of all the paths (<code>String</code> objects) | 986 * Returns an Enumeration of all the paths (<code>String</code> objects) |
981 // * to entries within this bundle whose longest sub-path matches the | 987 * to entries within this bundle whose longest sub-path matches the |
982 // * specified path. This bundle's classloader is not used to search for | 988 * specified path. This bundle's classloader is not used to search for |
983 // * entries. Only the contents of this bundle are searched. | 989 * entries. Only the contents of this bundle are searched. |
984 // * <p> | 990 * <p> |
985 // * The specified path is always relative to the root of this bundle and may | 991 * The specified path is always relative to the root of this bundle and may |
986 // * begin with a "/". A path value of "/" indicates the | 992 * begin with a "/". A path value of "/" indicates the |
987 // * root of this bundle. | 993 * root of this bundle. |
988 // * <p> | 994 * <p> |
989 // * Returned paths indicating subdirectory paths end with a "/". | 995 * Returned paths indicating subdirectory paths end with a "/". |
990 // * The returned paths are all relative to the root of this bundle and must | 996 * The returned paths are all relative to the root of this bundle and must |
991 // * not begin with "/". | 997 * not begin with "/". |
992 // * | 998 * |
993 // * @param path The path name for which to return entry paths. | 999 * @param path The path name for which to return entry paths. |
994 // * @return An Enumeration of the entry paths (<code>String</code> | 1000 * @return An Enumeration of the entry paths (<code>String</code> |
995 // * objects) or <code>null</code> if no entry could be found or if | 1001 * objects) or <code>null</code> if no entry could be found or if |
996 // * the caller does not have the appropriate | 1002 * the caller does not have the appropriate |
997 // * <code>AdminPermission[this,RESOURCE]</code> and the Java | 1003 * <code>AdminPermission[this,RESOURCE]</code> and the Java |
998 // * Runtime Environment supports permissions. | 1004 * Runtime Environment supports permissions. |
999 // * @throws java.lang.IllegalStateException If this bundle has been | 1005 * @throws java.lang.IllegalStateException If this bundle has been |
1000 // * uninstalled. | 1006 * uninstalled. |
1001 // * @since 1.3 | 1007 * @since 1.3 |
1002 // */ | 1008 */ |
1003 // public Enumeration getEntryPaths(String path); | 1009 public Enumeration getEntryPaths(String path); |
1004 // | 1010 |
1005 // /** | 1011 /** |
1006 // * Returns a URL to the entry at the specified path in this bundle. This | 1012 * Returns a URL to the entry at the specified path in this bundle. This |
1007 // * bundle's classloader is not used to search for the entry. Only the | 1013 * bundle's classloader is not used to search for the entry. Only the |
1008 // * contents of this bundle are searched for the entry. | 1014 * contents of this bundle are searched for the entry. |
1009 // * <p> | 1015 * <p> |
1010 // * The specified path is always relative to the root of this bundle and may | 1016 * The specified path is always relative to the root of this bundle and may |
1011 // * begin with "/". A path value of "/" indicates the | 1017 * begin with "/". A path value of "/" indicates the |
1012 // * root of this bundle. | 1018 * root of this bundle. |
1013 // * | 1019 * |
1014 // * @param path The path name of the entry. | 1020 * @param path The path name of the entry. |
1015 // * @return A URL to the entry, or <code>null</code> if no entry could be | 1021 * @return A URL to the entry, or <code>null</code> if no entry could be |
1016 // * found or if the caller does not have the appropriate | 1022 * found or if the caller does not have the appropriate |
1017 // * <code>AdminPermission[this,RESOURCE]</code> and the Java | 1023 * <code>AdminPermission[this,RESOURCE]</code> and the Java |
1018 // * Runtime Environment supports permissions. | 1024 * Runtime Environment supports permissions. |
1019 // * | 1025 * |
1020 // * @throws java.lang.IllegalStateException If this bundle has been | 1026 * @throws java.lang.IllegalStateException If this bundle has been |
1021 // * uninstalled. | 1027 * uninstalled. |
1022 // * @since 1.3 | 1028 * @since 1.3 |
1023 // */ | 1029 */ |
1024 // public URL getEntry(String path); | 1030 public URL getEntry(String path); |
1025 // | 1031 |
1026 // /** | 1032 /** |
1027 // * Returns the time when this bundle was last modified. A bundle is | 1033 * Returns the time when this bundle was last modified. A bundle is |
1028 // * considered to be modified when it is installed, updated or uninstalled. | 1034 * considered to be modified when it is installed, updated or uninstalled. |
1029 // * | 1035 * |
1030 // * <p> | 1036 * <p> |
1031 // * The time value is the number of milliseconds since January 1, 1970, | 1037 * The time value is the number of milliseconds since January 1, 1970, |
1032 // * 00:00:00 GMT. | 1038 * 00:00:00 GMT. |
1033 // * | 1039 * |
1034 // * @return The time when this bundle was last modified. | 1040 * @return The time when this bundle was last modified. |
1035 // * @since 1.3 | 1041 * @since 1.3 |
1036 // */ | 1042 */ |
1037 // public long getLastModified(); | 1043 public long getLastModified(); |
1038 // | 1044 |
1039 // /** | 1045 /** |
1040 // * Returns entries in this bundle and its attached fragments. This bundle's | 1046 * Returns entries in this bundle and its attached fragments. This bundle's |
1041 // * classloader is not used to search for entries. Only the contents of this | 1047 * classloader is not used to search for entries. Only the contents of this |
1042 // * bundle and its attached fragments are searched for the specified entries. | 1048 * bundle and its attached fragments are searched for the specified entries. |
1043 // * | 1049 * |
1044 // * If this bundle's state is <code>INSTALLED</code>, this method must | 1050 * If this bundle's state is <code>INSTALLED</code>, this method must |
1045 // * attempt to resolve this bundle before attempting to find entries. | 1051 * attempt to resolve this bundle before attempting to find entries. |
1046 // * | 1052 * |
1047 // * <p> | 1053 * <p> |
1048 // * This method is intended to be used to obtain configuration, setup, | 1054 * This method is intended to be used to obtain configuration, setup, |
1049 // * localization and other information from this bundle. This method takes | 1055 * localization and other information from this bundle. This method takes |
1050 // * into account that the "contents" of this bundle can be extended | 1056 * into account that the "contents" of this bundle can be extended |
1051 // * with fragments. This "bundle space" is not a namespace with | 1057 * with fragments. This "bundle space" is not a namespace with |
1052 // * unique members; the same entry name can be present multiple times. This | 1058 * unique members; the same entry name can be present multiple times. This |
1053 // * method therefore returns an enumeration of URL objects. These URLs can | 1059 * method therefore returns an enumeration of URL objects. These URLs can |
1054 // * come from different JARs but have the same path name. This method can | 1060 * come from different JARs but have the same path name. This method can |
1055 // * either return only entries in the specified path or recurse into | 1061 * either return only entries in the specified path or recurse into |
1056 // * subdirectories returning entries in the directory tree beginning at the | 1062 * subdirectories returning entries in the directory tree beginning at the |
1057 // * specified path. Fragments can be attached after this bundle is resolved, | 1063 * specified path. Fragments can be attached after this bundle is resolved, |
1058 // * possibly changing the set of URLs returned by this method. If this bundle | 1064 * possibly changing the set of URLs returned by this method. If this bundle |
1059 // * is not resolved, only the entries in the JAR file of this bundle are | 1065 * is not resolved, only the entries in the JAR file of this bundle are |
1060 // * returned. | 1066 * returned. |
1061 // * <p> | 1067 * <p> |
1062 // * Examples: | 1068 * Examples: |
1063 // * | 1069 * |
1064 // * <pre> | 1070 * <pre> |
1065 // * // List all XML files in the OSGI-INF directory and below | 1071 * // List all XML files in the OSGI-INF directory and below |
1066 // * Enumeration e = b.findEntries("OSGI-INF", "*.xml", true); | 1072 * Enumeration e = b.findEntries("OSGI-INF", "*.xml", true); |
1067 // * | 1073 * |
1068 // * // Find a specific localization file | 1074 * // Find a specific localization file |
1069 // * Enumeration e = b.findEntries("OSGI-INF/l10n", | 1075 * Enumeration e = b.findEntries("OSGI-INF/l10n", |
1070 // * "bundle_nl_DU.properties", | 1076 * "bundle_nl_DU.properties", |
1071 // * false); | 1077 * false); |
1072 // * if (e.hasMoreElements()) | 1078 * if (e.hasMoreElements()) |
1073 // * return (URL) e.nextElement(); | 1079 * return (URL) e.nextElement(); |
1074 // * </pre> | 1080 * </pre> |
1075 // * | 1081 * |
1076 // * @param path The path name in which to look. The path is always relative | 1082 * @param path The path name in which to look. The path is always relative |
1077 // * to the root of this bundle and may begin with "/". A | 1083 * to the root of this bundle and may begin with "/". A |
1078 // * path value of "/" indicates the root of this bundle. | 1084 * path value of "/" indicates the root of this bundle. |
1079 // * @param filePattern The file name pattern for selecting entries in the | 1085 * @param filePattern The file name pattern for selecting entries in the |
1080 // * specified path. The pattern is only matched against the last | 1086 * specified path. The pattern is only matched against the last |
1081 // * element of the entry path and it supports substring matching, as | 1087 * element of the entry path and it supports substring matching, as |
1082 // * specified in the Filter specification, using the wildcard | 1088 * specified in the Filter specification, using the wildcard |
1083 // * character ("*"). If null is specified, this is | 1089 * character ("*"). If null is specified, this is |
1084 // * equivalent to "*" and matches all files. | 1090 * equivalent to "*" and matches all files. |
1085 // * @param recurse If <code>true</code>, recurse into subdirectories. | 1091 * @param recurse If <code>true</code>, recurse into subdirectories. |
1086 // * Otherwise only return entries from the specified path. | 1092 * Otherwise only return entries from the specified path. |
1087 // * @return An enumeration of URL objects for each matching entry, or | 1093 * @return An enumeration of URL objects for each matching entry, or |
1088 // * <code>null</code> if an entry could not be found or if the | 1094 * <code>null</code> if an entry could not be found or if the |
1089 // * caller does not have the appropriate | 1095 * caller does not have the appropriate |
1090 // * <code>AdminPermission[this,RESOURCE]</code>, and the Java | 1096 * <code>AdminPermission[this,RESOURCE]</code>, and the Java |
1091 // * Runtime Environment supports permissions. The URLs are sorted | 1097 * Runtime Environment supports permissions. The URLs are sorted |
1092 // * such that entries from this bundle are returned first followed by | 1098 * such that entries from this bundle are returned first followed by |
1093 // * the entries from attached fragments in ascending bundle id order. | 1099 * the entries from attached fragments in ascending bundle id order. |
1094 // * If this bundle is a fragment, then only matching entries in this | 1100 * If this bundle is a fragment, then only matching entries in this |
1095 // * fragment are returned. | 1101 * fragment are returned. |
1096 // * @since 1.3 | 1102 * @since 1.3 |
1097 // */ | 1103 */ |
1098 // public Enumeration findEntries(String path, String filePattern, | 1104 public Enumeration findEntries(String path, String filePattern, |
1099 // bool recurse); | 1105 bool recurse); |
1100 // | 1106 |
1101 // /** | 1107 /** |
1102 // * Returns this bundle's {@link BundleContext}. The returned | 1108 * Returns this bundle's {@link BundleContext}. The returned |
1103 // * <code>BundleContext</code> can be used by the caller to act on behalf | 1109 * <code>BundleContext</code> can be used by the caller to act on behalf |
1104 // * of this bundle. | 1110 * of this bundle. |
1105 // * | 1111 * |
1106 // * <p> | 1112 * <p> |
1107 // * If this bundle is not in the {@link #STARTING}, {@link #ACTIVE}, or | 1113 * If this bundle is not in the {@link #STARTING}, {@link #ACTIVE}, or |
1108 // * {@link #STOPPING} states or this bundle is a fragment bundle, then this | 1114 * {@link #STOPPING} states or this bundle is a fragment bundle, then this |
1109 // * bundle has no valid <code>BundleContext</code>. This method will | 1115 * bundle has no valid <code>BundleContext</code>. This method will |
1110 // * return <code>null</code> if this bundle has no valid | 1116 * return <code>null</code> if this bundle has no valid |
1111 // * <code>BundleContext</code>. | 1117 * <code>BundleContext</code>. |
1112 // * | 1118 * |
1113 // * @return A <code>BundleContext</code> for this bundle or | 1119 * @return A <code>BundleContext</code> for this bundle or |
1114 // * <code>null</code> if this bundle has no valid | 1120 * <code>null</code> if this bundle has no valid |
1115 // * <code>BundleContext</code>. | 1121 * <code>BundleContext</code>. |
1116 // * @throws java.lang.SecurityException If the caller does not have the | 1122 * @throws java.lang.SecurityException If the caller does not have the |
1117 // * appropriate <code>AdminPermission[this,CONTEXT]</code>, and | 1123 * appropriate <code>AdminPermission[this,CONTEXT]</code>, and |
1118 // * the Java Runtime Environment supports permissions. | 1124 * the Java Runtime Environment supports permissions. |
1119 // * @since 1.4 | 1125 * @since 1.4 |
1120 // */ | 1126 */ |
1121 // public BundleContext getBundleContext(); | 1127 public BundleContext getBundleContext(); |
1122 } | 1128 } |