Package com.jalios.jcms.policy
Class BasicMailPolicyFilter
- java.lang.Object
-
- com.jalios.jcms.policy.AbstractPolicyFilter
-
- com.jalios.jcms.policy.BasicMailPolicyFilter
-
- All Implemented Interfaces:
MailListener
,PluginComponent
,MailPolicyFilter
,PolicyFilter
,java.lang.Comparable
- Direct Known Subclasses:
AbstractDataMailPolicyFilter
public class BasicMailPolicyFilter extends AbstractPolicyFilter implements MailPolicyFilter, PluginComponent
Default implementation ofMailPolicyFilter
.This implementation does nothing and lets the mail be sent.
- Since:
- jcms-6.0.1
- See Also:
MailPolicyFilter
-
-
Field Summary
-
Fields inherited from class com.jalios.jcms.policy.AbstractPolicyFilter
order
-
-
Constructor Summary
Constructors Constructor Description BasicMailPolicyFilter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
afterSendMail(MailMessage msg, java.util.HashMap<java.lang.String,java.lang.Object> ctxt)
Invoked after a mail was sent.boolean
beforeSendMail(MailMessage msg, java.util.HashMap<java.lang.String,java.lang.Object> ctxt)
Invoked before a mail is sent.boolean
fetchMessage(MailMessage mail, boolean stored, java.util.Map<java.lang.String,java.lang.Object> ctxt)
Invoked after a mail was fetch.boolean
init(Plugin plugin)
Initialize the component with the given plugin configuration-
Methods inherited from class com.jalios.jcms.policy.AbstractPolicyFilter
compareTo, equals, getOrder, setOrder
-
-
-
-
Method Detail
-
init
public boolean init(Plugin plugin)
Description copied from interface:PluginComponent
Initialize the component with the given plugin configuration- Specified by:
init
in interfacePluginComponent
- Parameters:
plugin
- the calling plugin- Returns:
- true if the component has been correctly initialized.
- Since:
- jcms-6.0.1
- See Also:
PluginComponent.init(Plugin)
-
beforeSendMail
public boolean beforeSendMail(MailMessage msg, java.util.HashMap<java.lang.String,java.lang.Object> ctxt)
Invoked before a mail is sent.- Specified by:
beforeSendMail
in interfaceMailPolicyFilter
- Parameters:
msg
- the MailMessage instance that will be sentctxt
- a context used to store information for this mail sending (context is used accross beforeSendMail and afterSensMail)- Returns:
- false to stop the sending, true to continue. implementation of BasicMailPolicyFilter is to return false
-
afterSendMail
public void afterSendMail(MailMessage msg, java.util.HashMap<java.lang.String,java.lang.Object> ctxt)
Invoked after a mail was sent.This method may not be invoked if an exception occured during sending or if sending was cancelled by a MailPolicyFilter in beforeSendMail.
- Specified by:
afterSendMail
in interfaceMailPolicyFilter
- Parameters:
msg
- the MailMessage instance that was sentctxt
- a context used to store information for this mail sending (context is used accross beforeSendMail and afterSensMail)
-
fetchMessage
public boolean fetchMessage(MailMessage mail, boolean stored, java.util.Map<java.lang.String,java.lang.Object> ctxt)
Invoked after a mail was fetch.- Specified by:
fetchMessage
in interfaceMailListener
- Parameters:
mail
- the javax.mail.Message fetchedstored
- boolean to store MailMessage in JCMSctxt
- a context used to store information- Returns:
- boolean stored
-
-