HolidayCalendarBean.java
资源名称:某公司的java培训教材 [点击查看]
上传用户:dinglihq
上传日期:2013-02-04
资源大小:99958k
文件大小:1k
源码类别:
Java编程
开发平台:
Java
- package com.cwj.meetings;
- import javax.ejb.*;
- import java.util.*;
- public class HolidayCalendarBean implements SessionBean {
- SessionContext sessionContext;
- public void ejbCreate() throws CreateException {
- /**@todo Complete this method*/
- }
- public void ejbRemove() {
- /**@todo Complete this method*/
- }
- public void ejbActivate() {
- /**@todo Complete this method*/
- }
- public void ejbPassivate() {
- /**@todo Complete this method*/
- }
- public void setSessionContext(SessionContext sessionContext) {
- this.sessionContext = sessionContext;
- }
- public boolean isCompanyHoliday(java.util.Date date) {
- Calendar cal=Calendar.getInstance();
- cal.setTime(date);
- int dayOfWeek=cal.get(Calendar.DAY_OF_WEEK);
- if((dayOfWeek==Calendar.SATURDAY)||(dayOfWeek==Calendar.SUNDAY)){
- return true;
- }
- return false;
- }
- }