|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnl.astron.lofar.odtb.mom2otdbadapter.otdblistener.Queue
public class Queue
Queue of tasks
Nested Class Summary | |
---|---|
(package private) class |
Queue.TasksFilter
Filters task files |
Field Summary | |
---|---|
private static java.lang.String |
DATE_TIME_FORMAT
|
private java.util.Date |
endTime
|
private static java.lang.String |
FILE_DATE_TIME_FORMAT
|
private boolean |
isTaskLocked
|
private org.apache.commons.logging.Log |
log
|
private static java.lang.String |
OTDB_TIME_FORMAT
|
private java.util.Date |
startTime
|
private java.lang.String |
taskDir
|
private java.util.List |
tasks
|
Constructor Summary | |
---|---|
Queue()
Constructor that looks for tasks (*.xml) in the . |
Method Summary | |
---|---|
void |
add(Task task)
Add the task to the task list and store it as a xml file |
Task |
get()
Retrieve a task, if there are tasks, if there are no tasks, wait until a task is in the queue |
protected java.lang.String |
getFile(java.lang.String fileName)
Retrieve file by file name |
TimePeriod |
getTimePeriod()
Retrieves the new time period, from the last time period to now |
void |
moveToEndOfTaskList(Task task)
If a task can not be executed, move it to the end of the tasks list, so other tasks can be executed. |
void |
remove(Task task)
Remove a task |
void |
saveTimePeriod()
Save the time period |
protected void |
storeTask(Task task)
Store a task |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private org.apache.commons.logging.Log log
private java.util.List tasks
private java.lang.String taskDir
private static final java.lang.String FILE_DATE_TIME_FORMAT
private static final java.lang.String DATE_TIME_FORMAT
private static final java.lang.String OTDB_TIME_FORMAT
private java.util.Date startTime
private java.util.Date endTime
private boolean isTaskLocked
Constructor Detail |
---|
public Queue() throws java.io.IOException
java.io.IOException
Method Detail |
---|
public Task get()
public void remove(Task task)
task
- task to be removedpublic void moveToEndOfTaskList(Task task)
task
- task to be moved to the end of the tasks list.public TimePeriod getTimePeriod() throws java.io.IOException
java.io.IOException
public void saveTimePeriod() throws java.io.IOException
java.io.IOException
public void add(Task task) throws java.io.IOException
task
- Task to be stored
java.io.IOException
protected java.lang.String getFile(java.lang.String fileName) throws java.io.IOException
fileName
- name of the file to be read
java.io.IOException
protected void storeTask(Task task) throws java.io.FileNotFoundException, java.io.IOException
task
- task to be stored
java.io.FileNotFoundException
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |