org.apache.droids.queue
Class QueueBean

Package class diagram package QueueBean
java.lang.Object
  extended by org.apache.droids.queue.QueueBean
Direct Known Subclasses:
Simple

public class QueueBean
extends Object

Simple bean that holds all information (as wrapper bean) that are needed when working with queue objects.


Field Summary
protected  org.apache.commons.logging.Log log
           
 
Constructor Summary
QueueBean()
           
 
Method Summary
 boolean acceptDepth(int i)
          Can we accept the new depth or would it violate the maxDepth allowed for the queue.
 boolean acceptSize(int i)
          Can we accept the new size or would it violate the maxSize allowed for the queue.
 int currentSize()
          Return the number of threads that are currently running.
 int getCurrentSize()
          What is the current size of all queue items actively worked on.
 Task[] getDoneTasks()
          Return an array of all tasks that we already finished.
 int getMaxDepth()
          The limitation of how many loops we want to admit.
 int getMaxSize()
          The limitation of how many queue items we want to admit.
 Task[] getToDoTasks()
          Return an array of all tasks that we still need to finish.
 void setCurrentSize(int currentSize)
          Set the current size of all queue items actively worked on.
 void setDoneTasks(Task[] doneTasks)
          Set an array of all tasks that we already finished.
 void setMaxDepth(int maxDepth)
          The limitation of how many loops items we want to admit.
 void setMaxSize(int maxSize)
          The limitation of how many queue items we want to admit.
 void setToDoTasks(Task[] toDoTasks)
          Set an array of all tasks that we did not finished yet and add them to the queue.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected final org.apache.commons.logging.Log log
Constructor Detail

QueueBean

public QueueBean()
Method Detail

currentSize

public int currentSize()
Return the number of threads that are currently running.

Returns:
number of queue items in execution

getDoneTasks

public Task[] getDoneTasks()
Return an array of all tasks that we already finished.

Returns:
an array of all tasks that we already finished.

getMaxDepth

public int getMaxDepth()
The limitation of how many loops we want to admit. Value of -1 means no limitation.

Returns:
max depth

getMaxSize

public int getMaxSize()
The limitation of how many queue items we want to admit. Value of -1 means no limitation.

Returns:
max number of queue items

getToDoTasks

public Task[] getToDoTasks()
Return an array of all tasks that we still need to finish.

Returns:
all open queue items that have not finished.

setMaxSize

public void setMaxSize(int maxSize)
The limitation of how many queue items we want to admit. Value of -1 means no limitation.

Parameters:
maxSize - how many queue items we want to admit

setMaxDepth

public void setMaxDepth(int maxDepth)
The limitation of how many loops items we want to admit. Value of -1 means no limitation.

Parameters:
maxDepth - how many loops items we want to admit

acceptSize

public boolean acceptSize(int i)
Can we accept the new size or would it violate the maxSize allowed for the queue.

Parameters:
i - new queue size
Returns:
true if either there is no limit of the queue size or the new size of the queue is not bigger then the maxSize. False otherwise.

acceptDepth

public boolean acceptDepth(int i)
Can we accept the new depth or would it violate the maxDepth allowed for the queue.

Parameters:
i - new depth size
Returns:
true if either there is no limit of the queue depth or the new depth of the queue is not bigger then the maxDepth. False otherwise.

getCurrentSize

public int getCurrentSize()
What is the current size of all queue items actively worked on.

Returns:
size of all queue items actively worked on.

setCurrentSize

public void setCurrentSize(int currentSize)
Set the current size of all queue items actively worked on.

Parameters:
currentSize - current size of all queue items actively worked on.

setDoneTasks

public void setDoneTasks(Task[] doneTasks)
Set an array of all tasks that we already finished.

Parameters:
doneTasks - an array of all tasks that we already finished.

setToDoTasks

public void setToDoTasks(Task[] toDoTasks)
Set an array of all tasks that we did not finished yet and add them to the queue.

Parameters:
toDoTasks - an array of all tasks that we need to add to the queue.


Copyright © 2008 The Apache Software Foundation