org.sca4j.threadpool
Class ThreadPoolWorkScheduler

java.lang.Object
  extended by org.sca4j.threadpool.ThreadPoolWorkScheduler
All Implemented Interfaces:
org.sca4j.host.work.WorkScheduler

public class ThreadPoolWorkScheduler
extends java.lang.Object
implements org.sca4j.host.work.WorkScheduler

Thread pool based implementation of the work scheduler.


Field Summary
 boolean pauseOnStart
           
 int size
           
 
Constructor Summary
ThreadPoolWorkScheduler()
           
 
Method Summary
 void init()
          Initializes the thread-pool.
<T extends org.sca4j.host.work.DefaultPausableWork>
void
scheduleWork(T work)
           
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

size

public int size

pauseOnStart

public boolean pauseOnStart
Constructor Detail

ThreadPoolWorkScheduler

public ThreadPoolWorkScheduler()
Method Detail

init

public void init()
Initializes the thread-pool. Supports unbounded work with a fixed pool size. If all the workers are busy, work gets queued.


scheduleWork

public <T extends org.sca4j.host.work.DefaultPausableWork> void scheduleWork(T work)
Specified by:
scheduleWork in interface org.sca4j.host.work.WorkScheduler

stop

public void stop()
          throws java.lang.InterruptedException
Throws:
java.lang.InterruptedException


Copyright © 2008-2010 Service Symphony. All Rights Reserved.