public abstract class AbstractStateCompositeProcessor extends Object implements MailProcessor, Configurable, LogEnabled
CamelCompositeProcessor
which service the
Mail
with a CamelProcessor
instancesModifier and Type | Class and Description |
---|---|
static interface |
AbstractStateCompositeProcessor.CompositeProcessorListener
A Listener which will get called after
MailProcessor.service(Mail) was called |
Modifier and Type | Field and Description |
---|---|
protected org.apache.commons.configuration.HierarchicalConfiguration |
config |
protected org.slf4j.Logger |
logger |
Constructor and Description |
---|
AbstractStateCompositeProcessor() |
Modifier and Type | Method and Description |
---|---|
void |
addListener(AbstractStateCompositeProcessor.CompositeProcessorListener listener) |
void |
configure(org.apache.commons.configuration.HierarchicalConfiguration config)
Configure the object.
|
protected abstract MailProcessor |
createMailProcessor(String state,
org.apache.commons.configuration.HierarchicalConfiguration config)
Create a new
MailProcessor |
void |
dispose() |
List<AbstractStateCompositeProcessor.CompositeProcessorListener> |
getListeners() |
MailProcessor |
getProcessor(String state)
Return a
MailProcessor for a given state |
String[] |
getProcessorStates() |
void |
init() |
void |
removeListener(AbstractStateCompositeProcessor.CompositeProcessorListener listener) |
void |
service(org.apache.mailet.Mail mail)
Service the given
Mail by hand the Mail over the
MailProcessor which is responsible for the
Mail.getState() |
void |
setLog(org.slf4j.Logger log)
Sets the service log.
|
protected org.slf4j.Logger logger
protected org.apache.commons.configuration.HierarchicalConfiguration config
public void setLog(org.slf4j.Logger log)
LogEnabled
setLog
in interface LogEnabled
log
- not nullLogEnabled.setLog(org.slf4j.Logger)
public void addListener(AbstractStateCompositeProcessor.CompositeProcessorListener listener)
public List<AbstractStateCompositeProcessor.CompositeProcessorListener> getListeners()
public void removeListener(AbstractStateCompositeProcessor.CompositeProcessorListener listener)
public void configure(org.apache.commons.configuration.HierarchicalConfiguration config) throws org.apache.commons.configuration.ConfigurationException
Configurable
configure
in interface Configurable
org.apache.commons.configuration.ConfigurationException
Configurable.configure(org.apache.commons.configuration.HierarchicalConfiguration)
public void service(org.apache.mailet.Mail mail) throws javax.mail.MessagingException
Mail
by hand the Mail
over the
MailProcessor
which is responsible for the
Mail.getState()
service
in interface MailProcessor
mail
- - the Mail object that contains the message and routing
informationjavax.mail.MessagingException
- - if a message or address parsing exception occurs or an
exception that interferes with the mailet's normal operationpublic MailProcessor getProcessor(String state)
MailProcessor
for a given statestate
- public String[] getProcessorStates()
@PostConstruct public void init() throws Exception
Exception
@PreDestroy public void dispose()
protected abstract MailProcessor createMailProcessor(String state, org.apache.commons.configuration.HierarchicalConfiguration config) throws Exception
MailProcessor
state
- config
- Exception
Copyright © 2002-2012 The Apache Software Foundation. All Rights Reserved.