1 45 package org.openejb.core.stateful; 46 47 import javax.ejb.SessionBean ; 48 import javax.transaction.Transaction ; 49 50 public class BeanEntry implements java.io.Serializable { 51 protected final SessionBean bean; 52 protected Object primaryKey; 53 protected Object ancillaryState; 54 protected transient Transaction transaction; 55 protected long timeStamp; 56 protected long timeOutInterval; 57 protected boolean inQue = false; 58 59 protected BeanEntry(SessionBean beanInstance, Object primKey, Object ancillary, long timeOut){ 60 bean = beanInstance; 61 primaryKey = primKey; 62 ancillaryState = ancillary; 63 transaction = null; 64 timeStamp = System.currentTimeMillis(); 65 timeOutInterval = timeOut; 66 } 67 protected boolean isTimedOut(){ 68 if(timeOutInterval == 0) 69 return false; 70 long now = System.currentTimeMillis(); 71 return (now - timeStamp)> timeOutInterval; 72 } 73 protected void resetTimeOut( ){ 74 if(timeOutInterval > 0) { 75 timeStamp = System.currentTimeMillis(); 76 } 77 } 78 } 79 | Popular Tags |