|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.exolab.jms.service.Service | +--org.exolab.jms.service.BasicService | +--org.exolab.jms.lease.LeaseManager
The LeaseManager is responsible for creating and managing the lease objects. The Leasemanager is a singleton. When a BaseLease object is created it is added to the queue according to the duration (i.e. leases with shorter durations are placed at the top of the queue.
When the lease expires the LeeaseManager calls the leasee's associated listener(s).
Constructor Summary | |
LeaseManager()
Create a new sorted tree set using the lease comparator as the sorting functor. |
Method Summary | |
void |
addLease(BaseLease lease)
Add a lease. |
void |
doStop()
Stop the service. |
protected void |
expire()
Expires active leases |
void |
removeAll()
Remove all the leases from the queue. |
boolean |
removeLease(BaseLease lease)
Remove a lease. |
BaseLease |
renewLease(BaseLease lease,
long duration)
Renew the lease on the specified object |
void |
run()
The run method will search for expired leases, remove them from the list and notify listeners |
Methods inherited from class org.exolab.jms.service.BasicService |
doStart, toString |
Methods inherited from class org.exolab.jms.service.Service |
getName, isStarted, restart, start, stop |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public LeaseManager()
Method Detail |
public void addLease(BaseLease lease)
lease
- the lease to addpublic boolean removeLease(BaseLease lease)
lease
- lease to removepublic BaseLease renewLease(BaseLease lease, long duration)
lease
- the lease to renewduration
- the new duration of the lease in mspublic void removeAll()
public void run()
public void doStop() throws ServiceException
doStop
in class BasicService
ServiceException
- if the service fails to stopprotected void expire()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |