$B2CF#$5$s!#(B<div><br></div><div>$B6b@.$G$9!#(B</div><div>$B$42sEz$"$j$,$H$&$4$6$$$^$9!#(B</div><div><br></div><div>$BC1=c$K(BTaskA.doExecute$B$rF14|2=$9$l$PLdBj$J$+$C$?$N$G$9$M!#(B</div><div>$B:rF|$4;XE&D:$$$?J}K!$G$N<B9T3NG'$r9T$C$?$N$G!"Js9pCW$7$^$9!#(B</div><div><br></div><div>$B<B9T3NG'$r9T$$$^$7$?$,!"(B</div><div>$BLdBj$J$/F0:nCW$7$^$9(B($B8=;~E@$G$O!"%3%s%=!<%k=PNO%l%Y%k$N3NG'$G$9(B)$B!#(B</div>
<div><br></div><div>$B0J2<!";HMQ$7$?%=!<%9$N(BdoExecute$B%a%=%C%IItJ,$G$9!#(B</div><div><br></div><div>ATask.java</div><div><div><span class="Apple-tab-span" style="white-space:pre">        </span>public synchronized void doExecute() {</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>System.out.println("ATask$B<B9T(B : ");</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>pause.set( ! pause.get());</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>this.notify();</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>}</div>
<div><br></div><div>BTask.java</div><div><div><span class="Apple-tab-span" style="white-space:pre">        </span>public void doExecute() {</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>int count = 0;</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>while(count++ < 9000000) {</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>System.out.println("BTask$B<B9TCf(B : " + count);</div>
<div><span class="Apple-tab-span" style="white-space:pre">                        </span>waitProcess();</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>}</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>}</div>
<div><br></div><div>$B59$7$/$*4j$$CW$7$^$9!#(B</div></div></div><div><br></div><div><br><div class="gmail_quote">2009/07/29 17:23 Junichi Kato <span dir="ltr"><<a href="mailto:j5ik2o@gmail.com">j5ik2o@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
$B6b@.$5$s(B<br>
$B2CF#$G$9!#(B<br>
<br>
public synchronized void doExecute() {<br>
<div class="im"> System.out.println("ATask$B<B9T(B : ");<br>
pause.set( ! pause.get() );<br>
this.notify();<br>
}<br>
<br>
</div>$B$H$9$k$H$&$^$/$$$/$H;W$&$s$G$9$,!"$I$&$G$7$g$&$+!#(B<br>
$B$h$m$7$/$*4j$$$7$^$9!#(B<br>
<br>
2009/07/29 10:25 $B$K(B kanari takuma<<a href="mailto:omitmyself.t@gmail.com">omitmyself.t@gmail.com</a>> $B$5$s$O=q$-$^$7$?(B:<br>
<div><div></div><div class="h5">> $B2CF#$5$s(B<br>
> $B6b@.$G$9!#(B<br>
> $B$42sEz$"$j$,$H$&$4$6$$$^$9!#(B<br>
> $BAaB.$G$9$,!"(B<br>
> $B:rF|$4;XE&D:$$$?<BAuJ}K!$G!"F0:n3NG'$r9T$$$^$7$?$N$G!"Js9pCW$7$^$9!#(B<br>
> $B0J2<!";HMQ$7$?%/%i%9$N(BdoExecute$BItJ,$G$9!#(B<br>
> $B!&(BATask(CRON)<br>
> public BTask bTask;<br>
> private AtomicBoolean pause = new AtomicBoolean();<br>
> -- $BCfN,(B --<br>
> public void doExecute() {<br>
> System.out.println("ATask$B<B9T(B : ");<br>
> pause.set( ! pause.get() );<br>
> this.notify();<br>
> }<br>
> (AbstractPausableTask$BFb$G(Bpause$B$,(Bnull$B$K$J$C$F$7$^$&$?$a!"(B<br>
> ATask$B$N(Bpause$B$N@k8@$r!"(Bprivate AtomicBoolean pause;<br>
> $B"*(B private AtomicBoolean pause = new AtomicBoolean();<br>
> $B$KJQ99$7$F!"(BAbstractPausableTask.setPause$B$r8F$S=P$9$h$&$K=$@5$7$^$7$?!#(B)<br>
> $B!&(BBTask(NonDelayTrigger)<br>
> public void doExecute() {<br>
> int count = 0;<br>
> while(count++ < 9000000) {<br>
> System.out.println("BTask$B<B9TCf(B : " + count);<br>
> waitProcess();<br>
> }<br>
> }<br>
> $B!&(BAbstractPausableTask$B$KJQ99$O$"$j$^$;$s!#(B<br>
> $B$3$N%?%9%/$r<B9T$7$?7k2L!"(B<br>
> ATask.doExucete$B$G$N!"(Bnotify$B$r8F$S=P$7;~$K!"(B<br>
> IllegalMonitorStateException$B$,H/@8$7$^$9!#(B<br>
> $B%9%l%C%IE*$KNI$/$J$$$H;W$&$N$G$9$,!"(B<br>
> notify$B$r8F$P$J$1$l$P!"@5>o$K0l;~Dd;_!":F3+$,2DG=$G$7$?!#(B<br>
> ($BNc$($P!"(BAbstractPausableTask$BFb$G!"(BpauseObject$B$N(Bnofity$B$^$GA`:n$9$k$N$O!"(B<br>
> $B$"$^$j%9%^!<%H$J$d$jJ}$G$O$J$$$N$G$7$g$&$+!#(B)<br>
> $B<B9TJ}K!$KLdBjE@Ey$4$6$$$^$7$?$i!"$4;XE&2<$5$$!#(B<br>
> $B59$7$/$*4j$$CW$7$^$9!#(B<br>
><br>
><br>
</div></div><div><div></div><div class="h5">> _______________________________________________<br>
> Seasar-user mailing list<br>
> <a href="mailto:Seasar-user@ml.seasar.org">Seasar-user@ml.seasar.org</a><br>
> <a href="https://ml.seasar.org/mailman/listinfo/seasar-user" target="_blank">https://ml.seasar.org/mailman/listinfo/seasar-user</a><br>
><br>
><br>
<br>
<br>
<br>
--<br>
/**<br>
* name : Junichi Kato<br>
* email : <a href="mailto:j5ik2o@gmail.com">j5ik2o@gmail.com</a><br>
*<br>
* blog : <a href="http://d.hatena.ne.jp/j5ik2o/" target="_blank">http://d.hatena.ne.jp/j5ik2o/</a><br>
*<br>
* commiting projects :<br>
* <a href="http://jiemamy.org/" target="_blank">http://jiemamy.org/</a><br>
* <a href="http://s2chronos.sandbox.seasar.org/" target="_blank">http://s2chronos.sandbox.seasar.org/</a><br>
* <a href="http://s2config.sandbox.seasar.org/" target="_blank">http://s2config.sandbox.seasar.org/</a><br>
*/<br>
_______________________________________________<br>
Seasar-user mailing list<br>
<a href="mailto:Seasar-user@ml.seasar.org">Seasar-user@ml.seasar.org</a><br>
<a href="https://ml.seasar.org/mailman/listinfo/seasar-user" target="_blank">https://ml.seasar.org/mailman/listinfo/seasar-user</a><br>
</div></div></blockquote></div><br></div>