Using Other J2EE Resources

When you deploy Quartz within the J2EE container, you can take advantage of other resources available to the J2EE components. For example, if you need to send e-mails, one approach would be to use the Quartz SendMailJob, which relies on JavaMail. Another approach you can take if you deploy Quartz within the container is to use the mail session that should be readily available for all J2EE servers, assuming that you've set one up. That's another one of the benefits of deploying Quartz as a J2EE client.

InitialContext initialContext = new InitialContext();
Session session = (Session)
initialContext.lookup(urlToMailSession);

Message msg = new MimeMessage(session);
// ... build up msg
Transport.send(msg);






Quartz Job Scheduling Framework(c) Building Open Source Enterprise Applications
Quartz Job Scheduling Framework: Building Open Source Enterprise Applications
ISBN: 0131886703
EAN: 2147483647
Year: N/A
Pages: 148
Simiral book on Amazon

Flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net