org.jhotdraw.contrib.html
Interface DisposableResourceManager

All Known Implementing Classes:
StandardDisposableResourceManager

public interface DisposableResourceManager

DisposableResourceManager defines the interface for managers of disposable resources.
A DisposableResourceManager implements a strategy for efficient disposal of seldom used resources.

Version:
<$CURRENT_VERSION$>
Author:
Eduardo Francos - InContext

Method Summary
 java.util.Iterator getResources()
          Returns an iterator on the managed resources
 boolean managesResource(DisposableResourceHolder resource)
          True if the resource is registered with this manager
 void registerResource(DisposableResourceHolder resource)
          Registers a resource with the manager so as to be disposed
 void startDisposing()
          Activates the strategy which starts disposing of resources as fitted
 void stopDisposing(long millis)
          Deactivates the strategy that stops automatic disposal of resource.
 void unregisterResource(DisposableResourceHolder resource)
          Unregisters a resource so it is not automatically GCed.
 

Method Detail

registerResource

void registerResource(DisposableResourceHolder resource)
Registers a resource with the manager so as to be disposed

Parameters:
resource - the resource

unregisterResource

void unregisterResource(DisposableResourceHolder resource)
Unregisters a resource so it is not automatically GCed.

Parameters:
resource - the resource

getResources

java.util.Iterator getResources()
Returns an iterator on the managed resources

Returns:
The resources iterator

managesResource

boolean managesResource(DisposableResourceHolder resource)
True if the resource is registered with this manager

Parameters:
resource - The resource
Returns:
True if the resource is registered with this manager

startDisposing

void startDisposing()
                    throws ResourceManagerNotSetException
Activates the strategy which starts disposing of resources as fitted

Throws:
ResourceManagerNotSetException - Description of the Exception

stopDisposing

void stopDisposing(long millis)
Deactivates the strategy that stops automatic disposal of resource.
The millis parameters specifies in milliseconds the time to wait for the disposal to stop. After this time the method returns whether the disposal was stopped or not, but the desactivation request remains active.

Parameters:
millis - time to wait for disposal to stop