public class FetchMail extends AbstractLogEnabled implements Configurable,Target,Serviceable(Code)
Class FetchMail is an Avalon task that is periodically
triggered to fetch mail from a JavaMail Message Store.
The lifecycle of an instance of FetchMail is managed by
Avalon. The configure(Configuration) method is invoked to parse
and validate Configuration properties. The targetTriggered(String) method is
invoked to execute the task.
When triggered, a sorted list of Message Store Accounts to be processed is
built. Each Message Store Account is processed by delegating to
StoreProcessor.
There are two kinds of Message Store Accounts, static and dynamic. Static
accounts are expliciltly declared in the Configuration. Dynamic accounts are
built each time the task is executed, one per each user defined to James,
using the James user name with a configurable prefix and suffix to define
the host user identity and recipient identity for each Account. Dynamic
accounts allow FetchMail to fetch mail for all James users
without modifying the Configuration parameters or restarting the Avalon
server.
To fully understand the operations supported by this task, read the Class
documention for each Class in the delegation chain starting with this
class' delegate, StoreProcessor.
configure(Configuration configuration) Method configure parses and validates the Configuration data and creates
a new ParsedConfiguration, an Account for each
configured static account and a ParsedDynamicAccountParameters
for each dynamic account.
Compute the dynamicAccounts for the passed parameters.
Accounts for existing users are copied and accounts for new users are
created.
Parameters: oldAccounts - Parameters: parameters - Map - The current Accounts throws: ConfigurationException -
public void configure(Configuration configuration) throws ConfigurationException(Code)
Method configure parses and validates the Configuration data and creates
a new ParsedConfiguration, an Account for each
configured static account and a ParsedDynamicAccountParameters
for each dynamic account.
See Also: org.apache.avalon.framework.configuration.Configurable.configure(Configuration)
Propogate any Session parameters in the configuration to the Session.
Parameters: configuration - The configuration containing the parameters throws: ConfigurationException -
Method target triggered fetches mail for each configured account.
See Also: org.apache.avalon.cornerstone.services.scheduler.Target.targetTriggered(String)