plannerbean.java
来自「100多M的J2EE培训内容」· Java 代码 · 共 56 行
JAVA
56 行
package com.borland.training.meetings.sessions;import javax.ejb.*;import java.util.*;import com.borland.training.meetings.entities.*;public class PlannerBean implements SessionBean { private SessionContext sessionContext; private Date nextStartTime; private Collection attendees; transient private TimeFinder timeFinder; public void ejbCreate(Collection attendeeIds, java.util.Date startTime) { try { AttendeeValueFactory factory = AttendeeValueFactory.getInstance(); Iterator iterator = attendeeIds.iterator(); attendees = new Vector(); Attendee attendee = null; while(iterator.hasNext()) { attendee = factory.findAttendee((Long) iterator.next()); attendees.add(attendee); } nextStartTime = startTime; timeFinder = TimeFinder.getInstance(); } catch(Exception e) { throw new javax.ejb.EJBException(e); } } public void ejbRemove() { } public void ejbActivate() { } public void ejbPassivate() { } public void setSessionContext(SessionContext sessionContext) { this.sessionContext = sessionContext; } public TimePeriod nextAvailableTimePeriod() { try { TimePeriod availablePeriod = timeFinder.firstAvailableTime(attendees, nextStartTime); if(availablePeriod != null) { nextStartTime = availablePeriod.getFinishTime(); } return availablePeriod; } catch (Exception e) { throw new javax.ejb.EJBException(e); } }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?