org.apache.james.transport
Class JamesSpoolManager

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.james.transport.JamesSpoolManager
All Implemented Interfaces:
java.lang.Runnable, org.apache.avalon.framework.activity.Disposable, org.apache.avalon.framework.configuration.Configurable, org.apache.avalon.framework.logger.LogEnabled, org.apache.avalon.framework.service.Serviceable, SpoolManager

public class JamesSpoolManager
extends org.apache.avalon.framework.logger.AbstractLogEnabled
implements org.apache.avalon.framework.service.Serviceable, org.apache.avalon.framework.configuration.Configurable, java.lang.Runnable, org.apache.avalon.framework.activity.Disposable, SpoolManager

Manages the mail spool. This class is responsible for retrieving messages from the spool, directing messages to the appropriate processor, and removing them from the spool when processing is complete.

Version:
CVS $Revision: 725962 $ $Date: 2008-12-12 11:02:01 +0000 (Fri, 12 Dec 2008) $

Field Summary
 
Fields inherited from interface org.apache.james.services.SpoolManager
ROLE
 
Constructor Summary
JamesSpoolManager()
           
 
Method Summary
 void configure(org.apache.avalon.framework.configuration.Configuration conf)
           
 void dispose()
          The dispose operation is called at the end of a components lifecycle.
 java.util.List getMailetConfigs(java.lang.String processorName)
          retrieve all mailets for given processor
 java.util.List getMatcherConfigs(java.lang.String processorName)
          retrieve all matchers for given processor
 java.lang.String[] getProcessorNames()
           
 void initialize()
          Initialises the spool manager.
 void run()
          This routinely checks the message spool for messages, and processes them as necessary
 void service(org.apache.avalon.framework.service.ServiceManager comp)
           
 void setSpool(SpoolRepository spool)
          Set the SpoolRepository
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JamesSpoolManager

public JamesSpoolManager()
Method Detail

setSpool

public void setSpool(SpoolRepository spool)
Set the SpoolRepository

Parameters:
spool - the SpoolRepository

service

public void service(org.apache.avalon.framework.service.ServiceManager comp)
             throws org.apache.avalon.framework.service.ServiceException
Specified by:
service in interface org.apache.avalon.framework.service.Serviceable
Throws:
org.apache.avalon.framework.service.ServiceException
See Also:
Serviceable.service(ServiceManager)

configure

public void configure(org.apache.avalon.framework.configuration.Configuration conf)
               throws org.apache.avalon.framework.configuration.ConfigurationException
Specified by:
configure in interface org.apache.avalon.framework.configuration.Configurable
Throws:
org.apache.avalon.framework.configuration.ConfigurationException
See Also:
Configurable.configure(Configuration)

initialize

@PostConstruct
public void initialize()
                throws java.lang.Exception
Initialises the spool manager.

Throws:
java.lang.Exception

run

public void run()
This routinely checks the message spool for messages, and processes them as necessary

Specified by:
run in interface java.lang.Runnable

dispose

public void dispose()
The dispose operation is called at the end of a components lifecycle. Instances of this class use this method to release and destroy any resources that they own. This implementation shuts down the LinearProcessors managed by this JamesSpoolManager

Specified by:
dispose in interface org.apache.avalon.framework.activity.Disposable
See Also:
Disposable.dispose()

getProcessorNames

public java.lang.String[] getProcessorNames()
Specified by:
getProcessorNames in interface SpoolManager
Returns:
names of all configured processors

getMailetConfigs

public java.util.List getMailetConfigs(java.lang.String processorName)
Description copied from interface: SpoolManager
retrieve all mailets for given processor

Specified by:
getMailetConfigs in interface SpoolManager
Parameters:
processorName - - name of the processor who's mailets should be retrieved
Returns:
List

getMatcherConfigs

public java.util.List getMatcherConfigs(java.lang.String processorName)
Description copied from interface: SpoolManager
retrieve all matchers for given processor

Specified by:
getMatcherConfigs in interface SpoolManager
Parameters:
processorName - - name of the processor who's matchers should be retrieved
Returns:
List


Copyright ? 2002-2009 The Apache Software Foundation. All Rights Reserved.