Coverage report

  %line %branch
com.ozacc.mail.spring.MailetRunnerJob
0% 
0% 

 1  
 package com.ozacc.mail.spring;
 2  
 
 3  
 import java.util.ArrayList;
 4  
 import java.util.Iterator;
 5  
 import java.util.List;
 6  
 
 7  
 import org.quartz.JobExecutionContext;
 8  
 import org.quartz.JobExecutionException;
 9  
 import org.springframework.scheduling.quartz.QuartzJobBean;
 10  
 
 11  
 import com.ozacc.mail.fetch.FetchMailPro;
 12  
 import com.ozacc.mail.fetch.ReceivedMail;
 13  
 import com.ozacc.mail.mailet.MailetWrapper;
 14  
 
 15  
 /**
 16  
  * Spring Framework¤ÎQuartz¼Â¹ÔÍÑMailetRunner¡£
 17  
  * 
 18  
  * @since 1.2
 19  
  * @author Tomohiro Otsuka
 20  
  * @version $Id: MailetRunnerJob.java,v 1.1.2.3 2005/01/23 06:47:16 otsuka Exp $
 21  
  */
 22  
 public class MailetRunnerJob extends QuartzJobBean {
 23  
 
 24  
 	private List mailetWrapperList;
 25  
 
 26  
 	private FetchMailPro fetchMailPro;
 27  
 
 28  
 	/**
 29  
 	 * ¥³¥ó¥¹¥È¥é¥¯¥¿¡£
 30  
 	 */
 31  0
 	public MailetRunnerJob() {
 32  0
 		mailetWrapperList = new ArrayList();
 33  0
 	}
 34  
 
 35  
 	/**
 36  
 	 * ¥á¡¼¥?¼õ¿®¤ÈMailet¤Îµ¯Æ°¤ò¹Ô¤¤¤Þ¤¹¡£
 37  
 	 * 
 38  
 	 * @see org.springframework.scheduling.quartz.QuartzJobBean#executeInternal(org.quartz.JobExecutionContext)
 39  
 	 */
 40  
 	protected void executeInternal(JobExecutionContext context) throws JobExecutionException {
 41  0
 		fetchMailPro.connect();
 42  
 		try {
 43  0
 			int count = fetchMailPro.getMailCount();
 44  0
 			for (int i = 1; i <= count; i++) {
 45  0
 				ReceivedMail mail = fetchMailPro.getMail(i);
 46  0
 				processMail(mail);
 47  
 			}
 48  0
 		} finally {
 49  0
 			if (fetchMailPro.isConnected()) {
 50  0
 				fetchMailPro.disconnect();
 51  
 			}
 52  0
 		}
 53  0
 	}
 54  
 
 55  
 	/**
 56  
 	 * »ØÄꤵ¤?¤¿¼õ¿®¥á¡¼¥?¤ËÂФ·¤ÆMailet¤òŬÍѤ·¤Þ¤¹¡£
 57  
 	 * 
 58  
 	 * @param mail MailetUnit¤ËÅϤ¹¼õ¿®¥á¡¼¥?
 59  
 	 */
 60  
 	private void processMail(ReceivedMail mail) {
 61  0
 		for (Iterator itr = mailetWrapperList.iterator(); itr.hasNext();) {
 62  0
 			MailetWrapper mailetWrapper = (MailetWrapper)itr.next();
 63  0
 			mailetWrapper.execute(mail);
 64  
 		}
 65  0
 	}
 66  
 
 67  
 	/**
 68  
 	 * ¥á¡¼¥?¤Î¼õ¿®¤Ë»ÈÍѤ¹¤?FetchMailPro¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Î¼ÂÁõ¥¤¥ó¥¹¥¿¥ó¥¹¤ò¥»¥Ã¥È¤·¤Þ¤¹¡£
 69  
 	 * 
 70  
 	 * @param fetchMailPro FetchMailPro¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Î¼ÂÁõ¥¤¥ó¥¹¥¿¥ó¥¹
 71  
 	 */
 72  
 	public void setFetchMailPro(FetchMailPro fetchMailPro) {
 73  0
 		this.fetchMailPro = fetchMailPro;
 74  0
 	}
 75  
 
 76  
 	/**
 77  
 	 * ¼Â¹Ô¤¹¤?Mailet¤ÎMailetWrapper¥?¥¹¥È¤ò¥»¥Ã¥È¤·¤Þ¤¹¡£
 78  
 	 * 
 79  
 	 * @param mailetWrapperList ¼Â¹Ô¤¹¤?Mailet¤ÎMailetWrapper¥?¥¹¥È
 80  
 	 */
 81  
 	public void setMailetWrapperList(List mailetWrapperList) {
 82  0
 		this.mailetWrapperList = mailetWrapperList;
 83  0
 	}
 84  
 
 85  
 }

This report is generated by jcoverage, Maven and Maven JCoverage Plugin.