org.apache.jetspeed.services.daemonfactory
Class JetspeedDaemonFactoryService

java.lang.Object
  extended byorg.apache.turbine.services.BaseInitable
      extended byorg.apache.turbine.services.BaseService
          extended byorg.apache.turbine.services.TurbineBaseService
              extended byorg.apache.jetspeed.services.daemonfactory.JetspeedDaemonFactoryService
All Implemented Interfaces:
DaemonFactoryService, org.apache.turbine.services.Initable, org.apache.turbine.services.Service

public class JetspeedDaemonFactoryService
extends org.apache.turbine.services.TurbineBaseService
implements DaemonFactoryService

Version:
$Id: JetspeedDaemonFactoryService.java,v 1.11 2004/02/23 03:29:24 jford Exp $
Author:
Kevin A. Burton, Santiago Gala

Field Summary
static java.lang.String BADURLMANAGERDAEMON_KEY
           
static java.lang.String DISKCACHEDAEMON_KEY
           
static java.lang.String FEEDDAEMON_KEY
           
 
Fields inherited from class org.apache.turbine.services.BaseService
configuration, name, properties, serviceBroker
 
Fields inherited from class org.apache.turbine.services.BaseInitable
initableBroker, isInitialized
 
Fields inherited from interface org.apache.jetspeed.services.daemonfactory.DaemonFactoryService
SERVICE_NAME
 
Constructor Summary
JetspeedDaemonFactoryService()
           
 
Method Summary
 Daemon getDaemon(DaemonEntry entry)
          Allows a Daemon to define its Thread priority through a factory.
 Daemon getDaemon(java.lang.String classname)
          Get a daemon with the given classname.
 DaemonContext getDaemonContext()
           
 DaemonEntry[] getDaemonEntries()
          Get the current known DaemonEntries within the DaemonFactory
 DaemonEntry getDaemonEntry(java.lang.String name)
          Given the name of a DaemonEntry...
 java.lang.String getMessage(DaemonEntry entry)
          Get the last known message of the given DaemonEntry's processing
 int getResult(DaemonEntry entry)
          Get the last known result of the given DaemonEntry's processing
 int getStatus(DaemonEntry entry)
           
 void init()
          Late init.
 void init(javax.servlet.ServletConfig config)
          Perform initialization of the DaemonFactory.
 void process(DaemonEntry entry)
          Kicks of processing of a Daemon.
 void start()
           Starts any daemons that need processing.
 
Methods inherited from class org.apache.turbine.services.TurbineBaseService
init, init, shutdown
 
Methods inherited from class org.apache.turbine.services.BaseService
getConfiguration, getName, getProperties, getServiceBroker, setName, setServiceBroker
 
Methods inherited from class org.apache.turbine.services.BaseInitable
getInit, getInitableBroker, setInit, setInitableBroker
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.turbine.services.Service
getConfiguration, getName, getProperties, setName, setServiceBroker
 
Methods inherited from interface org.apache.turbine.services.Initable
getInit, init, setInitableBroker, shutdown
 

Field Detail

FEEDDAEMON_KEY

public static final java.lang.String FEEDDAEMON_KEY
See Also:
Constant Field Values

DISKCACHEDAEMON_KEY

public static final java.lang.String DISKCACHEDAEMON_KEY
See Also:
Constant Field Values

BADURLMANAGERDAEMON_KEY

public static final java.lang.String BADURLMANAGERDAEMON_KEY
See Also:
Constant Field Values
Constructor Detail

JetspeedDaemonFactoryService

public JetspeedDaemonFactoryService()
Method Detail

init

public void init()
Late init. Don't return control until early init says we're done.

Specified by:
init in interface org.apache.turbine.services.Initable

init

public void init(javax.servlet.ServletConfig config)
Perform initialization of the DaemonFactory. Note that this should return right away so that processing can continue (IE thread off everything)


start

public 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()

Specified by:
start in interface DaemonFactoryService

getDaemon

public 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.

Specified by:
getDaemon in interface DaemonFactoryService
Throws:
DaemonException

getDaemon

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

Specified by:
getDaemon in interface DaemonFactoryService
Throws:
DaemonException
See Also:
getDaemon( DaemonEntry entry )

getDaemonContext

public DaemonContext getDaemonContext()
Specified by:
getDaemonContext in interface DaemonFactoryService

process

public 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.

Specified by:
process in interface DaemonFactoryService
Throws:
DaemonException

getStatus

public int getStatus(DaemonEntry entry)
Specified by:
getStatus in interface DaemonFactoryService

getResult

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

Specified by:
getResult in interface DaemonFactoryService

getMessage

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

Specified by:
getMessage in interface DaemonFactoryService

getDaemonEntries

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

Specified by:
getDaemonEntries in interface DaemonFactoryService

getDaemonEntry

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

Specified by:
getDaemonEntry in interface DaemonFactoryService
Throws:
DaemonNotFoundException


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