Class ResourceDigestManagerImpl
- java.lang.Object
-
- org.apache.tapestry5.internal.services.ResourceDigestManagerImpl
-
- All Implemented Interfaces:
InvalidationEventHub,ResourceDigestManager
public class ResourceDigestManagerImpl extends java.lang.Object implements ResourceDigestManager
-
-
Constructor Summary
Constructors Constructor Description ResourceDigestManagerImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddInvalidationCallback(java.lang.Runnable callback)Adds a callback that is invoked when an underlying tracked resource has changed.voidaddInvalidationCallback(java.util.function.Function<java.util.List<java.lang.String>,java.util.List<java.lang.String>> function)Adds a callback, as a function that receives a list of strings and also returns a list of strings, that is invoked when one or more listed underlying tracked resource have changed.voidaddInvalidationListener(InvalidationListener listener)Adds a listener, who needs to know when an underlying resource of a given category has changed (so that the receiver may discard any cached data that may have been invalidated).voidclearOnInvalidation(java.util.Map<?,?> map)Adds a callback that clears the map.voidfireInvalidationEvent(java.util.List<java.lang.String> resources)Notify resource-specific invalidations to listeners.java.lang.StringgetDigest(Resource resource)Returns the digest for the given path.booleanrequiresDigest(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.
-
-
-
Constructor Detail
-
ResourceDigestManagerImpl
public ResourceDigestManagerImpl()
-
-
Method Detail
-
getDigest
public java.lang.String getDigest(Resource resource)
Description copied from interface:ResourceDigestManagerReturns the digest for the given path. As of 5.4, simple returns null.- Specified by:
getDigestin interfaceResourceDigestManager- Returns:
- the digest, or null if the resource does not exist
-
requiresDigest
public boolean requiresDigest(Resource resource)
Description copied from interface:ResourceDigestManagerReturns 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. As of 5.4, simply returns false.- Specified by:
requiresDigestin interfaceResourceDigestManager- Returns:
- true if digest is required for the resource
- See Also:
ResourceDigestGenerator.requiresDigest(String)
-
addInvalidationListener
public void addInvalidationListener(InvalidationListener listener)
Description copied from interface:InvalidationEventHubAdds a listener, who needs to know when an underlying resource of a given category has changed (so that the receiver may discard any cached data that may have been invalidated). Does nothing in production mode.- Specified by:
addInvalidationListenerin interfaceInvalidationEventHub
-
addInvalidationCallback
public void addInvalidationCallback(java.lang.Runnable callback)
Description copied from interface:InvalidationEventHubAdds a callback that is invoked when an underlying tracked resource has changed. Does nothing in production mode.- Specified by:
addInvalidationCallbackin interfaceInvalidationEventHub
-
clearOnInvalidation
public void clearOnInvalidation(java.util.Map<?,?> map)
Description copied from interface:InvalidationEventHubAdds a callback that clears the map.- Specified by:
clearOnInvalidationin interfaceInvalidationEventHub
-
addInvalidationCallback
public void addInvalidationCallback(java.util.function.Function<java.util.List<java.lang.String>,java.util.List<java.lang.String>> function)
Description copied from interface:InvalidationEventHubAdds a callback, as a function that receives a list of strings and also returns a list of strings, that is invoked when one or more listed underlying tracked resource have changed. An empty list should be considered as all resources being changed and any caches needing to be cleared. The return value of the function should be a non-null, but possibly empty, list of other resources that also need to be invalidated in a recursive fashion. This method does nothing in production mode.- Specified by:
addInvalidationCallbackin interfaceInvalidationEventHub
-
fireInvalidationEvent
public void fireInvalidationEvent(java.util.List<java.lang.String> resources)
Description copied from interface:InvalidationEventHubNotify resource-specific invalidations to listeners.- Specified by:
fireInvalidationEventin interfaceInvalidationEventHub
-
-