org.jmage.pool
Class WorkerPoolImpl

java.lang.Object
  extended by org.jmage.pool.WorkerPoolImpl
All Implemented Interfaces:
WorkerPool

public class WorkerPoolImpl
extends java.lang.Object
implements WorkerPool

WorkerPoolImpl


Field Summary
protected static int DEFAULT_TIMEOUT_SECONDS
           
protected static org.apache.log4j.Logger log
           
static int MAX_JOBS
           
protected  int timeoutSeconds
           
protected  java.util.Set workerPool
           
 
Constructor Summary
WorkerPoolImpl()
           
 
Method Summary
 void addWorker(Worker worker)
           
 void freeWorker(Worker worker)
           
 void freeWorkerFor(java.lang.Object object)
           
 java.util.Set getAllWorkers()
           
 int getTimeoutSeconds()
           
protected  boolean hasDozedOff(Worker worker)
           
 Worker hireWorker()
           
 void removeWorker(Worker worker)
           
protected  void resetWorker(Worker worker)
           
 void setTimeoutSeconds(int timeoutSeconds)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

timeoutSeconds

protected int timeoutSeconds

DEFAULT_TIMEOUT_SECONDS

protected static final int DEFAULT_TIMEOUT_SECONDS
See Also:
Constant Field Values

MAX_JOBS

public static final int MAX_JOBS
See Also:
Constant Field Values

workerPool

protected java.util.Set workerPool

log

protected static org.apache.log4j.Logger log
Constructor Detail

WorkerPoolImpl

public WorkerPoolImpl()
Method Detail

getTimeoutSeconds

public int getTimeoutSeconds()
                      throws WorkerException
Specified by:
getTimeoutSeconds in interface WorkerPool
Throws:
WorkerException

setTimeoutSeconds

public void setTimeoutSeconds(int timeoutSeconds)
                       throws WorkerException
Specified by:
setTimeoutSeconds in interface WorkerPool
Throws:
WorkerException

addWorker

public void addWorker(Worker worker)
               throws WorkerException
Specified by:
addWorker in interface WorkerPool
Throws:
WorkerException

removeWorker

public void removeWorker(Worker worker)
                  throws WorkerException
Specified by:
removeWorker in interface WorkerPool
Throws:
WorkerException

hireWorker

public Worker hireWorker()
                  throws WorkerException
Specified by:
hireWorker in interface WorkerPool
Throws:
WorkerException

getAllWorkers

public java.util.Set getAllWorkers()
                            throws WorkerException
Specified by:
getAllWorkers in interface WorkerPool
Throws:
WorkerException

freeWorker

public void freeWorker(Worker worker)
                throws WorkerException
Specified by:
freeWorker in interface WorkerPool
Throws:
WorkerException

freeWorkerFor

public void freeWorkerFor(java.lang.Object object)
                   throws WorkerException
Specified by:
freeWorkerFor in interface WorkerPool
Throws:
WorkerException

hasDozedOff

protected boolean hasDozedOff(Worker worker)

resetWorker

protected void resetWorker(Worker worker)


Copyright © 2004-2008 Sourceforge. All Rights Reserved.