|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.droids.AbstractDroid
public abstract class AbstractDroid
Constructor Summary | |
---|---|
AbstractDroid()
|
Method Summary | |
---|---|
void |
finishedWorker(long id)
Notification that we finished a given worker. |
Core |
getCore()
Return the core configuration for the current Droid. |
int |
getFreeSlots()
Get number of slots that we have currently open to accept new workers. |
int |
getMaxThreads()
Get number of maximum allowed threads |
ThreadPoolExecutor |
getPool()
Get our pool. |
protected Queue |
getQueue()
Get the queue implementation that we want to use. |
int |
getRunningThreads()
Get number of currently running threads |
ConcurrentHashMap<Long,Worker> |
getRunningWorker()
Return the map of running workers |
String |
getTaskDate()
When did the task showed up the first time in the queue |
abstract Worker |
getWorker()
Get the default worker for the class. |
void |
setCore(Core core)
Set the fully configured core and inject it in the |
void |
setFreeSlots(int freeSlots)
Set number of slots that we have currently open to accept new workers |
void |
setMaxThreads(int maxThreads)
Adjust number of allowed threads |
void |
setPool(ThreadPoolExecutor pool)
Set our pool. |
void |
setQueue(Queue queue)
Which implementation of a queue are we using. |
void |
setRunningThreads(int runningThreads)
To set the number of running threads. |
void |
setRunningWorker(ConcurrentHashMap<Long,Worker> runningWorker)
Set the map of running workers |
void |
setTaskDate(String taskDate)
When did the task showed up the first time in the queue |
protected void |
shutdownAndAwaitTermination()
Shutdown all threads, close the pools and leave. |
abstract long |
startWorkers()
Will start a new worker. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.droids.api.Droid |
---|
initQueue, run |
Constructor Detail |
---|
public AbstractDroid()
Method Detail |
---|
public void finishedWorker(long id) throws DroidsException
Droid
finishedWorker
in interface Droid
id
- the id of the worker that has finished
DroidsException
public abstract long startWorkers()
public abstract Worker getWorker() throws DroidsException
DroidsException
public Core getCore()
Droid
getCore
in interface Droid
public void setCore(Core core)
core
- public ThreadPoolExecutor getPool()
public void setPool(ThreadPoolExecutor pool)
pool
- the new pool.public ConcurrentHashMap<Long,Worker> getRunningWorker()
public void setRunningWorker(ConcurrentHashMap<Long,Worker> runningWorker)
runningWorker
- new map of running workerspublic void setRunningThreads(int runningThreads)
runningThreads
- public int getRunningThreads()
public String getTaskDate()
public void setTaskDate(String taskDate)
taskDate
- the date when the task registered with the queuepublic int getFreeSlots()
public void setFreeSlots(int freeSlots)
freeSlots
- number of slots that are waiting to servepublic void setMaxThreads(int maxThreads)
maxThreads
- public int getMaxThreads()
public void setQueue(Queue queue)
Droid
Not all implementations are using a queue at all.
setQueue
in interface Droid
queue
- queue implementationprotected Queue getQueue()
protected void shutdownAndAwaitTermination()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |