org.apache.jetspeed.daemon
Interface Daemon

All Superinterfaces:
java.lang.Runnable
All Known Implementing Classes:
BadURLManagerDaemon, DiskCacheDaemon, FeedDaemon

public interface Daemon
extends java.lang.Runnable

A simple interface to create Daemons within Jetspeed. These are basically threads that get work done to facilitate content serving.

Version:
$Id: Daemon.java,v 1.9 2004/02/23 02:48:57 jford Exp $
Author:
Kevin A. Burton

Field Summary
static int RESULT_FAILED
          A daemon has processed but it has failed
static int RESULT_PROCESSING
          A daemon is processing so its result is not yet known
static int RESULT_SUCCESS
          A daemon has processed and it was successful
static int RESULT_UNKNOWN
          The result for this daemon is not yet known.
static int STATUS_NOT_PROCESSED
           
static int STATUS_NOT_STARTED
           
static int STATUS_PROCESSED
           
static int STATUS_PROCESSING
           
static int STATUS_STARTED
           
static int STATUS_UNKNOWN
           
 
Method Summary
 DaemonConfig getDaemonConfig()
          Require that Daemons have a getter for the DaemonConfig
 DaemonEntry getDaemonEntry()
          Get the entry for this daemon.
 java.lang.String getMessage()
          Provided so that a Daemon can provide a message to users.
 int getResult()
           Get the result of this daemons processing.
 int getStatus()
          Report on the status of this daemon.
 void init(DaemonConfig config, DaemonEntry entry)
          Initialize this daemon providing configuration data.
 void setResult(int result)
          Force the result of this Daemon
 void setStatus(int status)
          Force the status on this Daemon
 
Methods inherited from interface java.lang.Runnable
run
 

Field Detail

STATUS_UNKNOWN

public static final int STATUS_UNKNOWN
See Also:
Constant Field Values

STATUS_NOT_PROCESSED

public static final int STATUS_NOT_PROCESSED
See Also:
Constant Field Values

STATUS_PROCESSED

public static final int STATUS_PROCESSED
See Also:
Constant Field Values

STATUS_PROCESSING

public static final int STATUS_PROCESSING
See Also:
Constant Field Values

STATUS_NOT_STARTED

public static final int STATUS_NOT_STARTED
See Also:
Constant Field Values

STATUS_STARTED

public static final int STATUS_STARTED
See Also:
Constant Field Values

RESULT_UNKNOWN

public static final int RESULT_UNKNOWN
The result for this daemon is not yet known.

See Also:
Constant Field Values

RESULT_SUCCESS

public static final int RESULT_SUCCESS
A daemon has processed and it was successful

See Also:
Constant Field Values

RESULT_FAILED

public static final int RESULT_FAILED
A daemon has processed but it has failed

See Also:
Constant Field Values

RESULT_PROCESSING

public static final int RESULT_PROCESSING
A daemon is processing so its result is not yet known

See Also:
Constant Field Values
Method Detail

init

public void init(DaemonConfig config,
                 DaemonEntry entry)
Initialize this daemon providing configuration data.


getDaemonConfig

public DaemonConfig getDaemonConfig()
Require that Daemons have a getter for the DaemonConfig


getStatus

public int getStatus()
Report on the status of this daemon. Should be of STATUS_NOT_PROCESSED, STATUS_PROCESSED, or STATUS_PROCESSING


setStatus

public void setStatus(int status)
Force the status on this Daemon


getDaemonEntry

public DaemonEntry getDaemonEntry()
Get the entry for this daemon.


getResult

public int getResult()

Get the result of this daemons processing. All Daemon implementations are responsible for defining this.

The default for this should be RESULT_UNKNOWN. This usually means that this daemon has never been called for processing.


setResult

public void setResult(int result)
Force the result of this Daemon


getMessage

public java.lang.String getMessage()
Provided so that a Daemon can provide a message to users. Null if it has nothing to give to the user.



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