org.apache.tapestry5.internal.services
Class ResourceCacheImpl

java.lang.Object
  extended by org.apache.tapestry5.internal.event.InvalidationEventHubImpl
      extended by org.apache.tapestry5.internal.services.ResourceCacheImpl
All Implemented Interfaces:
ResourceCache, InvalidationEventHub, UpdateListener

public class ResourceCacheImpl
extends InvalidationEventHubImpl
implements ResourceCache, UpdateListener


Constructor Summary
ResourceCacheImpl(ResourceDigestGenerator digestGenerator, ClasspathURLConverter classpathURLConverter)
           
 
Method Summary
 void checkForUpdates()
          Invoked to force the receiver to check for updates to whatever underlying resources it makes use of.
 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 class org.apache.tapestry5.internal.event.InvalidationEventHubImpl
addInvalidationListener, fireInvalidationEvent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.tapestry5.services.InvalidationEventHub
addInvalidationListener
 

Constructor Detail

ResourceCacheImpl

public ResourceCacheImpl(ResourceDigestGenerator digestGenerator,
                         ClasspathURLConverter classpathURLConverter)
Method Detail

checkForUpdates

public void checkForUpdates()
Description copied from interface: UpdateListener
Invoked to force the receiver to check for updates to whatever underlying resources it makes use of.

Specified by:
checkForUpdates in interface UpdateListener

getDigest

public String getDigest(Resource resource)
Description copied from interface: ResourceCache
Returns the digest for the given path.

Specified by:
getDigest in interface ResourceCache
Returns:
the digest, or null if the resource does not exist

getTimeModified

public long getTimeModified(Resource resource)
Description copied from interface: ResourceCache
Returns the time modified for the resource.

Specified by:
getTimeModified in interface ResourceCache
Returns:
the date time modified for the path, or a negative value if the resource does not exist

requiresDigest

public boolean requiresDigest(Resource resource)
Description copied from interface: ResourceCache
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.

Specified by:
requiresDigest in interface ResourceCache
Returns:
true if digest is required for the resource
See Also:
ResourceDigestGenerator.requiresDigest(String)

getStreamableResource

public StreamableResource getStreamableResource(Resource resource)
Description copied from interface: ResourceCache
Returns the contents of the resource

Specified by:
getStreamableResource in interface ResourceCache
Returns:
access to compressed and uncompressed streams


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