Examples of AsyncToken


Examples of cn.org.rapid_framework.util.concurrent.async.AsyncToken

   */
  public AsyncToken sendConfirmOrder(final String username) {
    final SimpleMailMessage msg = createConfirmOrder(username);
   
    //转换为html邮件并发送,另有一个参数可以指定发件人名称
    AsyncToken token = getAsyncJavaMailSender().send(SimpleMailMessageUtils.toHtmlMsg(msg,"rapid小明"));
   
    //处理邮件发送结果
    token.addResponder(new IResponder() {
      public void onFault(Exception fault) {
        System.out.println("[ERROR] confirmOrder mail send fail,cause:"+fault);
      }
      public void onResult(Object result) {
        System.out.println("[INFO] confirmOrder mail send success");
View Full Code Here

Examples of cn.org.rapid_framework.util.concurrent.async.AsyncToken

    orderMailer = (OrderMailer)context.getBean("orderMailer");
  }
 
  @Test
  public void testSendFromOrderMailer() throws TemplateException, IOException, Exception {
    AsyncToken token = orderMailer.sendConfirmOrder("badqiu");
   
    //waitForResult主要用于测试,请使用相同功能的Future.get()
    token.waitForResult();
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.