mailerbean.java
来自「《Java网络程序设计.rar》包括三个网络程序的源代码。」· Java 代码 · 共 61 行
JAVA
61 行
/* */package org.impact.stars.mail.ejb;import java.rmi.RemoteException;import javax.ejb.EJBException;import javax.ejb.FinderException;import javax.ejb.SessionBean;import javax.ejb.SessionContext;import org.impact.stars.mail.exceptions.MailerAppException;/** * Session Bean implementation of MailerEJB. * Used to send a mail messageconfirmation such as anemail * to a customer after a purchase is completed. * This functionality is enabled by the petstore by modifying the * sendConfirmationMail property of the petstore at deployment time. * * @see MailHelper*/public class MailerBean implements SessionBean { public void ejbCreate() {} public void setSessionContext(SessionContext sc) {} public void ejbRemove() {} public void ejbActivate() {} public void ejbPassivate() {} /** * This method sends an email message. Most of the mailing logic * is in the MailHelper class. * * @param eMess content for the email message and also the * information such as recipient required to * send the message. * @see EMailMessage * @see MailHelper */ public void sendMail(EMailMessage eMess) throws MailerAppException { // Exception is just declared as there is only one recoverable // app exception that is thrown by the MailHelper which should be // passed on as it is getMailHelper().createAndSendMail(eMess); } private MailHelper getMailHelper() { return (new MailHelper()); }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?