/usr/share/doc/libosgi-compendium-java/api/org/osgi/util/tracker/ServiceTracker.html is in libosgi-compendium-java-doc 4.3.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_23) on Wed Nov 09 19:45:53 UTC 2011 -->
<TITLE>
ServiceTracker
</TITLE>
<META NAME="date" CONTENT="2011-11-09">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="ServiceTracker";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../org/osgi/util/tracker/BundleTrackerCustomizer.html" title="interface in org.osgi.util.tracker"><B>PREV CLASS</B></A>
<A HREF="../../../../org/osgi/util/tracker/ServiceTrackerCustomizer.html" title="interface in org.osgi.util.tracker"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../index.html?org/osgi/util/tracker/ServiceTracker.html" target="_top"><B>FRAMES</B></A>
<A HREF="ServiceTracker.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
org.osgi.util.tracker</FONT>
<BR>
Class ServiceTracker<S,T></H2>
<PRE>
java.lang.Object
<IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><B>org.osgi.util.tracker.ServiceTracker<S,T></B>
</PRE>
<DL>
<DT><DT><B>Type Parameters:</B><DD><CODE>S</CODE> - The type of the service being tracked.<DD><CODE>T</CODE> - The type of the tracked object.</DL>
<DL>
<DT><B>All Implemented Interfaces:</B> <DD><A HREF="../../../../org/osgi/util/tracker/ServiceTrackerCustomizer.html" title="interface in org.osgi.util.tracker">ServiceTrackerCustomizer</A><S,T></DD>
</DL>
<HR>
<DL>
<DT><PRE>public class <B>ServiceTracker<S,T></B><DT>extends java.lang.Object<DT>implements <A HREF="../../../../org/osgi/util/tracker/ServiceTrackerCustomizer.html" title="interface in org.osgi.util.tracker">ServiceTrackerCustomizer</A><S,T></DL>
</PRE>
<P>
The <code>ServiceTracker</code> class simplifies using services from the
Framework's service registry.
<p>
A <code>ServiceTracker</code> object is constructed with search criteria and
a <code>ServiceTrackerCustomizer</code> object. A <code>ServiceTracker</code>
can use a <code>ServiceTrackerCustomizer</code> to customize the service
objects to be tracked. The <code>ServiceTracker</code> can then be opened to
begin tracking all services in the Framework's service registry that match
the specified search criteria. The <code>ServiceTracker</code> correctly
handles all of the details of listening to <code>ServiceEvent</code>s and
getting and ungetting services.
<p>
The <code>getServiceReferences</code> method can be called to get references
to the services being tracked. The <code>getService</code> and
<code>getServices</code> methods can be called to get the service objects for
the tracked service.
<p>
The <code>ServiceTracker</code> class is thread-safe. It does not call a
<code>ServiceTrackerCustomizer</code> while holding any locks.
<code>ServiceTrackerCustomizer</code> implementations must also be
thread-safe.
<P>
<P>
<HR>
<P>
<!-- =========== FIELD SUMMARY =========== -->
<A NAME="field_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Field Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected org.osgi.framework.BundleContext</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html#context">context</A></B></CODE>
<BR>
The Bundle Context used by this <code>ServiceTracker</code>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected org.osgi.framework.Filter</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html#filter">filter</A></B></CODE>
<BR>
The Filter used by this <code>ServiceTracker</code> which specifies the
search criteria for the services to track.</TD>
</TR>
</TABLE>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html#ServiceTracker(org.osgi.framework.BundleContext, java.lang.Class, org.osgi.util.tracker.ServiceTrackerCustomizer)">ServiceTracker</A></B>(org.osgi.framework.BundleContext context,
java.lang.Class<<A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html" title="type parameter in ServiceTracker">S</A>> clazz,
<A HREF="../../../../org/osgi/util/tracker/ServiceTrackerCustomizer.html" title="interface in org.osgi.util.tracker">ServiceTrackerCustomizer</A><<A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html" title="type parameter in ServiceTracker">S</A>,<A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html" title="type parameter in ServiceTracker">T</A>> customizer)</CODE>
<BR>
Create a <code>ServiceTracker</code> on the specified class.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html#ServiceTracker(org.osgi.framework.BundleContext, org.osgi.framework.Filter, org.osgi.util.tracker.ServiceTrackerCustomizer)">ServiceTracker</A></B>(org.osgi.framework.BundleContext context,
org.osgi.framework.Filter filter,
<A HREF="../../../../org/osgi/util/tracker/ServiceTrackerCustomizer.html" title="interface in org.osgi.util.tracker">ServiceTrackerCustomizer</A><<A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html" title="type parameter in ServiceTracker">S</A>,<A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html" title="type parameter in ServiceTracker">T</A>> customizer)</CODE>
<BR>
Create a <code>ServiceTracker</code> on the specified <code>Filter</code>
object.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html#ServiceTracker(org.osgi.framework.BundleContext, org.osgi.framework.ServiceReference, org.osgi.util.tracker.ServiceTrackerCustomizer)">ServiceTracker</A></B>(org.osgi.framework.BundleContext context,
org.osgi.framework.ServiceReference<<A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html" title="type parameter in ServiceTracker">S</A>> reference,
<A HREF="../../../../org/osgi/util/tracker/ServiceTrackerCustomizer.html" title="interface in org.osgi.util.tracker">ServiceTrackerCustomizer</A><<A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html" title="type parameter in ServiceTracker">S</A>,<A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html" title="type parameter in ServiceTracker">T</A>> customizer)</CODE>
<BR>
Create a <code>ServiceTracker</code> on the specified
<code>ServiceReference</code>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html#ServiceTracker(org.osgi.framework.BundleContext, java.lang.String, org.osgi.util.tracker.ServiceTrackerCustomizer)">ServiceTracker</A></B>(org.osgi.framework.BundleContext context,
java.lang.String clazz,
<A HREF="../../../../org/osgi/util/tracker/ServiceTrackerCustomizer.html" title="interface in org.osgi.util.tracker">ServiceTrackerCustomizer</A><<A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html" title="type parameter in ServiceTracker">S</A>,<A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html" title="type parameter in ServiceTracker">T</A>> customizer)</CODE>
<BR>
Create a <code>ServiceTracker</code> on the specified class name.</TD>
</TR>
</TABLE>
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html" title="type parameter in ServiceTracker">T</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html#addingService(org.osgi.framework.ServiceReference)">addingService</A></B>(org.osgi.framework.ServiceReference<<A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html" title="type parameter in ServiceTracker">S</A>> reference)</CODE>
<BR>
Default implementation of the
<code>ServiceTrackerCustomizer.addingService</code> method.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html#close()">close</A></B>()</CODE>
<BR>
Close this <code>ServiceTracker</code>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html" title="type parameter in ServiceTracker">T</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html#getService()">getService</A></B>()</CODE>
<BR>
Returns a service object for one of the services being tracked by this
<code>ServiceTracker</code>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html" title="type parameter in ServiceTracker">T</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html#getService(org.osgi.framework.ServiceReference)">getService</A></B>(org.osgi.framework.ServiceReference<<A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html" title="type parameter in ServiceTracker">S</A>> reference)</CODE>
<BR>
Returns the service object for the specified
<code>ServiceReference</code> if the specified referenced service is
being tracked by this <code>ServiceTracker</code>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> org.osgi.framework.ServiceReference<<A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html" title="type parameter in ServiceTracker">S</A>></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html#getServiceReference()">getServiceReference</A></B>()</CODE>
<BR>
Returns a <code>ServiceReference</code> for one of the services being
tracked by this <code>ServiceTracker</code>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> org.osgi.framework.ServiceReference<<A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html" title="type parameter in ServiceTracker">S</A>>[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html#getServiceReferences()">getServiceReferences</A></B>()</CODE>
<BR>
Return an array of <code>ServiceReference</code>s for all services being
tracked by this <code>ServiceTracker</code>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.lang.Object[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html#getServices()">getServices</A></B>()</CODE>
<BR>
Return an array of service objects for all services being tracked by this
<code>ServiceTracker</code>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html" title="type parameter in ServiceTracker">T</A>[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html#getServices(T[])">getServices</A></B>(<A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html" title="type parameter in ServiceTracker">T</A>[] array)</CODE>
<BR>
Return an array of service objects for all services being tracked by this
<code>ServiceTracker</code>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.util.SortedMap<org.osgi.framework.ServiceReference<<A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html" title="type parameter in ServiceTracker">S</A>>,<A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html" title="type parameter in ServiceTracker">T</A>></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html#getTracked()">getTracked</A></B>()</CODE>
<BR>
Return a <code>SortedMap</code> of the <code>ServiceReference</code>s and
service objects for all services being tracked by this
<code>ServiceTracker</code>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html#getTrackingCount()">getTrackingCount</A></B>()</CODE>
<BR>
Returns the tracking count for this <code>ServiceTracker</code>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html#isEmpty()">isEmpty</A></B>()</CODE>
<BR>
Return if this <code>ServiceTracker</code> is empty.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html#modifiedService(org.osgi.framework.ServiceReference, T)">modifiedService</A></B>(org.osgi.framework.ServiceReference<<A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html" title="type parameter in ServiceTracker">S</A>> reference,
<A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html" title="type parameter in ServiceTracker">T</A> service)</CODE>
<BR>
Default implementation of the
<code>ServiceTrackerCustomizer.modifiedService</code> method.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html#open()">open</A></B>()</CODE>
<BR>
Open this <code>ServiceTracker</code> and begin tracking services.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html#open(boolean)">open</A></B>(boolean trackAllServices)</CODE>
<BR>
Open this <code>ServiceTracker</code> and begin tracking services.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html#remove(org.osgi.framework.ServiceReference)">remove</A></B>(org.osgi.framework.ServiceReference<<A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html" title="type parameter in ServiceTracker">S</A>> reference)</CODE>
<BR>
Remove a service from this <code>ServiceTracker</code>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html#removedService(org.osgi.framework.ServiceReference, T)">removedService</A></B>(org.osgi.framework.ServiceReference<<A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html" title="type parameter in ServiceTracker">S</A>> reference,
<A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html" title="type parameter in ServiceTracker">T</A> service)</CODE>
<BR>
Default implementation of the
<code>ServiceTrackerCustomizer.removedService</code> method.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html#size()">size</A></B>()</CODE>
<BR>
Return the number of services being tracked by this
<code>ServiceTracker</code>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html" title="type parameter in ServiceTracker">T</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html#waitForService(long)">waitForService</A></B>(long timeout)</CODE>
<BR>
Wait for at least one service to be tracked by this
<code>ServiceTracker</code>.</TD>
</TR>
</TABLE>
<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD>
</TR>
</TABLE>
<P>
<!-- ============ FIELD DETAIL =========== -->
<A NAME="field_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Field Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="context"><!-- --></A><H3>
context</H3>
<PRE>
protected final org.osgi.framework.BundleContext <B>context</B></PRE>
<DL>
<DD>The Bundle Context used by this <code>ServiceTracker</code>.
<P>
<DL>
</DL>
</DL>
<HR>
<A NAME="filter"><!-- --></A><H3>
filter</H3>
<PRE>
protected final org.osgi.framework.Filter <B>filter</B></PRE>
<DL>
<DD>The Filter used by this <code>ServiceTracker</code> which specifies the
search criteria for the services to track.
<P>
<DL>
<DT><B>Since:</B></DT>
<DD>1.1</DD>
</DL>
</DL>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="ServiceTracker(org.osgi.framework.BundleContext, org.osgi.framework.ServiceReference, org.osgi.util.tracker.ServiceTrackerCustomizer)"><!-- --></A><H3>
ServiceTracker</H3>
<PRE>
public <B>ServiceTracker</B>(org.osgi.framework.BundleContext context,
org.osgi.framework.ServiceReference<<A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html" title="type parameter in ServiceTracker">S</A>> reference,
<A HREF="../../../../org/osgi/util/tracker/ServiceTrackerCustomizer.html" title="interface in org.osgi.util.tracker">ServiceTrackerCustomizer</A><<A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html" title="type parameter in ServiceTracker">S</A>,<A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html" title="type parameter in ServiceTracker">T</A>> customizer)</PRE>
<DL>
<DD>Create a <code>ServiceTracker</code> on the specified
<code>ServiceReference</code>.
<p>
The service referenced by the specified <code>ServiceReference</code>
will be tracked by this <code>ServiceTracker</code>.
<P>
<DL>
<DT><B>Parameters:</B><DD><CODE>context</CODE> - The <code>BundleContext</code> against which the tracking
is done.<DD><CODE>reference</CODE> - The <code>ServiceReference</code> for the service to be
tracked.<DD><CODE>customizer</CODE> - The customizer object to call when services are added,
modified, or removed in this <code>ServiceTracker</code>. If
customizer is <code>null</code>, then this
<code>ServiceTracker</code> will be used as the
<code>ServiceTrackerCustomizer</code> and this
<code>ServiceTracker</code> will call the
<code>ServiceTrackerCustomizer</code> methods on itself.</DL>
</DL>
<HR>
<A NAME="ServiceTracker(org.osgi.framework.BundleContext, java.lang.String, org.osgi.util.tracker.ServiceTrackerCustomizer)"><!-- --></A><H3>
ServiceTracker</H3>
<PRE>
public <B>ServiceTracker</B>(org.osgi.framework.BundleContext context,
java.lang.String clazz,
<A HREF="../../../../org/osgi/util/tracker/ServiceTrackerCustomizer.html" title="interface in org.osgi.util.tracker">ServiceTrackerCustomizer</A><<A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html" title="type parameter in ServiceTracker">S</A>,<A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html" title="type parameter in ServiceTracker">T</A>> customizer)</PRE>
<DL>
<DD>Create a <code>ServiceTracker</code> on the specified class name.
<p>
Services registered under the specified class name will be tracked by
this <code>ServiceTracker</code>.
<P>
<DL>
<DT><B>Parameters:</B><DD><CODE>context</CODE> - The <code>BundleContext</code> against which the tracking
is done.<DD><CODE>clazz</CODE> - The class name of the services to be tracked.<DD><CODE>customizer</CODE> - The customizer object to call when services are added,
modified, or removed in this <code>ServiceTracker</code>. If
customizer is <code>null</code>, then this
<code>ServiceTracker</code> will be used as the
<code>ServiceTrackerCustomizer</code> and this
<code>ServiceTracker</code> will call the
<code>ServiceTrackerCustomizer</code> methods on itself.</DL>
</DL>
<HR>
<A NAME="ServiceTracker(org.osgi.framework.BundleContext, org.osgi.framework.Filter, org.osgi.util.tracker.ServiceTrackerCustomizer)"><!-- --></A><H3>
ServiceTracker</H3>
<PRE>
public <B>ServiceTracker</B>(org.osgi.framework.BundleContext context,
org.osgi.framework.Filter filter,
<A HREF="../../../../org/osgi/util/tracker/ServiceTrackerCustomizer.html" title="interface in org.osgi.util.tracker">ServiceTrackerCustomizer</A><<A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html" title="type parameter in ServiceTracker">S</A>,<A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html" title="type parameter in ServiceTracker">T</A>> customizer)</PRE>
<DL>
<DD>Create a <code>ServiceTracker</code> on the specified <code>Filter</code>
object.
<p>
Services which match the specified <code>Filter</code> object will be
tracked by this <code>ServiceTracker</code>.
<P>
<DL>
<DT><B>Parameters:</B><DD><CODE>context</CODE> - The <code>BundleContext</code> against which the tracking
is done.<DD><CODE>filter</CODE> - The <code>Filter</code> to select the services to be
tracked.<DD><CODE>customizer</CODE> - The customizer object to call when services are added,
modified, or removed in this <code>ServiceTracker</code>. If
customizer is null, then this <code>ServiceTracker</code> will be
used as the <code>ServiceTrackerCustomizer</code> and this
<code>ServiceTracker</code> will call the
<code>ServiceTrackerCustomizer</code> methods on itself.<DT><B>Since:</B></DT>
<DD>1.1</DD>
</DL>
</DL>
<HR>
<A NAME="ServiceTracker(org.osgi.framework.BundleContext, java.lang.Class, org.osgi.util.tracker.ServiceTrackerCustomizer)"><!-- --></A><H3>
ServiceTracker</H3>
<PRE>
public <B>ServiceTracker</B>(org.osgi.framework.BundleContext context,
java.lang.Class<<A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html" title="type parameter in ServiceTracker">S</A>> clazz,
<A HREF="../../../../org/osgi/util/tracker/ServiceTrackerCustomizer.html" title="interface in org.osgi.util.tracker">ServiceTrackerCustomizer</A><<A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html" title="type parameter in ServiceTracker">S</A>,<A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html" title="type parameter in ServiceTracker">T</A>> customizer)</PRE>
<DL>
<DD>Create a <code>ServiceTracker</code> on the specified class.
<p>
Services registered under the name of the specified class will be tracked
by this <code>ServiceTracker</code>.
<P>
<DL>
<DT><B>Parameters:</B><DD><CODE>context</CODE> - The <code>BundleContext</code> against which the tracking
is done.<DD><CODE>clazz</CODE> - The class of the services to be tracked.<DD><CODE>customizer</CODE> - The customizer object to call when services are added,
modified, or removed in this <code>ServiceTracker</code>. If
customizer is <code>null</code>, then this
<code>ServiceTracker</code> will be used as the
<code>ServiceTrackerCustomizer</code> and this
<code>ServiceTracker</code> will call the
<code>ServiceTrackerCustomizer</code> methods on itself.<DT><B>Since:</B></DT>
<DD>1.5</DD>
</DL>
</DL>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="open()"><!-- --></A><H3>
open</H3>
<PRE>
public void <B>open</B>()</PRE>
<DL>
<DD>Open this <code>ServiceTracker</code> and begin tracking services.
<p>
This implementation calls <code>open(false)</code>.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Throws:</B>
<DD><CODE>java.lang.IllegalStateException</CODE> - If the <code>BundleContext</code>
with which this <code>ServiceTracker</code> was created is no
longer valid.<DT><B>See Also:</B><DD><A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html#open(boolean)"><CODE>open(boolean)</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="open(boolean)"><!-- --></A><H3>
open</H3>
<PRE>
public void <B>open</B>(boolean trackAllServices)</PRE>
<DL>
<DD>Open this <code>ServiceTracker</code> and begin tracking services.
<p>
Services which match the search criteria specified when this
<code>ServiceTracker</code> was created are now tracked by this
<code>ServiceTracker</code>.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>trackAllServices</CODE> - If <code>true</code>, then this
<code>ServiceTracker</code> will track all matching services
regardless of class loader accessibility. If <code>false</code>,
then this <code>ServiceTracker</code> will only track matching
services which are class loader accessible to the bundle whose
<code>BundleContext</code> is used by this
<code>ServiceTracker</code>.
<DT><B>Throws:</B>
<DD><CODE>java.lang.IllegalStateException</CODE> - If the <code>BundleContext</code>
with which this <code>ServiceTracker</code> was created is no
longer valid.<DT><B>Since:</B></DT>
<DD>1.3</DD>
</DL>
</DD>
</DL>
<HR>
<A NAME="close()"><!-- --></A><H3>
close</H3>
<PRE>
public void <B>close</B>()</PRE>
<DL>
<DD>Close this <code>ServiceTracker</code>.
<p>
This method should be called when this <code>ServiceTracker</code> should
end the tracking of services.
<p>
This implementation calls <A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html#getServiceReferences()"><CODE>getServiceReferences()</CODE></A> to get the list
of tracked services to remove.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="addingService(org.osgi.framework.ServiceReference)"><!-- --></A><H3>
addingService</H3>
<PRE>
public <A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html" title="type parameter in ServiceTracker">T</A> <B>addingService</B>(org.osgi.framework.ServiceReference<<A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html" title="type parameter in ServiceTracker">S</A>> reference)</PRE>
<DL>
<DD>Default implementation of the
<code>ServiceTrackerCustomizer.addingService</code> method.
<p>
This method is only called when this <code>ServiceTracker</code> has been
constructed with a <code>null ServiceTrackerCustomizer</code> argument.
<p>
This implementation returns the result of calling <code>getService</code>
on the <code>BundleContext</code> with which this
<code>ServiceTracker</code> was created passing the specified
<code>ServiceReference</code>.
<p>
This method can be overridden in a subclass to customize the service
object to be tracked for the service being added. In that case, take care
not to rely on the default implementation of
<A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html#removedService(org.osgi.framework.ServiceReference, T)"><CODE>removedService</CODE></A> to unget
the service.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../org/osgi/util/tracker/ServiceTrackerCustomizer.html#addingService(org.osgi.framework.ServiceReference)">addingService</A></CODE> in interface <CODE><A HREF="../../../../org/osgi/util/tracker/ServiceTrackerCustomizer.html" title="interface in org.osgi.util.tracker">ServiceTrackerCustomizer</A><<A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html" title="type parameter in ServiceTracker">S</A>,<A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html" title="type parameter in ServiceTracker">T</A>></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>reference</CODE> - The reference to the service being added to this
<code>ServiceTracker</code>.
<DT><B>Returns:</B><DD>The service object to be tracked for the service added to this
<code>ServiceTracker</code>.<DT><B>See Also:</B><DD><A HREF="../../../../org/osgi/util/tracker/ServiceTrackerCustomizer.html#addingService(org.osgi.framework.ServiceReference)"><CODE>ServiceTrackerCustomizer.addingService(ServiceReference)</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="modifiedService(org.osgi.framework.ServiceReference,java.lang.Object)"><!-- --></A><A NAME="modifiedService(org.osgi.framework.ServiceReference, T)"><!-- --></A><H3>
modifiedService</H3>
<PRE>
public void <B>modifiedService</B>(org.osgi.framework.ServiceReference<<A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html" title="type parameter in ServiceTracker">S</A>> reference,
<A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html" title="type parameter in ServiceTracker">T</A> service)</PRE>
<DL>
<DD>Default implementation of the
<code>ServiceTrackerCustomizer.modifiedService</code> method.
<p>
This method is only called when this <code>ServiceTracker</code> has been
constructed with a <code>null ServiceTrackerCustomizer</code> argument.
<p>
This implementation does nothing.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../org/osgi/util/tracker/ServiceTrackerCustomizer.html#modifiedService(org.osgi.framework.ServiceReference, T)">modifiedService</A></CODE> in interface <CODE><A HREF="../../../../org/osgi/util/tracker/ServiceTrackerCustomizer.html" title="interface in org.osgi.util.tracker">ServiceTrackerCustomizer</A><<A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html" title="type parameter in ServiceTracker">S</A>,<A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html" title="type parameter in ServiceTracker">T</A>></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>reference</CODE> - The reference to modified service.<DD><CODE>service</CODE> - The service object for the modified service.<DT><B>See Also:</B><DD><A HREF="../../../../org/osgi/util/tracker/ServiceTrackerCustomizer.html#modifiedService(org.osgi.framework.ServiceReference, T)"><CODE>ServiceTrackerCustomizer.modifiedService(ServiceReference, Object)</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="removedService(org.osgi.framework.ServiceReference,java.lang.Object)"><!-- --></A><A NAME="removedService(org.osgi.framework.ServiceReference, T)"><!-- --></A><H3>
removedService</H3>
<PRE>
public void <B>removedService</B>(org.osgi.framework.ServiceReference<<A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html" title="type parameter in ServiceTracker">S</A>> reference,
<A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html" title="type parameter in ServiceTracker">T</A> service)</PRE>
<DL>
<DD>Default implementation of the
<code>ServiceTrackerCustomizer.removedService</code> method.
<p>
This method is only called when this <code>ServiceTracker</code> has been
constructed with a <code>null ServiceTrackerCustomizer</code> argument.
<p>
This implementation calls <code>ungetService</code>, on the
<code>BundleContext</code> with which this <code>ServiceTracker</code>
was created, passing the specified <code>ServiceReference</code>.
<p>
This method can be overridden in a subclass. If the default
implementation of <A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html#addingService(org.osgi.framework.ServiceReference)"><CODE>addingService</CODE></A>
method was used, this method must unget the service.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../org/osgi/util/tracker/ServiceTrackerCustomizer.html#removedService(org.osgi.framework.ServiceReference, T)">removedService</A></CODE> in interface <CODE><A HREF="../../../../org/osgi/util/tracker/ServiceTrackerCustomizer.html" title="interface in org.osgi.util.tracker">ServiceTrackerCustomizer</A><<A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html" title="type parameter in ServiceTracker">S</A>,<A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html" title="type parameter in ServiceTracker">T</A>></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>reference</CODE> - The reference to removed service.<DD><CODE>service</CODE> - The service object for the removed service.<DT><B>See Also:</B><DD><A HREF="../../../../org/osgi/util/tracker/ServiceTrackerCustomizer.html#removedService(org.osgi.framework.ServiceReference, T)"><CODE>ServiceTrackerCustomizer.removedService(ServiceReference, Object)</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="waitForService(long)"><!-- --></A><H3>
waitForService</H3>
<PRE>
public <A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html" title="type parameter in ServiceTracker">T</A> <B>waitForService</B>(long timeout)
throws java.lang.InterruptedException</PRE>
<DL>
<DD>Wait for at least one service to be tracked by this
<code>ServiceTracker</code>. This method will also return when this
<code>ServiceTracker</code> is closed.
<p>
It is strongly recommended that <code>waitForService</code> is not used
during the calling of the <code>BundleActivator</code> methods.
<code>BundleActivator</code> methods are expected to complete in a short
period of time.
<p>
This implementation calls <A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html#getService()"><CODE>getService()</CODE></A> to determine if a service
is being tracked.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>timeout</CODE> - The time interval in milliseconds to wait. If zero, the
method will wait indefinitely.
<DT><B>Returns:</B><DD>Returns the result of <A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html#getService()"><CODE>getService()</CODE></A>.
<DT><B>Throws:</B>
<DD><CODE>java.lang.InterruptedException</CODE> - If another thread has interrupted the
current thread.
<DD><CODE>java.lang.IllegalArgumentException</CODE> - If the value of timeout is negative.</DL>
</DD>
</DL>
<HR>
<A NAME="getServiceReferences()"><!-- --></A><H3>
getServiceReferences</H3>
<PRE>
public org.osgi.framework.ServiceReference<<A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html" title="type parameter in ServiceTracker">S</A>>[] <B>getServiceReferences</B>()</PRE>
<DL>
<DD>Return an array of <code>ServiceReference</code>s for all services being
tracked by this <code>ServiceTracker</code>.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>Array of <code>ServiceReference</code>s or <code>null</code> if
no services are being tracked.</DL>
</DD>
</DL>
<HR>
<A NAME="getServiceReference()"><!-- --></A><H3>
getServiceReference</H3>
<PRE>
public org.osgi.framework.ServiceReference<<A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html" title="type parameter in ServiceTracker">S</A>> <B>getServiceReference</B>()</PRE>
<DL>
<DD>Returns a <code>ServiceReference</code> for one of the services being
tracked by this <code>ServiceTracker</code>.
<p>
If multiple services are being tracked, the service with the highest
ranking (as specified in its <code>service.ranking</code> property) is
returned. If there is a tie in ranking, the service with the lowest
service ID (as specified in its <code>service.id</code> property); that
is, the service that was registered first is returned. This is the same
algorithm used by <code>BundleContext.getServiceReference</code>.
<p>
This implementation calls <A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html#getServiceReferences()"><CODE>getServiceReferences()</CODE></A> to get the list
of references for the tracked services.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>A <code>ServiceReference</code> or <code>null</code> if no
services are being tracked.<DT><B>Since:</B></DT>
<DD>1.1</DD>
</DL>
</DD>
</DL>
<HR>
<A NAME="getService(org.osgi.framework.ServiceReference)"><!-- --></A><H3>
getService</H3>
<PRE>
public <A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html" title="type parameter in ServiceTracker">T</A> <B>getService</B>(org.osgi.framework.ServiceReference<<A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html" title="type parameter in ServiceTracker">S</A>> reference)</PRE>
<DL>
<DD>Returns the service object for the specified
<code>ServiceReference</code> if the specified referenced service is
being tracked by this <code>ServiceTracker</code>.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>reference</CODE> - The reference to the desired service.
<DT><B>Returns:</B><DD>A service object or <code>null</code> if the service referenced
by the specified <code>ServiceReference</code> is not being
tracked.</DL>
</DD>
</DL>
<HR>
<A NAME="getServices()"><!-- --></A><H3>
getServices</H3>
<PRE>
public java.lang.Object[] <B>getServices</B>()</PRE>
<DL>
<DD>Return an array of service objects for all services being tracked by this
<code>ServiceTracker</code>.
<p>
This implementation calls <A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html#getServiceReferences()"><CODE>getServiceReferences()</CODE></A> to get the list
of references for the tracked services and then calls
<A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html#getService(org.osgi.framework.ServiceReference)"><CODE>getService(ServiceReference)</CODE></A> for each reference to get the
tracked service object.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>An array of service objects or <code>null</code> if no services
are being tracked.</DL>
</DD>
</DL>
<HR>
<A NAME="getService()"><!-- --></A><H3>
getService</H3>
<PRE>
public <A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html" title="type parameter in ServiceTracker">T</A> <B>getService</B>()</PRE>
<DL>
<DD>Returns a service object for one of the services being tracked by this
<code>ServiceTracker</code>.
<p>
If any services are being tracked, this implementation returns the result
of calling <code>getService(getServiceReference())</code>.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>A service object or <code>null</code> if no services are being
tracked.</DL>
</DD>
</DL>
<HR>
<A NAME="remove(org.osgi.framework.ServiceReference)"><!-- --></A><H3>
remove</H3>
<PRE>
public void <B>remove</B>(org.osgi.framework.ServiceReference<<A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html" title="type parameter in ServiceTracker">S</A>> reference)</PRE>
<DL>
<DD>Remove a service from this <code>ServiceTracker</code>.
The specified service will be removed from this
<code>ServiceTracker</code>. If the specified service was being tracked
then the <code>ServiceTrackerCustomizer.removedService</code> method will
be called for that service.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>reference</CODE> - The reference to the service to be removed.</DL>
</DD>
</DL>
<HR>
<A NAME="size()"><!-- --></A><H3>
size</H3>
<PRE>
public int <B>size</B>()</PRE>
<DL>
<DD>Return the number of services being tracked by this
<code>ServiceTracker</code>.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>The number of services being tracked.</DL>
</DD>
</DL>
<HR>
<A NAME="getTrackingCount()"><!-- --></A><H3>
getTrackingCount</H3>
<PRE>
public int <B>getTrackingCount</B>()</PRE>
<DL>
<DD>Returns the tracking count for this <code>ServiceTracker</code>.
The tracking count is initialized to 0 when this <code>ServiceTracker</code>
is opened. Every time a service is added, modified or removed from this
<code>ServiceTracker</code>, the tracking count is incremented.
<p>
The tracking count can be used to determine if this
<code>ServiceTracker</code> has added, modified or removed a service by
comparing a tracking count value previously collected with the current
tracking count value. If the value has not changed, then no service has
been added, modified or removed from this <code>ServiceTracker</code> since
the previous tracking count was collected.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>The tracking count for this <code>ServiceTracker</code> or -1 if this
<code>ServiceTracker</code> is not open.<DT><B>Since:</B></DT>
<DD>1.2</DD>
</DL>
</DD>
</DL>
<HR>
<A NAME="getTracked()"><!-- --></A><H3>
getTracked</H3>
<PRE>
public java.util.SortedMap<org.osgi.framework.ServiceReference<<A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html" title="type parameter in ServiceTracker">S</A>>,<A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html" title="type parameter in ServiceTracker">T</A>> <B>getTracked</B>()</PRE>
<DL>
<DD>Return a <code>SortedMap</code> of the <code>ServiceReference</code>s and
service objects for all services being tracked by this
<code>ServiceTracker</code>. The map is sorted in reverse natural order
of <code>ServiceReference</code>. That is, the first entry is the service
with the highest ranking and the lowest service id.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>A <code>SortedMap</code> with the <code>ServiceReference</code>s
and service objects for all services being tracked by this
<code>ServiceTracker</code>. If no services are being tracked,
then the returned map is empty.<DT><B>Since:</B></DT>
<DD>1.5</DD>
</DL>
</DD>
</DL>
<HR>
<A NAME="isEmpty()"><!-- --></A><H3>
isEmpty</H3>
<PRE>
public boolean <B>isEmpty</B>()</PRE>
<DL>
<DD>Return if this <code>ServiceTracker</code> is empty.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD><code>true</code> if this <code>ServiceTracker</code> is not tracking any
services.<DT><B>Since:</B></DT>
<DD>1.5</DD>
</DL>
</DD>
</DL>
<HR>
<A NAME="getServices(java.lang.Object[])"><!-- --></A><A NAME="getServices(T[])"><!-- --></A><H3>
getServices</H3>
<PRE>
public <A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html" title="type parameter in ServiceTracker">T</A>[] <B>getServices</B>(<A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html" title="type parameter in ServiceTracker">T</A>[] array)</PRE>
<DL>
<DD>Return an array of service objects for all services being tracked by this
<code>ServiceTracker</code>. The runtime type of the returned array is that of
the specified array.
<p>
This implementation calls <A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html#getServiceReferences()"><CODE>getServiceReferences()</CODE></A> to get the list
of references for the tracked services and then calls
<A HREF="../../../../org/osgi/util/tracker/ServiceTracker.html#getService(org.osgi.framework.ServiceReference)"><CODE>getService(ServiceReference)</CODE></A> for each reference to get the
tracked service object.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>array</CODE> - An array into which the tracked service objects will be
stored, if the array is large enough.
<DT><B>Returns:</B><DD>An array of service objects being tracked. If the specified array
is large enough to hold the result, then the specified array is
returned. If the specified array is longer then necessary to hold
the result, the array element after the last service object is
set to <code>null</code>. If the specified array is not large enough
to hold the result, a new array is created and returned.<DT><B>Since:</B></DT>
<DD>1.5</DD>
</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../org/osgi/util/tracker/BundleTrackerCustomizer.html" title="interface in org.osgi.util.tracker"><B>PREV CLASS</B></A>
<A HREF="../../../../org/osgi/util/tracker/ServiceTrackerCustomizer.html" title="interface in org.osgi.util.tracker"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../index.html?org/osgi/util/tracker/ServiceTracker.html" target="_top"><B>FRAMES</B></A>
<A HREF="ServiceTracker.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
</BODY>
</HTML>
|