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,Comparable
- Direct Known Subclasses:
AbstractDataMailPolicyFilter
public class BasicMailPolicyFilter
extends AbstractPolicyFilter
implements MailPolicyFilter, PluginComponent
Default implementation of
MailPolicyFilter.
This implementation does nothing and lets the mail be sent.
- Since:
- jcms-6.0.1
- See Also:
-
Field Summary
Fields inherited from class com.jalios.jcms.policy.AbstractPolicyFilter
order -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidafterSendMail(MailMessage msg, HashMap<String, Object> ctxt) Invoked after a mail was sent.booleanbeforeSendMail(MailMessage msg, HashMap<String, Object> ctxt) Invoked before a mail is sent.booleanfetchMessage(MailMessage mail, boolean stored, Map<String, Object> ctxt) Invoked after a mail was fetch.booleanInitialize the component with the given plugin configurationMethods inherited from class com.jalios.jcms.policy.AbstractPolicyFilter
compareTo, equals, getOrder, setOrderMethods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Comparable
compareTo
-
Constructor Details
-
BasicMailPolicyFilter
public BasicMailPolicyFilter()
-
-
Method Details
-
init
Description copied from interface:PluginComponentInitialize the component with the given plugin configuration- Specified by:
initin interfacePluginComponent- Parameters:
plugin- the calling plugin- Returns:
- true if the component has been correctly initialized.
- Since:
- jcms-6.0.1
- See Also:
-
beforeSendMail
Invoked before a mail is sent.- Specified by:
beforeSendMailin 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
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:
afterSendMailin 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
Invoked after a mail was fetch.- Specified by:
fetchMessagein interfaceMailListener- Parameters:
mail- the javax.mail.Message fetchedstored- boolean to store MailMessage in JCMSctxt- a context used to store information- Returns:
- boolean stored
-