|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Lease
The Lease
object is used to keep a named resource
active. This provides a very simple lease that can be used to
track the activity of a resource or system. Keeping track of
activity allows resources to be maintained until such time
that they are no longer required, allowing the server to clean
up any allocated memory, file descriptors, or other such data.
Method Summary | |
---|---|
void |
cancel()
This will cancel the lease and release the resource. |
long |
getExpiry()
Determines the duration remaining before the lease expires. |
void |
renew(long duration)
This ensures that the leased resource is maintained for the specified duration. |
java.lang.String |
toString()
Provides the name of the resource that this lease represents. |
Method Detail |
---|
void renew(long duration) throws LeaseException
System
time plus the
duration. The accuracy of this method should be exact.
duration
- this is the length of time to renew for
LeaseException
- if the expiry has been passedvoid cancel() throws LeaseException
renew
method with
a zero length duration. Once this has been called the
Cleaner
used should be notified immediately.
If the lease has already expired this throws an exception.
LeaseException
- if the expiry has been passedlong getExpiry() throws LeaseException
LeaseException
- if the lease expiry has passedjava.lang.String toString()
Object
.
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |