*/
public void updateStatus(Collection<Result> results ){
List<EmailContent> list = new ArrayList<EmailContent>();
for( Result result:results ){
EmailContent ec = get(result.getKey());
if( ec == null )
continue;
list.add(ec);
if( result.isSuccess() ){
ec.setFinishedTime(Calendar.getInstance());
ec.setStatus( Status.SUCCESS );
}else{
ec.setStatus( Status.FAILURE );
if( result.getObject() != null && result.getObject() instanceof JobQueue ){
JobQueue jq = (JobQueue)result.getObject();
ec.incFailureCount( jq.getFailureCount());
ec.setErrMsg(jq.getErrMsg());
}
}
}
dao.update(list);