|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--jrun.jms.core.scheduler.SchedulableEvent
|
+--jrun.jms.core.scheduler.BaseLease
This is the implementation of a non-specific lease object. It can be used to lease any Objeect. .
| Field Summary | |
protected long |
m_duration
The duration of the lease in milliseconds |
| Fields inherited from class jrun.jms.core.scheduler.SchedulableEvent |
CREATED, FIRED, SCHEDULED |
| Constructor Summary | |
BaseLease()
Default constructor for the Serailizable/Externalizable interface |
|
BaseLease(java.lang.Object object,
long duration,
SchedulableEventListener listener)
Construct an instance of this class with the specified objct, and duration |
|
| Method Summary | |
int |
compareTo(java.lang.Object object)
Compares this object with the specified object.It returns a negative integer is this object is less than the specified object; zero if this object is equal to the specified object or a positive integer if this object is greater than the specified object |
long |
getDuration()
Return the orginal duration of the lease. |
long |
getExpiryTime()
Return the absolute expiry time of this lease |
java.lang.Object |
getLeasedObject()
Return the leased object |
java.lang.Class |
getLeasedObjectType()
Return the class of leased object |
SchedulableEventListener |
getLeaseEventListener()
Return a reference to the listener registered with this object |
long |
getRemainingTime()
Return the time remaining on the lease in milliseconds |
void |
setDuration(long duration)
|
java.lang.String |
toString()
Return a string representation of this object |
| Methods inherited from class jrun.jms.core.scheduler.SchedulableEvent |
getContext, getListener, getNickTime, getType, run, setStatus |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected long m_duration
| Constructor Detail |
public BaseLease()
public BaseLease(java.lang.Object object,
long duration,
SchedulableEventListener listener)
object - leased objectduration - duration of leaselistener - will get notified on lease events| Method Detail |
public long getExpiryTime()
LeaseIfcgetExpiryTime in interface LeaseIfcjrun.jms.core.scheduler.LeaseIfcpublic long getDuration()
LeaseIfcgetDuration in interface LeaseIfcjrun.jms.core.scheduler.LeaseIfcpublic void setDuration(long duration)
public long getRemainingTime()
LeaseIfcgetRemainingTime in interface LeaseIfcjrun.jms.core.scheduler.LeaseIfcpublic java.lang.Object getLeasedObject()
LeaseIfcgetLeasedObject in interface LeaseIfcjrun.jms.core.scheduler.LeaseIfcpublic java.lang.Class getLeasedObjectType()
LeaseIfcgetLeasedObjectType in interface LeaseIfcjrun.jms.core.scheduler.LeaseIfcpublic SchedulableEventListener getLeaseEventListener()
public int compareTo(java.lang.Object object)
The comparison is based on the expiration time.
compareTo in interface java.lang.Comparablepublic java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||