org.seasar.extension.timer
クラス TimeoutManager

java.lang.Object
  拡張org.seasar.extension.timer.TimeoutManager
すべての実装インタフェース:
Runnable

public class TimeoutManager
extends Object
implements Runnable

Timerを扱うクラスです。

作成者:
higa

フィールドの概要
protected static TimeoutManager instance
          シングルトンのためのインスタンスです。
protected  Thread thread
          TimerのためのThreadです。
protected  SLinkedList timeoutTaskList
          TimeoutTask管理用のリストです。
 
メソッドの概要
 TimeoutTask addTimeoutTarget(TimeoutTarget timeoutTarget, int timeout, boolean permanent)
          TimeoutTargetを追加します。
 void clear()
          管理している TimeoutTaskをクリアします。
protected  List getExpiredTask()
          期限の切れた TimeoutTaskのリストを返します。
static TimeoutManager getInstance()
          シングルトン用のインスタンスを返します。
 int getTimeoutTaskCount()
          管理している TimeoutTaskの数を返します。
 void run()
           
 void start()
          処理を開始します。
 void stop()
          処理を停止します。
protected  boolean stopIfLeisure()
          管理しているタスクが無いなら処理を停止します。
 
クラス java.lang.Object から継承したメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

フィールドの詳細

instance

protected static final TimeoutManager instance
シングルトンのためのインスタンスです。


thread

protected Thread thread
TimerのためのThreadです。


timeoutTaskList

protected final SLinkedList timeoutTaskList
TimeoutTask管理用のリストです。

メソッドの詳細

getInstance

public static TimeoutManager getInstance()
シングルトン用のインスタンスを返します。

戻り値:
シングルトン用のインスタンス

start

public void start()
処理を開始します。


stop

public void stop()
処理を停止します。


clear

public void clear()
管理している TimeoutTaskをクリアします。


addTimeoutTarget

public TimeoutTask addTimeoutTarget(TimeoutTarget timeoutTarget,
                                    int timeout,
                                    boolean permanent)
TimeoutTargetを追加します。

パラメータ:
timeoutTarget -
timeout -
permanent -
戻り値:
TimeoutTask

getTimeoutTaskCount

public int getTimeoutTaskCount()
管理している TimeoutTaskの数を返します。

戻り値:
管理している TimeoutTaskの数

run

public void run()
定義:
インタフェース Runnable 内の run

getExpiredTask

protected List getExpiredTask()
期限の切れた TimeoutTaskのリストを返します。

戻り値:
期限の切れた TimeoutTaskのリスト

stopIfLeisure

protected boolean stopIfLeisure()
管理しているタスクが無いなら処理を停止します。

戻り値:
停止したかどうか


Copyright ? 2004-2007 The Seasar Foundation. All Rights Reserved.