|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.umber.catalan.queues.SingleFileQueue
Command queue which pulls commands from files on the file system.
Constructor Summary | |
SingleFileQueue()
|
Method Summary | |
boolean |
canQuit()
Determines if the queue can safely shut down without losing its current status. |
void |
connect()
Establishes a connection to the queue. |
void |
disconnect()
Closes down the queue. |
IForgeCommand |
getNextCommand()
Retrieves the next command in the queue, or null if queue is empty. |
java.io.File |
getQueueFile()
Retrieves the current file that backs this queue. |
boolean |
isConnected()
Determines if the queue is currently connected to a live command feed. |
protected abstract IForgeCommand[] |
parseQueueFile()
Reads the contents of the file and converts it into an array of commands. |
void |
setQueueFile(java.io.File queueFile)
Assigns a new queue file. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.umber.catalan.queues.ICommandQueue |
sendResult |
Constructor Detail |
public SingleFileQueue()
Method Detail |
protected abstract IForgeCommand[] parseQueueFile() throws CatalanQueueException
CatalanQueueException
- if unable to load filepublic boolean isConnected()
isConnected
in interface ICommandQueue
public boolean canQuit()
This implementation returns true when the command is empty, but false whenver there are commands in the queue.
canQuit
in interface ICommandQueue
public java.io.File getQueueFile()
public void setQueueFile(java.io.File queueFile) throws CatalanQueueException
queueFile
- file containing queue commands
CatalanQueueException
- if currently connectedpublic void connect() throws CatalanQueueException
connect
in interface ICommandQueue
CatalanQueueException
- if unable to open queue filepublic void disconnect() throws CatalanQueueException
disconnect
in interface ICommandQueue
CatalanQueueException
- if queue is not emptypublic IForgeCommand getNextCommand()
This implementation loads commands from a single queue file.
getNextCommand
in interface ICommandQueue
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |