gnu.crypto.util
public abstract class ExpirableObject extends Object implements Destroyable
Concrete subclasses must implement the doDestroy()
method
instead of Destroyable#destroy(); the behavior of that method
should match exactly the behavior desired of destroy()
.
Note that if a DestroyFailedException occurs when the timeout expires, it will not be reported.
See Also: Destroyable
Field Summary | |
---|---|
static long | DEFAULT_TIMEOUT
The default timeout, used in the default constructor. |
Constructor Summary | |
---|---|
protected | ExpirableObject()
Create a new expirable object that will expire after one hour. |
protected | ExpirableObject(long delay)
Create a new expirable object that will expire after the specified
timeout.
|
Method Summary | |
---|---|
void | destroy()
Destroys this object. |
protected abstract void | doDestroy()
Subclasses must implement this method instead of the Destroyable#destroy() method.
|
Parameters: delay The delay before expiration.
Throws: IllegalArgumentException If delay is negative, or if
delay + System.currentTimeMillis()
is negative.
Throws: DestroyFailedException If this operation fails.
Throws: DestroyFailedException If this operation fails.