|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.caucho.health.action.AbstractHealthAction
com.caucho.health.action.SendMail
@Singleton @Configurable public class SendMail
Health action to send an email containing the results of the health check.
The SMTP server should be configured using a <mail> resource, as demonstrated in the following example. See Resin documentation on <mail> for additional configuration.
<health:HttpStatusHealthCheck ee:Named="httpStatusCheck">
<url>http://localhost:8080/test-ping.jsp</url>
</health:HttpStatusHealthCheck>
<mail name="healthMailer">
<from>resin@yourdomain.com</from>
<smtp-host>localhost</smtp-host>
<smtp-port>25</smtp-port>
</mail>
<health:SendMail mail="${healthMailer}">
<to>admin@yourdomain.com</to>
<to>another_admin@yourdomain.com</to>
<health:IfHealthCritical healthCheck="${httpStatusCheck}"/>
<health:IfRechecked/>
</health:SendMail>
| Constructor Summary | |
|---|---|
SendMail()
|
|
| Method Summary | |
|---|---|
void |
addTo(java.lang.String to)
Add a "TO:" address; a mail recipient |
void |
doActionImpl(HealthEvent healthEvent)
|
void |
init()
|
void |
setFrom(java.lang.String from)
Set the "FROM:" address, defaults to "resin@localhost" |
void |
setMail(Session session)
Set the javax.mail.Session to send; configure using a <mail> resource |
| Methods inherited from class com.caucho.health.action.AbstractHealthAction |
|---|
add, addListener, doAction, getPredicates, start, stop, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public SendMail()
| Method Detail |
|---|
@PostConstruct public void init()
init in class AbstractHealthAction
@Configurable
public void addTo(java.lang.String to)
throws AddressException
AddressException - for an invalid email address
@Configurable
public void setFrom(java.lang.String from)
throws AddressException
AddressException - for an invalid email address@Configurable public void setMail(Session session)
public void doActionImpl(HealthEvent healthEvent)
doActionImpl in class AbstractHealthAction
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||