Class ResourceChangeTrackerImpl
- java.lang.Object
-
- org.apache.tapestry5.internal.event.InvalidationEventHubImpl
-
- org.apache.tapestry5.internal.services.assets.ResourceChangeTrackerImpl
-
- All Implemented Interfaces:
InvalidationEventHub
,ResourceChangeTracker
,UpdateListener
,ResourceDependencies
public class ResourceChangeTrackerImpl extends InvalidationEventHubImpl implements ResourceChangeTracker, UpdateListener
-
-
Constructor Summary
Constructors Constructor Description ResourceChangeTrackerImpl(ClasspathURLConverter classpathURLConverter, boolean productionMode, boolean multipleClassLoaders, org.slf4j.Logger logger)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addDependency(Resource dependency)
Marks the dependency as an additional resource.void
checkForUpdates()
Invoked to force the receiver to check for updates to whatever underlying resources it makes use of.void
clearCurrentClassName()
Informs this service that no component class is associated with the resources being loaded.void
forceInvalidationEvent()
Forces an invalidation event.void
registerWithUpdateListenerHub(UpdateListenerHub hub)
void
setCurrentClassName(java.lang.String className)
Informs this service that the resources being loaded are associated with a given Tapestry component (i.e.long
trackResource(Resource resource)
Start tracking the resource (or return the last modified time of an already tracked resource).-
Methods inherited from class org.apache.tapestry5.internal.event.InvalidationEventHubImpl
addInvalidationCallback, addInvalidationCallback, addInvalidationListener, clearOnInvalidation, fireInvalidationEvent, 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.commons.services.InvalidationEventHub
addInvalidationCallback, addInvalidationCallback, addInvalidationListener, clearOnInvalidation, fireInvalidationEvent
-
-
-
-
Constructor Detail
-
ResourceChangeTrackerImpl
public ResourceChangeTrackerImpl(ClasspathURLConverter classpathURLConverter, @Symbol("tapestry.production-mode") boolean productionMode, @Symbol("tapestry.multiple-classloaders") boolean multipleClassLoaders, org.slf4j.Logger logger)
-
-
Method Detail
-
registerWithUpdateListenerHub
@PostInjection public void registerWithUpdateListenerHub(UpdateListenerHub hub)
-
trackResource
public long trackResource(Resource resource)
Description copied from interface:ResourceChangeTracker
Start tracking the resource (or return the last modified time of an already tracked resource). Only file system resources are tracked. Resources are tracked until any resource changes, at which points listeners are notified and the internal state is cleared.- Specified by:
trackResource
in interfaceResourceChangeTracker
- Parameters:
resource
- to track- Returns:
- last modified time, to nearest second
- See Also:
URLChangeTracker
-
addDependency
public void addDependency(Resource dependency)
Description copied from interface:ResourceDependencies
Marks the dependency as an additional resource. A change to the dependency is considered the same as a change to the resource being transformed.- Specified by:
addDependency
in interfaceResourceDependencies
-
forceInvalidationEvent
public void forceInvalidationEvent()
Description copied from interface:ResourceChangeTracker
Forces an invalidation event. This is required in a rare case, to clear out aStreamableResource
generated from the component message catalog; there are some walls in place that prevent the message catalog's underlyingResource
s from being exposed.- Specified by:
forceInvalidationEvent
in interfaceResourceChangeTracker
- See Also:
MessageCatalogResource
-
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 interfaceUpdateListener
-
setCurrentClassName
public void setCurrentClassName(java.lang.String className)
Description copied from interface:ResourceChangeTracker
Informs this service that the resources being loaded are associated with a given Tapestry component (i.e. component, page, mixin and base) component class.- Specified by:
setCurrentClassName
in interfaceResourceChangeTracker
- Parameters:
className
- The fully classified class name of the component or page associated with the current resources being processed.
-
clearCurrentClassName
public void clearCurrentClassName()
Description copied from interface:ResourceChangeTracker
Informs this service that no component class is associated with the resources being loaded.- Specified by:
clearCurrentClassName
in interfaceResourceChangeTracker
-
-