|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.arsdigita.cms.publishToFile.QueueManager
Class for queuing tasks for publishing and unpublishing to the file system and for processing the queue. When processing queued tasks, this class insures that the transaction that created the queue entry is committed before the task is processed. This is mainly for publishing tasks because a http request is used to get the content to publish and the content may not be available until the transaction which makes the content live is committed. The class saves the information for the page to be published using the QueueEntry object (publish_to_fs_queue table). This class locks the Lifecycle thread when it starts processing queue entries.This is done in order to stop the lifecycle thread from modifying the item's date when items are being processed for publication.
Method Summary | |
static void |
queueMoveTask(ContentItem liveItem,
Folder source,
Folder destination)
Schedule the moving of an item in the file system. |
static void |
queuePublish(ContentItem item)
Schedule an item for publishing. |
static void |
queueRepublish(ContentItem item)
Schedule an item for republishing. |
static void |
queueUnpublish(ContentItem item)
Schedule an item for unpublishing. |
static void |
requeueMissingFiles()
|
void |
run()
Watch queue for entries to process. |
static void |
setBlockSize(Integer size)
The number of queue entries that should be processed in one block (database transaction). |
static void |
setListener(PublishToFileListener l)
Set the listener that processes the publish and unpublish requests. |
static void |
setMaximumFailCount(Integer maxFailCount)
Set how many times processing a queue entry should be attempted at the most. |
static void |
setRetryDelay(Integer delay)
Set how many seconds the queue manager should wait before trying to process an entry which has previously failed. |
static void |
startWatchingQueue(int startupDelay,
int pollDelay)
Start watching and processing the queue. |
static void |
stopWatchingQueue()
Stop watching and processing the queue. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static void setRetryDelay(Integer delay)
delay
- number of seconds between reprocessing of failed
entries.public static void setBlockSize(Integer size)
size
- number of queue enries to be procesed in one blockpublic static void setMaximumFailCount(Integer maxFailCount)
maxFailCount
attempts are ignored.
maxFailCount
- maximum fail count in publishing threadpublic static void setListener(PublishToFileListener l)
public static void requeueMissingFiles()
public static void queuePublish(ContentItem item)
item
- item to be published to file system.public static void queueUnpublish(ContentItem item)
item
is deleted.
item
- item to be unpublished from file system.public static void queueRepublish(ContentItem item)
item
should be refreshed in the file
system.
item
- Item to be republished (unpublished then published) on the
file system.public static void queueMoveTask(ContentItem liveItem, Folder source, Folder destination)
liveItem
- the item to be movedsource
- the folder from which the item is moveddestination
- the folder to which the item is movedpublic static void startWatchingQueue(int startupDelay, int pollDelay)
startupDelay
seconds. The queue is checked for new
entries every pollDelay
seconds.
startupDelay
- number of seconds to wait before starting to
process the queuepollDelay
- number of seconds to wait between checks if the queue
has any entries.public static void stopWatchingQueue()
public void run()
run
in interface Runnable
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |