org.apache.jetspeed.services.daemonfactory
Class DaemonFactory

java.lang.Object
  extended byorg.apache.jetspeed.services.daemonfactory.DaemonFactory

public class DaemonFactory
extends java.lang.Object

Version:
$Id: DaemonFactory.java,v 1.4 2004/02/23 03:29:24 jford Exp $
Author:
Kevin A. Burton

Constructor Summary
DaemonFactory()
           
 
Method Summary
static Daemon getDaemon(DaemonEntry entry)
          Allows a Daemon to define its Thread priority through a factory.
static Daemon getDaemon(java.lang.String classname)
          Get a daemon with the given classname.
static DaemonContext getDaemonContext()
           
static DaemonEntry[] getDaemonEntries()
          Get the current known DaemonEntries within the DaemonFactory
static DaemonEntry getDaemonEntry(java.lang.String name)
          Given the name of a DaemonEntry...
static java.lang.String getMessage(DaemonEntry entry)
          Get the last known message of the given DaemonEntry's processing
static int getResult(DaemonEntry entry)
          Get the last known result of the given DaemonEntry's processing
protected static DaemonFactoryService getService()
           
static int getStatus(DaemonEntry entry)
           
static void process(DaemonEntry entry)
          Kicks of processing of a Daemon.
static void start()
           Starts any daemons that need processing.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DaemonFactory

public DaemonFactory()
Method Detail

getService

protected static final DaemonFactoryService getService()

start

public static void start()

Starts any daemons that need processing.

This should be called right after init() so that any daemons that need to be started will be. If you need to do any per-daemon initialization then do so before calling start()


getDaemon

public static Daemon getDaemon(DaemonEntry entry)
                        throws DaemonException
Allows a Daemon to define its Thread priority through a factory. The Thread that this object should return should be an implementation of itself.

Throws:
DaemonException

getDaemon

public static Daemon getDaemon(java.lang.String classname)
                        throws DaemonException
Get a daemon with the given classname.

Throws:
DaemonException
See Also:
getDaemon( DaemonEntry entry )

getDaemonContext

public static DaemonContext getDaemonContext()

process

public static void process(DaemonEntry entry)
                    throws DaemonException
Kicks of processing of a Daemon. Does the same thing as getDaemon() but also creates a thread and runs the daemon.

Throws:
DaemonException

getStatus

public static int getStatus(DaemonEntry entry)

getResult

public static int getResult(DaemonEntry entry)
Get the last known result of the given DaemonEntry's processing


getMessage

public static java.lang.String getMessage(DaemonEntry entry)
Get the last known message of the given DaemonEntry's processing


getDaemonEntries

public static DaemonEntry[] getDaemonEntries()
Get the current known DaemonEntries within the DaemonFactory


getDaemonEntry

public static DaemonEntry getDaemonEntry(java.lang.String name)
                                  throws DaemonNotFoundException
Given the name of a DaemonEntry... get it from the DaemonFactory

Throws:
DaemonNotFoundException


Copyright © 2000-2005 Apache Software Foundation. All Rights Reserved.