de.phleisch.app.itsucks.core.impl
Class WorkerPoolImpl

java.lang.Object
  extended by de.phleisch.app.itsucks.core.impl.WorkerPoolImpl
All Implemented Interfaces:
WorkerPool

public class WorkerPoolImpl
extends java.lang.Object
implements WorkerPool

Default implementation of the WorkerPool.

Author:
olli

Constructor Summary
WorkerPoolImpl()
           
WorkerPoolImpl(int pSize)
           
 
Method Summary
 void abortBusyWorker()
           
 void dispatchJob(Job job)
           
 int getBusyWorkerCount()
           
 WorkerThread getFreeWorker()
           
 void initialize()
           
 void returnWorker(WorkerThread pWorker)
           
 void setSize(int pSize)
           
 void shutdown()
           
 WorkerThread waitForFreeWorker()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WorkerPoolImpl

public WorkerPoolImpl()

WorkerPoolImpl

public WorkerPoolImpl(int pSize)
Method Detail

initialize

public void initialize()
Specified by:
initialize in interface WorkerPool

shutdown

public void shutdown()
Specified by:
shutdown in interface WorkerPool

setSize

public void setSize(int pSize)
Specified by:
setSize in interface WorkerPool

getFreeWorker

public WorkerThread getFreeWorker()
Specified by:
getFreeWorker in interface WorkerPool

returnWorker

public void returnWorker(WorkerThread pWorker)
Specified by:
returnWorker in interface WorkerPool

waitForFreeWorker

public WorkerThread waitForFreeWorker()
                               throws java.lang.InterruptedException
Specified by:
waitForFreeWorker in interface WorkerPool
Throws:
java.lang.InterruptedException

dispatchJob

public void dispatchJob(Job job)
                 throws java.lang.InterruptedException
Specified by:
dispatchJob in interface WorkerPool
Throws:
java.lang.InterruptedException

getBusyWorkerCount

public int getBusyWorkerCount()
Specified by:
getBusyWorkerCount in interface WorkerPool

abortBusyWorker

public void abortBusyWorker()
Specified by:
abortBusyWorker in interface WorkerPool


Copyright © 2010. All Rights Reserved.