to.etc.webapp.pendingoperations
Class PolledActionQueue

java.lang.Object
  extended by to.etc.webapp.pendingoperations.PolledActionQueue
All Implemented Interfaces:
IPollQueueTaskProvider

public class PolledActionQueue
extends java.lang.Object
implements IPollQueueTaskProvider

Queue containing jobs to execute. When jobs are added here the polling task provider will be signalled.

Author:
Frits Jalvingh Created on Mar 4, 2009

Constructor Summary
PolledActionQueue()
           
 
Method Summary
 java.lang.Runnable getRunnableTask()
          Must return the next task to run without ever blocking, except when executing code to find the next task.
 void initializeOnRegistration(PollingWorkerQueue pwq)
           
 void schedule(java.lang.Runnable run)
          Adds a job to the execution queue.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PolledActionQueue

public PolledActionQueue()
Method Detail

schedule

public void schedule(java.lang.Runnable run)
Adds a job to the execution queue. If a free thread is available the job gets run immediately.

Parameters:
run -

initializeOnRegistration

public void initializeOnRegistration(PollingWorkerQueue pwq)
                              throws java.lang.Exception
Specified by:
initializeOnRegistration in interface IPollQueueTaskProvider
Throws:
java.lang.Exception

getRunnableTask

public java.lang.Runnable getRunnableTask()
                                   throws java.lang.Exception
Description copied from interface: IPollQueueTaskProvider
Must return the next task to run without ever blocking, except when executing code to find the next task.

Specified by:
getRunnableTask in interface IPollQueueTaskProvider
Returns:
Throws:
java.lang.Exception