fr.paris.lutece.portal.service.daemon
Class ThreadLauncherDaemon

java.lang.Object
  extended by fr.paris.lutece.portal.service.daemon.Daemon
      extended by fr.paris.lutece.portal.service.daemon.ThreadLauncherDaemon
All Implemented Interfaces:
Runnable

public class ThreadLauncherDaemon
extends Daemon

Daemon that manage a pool of threads to launch runnables.


Field Summary
 
Fields inherited from class fr.paris.lutece.portal.service.daemon.Daemon
RESULT_FAILED, RESULT_PROCESSING, RESULT_SUCCESS, RESULT_UNKNOWN, STATUS_RUNNING, STATUS_STOPPED
 
Constructor Summary
ThreadLauncherDaemon()
           
 
Method Summary
static void addItemToQueue(Runnable runnable, String strKey, Plugin plugin)
          Add a runnable to the launch queue.
static Integer countItemsInQueue()
          Count the number of items in the queue.
 void run()
          
 
Methods inherited from class fr.paris.lutece.portal.service.daemon.Daemon
getLastRunLogs, getPluginName, getResult, setLastRunLogs, setPluginName, setResult
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ThreadLauncherDaemon

public ThreadLauncherDaemon()
Method Detail

run

public void run()


addItemToQueue

public static void addItemToQueue(Runnable runnable,
                                  String strKey,
                                  Plugin plugin)
Add a runnable to the launch queue. It will be launched as soon as a thread is available.

Parameters:
runnable - The runnable to execute
strKey - The key of the runnable. Runnables of a given plugin are ensured that they will not be executed at the same time if they have the same key.
plugin - The plugin the runnable is associated with

countItemsInQueue

public static Integer countItemsInQueue()
Count the number of items in the queue.

Returns:
The current number of items in the queue


Copyright © 2014 Mairie de Paris. All Rights Reserved.