RoomBean.java
资源名称:某公司的java培训教材 [点击查看]
上传用户:dinglihq
上传日期:2013-02-04
资源大小:99958k
文件大小:1k
源码类别:
Java编程
开发平台:
Java
- package com.borland.training.meetings.entities;
- import javax.ejb.*;
- public abstract class RoomBean implements EntityBean {
- EntityContext entityContext;
- public java.lang.String ejbCreate(java.lang.String name, int capacity) throws CreateException {
- setName(name);
- setCapacity(capacity);
- return null;
- }
- public void ejbPostCreate(java.lang.String name, int capacity) throws CreateException {
- }
- public void ejbRemove() throws RemoveException {
- }
- public abstract void setName(java.lang.String name);
- public abstract void setCapacity(int capacity);
- public abstract void setMeetings(java.util.Collection meetings);
- public abstract java.util.Collection getMeetings();
- public abstract int getCapacity();
- public abstract java.lang.String getName();
- public void unsetEntityContext() {
- this.entityContext = null;
- }
- public void setEntityContext(EntityContext entityContext) {
- this.entityContext = entityContext;
- }
- public void ejbLoad() {
- }
- public void ejbStore() {
- }
- public void ejbActivate() {
- }
- public void ejbPassivate() {
- }
- public int ejbHomeCalculateTotalCapacity() {
- int res = 0;
- try {
- java.util.Iterator iter = ejbSelectAll().iterator();
- while(iter.hasNext()) {
- Room room = (Room)iter.next();
- res = res + room.getCapacity();
- }
- }
- catch(Exception e) {
- throw new javax.ejb.EJBException(e);
- }
- return res;
- }
- public abstract java.util.Collection ejbSelectAll() throws FinderException ;
- }