org.apache.tapestry5.internal.services
Interface ResourceCache

All Superinterfaces:
InvalidationEventHub
All Known Implementing Classes:
ResourceCacheImpl

public interface ResourceCache
extends InvalidationEventHub

Caches information about resources on the classpath. In addition, acts as an invalidation hub for any resources for which information is obtained (when any of the resources are changed, invalidation listeners are notified so they can clear their caches).


Method Summary
 String getDigest(Resource resource)
          Returns the digest for the given path.
 StreamableResource getStreamableResource(Resource resource)
          Returns the contents of the resource
 long getTimeModified(Resource resource)
          Returns the time modified for the resource.
 boolean requiresDigest(Resource resource)
          Returns true if the path requires that the client URL for the resource include a digest to validate that the client is authorized to access the resource.
 
Methods inherited from interface org.apache.tapestry5.services.InvalidationEventHub
addInvalidationListener
 

Method Detail

requiresDigest

boolean requiresDigest(Resource resource)
Returns true if the path requires that the client URL for the resource include a digest to validate that the client is authorized to access the resource.

Parameters:
resource -
Returns:
true if digest is required for the resource
See Also:
ResourceDigestGenerator.requiresDigest(String)

getStreamableResource

StreamableResource getStreamableResource(Resource resource)
Returns the contents of the resource

Parameters:
resource -
Returns:
access to compressed and uncompressed streams
Since:
5.1.0.0

getDigest

String getDigest(Resource resource)
Returns the digest for the given path.

Parameters:
resource -
Returns:
the digest, or null if the resource does not exist

getTimeModified

long getTimeModified(Resource resource)
Returns the time modified for the resource.

Parameters:
resource -
Returns:
the date time modified for the path, or a negative value if the resource does not exist


Copyright © 2006-2009 Apache Software Foundation. All Rights Reserved.