|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsimple.util.lease.LeaseManager
public class LeaseManager
The LeaseManager
is used to issue a lease for a
named resource. This is effectively used to issue a request
for a named resource to be released when a lease has expired.
The use of a Lease
simplifies the interface to
the notification and also enables other objects to manage the
lease without any knowledge of the resource it represents.
Constructor Summary | |
---|---|
LeaseManager(Cleaner cleaner)
Constructor for the LeaseManager object. |
Method Summary | |
---|---|
Lease |
lease(java.lang.String name,
long duration)
This method will issue a Lease object that
can be used to manage the release of a named resource. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LeaseManager(Cleaner cleaner)
LeaseManager
object. This
instance is created using a specified notification handler.
The specified Cleaner
will be notified when
the lease for a named resource expires, which will allow
the cleaner object to perform a clean up for that resource.
cleaner
- the cleaner object receiving notificationsMethod Detail |
---|
public Lease lease(java.lang.String name, long duration)
Lease
object that
can be used to manage the release of a named resource. If
the lease duration expires before it is renewed then the
notification is sent, typically to a Cleaner
implementation, to signify that the resource should be
recovered. The issued lease can also be canceled.
name
- this is the name of the leased resourceduration
- this is the duration of the issued lease
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |