It checks the last time a resource was accessed and if greater than
the resource's disposalDelay it disposes of the resource so that it can
be GCed.
Disposal activity must be explicitely started using the startDisposing method
- Version:
- 1.0
- Author:
- Eduardo Francos - InContext
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ETSLADisposalStrategy
public ETSLADisposalStrategy()
- Constructor for the ETSLADisposalStrategy object
ETSLADisposalStrategy
public ETSLADisposalStrategy(long periodicity)
- Constructor for the ETSLADisposalStrategy object
- Parameters:
periodicity
- the periodicity at which to check for disposable resources
ETSLADisposalStrategy
public ETSLADisposalStrategy(DisposableResourceManager newManager,
long newPeriodicity)
- Constructor for the ETSLADisposalStrategy object
- Parameters:
manager
- the managerperiodicity
- the periodicity at which to check for disposable resources
setManager
public void setManager(DisposableResourceManager newManager)
- Sets the manager holding the resources for this strategy
- Specified by:
setManager
in interface ResourceDisposabilityStrategy
- Parameters:
manager
- The new manager value
getManager
public DisposableResourceManager getManager()
- Gets the manager holding the resources for this strategy
- Specified by:
getManager
in interface ResourceDisposabilityStrategy
- Returns:
- The manager value
startDisposing
public void startDisposing()
throws ResourceManagerNotSetException
- Activates the strategy which starts disposing of resources as fitted
- Specified by:
startDisposing
in interface ResourceDisposabilityStrategy
- Throws:
ResourceManagerNotSetException
- thrown if the manager has not
been set, so impossible to run
stopDisposing
public void stopDisposing(long millis)
- Deactivates the strategy that stops automatic disposal of resources.
The millis parameters specifies in milliseconds the time to wait for
the disposal to stop. After this time the method returns, but the
deactivation request remains active.
- Specified by:
stopDisposing
in interface ResourceDisposabilityStrategy
- Parameters:
millis
- time to wait for disposal to stop
getPeriodicity
public long getPeriodicity()
- Gets the periodicity attribute of the ETSLADisposalStrategy object
- Returns:
- The periodicity value
setPeriodicity
public void setPeriodicity(long newPeriodicity)
- Sets the periodicity attribute of the ETSLADisposalStrategy object
- Parameters:
newPeriodicity
- The new periodicity value