1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 2 <!--NewPage--> 3 <HTML> 4 <HEAD> 5 <!-- Generated by javadoc (build 1.6.0-google-internal) on Mon Jan 04 20:48:00 PST 2010 --> 6 <TITLE> 7 ForwardingService (Guava Libraries 2010.01.04) 8 </TITLE> 9 10 <META NAME="date" CONTENT="2010-01-04"> 11 12 <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style"> 13 14 <SCRIPT type="text/javascript"> 15 function windowTitle() 16 { 17 if (location.href.indexOf('is-external=true') == -1) { 18 parent.document.title="ForwardingService (Guava Libraries 2010.01.04)"; 19 } 20 } 21 </SCRIPT> 22 <NOSCRIPT> 23 </NOSCRIPT> 24 25 </HEAD> 26 27 <BODY BGCOLOR="white" onload="windowTitle();"> 28 <HR> 29 30 31 <!-- ========= START OF TOP NAVBAR ======= --> 32 <A NAME="navbar_top"><!-- --></A> 33 <A HREF="#skip-navbar_top" title="Skip navigation links"></A> 34 <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> 35 <TR> 36 <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> 37 <A NAME="navbar_top_firstrow"><!-- --></A> 38 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> 39 <TR ALIGN="center" VALIGN="top"> 40 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> 41 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> 42 <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> 43 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/ForwardingService.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> 44 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> 45 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> 46 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> 47 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> 48 </TR> 49 </TABLE> 50 </TD> 51 <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> 52 </EM> 53 </TD> 54 </TR> 55 56 <TR> 57 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> 58 <A HREF="../../../../../com/google/common/util/concurrent/ForwardingFuture.html" title="class in com.google.common.util.concurrent"><B>PREV CLASS</B></A> 59 <A HREF="../../../../../com/google/common/util/concurrent/Futures.html" title="class in com.google.common.util.concurrent"><B>NEXT CLASS</B></A></FONT></TD> 60 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> 61 <A HREF="../../../../../index.html?com/google/common/util/concurrent/ForwardingService.html" target="_top"><B>FRAMES</B></A> 62 <A HREF="ForwardingService.html" target="_top"><B>NO FRAMES</B></A> 63 <SCRIPT type="text/javascript"> 64 <!-- 65 if(window==top) { 66 document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); 67 } 68 //--> 69 </SCRIPT> 70 <NOSCRIPT> 71 <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> 72 </NOSCRIPT> 73 74 75 </FONT></TD> 76 </TR> 77 <TR> 78 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> 79 SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> 80 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> 81 DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> 82 </TR> 83 </TABLE> 84 <A NAME="skip-navbar_top"></A> 85 <!-- ========= END OF TOP NAVBAR ========= --> 86 87 <HR> 88 <!-- ======== START OF CLASS DATA ======== --> 89 <H2> 90 <FONT SIZE="-1"> 91 com.google.common.util.concurrent</FONT> 92 <BR> 93 Class ForwardingService</H2> 94 <PRE> 95 <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</A> 96 <IMG SRC="../../../../../resources/inherit.gif" ALT="extended by "><A HREF="../../../../../com/google/common/collect/ForwardingObject.html" title="class in com.google.common.collect">com.google.common.collect.ForwardingObject</A> 97 <IMG SRC="../../../../../resources/inherit.gif" ALT="extended by "><B>com.google.common.util.concurrent.ForwardingService</B> 98 </PRE> 99 <DL> 100 <DT><B>All Implemented Interfaces:</B> <DD><A HREF="../../../../../com/google/common/base/Service.html" title="interface in com.google.common.base">Service</A></DD> 101 </DL> 102 <HR> 103 <DL> 104 <DT><PRE>public abstract class <B>ForwardingService</B><DT>extends <A HREF="../../../../../com/google/common/collect/ForwardingObject.html" title="class in com.google.common.collect">ForwardingObject</A><DT>implements <A HREF="../../../../../com/google/common/base/Service.html" title="interface in com.google.common.base">Service</A></DL> 105 </PRE> 106 107 <P> 108 A <A HREF="../../../../../com/google/common/base/Service.html" title="interface in com.google.common.base"><CODE>Service</CODE></A> that forwards all method calls to another service. 109 <P> 110 111 <P> 112 <DL> 113 <DT><B>Since:</B></DT> 114 <DD>2009.09.15 <b>tentative</b></DD> 115 <DT><B>Author:</B></DT> 116 <DD>Chris Nokleberg</DD> 117 </DL> 118 <HR> 119 120 <P> 121 <!-- ======== NESTED CLASS SUMMARY ======== --> 122 123 <A NAME="nested_class_summary"><!-- --></A> 124 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> 125 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> 126 <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> 127 <B>Nested Class Summary</B></FONT></TH> 128 </TR> 129 </TABLE> 130 <A NAME="nested_classes_inherited_from_class_com.google.common.base.Service"><!-- --></A> 131 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> 132 <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> 133 <TH ALIGN="left"><B>Nested classes/interfaces inherited from interface com.google.common.base.<A HREF="../../../../../com/google/common/base/Service.html" title="interface in com.google.common.base">Service</A></B></TH> 134 </TR> 135 <TR BGCOLOR="white" CLASS="TableRowColor"> 136 <TD><CODE><A HREF="../../../../../com/google/common/base/Service.State.html" title="enum in com.google.common.base">Service.State</A></CODE></TD> 137 </TR> 138 </TABLE> 139 140 141 <!-- ======== CONSTRUCTOR SUMMARY ======== --> 142 143 <A NAME="constructor_summary"><!-- --></A> 144 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> 145 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> 146 <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> 147 <B>Constructor Summary</B></FONT></TH> 148 </TR> 149 <TR BGCOLOR="white" CLASS="TableRowColor"> 150 <TD><CODE><B><A HREF="../../../../../com/google/common/util/concurrent/ForwardingService.html#ForwardingService()">ForwardingService</A></B>()</CODE> 151 152 <BR> 153 </TD> 154 </TR> 155 </TABLE> 156 157 <!-- ========== METHOD SUMMARY =========== --> 158 159 <A NAME="method_summary"><!-- --></A> 160 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> 161 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> 162 <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> 163 <B>Method Summary</B></FONT></TH> 164 </TR> 165 <TR BGCOLOR="white" CLASS="TableRowColor"> 166 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 167 <CODE>protected abstract <A HREF="../../../../../com/google/common/base/Service.html" title="interface in com.google.common.base">Service</A></CODE></FONT></TD> 168 <TD><CODE><B><A HREF="../../../../../com/google/common/util/concurrent/ForwardingService.html#delegate()">delegate</A></B>()</CODE> 169 170 <BR> 171 Returns the backing delegate instance that methods are forwarded to.</TD> 172 </TR> 173 <TR BGCOLOR="white" CLASS="TableRowColor"> 174 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 175 <CODE> boolean</CODE></FONT></TD> 176 <TD><CODE><B><A HREF="../../../../../com/google/common/util/concurrent/ForwardingService.html#isRunning()">isRunning</A></B>()</CODE> 177 178 <BR> 179 Returns <code>true</code> if this service is <A HREF="../../../../../com/google/common/base/Service.State.html#RUNNING"><CODE>running</CODE></A>.</TD> 180 </TR> 181 <TR BGCOLOR="white" CLASS="TableRowColor"> 182 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 183 <CODE> <A HREF="http://java.sun.com/javase/6/docs/api/java/util/concurrent/Future.html?is-external=true" title="class or interface in java.util.concurrent">Future</A><<A HREF="../../../../../com/google/common/base/Service.State.html" title="enum in com.google.common.base">Service.State</A>></CODE></FONT></TD> 184 <TD><CODE><B><A HREF="../../../../../com/google/common/util/concurrent/ForwardingService.html#start()">start</A></B>()</CODE> 185 186 <BR> 187 If the service state is <A HREF="../../../../../com/google/common/base/Service.State.html#NEW"><CODE>Service.State.NEW</CODE></A>, this initiates service startup 188 and returns immediately.</TD> 189 </TR> 190 <TR BGCOLOR="white" CLASS="TableRowColor"> 191 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 192 <CODE> <A HREF="../../../../../com/google/common/base/Service.State.html" title="enum in com.google.common.base">Service.State</A></CODE></FONT></TD> 193 <TD><CODE><B><A HREF="../../../../../com/google/common/util/concurrent/ForwardingService.html#startAndWait()">startAndWait</A></B>()</CODE> 194 195 <BR> 196 Initiates service startup (if necessary), returning once the service has 197 finished starting.</TD> 198 </TR> 199 <TR BGCOLOR="white" CLASS="TableRowColor"> 200 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 201 <CODE> <A HREF="../../../../../com/google/common/base/Service.State.html" title="enum in com.google.common.base">Service.State</A></CODE></FONT></TD> 202 <TD><CODE><B><A HREF="../../../../../com/google/common/util/concurrent/ForwardingService.html#state()">state</A></B>()</CODE> 203 204 <BR> 205 Returns the lifecycle state of the service.</TD> 206 </TR> 207 <TR BGCOLOR="white" CLASS="TableRowColor"> 208 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 209 <CODE> <A HREF="http://java.sun.com/javase/6/docs/api/java/util/concurrent/Future.html?is-external=true" title="class or interface in java.util.concurrent">Future</A><<A HREF="../../../../../com/google/common/base/Service.State.html" title="enum in com.google.common.base">Service.State</A>></CODE></FONT></TD> 210 <TD><CODE><B><A HREF="../../../../../com/google/common/util/concurrent/ForwardingService.html#stop()">stop</A></B>()</CODE> 211 212 <BR> 213 If the service is <A HREF="../../../../../com/google/common/base/Service.State.html#STARTING"><CODE>Service.State.STARTING</CODE></A> or <A HREF="../../../../../com/google/common/base/Service.State.html#RUNNING"><CODE>Service.State.RUNNING</CODE></A>, this 214 initiates service shutdown and returns immediately.</TD> 215 </TR> 216 <TR BGCOLOR="white" CLASS="TableRowColor"> 217 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 218 <CODE> <A HREF="../../../../../com/google/common/base/Service.State.html" title="enum in com.google.common.base">Service.State</A></CODE></FONT></TD> 219 <TD><CODE><B><A HREF="../../../../../com/google/common/util/concurrent/ForwardingService.html#stopAndWait()">stopAndWait</A></B>()</CODE> 220 221 <BR> 222 Initiates service shutdown (if necessary), returning once the service has 223 finished stopping.</TD> 224 </TR> 225 </TABLE> 226 <A NAME="methods_inherited_from_class_com.google.common.collect.ForwardingObject"><!-- --></A> 227 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> 228 <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> 229 <TH ALIGN="left"><B>Methods inherited from class com.google.common.collect.<A HREF="../../../../../com/google/common/collect/ForwardingObject.html" title="class in com.google.common.collect">ForwardingObject</A></B></TH> 230 </TR> 231 <TR BGCOLOR="white" CLASS="TableRowColor"> 232 <TD><CODE><A HREF="../../../../../com/google/common/collect/ForwardingObject.html#toString()">toString</A></CODE></TD> 233 </TR> 234 </TABLE> 235 <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> 236 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> 237 <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> 238 <TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></B></TH> 239 </TR> 240 <TR BGCOLOR="white" CLASS="TableRowColor"> 241 <TD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD> 242 </TR> 243 </TABLE> 244 245 <P> 246 247 <!-- ========= CONSTRUCTOR DETAIL ======== --> 248 249 <A NAME="constructor_detail"><!-- --></A> 250 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> 251 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> 252 <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> 253 <B>Constructor Detail</B></FONT></TH> 254 </TR> 255 </TABLE> 256 257 <A NAME="ForwardingService()"><!-- --></A><H3> 258 ForwardingService</H3> 259 <PRE> 260 public <B>ForwardingService</B>()</PRE> 261 <DL> 262 </DL> 263 264 <!-- ============ METHOD DETAIL ========== --> 265 266 <A NAME="method_detail"><!-- --></A> 267 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> 268 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> 269 <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> 270 <B>Method Detail</B></FONT></TH> 271 </TR> 272 </TABLE> 273 274 <A NAME="delegate()"><!-- --></A><H3> 275 delegate</H3> 276 <PRE> 277 protected abstract <A HREF="../../../../../com/google/common/base/Service.html" title="interface in com.google.common.base">Service</A> <B>delegate</B>()</PRE> 278 <DL> 279 <DD><B>Description copied from class: <CODE><A HREF="../../../../../com/google/common/collect/ForwardingObject.html#delegate()">ForwardingObject</A></CODE></B></DD> 280 <DD>Returns the backing delegate instance that methods are forwarded to. 281 Abstract subclasses generally override this method with an abstract method 282 that has a more specific return type, such as <A HREF="../../../../../com/google/common/collect/ForwardingSet.html#delegate()"><CODE>ForwardingSet.delegate()</CODE></A>. Concrete subclasses override this method to supply 283 the instance being decorated. 284 <P> 285 <DD><DL> 286 <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../com/google/common/collect/ForwardingObject.html#delegate()">delegate</A></CODE> in class <CODE><A HREF="../../../../../com/google/common/collect/ForwardingObject.html" title="class in com.google.common.collect">ForwardingObject</A></CODE></DL> 287 </DD> 288 <DD><DL> 289 </DL> 290 </DD> 291 </DL> 292 <HR> 293 294 <A NAME="start()"><!-- --></A><H3> 295 start</H3> 296 <PRE> 297 public <A HREF="http://java.sun.com/javase/6/docs/api/java/util/concurrent/Future.html?is-external=true" title="class or interface in java.util.concurrent">Future</A><<A HREF="../../../../../com/google/common/base/Service.State.html" title="enum in com.google.common.base">Service.State</A>> <B>start</B>()</PRE> 298 <DL> 299 <DD><B>Description copied from interface: <CODE><A HREF="../../../../../com/google/common/base/Service.html#start()">Service</A></CODE></B></DD> 300 <DD>If the service state is <A HREF="../../../../../com/google/common/base/Service.State.html#NEW"><CODE>Service.State.NEW</CODE></A>, this initiates service startup 301 and returns immediately. If the service has already been started, this 302 method returns immediately without taking action. A stopped service may not 303 be restarted. 304 <P> 305 <DD><DL> 306 <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../com/google/common/base/Service.html#start()">start</A></CODE> in interface <CODE><A HREF="../../../../../com/google/common/base/Service.html" title="interface in com.google.common.base">Service</A></CODE></DL> 307 </DD> 308 <DD><DL> 309 310 <DT><B>Returns:</B><DD>a future for the startup result, regardless of whether this call 311 initiated startup. Calling <A HREF="http://java.sun.com/javase/6/docs/api/java/util/concurrent/Future.html?is-external=true#get()" title="class or interface in java.util.concurrent"><CODE>Future.get()</CODE></A> will block until the 312 service has finished starting, and returns one of <A HREF="../../../../../com/google/common/base/Service.State.html#RUNNING"><CODE>Service.State.RUNNING</CODE></A>, <A HREF="../../../../../com/google/common/base/Service.State.html#STOPPING"><CODE>Service.State.STOPPING</CODE></A> or <A HREF="../../../../../com/google/common/base/Service.State.html#TERMINATED"><CODE>Service.State.TERMINATED</CODE></A>. If 313 the service fails to start, <A HREF="http://java.sun.com/javase/6/docs/api/java/util/concurrent/Future.html?is-external=true#get()" title="class or interface in java.util.concurrent"><CODE>Future.get()</CODE></A> will throw an <A HREF="http://java.sun.com/javase/6/docs/api/java/util/concurrent/ExecutionException.html?is-external=true" title="class or interface in java.util.concurrent"><CODE>ExecutionException</CODE></A>, and the service's state will be <A HREF="../../../../../com/google/common/base/Service.State.html#FAILED"><CODE>Service.State.FAILED</CODE></A>. If it has already finished starting, <A HREF="http://java.sun.com/javase/6/docs/api/java/util/concurrent/Future.html?is-external=true#get()" title="class or interface in java.util.concurrent"><CODE>Future.get()</CODE></A> 314 returns immediately. Cancelling the returned future is unsupported and 315 always returns <code>false</code>.</DL> 316 </DD> 317 </DL> 318 <HR> 319 320 <A NAME="state()"><!-- --></A><H3> 321 state</H3> 322 <PRE> 323 public <A HREF="../../../../../com/google/common/base/Service.State.html" title="enum in com.google.common.base">Service.State</A> <B>state</B>()</PRE> 324 <DL> 325 <DD><B>Description copied from interface: <CODE><A HREF="../../../../../com/google/common/base/Service.html#state()">Service</A></CODE></B></DD> 326 <DD>Returns the lifecycle state of the service. 327 <P> 328 <DD><DL> 329 <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../com/google/common/base/Service.html#state()">state</A></CODE> in interface <CODE><A HREF="../../../../../com/google/common/base/Service.html" title="interface in com.google.common.base">Service</A></CODE></DL> 330 </DD> 331 <DD><DL> 332 </DL> 333 </DD> 334 </DL> 335 <HR> 336 337 <A NAME="stop()"><!-- --></A><H3> 338 stop</H3> 339 <PRE> 340 public <A HREF="http://java.sun.com/javase/6/docs/api/java/util/concurrent/Future.html?is-external=true" title="class or interface in java.util.concurrent">Future</A><<A HREF="../../../../../com/google/common/base/Service.State.html" title="enum in com.google.common.base">Service.State</A>> <B>stop</B>()</PRE> 341 <DL> 342 <DD><B>Description copied from interface: <CODE><A HREF="../../../../../com/google/common/base/Service.html#stop()">Service</A></CODE></B></DD> 343 <DD>If the service is <A HREF="../../../../../com/google/common/base/Service.State.html#STARTING"><CODE>Service.State.STARTING</CODE></A> or <A HREF="../../../../../com/google/common/base/Service.State.html#RUNNING"><CODE>Service.State.RUNNING</CODE></A>, this 344 initiates service shutdown and returns immediately. If this is <A HREF="../../../../../com/google/common/base/Service.State.html#NEW"><CODE>Service.State.NEW</CODE></A>, it is <A HREF="../../../../../com/google/common/base/Service.State.html#TERMINATED"><CODE>terminated</CODE></A> without having been 345 started nor stopped. If the service has already been stopped, this 346 method returns immediately without taking action. 347 <P> 348 <DD><DL> 349 <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../com/google/common/base/Service.html#stop()">stop</A></CODE> in interface <CODE><A HREF="../../../../../com/google/common/base/Service.html" title="interface in com.google.common.base">Service</A></CODE></DL> 350 </DD> 351 <DD><DL> 352 353 <DT><B>Returns:</B><DD>a future for the shutdown result, regardless of whether this call 354 initiated shutdown. Calling <A HREF="http://java.sun.com/javase/6/docs/api/java/util/concurrent/Future.html?is-external=true#get()" title="class or interface in java.util.concurrent"><CODE>Future.get()</CODE></A> will block until the 355 service has finished shutting down, and either returns <A HREF="../../../../../com/google/common/base/Service.State.html#TERMINATED"><CODE>Service.State.TERMINATED</CODE></A> or throws an <A HREF="http://java.sun.com/javase/6/docs/api/java/util/concurrent/ExecutionException.html?is-external=true" title="class or interface in java.util.concurrent"><CODE>ExecutionException</CODE></A>. If it has 356 already finished stopping, <A HREF="http://java.sun.com/javase/6/docs/api/java/util/concurrent/Future.html?is-external=true#get()" title="class or interface in java.util.concurrent"><CODE>Future.get()</CODE></A> returns immediately. 357 Cancelling this future is unsupported and always returns <code>false</code>.</DL> 358 </DD> 359 </DL> 360 <HR> 361 362 <A NAME="startAndWait()"><!-- --></A><H3> 363 startAndWait</H3> 364 <PRE> 365 public <A HREF="../../../../../com/google/common/base/Service.State.html" title="enum in com.google.common.base">Service.State</A> <B>startAndWait</B>()</PRE> 366 <DL> 367 <DD><B>Description copied from interface: <CODE><A HREF="../../../../../com/google/common/base/Service.html#startAndWait()">Service</A></CODE></B></DD> 368 <DD>Initiates service startup (if necessary), returning once the service has 369 finished starting. Unlike calling <code>start().get()</code>, this method throws 370 no checked exceptions. 371 <P> 372 <DD><DL> 373 <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../com/google/common/base/Service.html#startAndWait()">startAndWait</A></CODE> in interface <CODE><A HREF="../../../../../com/google/common/base/Service.html" title="interface in com.google.common.base">Service</A></CODE></DL> 374 </DD> 375 <DD><DL> 376 377 <DT><B>Returns:</B><DD>the state of the service when startup finished.</DL> 378 </DD> 379 </DL> 380 <HR> 381 382 <A NAME="stopAndWait()"><!-- --></A><H3> 383 stopAndWait</H3> 384 <PRE> 385 public <A HREF="../../../../../com/google/common/base/Service.State.html" title="enum in com.google.common.base">Service.State</A> <B>stopAndWait</B>()</PRE> 386 <DL> 387 <DD><B>Description copied from interface: <CODE><A HREF="../../../../../com/google/common/base/Service.html#stopAndWait()">Service</A></CODE></B></DD> 388 <DD>Initiates service shutdown (if necessary), returning once the service has 389 finished stopping. If this is <A HREF="../../../../../com/google/common/base/Service.State.html#STARTING"><CODE>Service.State.STARTING</CODE></A>, startup will be 390 cancelled. If this is <A HREF="../../../../../com/google/common/base/Service.State.html#NEW"><CODE>Service.State.NEW</CODE></A>, it is <A HREF="../../../../../com/google/common/base/Service.State.html#TERMINATED"><CODE>terminated</CODE></A> without having been started nor stopped. Unlike calling <code>stop().get()</code>, this method throws no checked exceptions. 391 <P> 392 <DD><DL> 393 <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../com/google/common/base/Service.html#stopAndWait()">stopAndWait</A></CODE> in interface <CODE><A HREF="../../../../../com/google/common/base/Service.html" title="interface in com.google.common.base">Service</A></CODE></DL> 394 </DD> 395 <DD><DL> 396 397 <DT><B>Returns:</B><DD>the state of the service when shutdown finished.</DL> 398 </DD> 399 </DL> 400 <HR> 401 402 <A NAME="isRunning()"><!-- --></A><H3> 403 isRunning</H3> 404 <PRE> 405 public boolean <B>isRunning</B>()</PRE> 406 <DL> 407 <DD><B>Description copied from interface: <CODE><A HREF="../../../../../com/google/common/base/Service.html#isRunning()">Service</A></CODE></B></DD> 408 <DD>Returns <code>true</code> if this service is <A HREF="../../../../../com/google/common/base/Service.State.html#RUNNING"><CODE>running</CODE></A>. 409 <P> 410 <DD><DL> 411 <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../com/google/common/base/Service.html#isRunning()">isRunning</A></CODE> in interface <CODE><A HREF="../../../../../com/google/common/base/Service.html" title="interface in com.google.common.base">Service</A></CODE></DL> 412 </DD> 413 <DD><DL> 414 </DL> 415 </DD> 416 </DL> 417 <!-- ========= END OF CLASS DATA ========= --> 418 <HR> 419 420 421 <!-- ======= START OF BOTTOM NAVBAR ====== --> 422 <A NAME="navbar_bottom"><!-- --></A> 423 <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> 424 <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> 425 <TR> 426 <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> 427 <A NAME="navbar_bottom_firstrow"><!-- --></A> 428 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> 429 <TR ALIGN="center" VALIGN="top"> 430 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> 431 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> 432 <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> 433 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/ForwardingService.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> 434 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> 435 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> 436 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> 437 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> 438 </TR> 439 </TABLE> 440 </TD> 441 <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> 442 </EM> 443 </TD> 444 </TR> 445 446 <TR> 447 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> 448 <A HREF="../../../../../com/google/common/util/concurrent/ForwardingFuture.html" title="class in com.google.common.util.concurrent"><B>PREV CLASS</B></A> 449 <A HREF="../../../../../com/google/common/util/concurrent/Futures.html" title="class in com.google.common.util.concurrent"><B>NEXT CLASS</B></A></FONT></TD> 450 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> 451 <A HREF="../../../../../index.html?com/google/common/util/concurrent/ForwardingService.html" target="_top"><B>FRAMES</B></A> 452 <A HREF="ForwardingService.html" target="_top"><B>NO FRAMES</B></A> 453 <SCRIPT type="text/javascript"> 454 <!-- 455 if(window==top) { 456 document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); 457 } 458 //--> 459 </SCRIPT> 460 <NOSCRIPT> 461 <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> 462 </NOSCRIPT> 463 464 465 </FONT></TD> 466 </TR> 467 <TR> 468 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> 469 SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> 470 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> 471 DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> 472 </TR> 473 </TABLE> 474 <A NAME="skip-navbar_bottom"></A> 475 <!-- ======== END OF BOTTOM NAVBAR ======= --> 476 477 <HR> 478 479 </BODY> 480 </HTML> 481