Class InvalidationEventHubImpl
java.lang.Object
org.apache.tapestry5.internal.event.InvalidationEventHubImpl
- All Implemented Interfaces:
InvalidationEventHub
- Direct Known Subclasses:
ComponentTemplateSourceImpl,InternalComponentInvalidationEventHubImpl,MessagesSourceImpl,ResourceChangeTrackerImpl
Base implementation class for classes (especially services) that need to manage a list of
InvalidationListeners.-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedInvalidationEventHubImpl(boolean productionMode, org.slf4j.Logger logger) -
Method Summary
Modifier and TypeMethodDescriptionfinal voidaddInvalidationCallback(Runnable callback) Adds a callback that is invoked when an underlying tracked resource has changed.voidAdds 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.final 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).final voidclearOnInvalidation(Map<?, ?> map) Adds a callback that clears the map.protected final voidNotifies all listeners/callbacks.final voidfireInvalidationEvent(List<String> resources) Notifies all listeners/callbacks.
-
Constructor Details
-
InvalidationEventHubImpl
-
-
Method Details
-
fireInvalidationEvent
Notifies all listeners/callbacks. -
fireInvalidationEvent
Notifies all listeners/callbacks.- Specified by:
fireInvalidationEventin interfaceInvalidationEventHub
-
addInvalidationCallback
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
Description copied from interface:InvalidationEventHubAdds a callback that clears the map.- Specified by:
clearOnInvalidationin interfaceInvalidationEventHub
-
addInvalidationListener
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
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
-