org.databene.task.runner
Class PagedTaskRunner

java.lang.Object
  extended by org.databene.task.runner.PagedTaskRunner
All Implemented Interfaces:
java.lang.Thread.UncaughtExceptionHandler, TaskRunner

public class PagedTaskRunner
extends java.lang.Object
implements TaskRunner, java.lang.Thread.UncaughtExceptionHandler

TaskRunner implementation that provides for repeated, paged, multi- or single-threaded Task execution.

Created: 16.07.2007 19:25:30

Author:
Volker Bergmann

Field Summary
protected  StateTrackingTaskProxy<? extends Task> target
           
 
Constructor Summary
PagedTaskRunner(Task target, java.util.List<PageListener> listeners, long pageSize, int threads, boolean stats, java.util.concurrent.ExecutorService executor)
           
PagedTaskRunner(Task target, java.util.List<PageListener> pageListeners, long pageSize, int threads, boolean stats, org.databene.commons.Expression<java.util.concurrent.ExecutorService> executor, org.databene.commons.Context context, org.databene.commons.ErrorHandler errorHandler)
           
 
Method Summary
static org.databene.contiperf.PerformanceTracker execute(Task task, org.databene.commons.Context context, java.lang.Long requestedInvocations, java.lang.Long minInvocations, java.util.List<PageListener> pageListeners, long pageSize, int threadCount, boolean stats, java.util.concurrent.ExecutorService executorService, org.databene.commons.ErrorHandler errorHandler, boolean infoLog)
           
 long getActualCount()
           
 long getPageSize()
           
 java.lang.String getTaskName()
           
 int getThreadCount()
           
protected  void pageFinished(int currentPageNo, org.databene.commons.Context context)
           
protected  void pageStarting(int currentPageNo)
           
 long run(java.lang.Long invocationCount)
           
 long run(java.lang.Long requestedInvocations, java.lang.Long minInvocations)
           
 java.lang.String toString()
           
 void uncaughtException(java.lang.Thread t, java.lang.Throwable e)
           
protected  boolean workPending(java.lang.Long maxInvocationCount)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

target

protected StateTrackingTaskProxy<? extends Task> target
Constructor Detail

PagedTaskRunner

public PagedTaskRunner(Task target,
                       java.util.List<PageListener> listeners,
                       long pageSize,
                       int threads,
                       boolean stats,
                       java.util.concurrent.ExecutorService executor)

PagedTaskRunner

public PagedTaskRunner(Task target,
                       java.util.List<PageListener> pageListeners,
                       long pageSize,
                       int threads,
                       boolean stats,
                       org.databene.commons.Expression<java.util.concurrent.ExecutorService> executor,
                       org.databene.commons.Context context,
                       org.databene.commons.ErrorHandler errorHandler)
Method Detail

getActualCount

public long getActualCount()

getPageSize

public long getPageSize()

getThreadCount

public int getThreadCount()

run

public long run(java.lang.Long requestedInvocations,
                java.lang.Long minInvocations)

run

public long run(java.lang.Long invocationCount)
Specified by:
run in interface TaskRunner

getTaskName

public java.lang.String getTaskName()

execute

public static org.databene.contiperf.PerformanceTracker execute(Task task,
                                                                org.databene.commons.Context context,
                                                                java.lang.Long requestedInvocations,
                                                                java.lang.Long minInvocations,
                                                                java.util.List<PageListener> pageListeners,
                                                                long pageSize,
                                                                int threadCount,
                                                                boolean stats,
                                                                java.util.concurrent.ExecutorService executorService,
                                                                org.databene.commons.ErrorHandler errorHandler,
                                                                boolean infoLog)

workPending

protected boolean workPending(java.lang.Long maxInvocationCount)

pageStarting

protected void pageStarting(int currentPageNo)

pageFinished

protected void pageFinished(int currentPageNo,
                            org.databene.commons.Context context)

uncaughtException

public void uncaughtException(java.lang.Thread t,
                              java.lang.Throwable e)
Specified by:
uncaughtException in interface java.lang.Thread.UncaughtExceptionHandler

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2011. All Rights Reserved.