📄 forumcounttimertask.java
字号:
package com.laoer.bbscs.service.task;
import java.util.*;
import com.laoer.bbscs.service.*;
import org.apache.commons.logging.LogFactory;
import org.apache.commons.logging.Log;
/**
* <p>Title: Tianyi BBS</p>
*
* <p>Description: BBSCS</p>
*
* <p>Copyright: Copyright (c) 2006</p>
*
* <p>Company: Laoer.com</p>
*
* @author Gong Tianyi
* @version 7.0
*/
public class ForumCountTimerTask
extends TimerTask {
private static final Log logger = LogFactory.getLog(ForumCountTimerTask.class);
private ForumService forumService;
private SysStatService sysStatService;
private ForumHistoryService forumHistoryService;
public ForumCountTimerTask() {
}
/**
* When an object implementing interface <code>Runnable</code> is used to create a thread, starting the thread causes
* the object's <code>run</code> method to be called in that separately executing thread.
*
* @todo Implement this java.lang.Runnable method
*/
public void run() {
logger.info("ForumCount start");
int postNum = this.getForumService().getForumNum( -1) +
this.getForumHistoryService().getForumHistoryNum( -1);
int postMainNum = this.getForumService().getForumMainNum( -1) +
this.getForumHistoryService().getForumHistoryMainNum( -1);
//System.out.println(postMainNum + " " + postNum);
logger.info("postMainNum:" + postMainNum + " postNum:" + postNum);
this.getSysStatService().savePostNum(postMainNum, postNum);
logger.info("ForumCount end");
}
public ForumService getForumService() {
return forumService;
}
public SysStatService getSysStatService() {
return sysStatService;
}
public ForumHistoryService getForumHistoryService() {
return forumHistoryService;
}
public void setForumService(ForumService forumService) {
this.forumService = forumService;
}
public void setSysStatService(SysStatService sysStatService) {
this.sysStatService = sysStatService;
}
public void setForumHistoryService(ForumHistoryService forumHistoryService) {
this.forumHistoryService = forumHistoryService;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -