/usr/share/doc/libgpars-groovy-java/api/gpars/actor/AbstractPooledActor.html is in libgpars-groovy-java-doc 0.10-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 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- **************************************************************** -->
<!-- * PLEASE KEEP COMPLICATED EXPRESSIONS OUT OF THESE TEMPLATES, * -->
<!-- * i.e. only iterate & print data where possible. Thanks, Jez. * -->
<!-- **************************************************************** -->
<html>
<head>
<!-- Generated by groovydoc (1.7.0) on Tue Nov 16 18:55:58 UTC 2010 -->
<title>AbstractPooledActor (Groovy Documentation)</title>
<meta name="date" content="2010-11-16">
<link href="../../groovy.ico" type="image/x-icon" rel="shortcut icon">
<link href="../../groovy.ico" type="image/x-icon" rel="icon">
<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="AbstractPooledActor (Groovy Documentation)";
}
}
</script>
<noscript>
</noscript>
</head><body onload="windowTitle();" bgcolor="white">
<hr>
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></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>
<b>Groovy Documentation</b>
</EM></TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><!--<FONT SIZE="-2">
<A HREF="../../groovy/lang/ExpandoMetaClass.ExpandoMetaProperty.html" title="class in groovy.lang"><B>PREV CLASS</B></A>
<A HREF="../../groovy/lang/GroovyClassLoader.html" title="class in groovy.lang"><B>NEXT CLASS</B></A></FONT>--></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../index.html?gpars/actor/AbstractPooledActor.html" target="_top"><B>FRAMES</B></A>
<A HREF="AbstractPooledActor.html" target="_top"><B>NO FRAMES</B></A>
<script type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../allclasses-frame.html"><B>All Classes</B></A>');
}
//-->
</script>
<noscript>
<A HREF="../../allclasses-frame.html"><B>All Classes</B></A>
</noscript>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
gpars.actor</FONT>
<BR>
<FONT CLASS="ClassTitleFont">Class AbstractPooledActor</FONT></H2>
<pre><a href='/usr/share/doc/default-jdk-doc/api/java/lang/Object.html' title='java.lang.Object'>java.lang.Object</a>
<img src='../../inherit.gif'><a href='../../groovyx/gpars/actor/impl/SequentialProcessingActor.html'>groovyx.gpars.actor.impl.SequentialProcessingActor</a>
<img src='../../inherit.gif'>gpars.actor.AbstractPooledActor
</pre><hr>
<PRE>@SuppressWarnings({"ThrowCaughtLocally", "UnqualifiedStaticUsage"})
class AbstractPooledActor
extends <a href='../../groovyx/gpars/actor/impl/SequentialProcessingActor.html'>SequentialProcessingActor</a>
</PRE>
<P>
AbstractPooledActor provides the default Actor implementation. It represents a standalone active object (actor),
which reacts asynchronously to messages sent to it from outside through the send() method.
Each Actor has its own message queue and a thread pool shared with other Actors by means of an instance
of the PGroup, which they have in common.
The PGroup instance is responsible for the pool creation, management and shutdown.
All work performed by an Actor is divided into chunks, which are sequentially submitted as independent tasks
to the thread pool for processing.
Whenever an Actor looks for a new message through the react() method, the actor gets detached
from the thread, making the thread available for other actors. Thanks to the ability to dynamically attach and detach
threads to actors, Actors can scale far beyond the limits of the underlying platform on number of concurrently
available threads.
The receive() method can be used to read a message from the queue without giving up the thread. If no message is available,
the call to receive() blocks until a message arrives or the supplied timeout expires.
The loop() method allows to repeatedly invoke a closure and yet perform each of the iterations sequentially
in different thread from the thread pool.
To support continuations correctly the react() and loop() methods never return.
<pre>
import static groovyx.gpars.actor.Actors.actor
<p/>
def actor = actor {
loop {
react {message ->
println message
}
//this line will never be reached
}
//this line will never be reached
}.start()
<p/>
actor.send 'Hi!'
</pre>
This requires the code to be structured accordingly.
<p/>
<pre>
def adder = actor {
loop {
react {a ->
react {b ->
println a+b
replyIfExists a+b //sends reply, if b was sent by a PooledActor
}
}
//this line will never be reached
}
//this line will never be reached
}.start()
</pre>
The react method can accept multiple messages in the passed-in closure
<pre>
react {Integer a, String b ->
...
}
</pre>
The closures passed to the react() method can call reply() or replyIfExists(), which will send a message back to
the originator of the currently processed message. The replyIfExists() method unlike the reply() method will not fail
if the original message wasn't sent by an actor nor if the original sender actor is no longer running.
The reply() and replyIfExists() methods are also dynamically added to the processed messages.
<pre>
react {a ->
react {b ->
reply 'message' //sent to senders of a as well as b
a.reply 'private message' //sent to the sender of a only
}
}
</pre>
<p/>
The react() method accepts timeout specified using the TimeCategory DSL.
<pre>
react(10.MINUTES) {
println 'Received message: ' + it
}
</pre>
If no message arrives within the given timeout, the onTimeout() lifecycle handler is invoked, if exists,
and the actor terminates.
Each Actor has at any point in time at most one active instance of ActorAction associated, which abstracts
the current chunk of actor's work to perform. Once a thread is assigned to the ActorAction, it moves the actor forward
till loop() or react() is called. These methods schedule another ActorAction for processing and throw dedicated exception
to terminate the current ActorAction.
<p/>
Each Actor can define lifecycle observing methods, which will be called by the Actor's background thread whenever a certain lifecycle event occurs.
<ul>
<li>afterStart() - called immediately after the Actor's background thread has been started, before the act() method is called the first time.</li>
<li>afterStop(List undeliveredMessages) - called right after the actor is stopped, passing in all the messages from the queue.</li>
<li>onInterrupt(InterruptedException e) - called when a react() method timeouts. The actor will be terminated.
<li>onTimeout() - called when the actor's thread gets interrupted. Thread interruption will result in the stopping the actor in any case.</li>
<li>onException(Throwable e) - called when an exception occurs in the actor's thread. Throwing an exception from this method will stop the actor.</li>
</ul>
<DL><DT><B>author:</B></DT><DD>Vaclav Pech, Alex Tkachman, Dierk Koenig
Date: Feb 7, 2009
</DD></DL>
</P>
<hr>
<!-- =========== NESTED CLASS SUMMARY =========== -->
<A NAME="nested_summary"><!-- --></A>
<!-- =========== ENUM CONSTANT SUMMARY =========== -->
<A NAME="enum_constant_summary"><!-- --></A>
<!-- =========== FIELD SUMMARY =========== -->
<A NAME="field_summary"><!-- --></A>
<!-- =========== PROPERTY SUMMARY =========== -->
<A NAME="property_summary"><!-- --></A>
<!-- =========== ELEMENT SUMMARY =========== -->
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#D5D5FF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD>
<CODE><B><a href="#AbstractPooledActor()">AbstractPooledActor</a></B>()</CODE>
<BR>
<P></P>
</TD>
</TR>
</TABLE>
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2" CLASS="ClassHeadingFont">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1" CLASS="ClassItemFont">
<CODE>protected void</CODE></FONT>
</TD>
<TD>
<CODE><b><a href="#act()">act</a></b>()</CODE>
<BR>
<P> This method represents the body of the actor. </P>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1" CLASS="ClassItemFont">
<CODE>protected void</CODE></FONT>
</TD>
<TD>
<CODE><b><a href="#doOnException(Throwable)">doOnException</a></b>(<a href='/usr/share/doc/default-jdk-doc/api/java/lang/Throwable.html' title='Throwable'>Throwable</a> exception)</CODE>
<BR>
<P></P>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1" CLASS="ClassItemFont">
<CODE>protected void</CODE></FONT>
</TD>
<TD>
<CODE><b><a href="#doOnInterrupt(InterruptedException)">doOnInterrupt</a></b>(<a href='/usr/share/doc/default-jdk-doc/api/java/lang/InterruptedException.html' title='InterruptedException'>InterruptedException</a> exception)</CODE>
<BR>
<P></P>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1" CLASS="ClassItemFont">
<CODE>protected void</CODE></FONT>
</TD>
<TD>
<CODE><b><a href="#doOnStart()">doOnStart</a></b>()</CODE>
<BR>
<P></P>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1" CLASS="ClassItemFont">
<CODE>protected void</CODE></FONT>
</TD>
<TD>
<CODE><b><a href="#doOnTermination()">doOnTermination</a></b>()</CODE>
<BR>
<P></P>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1" CLASS="ClassItemFont">
<CODE>protected void</CODE></FONT>
</TD>
<TD>
<CODE><b><a href="#doOnTimeout()">doOnTimeout</a></b>()</CODE>
<BR>
<P></P>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1" CLASS="ClassItemFont">
<CODE>void</CODE></FONT>
</TD>
<TD>
<CODE><b><a href="#onStop(Closure)">onStop</a></b>(Closure onStop)</CODE>
<BR>
<P> Set on stop handler for this actor
</P>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1" CLASS="ClassItemFont">
<CODE>protected void</CODE></FONT>
</TD>
<TD>
<CODE><b><a href="#receive(Closure)">receive</a></b>(Closure handler)</CODE>
<BR>
<P> Retrieves a message from the message queue, waiting, if necessary, for a message to arrive.
</P>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1" CLASS="ClassItemFont">
<CODE>protected void</CODE></FONT>
</TD>
<TD>
<CODE><b><a href="#receive(long, TimeUnit, Closure)">receive</a></b>(long timeout, TimeUnit timeUnit, Closure handler)</CODE>
<BR>
<P> Retrieves a message from the message queue, waiting, if necessary, for a message to arrive.
</P>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1" CLASS="ClassItemFont">
<CODE>protected void</CODE></FONT>
</TD>
<TD>
<CODE><b><a href="#receive(Duration, Closure)">receive</a></b>(Duration duration, Closure handler)</CODE>
<BR>
<P> Retrieves a message from the message queue, waiting, if necessary, for a message to arrive.
</P>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1" CLASS="ClassItemFont">
<CODE>protected <a href='/usr/share/doc/default-jdk-doc/api/java/lang/Object.html' title='Object'>Object</a></CODE></FONT>
</TD>
<TD>
<CODE><b><a href="#receiveImpl()">receiveImpl</a></b>()</CODE>
<BR>
<P> Retrieves a message from the message queue, waiting, if necessary, for a message to arrive.
</P>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1" CLASS="ClassItemFont">
<CODE>protected <a href='/usr/share/doc/default-jdk-doc/api/java/lang/Object.html' title='Object'>Object</a></CODE></FONT>
</TD>
<TD>
<CODE><b><a href="#receiveImpl(long, TimeUnit)">receiveImpl</a></b>(long timeout, TimeUnit units)</CODE>
<BR>
<P> Retrieves a message from the message queue, waiting, if necessary, for a message to arrive.
</P>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1" CLASS="ClassItemFont">
<CODE>List</CODE></FONT>
</TD>
<TD>
<CODE><b><a href="#sweepQueue()">sweepQueue</a></b>()</CODE>
<BR>
<P> Clears the message queue returning all the messages it held.
</P>
</TD>
</TR>
</TABLE>
<P>
<!-- ============ ENUM CONSTANT DETAIL ========== -->
<A NAME="enum_constant_detail"><!-- --></A>
<!-- =========== FIELD DETAIL =========== -->
<A NAME="field_detail"><!-- --></A>
<!-- =========== PROPERTY DETAIL =========== -->
<A NAME="prop_detail"><!-- --></A>
<!-- =========== ELEMENT DETAIL =========== -->
<A NAME="element_detail"><!-- --></A>
<!-- ========= 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="AbstractPooledActor()"><!-- --></A><H3>
AbstractPooledActor</H3>
<PRE><B>AbstractPooledActor</B>()</PRE>
<DL>
<DD>
</DD>
<P>
</DL>
<HR>
<!-- ============ 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="act()"><!-- --></A><H3>
act</H3>
<PRE>protected void <B>act</B>()</PRE>
<DL>
<DD> This method represents the body of the actor. It is called upon actor's start and can exit either normally
by return or due to actor being stopped through the stop() method, which cancels the current actor action.
Provides an extension point for subclasses to provide their custom Actor's message handling code.
</DD>
<P>
</DL>
<HR>
<A NAME="doOnException(Throwable)"><!-- --></A><H3>
doOnException</H3>
<PRE>@SuppressWarnings({"UseOfSystemOutOrSystemErr"})
@Override
protected void <B>doOnException</B>(<a href='/usr/share/doc/default-jdk-doc/api/java/lang/Throwable.html' title='Throwable'>Throwable</a> exception)</PRE>
<DL>
<DD>
</DD>
<P>
</DL>
<HR>
<A NAME="doOnInterrupt(InterruptedException)"><!-- --></A><H3>
doOnInterrupt</H3>
<PRE>@SuppressWarnings({"UseOfSystemOutOrSystemErr"})
@Override
protected void <B>doOnInterrupt</B>(<a href='/usr/share/doc/default-jdk-doc/api/java/lang/InterruptedException.html' title='InterruptedException'>InterruptedException</a> exception)</PRE>
<DL>
<DD>
</DD>
<P>
</DL>
<HR>
<A NAME="doOnStart()"><!-- --></A><H3>
doOnStart</H3>
<PRE>@Override
protected void <B>doOnStart</B>()</PRE>
<DL>
<DD>
</DD>
<P>
</DL>
<HR>
<A NAME="doOnTermination()"><!-- --></A><H3>
doOnTermination</H3>
<PRE>@Override
@SuppressWarnings({"FeatureEnvy"})
protected void <B>doOnTermination</B>()</PRE>
<DL>
<DD>
</DD>
<P>
</DL>
<HR>
<A NAME="doOnTimeout()"><!-- --></A><H3>
doOnTimeout</H3>
<PRE>@Override
protected void <B>doOnTimeout</B>()</PRE>
<DL>
<DD>
</DD>
<P>
</DL>
<HR>
<A NAME="onStop(Closure)"><!-- --></A><H3>
onStop</H3>
<PRE>public final void <B>onStop</B>(Closure onStop)</PRE>
<DL>
<DD> Set on stop handler for this actor
<DL><DT><B>param:</B></DT><DD>onStop The code to invoke when stopping
</DD></DL>
</DD>
<P>
</DL>
<HR>
<A NAME="receive(Closure)"><!-- --></A><H3>
receive</H3>
<PRE>@SuppressWarnings({"MethodOverloadsMethodOfSuperclass"})
protected final void <B>receive</B>(Closure handler)</PRE>
<DL>
<DD> Retrieves a message from the message queue, waiting, if necessary, for a message to arrive.
The message retrieved from the queue is passed into the handler as the only parameter.
<DL><DT><B>param:</B></DT><DD>handler A closure accepting the retrieved message as a parameter, which will be invoked after a message is received.
</DD></DL><DL><DT><B>throws:</B></DT><DD>InterruptedException If the thread is interrupted during the wait. Should propagate up to stop the thread.
</DD></DL>
</DD>
<P>
</DL>
<HR>
<A NAME="receive(long, TimeUnit, Closure)"><!-- --></A><H3>
receive</H3>
<PRE>protected final void <B>receive</B>(long timeout, TimeUnit timeUnit, Closure handler)</PRE>
<DL>
<DD> Retrieves a message from the message queue, waiting, if necessary, for a message to arrive.
The message retrieved from the queue is passed into the handler as the only parameter.
A null value is passed into the handler, if the timeout expires
<DL><DT><B>param:</B></DT><DD>timeout how long to wait before giving up, in units of unit
</DD></DL><DL><DT><B>param:</B></DT><DD>timeUnit a TimeUnit determining how to interpret the timeout parameter
</DD></DL><DL><DT><B>param:</B></DT><DD>handler A closure accepting the retrieved message as a parameter, which will be invoked after a message is received.
</DD></DL><DL><DT><B>throws:</B></DT><DD>InterruptedException If the thread is interrupted during the wait. Should propagate up to stop the thread.
</DD></DL>
</DD>
<P>
</DL>
<HR>
<A NAME="receive(Duration, Closure)"><!-- --></A><H3>
receive</H3>
<PRE>@SuppressWarnings({"MethodOverloadsMethodOfSuperclass", "TypeMayBeWeakened"})
protected final void <B>receive</B>(Duration duration, Closure handler)</PRE>
<DL>
<DD> Retrieves a message from the message queue, waiting, if necessary, for a message to arrive.
The message retrieved from the queue is passed into the handler as the only parameter.
A null value is passed into the handler, if the timeout expires
<DL><DT><B>param:</B></DT><DD>duration how long to wait before giving up, in units of unit
</DD></DL><DL><DT><B>param:</B></DT><DD>handler A closure accepting the retrieved message as a parameter, which will be invoked after a message is received.
</DD></DL><DL><DT><B>throws:</B></DT><DD>InterruptedException If the thread is interrupted during the wait. Should propagate up to stop the thread.
</DD></DL>
</DD>
<P>
</DL>
<HR>
<A NAME="receiveImpl()"><!-- --></A><H3>
receiveImpl</H3>
<PRE>@Override
protected final <a href='/usr/share/doc/default-jdk-doc/api/java/lang/Object.html' title='Object'>Object</a> <B>receiveImpl</B>()</PRE>
<DL>
<DD> Retrieves a message from the message queue, waiting, if necessary, for a message to arrive.
<DL><DT><B>return:</B></DT><DD>The message retrieved from the queue.
</DD></DL><DL><DT><B>throws:</B></DT><DD>InterruptedException If the thread is interrupted during the wait. Should propagate up to stop the thread.
</DD></DL>
</DD>
<P>
</DL>
<HR>
<A NAME="receiveImpl(long, TimeUnit)"><!-- --></A><H3>
receiveImpl</H3>
<PRE>@Override
protected final <a href='/usr/share/doc/default-jdk-doc/api/java/lang/Object.html' title='Object'>Object</a> <B>receiveImpl</B>(long timeout, TimeUnit units)</PRE>
<DL>
<DD> Retrieves a message from the message queue, waiting, if necessary, for a message to arrive.
<DL><DT><B>param:</B></DT><DD>timeout how long to wait before giving up, in units of unit
</DD></DL><DL><DT><B>param:</B></DT><DD>units a TimeUnit determining how to interpret the timeout parameter
</DD></DL><DL><DT><B>return:</B></DT><DD>The message retrieved from the queue, or null, if the timeout expires.
</DD></DL><DL><DT><B>throws:</B></DT><DD>InterruptedException If the thread is interrupted during the wait. Should propagate up to stop the thread.
</DD></DL>
</DD>
<P>
</DL>
<HR>
<A NAME="sweepQueue()"><!-- --></A><H3>
sweepQueue</H3>
<PRE>public final List <B>sweepQueue</B>()</PRE>
<DL>
<DD> Clears the message queue returning all the messages it held.
<DL><DT><B>return:</B></DT><DD>The messages stored in the queue
</DD></DL>
</DD>
<P>
</DL>
<HR>
<!-- ========= END OF CLASS DATA ========= -->
<p>Groovy Documentation</p>
<hr>
</body>
</html>
|