|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.exolab.jms.lease.BaseLease
This is the implementation of a non-specific lease object. It can be used to lease any Objeect. .
Field Summary | |
protected long |
duration_
The duration of the lease in milliseconds |
protected long |
expiryTime_
This is the time that the lease will expire |
protected java.lang.Object |
leasedObject_
This is the object that is leased |
protected LeaseEventListenerIfc |
listener_
The listener that will be notified when the lease expires |
Constructor Summary | |
BaseLease()
Default constructor for the Serailizable/Externalizable interface |
|
BaseLease(java.lang.Object object,
long duration,
LeaseEventListenerIfc 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. |
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 |
LeaseEventListenerIfc |
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected java.lang.Object leasedObject_
protected long duration_
protected long expiryTime_
protected LeaseEventListenerIfc listener_
Constructor Detail |
public BaseLease()
public BaseLease(java.lang.Object object, long duration, LeaseEventListenerIfc listener)
object
- leased objectduration
- duration of leaselistener
- will get notified on lease eventsMethod Detail |
public long getExpiryTime()
LeaseIfc
getExpiryTime
in interface LeaseIfc
org.exolab.jms.lease.LeaseIfc
public long getDuration()
LeaseIfc
getDuration
in interface LeaseIfc
org.exolab.jms.lease.LeaseIfc
public void setDuration(long duration)
public long getRemainingTime()
LeaseIfc
getRemainingTime
in interface LeaseIfc
org.exolab.jms.lease.LeaseIfc
public java.lang.Object getLeasedObject()
LeaseIfc
getLeasedObject
in interface LeaseIfc
org.exolab.jms.lease.LeaseIfc
public java.lang.Class getLeasedObjectType()
LeaseIfc
getLeasedObjectType
in interface LeaseIfc
org.exolab.jms.lease.LeaseIfc
public LeaseEventListenerIfc getLeaseEventListener()
public int compareTo(java.lang.Object object)
The comparison is based on the expiration time.
compareTo
in interface java.lang.Comparable
public 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 |