HolidayCalendarBean.java
资源名称:某公司的java培训教材 [点击查看]
上传用户:dinglihq
上传日期:2013-02-04
资源大小:99958k
文件大小:1k
源码类别:
Java编程
开发平台:
Java
- package com.borland.training.meetings.sessions;
- import java.rmi.*;
- import javax.ejb.*;
- import java.util.Calendar;
- import java.util.Date;
- public class HolidayCalendarBean implements SessionBean {
- SessionContext sessionContext;
- public void ejbCreate() {
- }
- public void ejbRemove() {
- }
- public void setSessionContext(SessionContext sessionContext) {
- this.sessionContext = sessionContext;
- }
- public void ejbActivate() {
- }
- public void ejbPassivate() {
- }
- public boolean isCompanyHoliday(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;
- }
- }