|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--org.exolab.jms.lease.BaseLease
Generic lease implementation, which may be used to lease any object.
| 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(java.lang.Object object,
long duration,
LeaseEventListenerIfc listener)
Construct a new BaseLease. |
|
| Method Summary | |
int |
compareTo(java.lang.Object object)
Compares this object with the specified object. |
long |
getDuration()
Returns the duration of the lease. |
long |
getExpiryTime()
Return the absolute expiry time of this lease. |
java.lang.Object |
getLeasedObject()
Returns the leased object. |
LeaseEventListenerIfc |
getLeaseEventListener()
Returns the listener to notify of lease events. |
long |
getRemainingTime()
Returns the time remaining on the lease. |
protected void |
notifyLeaseExpired()
Notify the listeners that this lease has expird. |
void |
setDuration(long duration)
Change the duration of the lease. |
java.lang.String |
toString()
Returns 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 final java.lang.Object _leasedObject
protected long _duration
protected long _expiryTime
protected LeaseEventListenerIfc _listener
| Constructor Detail |
public BaseLease(java.lang.Object object,
long duration,
LeaseEventListenerIfc listener)
BaseLease.object - the leased objectduration - the duration of lease, in millisecondslistener - the listener to notify of lease events| Method Detail |
public long getExpiryTime()
getExpiryTime in interface LeaseIfcpublic long getDuration()
getDuration in interface LeaseIfcpublic void setDuration(long duration)
duration - the new lease duration, in millisecondspublic long getRemainingTime()
getRemainingTime in interface LeaseIfcpublic java.lang.Object getLeasedObject()
getLeasedObject in interface LeaseIfcpublic LeaseEventListenerIfc getLeaseEventListener()
public int compareTo(java.lang.Object object)
compareTo in interface java.lang.Comparablepublic java.lang.String toString()
toString in class java.lang.Objectprotected void notifyLeaseExpired()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||