|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.jcrontab.SendMail
This class sends an email to the given address every time a task ends This class does exactly the same as the directive MAILTO extension in crontab
Sending an email has a strong limitation: The log you receive by mail can be confused in multithreaded tasks or if you have more than two tasks running at the same time. Why? Cause The problem is that the output of the classes goes all to the same System.out and there is where jcrontab reads it. Then if you concurrent executions on you system the output you can receive bu mail can be confusing. But how can i avoid that? Using a better logging system for example log4j, take a look at http://jakarta.apache.org/log4j, this system sends emails and does a lot of things more... If you can't change your class or running a native program... well take it easy and be concious of the problem
Constructor Summary | |
SendMail()
|
Method Summary | |
void |
send(java.io.File file)
This method sends the email to the given address by the config |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SendMail()
Method Detail |
public void send(java.io.File file) throws java.lang.Exception
file
- the temporary file in which the output is stored
java.lang.Exception
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |