net.dpml.transit.monitor
Interface CacheMonitor

All Superinterfaces:
Monitor
All Known Implementing Classes:
CacheMonitorAdapter, CacheMonitorRouter

public interface CacheMonitor
extends Monitor

A monitor of a Transit cache activity.

The CacheMonitor must be thread safe.

Version:
1.0.1
Author:
Digital Product Meta Library
See Also:
Monitor

Field Summary
 
Fields inherited from interface net.dpml.transit.monitor.Monitor
BOOTSTRAP_DEBUG_KEY
 
Method Summary
 void addedToLocalCache(URL resource, File localFile)
          Notify the monitor that an artifact has been added to the local cache.
 void failedDownload(Artifact artifact)
          Notify the monitor of a failed download attempt.
 void failedDownloadFromHost(String host, Artifact artifact, Throwable cause)
          Notify the monitor of a failed download attempt relative to an identified host.
 void removedFromLocalCache(URL resource, File localFile)
          Notify the monitor that an artifact has been removed from the local cache.
 void resourceRequested(Artifact artifact)
          Notify the monitor that an artifact has been requested.
 void updatedLocalCache(URL resource, File localFile)
          Notify the monitor that an artifact in the local cache has been updated.
 

Method Detail

resourceRequested

public void resourceRequested(Artifact artifact)
Notify the monitor that an artifact has been requested.

Parameters:
artifact - the requested artifact

addedToLocalCache

public void addedToLocalCache(URL resource,
                              File localFile)
Notify the monitor that an artifact has been added to the local cache.

Parameters:
resource - the url of the resource added to the local cache
localFile - the local file resident in the cache

updatedLocalCache

public void updatedLocalCache(URL resource,
                              File localFile)
Notify the monitor that an artifact in the local cache has been updated.

Parameters:
resource - the url of the resource updating the local cache
localFile - the local file that has been updated

removedFromLocalCache

public void removedFromLocalCache(URL resource,
                                  File localFile)
Notify the monitor that an artifact has been removed from the local cache.

Parameters:
resource - the url of the resource removed from the local cache
localFile - the local file removed from the cache

failedDownloadFromHost

public void failedDownloadFromHost(String host,
                                   Artifact artifact,
                                   Throwable cause)
Notify the monitor of a failed download attempt relative to an identified host.

Parameters:
host - the host raising the fail status
artifact - the requested artifact
cause - the exception causing the failure

failedDownload

public void failedDownload(Artifact artifact)
Notify the monitor of a failed download attempt.

Parameters:
artifact - the requested artifact