|
|||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | ||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | ||||||||
java.lang.Objectjp.go.nict.langrid.commons.runner.MultithreadRunner
public class MultithreadRunner
複数スレッドから同時に特定の処理を呼び出す。
| コンストラクタの概要 | |
|---|---|
MultithreadRunner(int threadCount,
int retryCount,
StatusReporter reporter)
コンストラクタ。 |
|
| メソッドの概要 | |
|---|---|
protected Runnable |
createRunnable(String name,
SinglethreadRunnable runnable,
CountDownLatch startSignal,
CountDownLatch endSignal,
List<Exception> exceptions)
|
protected void |
done(long dt)
|
protected void |
fault(long dt)
|
protected void |
fault(long dt,
Exception e)
|
long |
getDeltaTimeMillis()
runメソッドに要した時間を取得する。 |
Collection<Exception> |
getExceptions()
処理の実行中に記録された例外を取得する。 |
int |
getRetryCount()
失敗時の再試行回数を取得する。 |
int |
getRetryWaitMinMillis()
再実行時の待機ミリ秒最小値を返す。 |
int |
getRetryWaitRangeMillis()
再実行時の待機ミリ秒幅を返す。 |
int |
getThreadCount()
スレッド数を取得する。 |
protected int |
getTotalCount()
|
void |
runAndWait(MultithreadRunnable runnable)
runnableを指定された個数のスレッドで実行する。 |
void |
runAndWait(SinglethreadRunnableFactory factory)
factoryから指定された個数のrunnableとスレッドを作成し実行する。 |
void |
setRetryWaitMinMillis(int retryWaitMinMillis)
再実行時の待機ミリ秒最小値を設定する。 |
void |
setRetryWaitRangeMillis(int retryWaitRangeMillis)
再実行時の待機ミリ秒幅を設定する。 |
| クラス java.lang.Object から継承されたメソッド |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| コンストラクタの詳細 |
|---|
public MultithreadRunner(int threadCount,
int retryCount,
StatusReporter reporter)
threadCount - スレッド数retryCount - 失敗時の再試行回数reporter - StatusReporter| メソッドの詳細 |
|---|
public int getThreadCount()
public int getRetryCount()
public long getDeltaTimeMillis()
public void runAndWait(MultithreadRunnable runnable)
throws InterruptedException
runnable - 実行する処理
InterruptedException - 同期処理が中断された
public void runAndWait(SinglethreadRunnableFactory factory)
throws InterruptedException
factory - 実行する処理のファクトリ
InterruptedException - 同期処理が中断されたpublic int getRetryWaitMinMillis()
public void setRetryWaitMinMillis(int retryWaitMinMillis)
retryWaitMinMillis - 再実行時の待機ミリ秒最小値public int getRetryWaitRangeMillis()
public void setRetryWaitRangeMillis(int retryWaitRangeMillis)
retryWaitRangeMillis - 再実行時の待機ミリ秒幅public Collection<Exception> getExceptions()
protected int getTotalCount()
protected Runnable createRunnable(String name,
SinglethreadRunnable runnable,
CountDownLatch startSignal,
CountDownLatch endSignal,
List<Exception> exceptions)
protected void done(long dt)
protected void fault(long dt)
protected void fault(long dt,
Exception e)
|
|||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | ||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | ||||||||