org.apache.tapestry5.internal.services
Class ComponentTemplateSourceImpl
java.lang.Object
org.apache.tapestry5.internal.event.InvalidationEventHubImpl
org.apache.tapestry5.internal.services.ComponentTemplateSourceImpl
- All Implemented Interfaces:
- ComponentTemplateSource, InvalidationEventHub, UpdateListener
public final class ComponentTemplateSourceImpl
- extends InvalidationEventHubImpl
- implements ComponentTemplateSource, UpdateListener
Service implementation that manages a cache of parsed component templates.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ComponentTemplateSourceImpl
public ComponentTemplateSourceImpl(TemplateParser parser,
PageTemplateLocator locator,
ClasspathURLConverter classpathURLConverter)
getTemplate
public ComponentTemplate getTemplate(ComponentModel componentModel,
Locale locale)
- Resolves the component name to a
Resource and finds the localization of that resource (the combination of
component name and locale is resolved to a resource). The localized resource is used as the key to a cache of
ComponentTemplates.
If a template doesn't exist, then the missing ComponentTemplate is returned.
- Specified by:
getTemplate in interface ComponentTemplateSource
- Parameters:
componentModel - model for the component whose template is to be accessedlocale - the locale to find the template within
- Returns:
- the cached template instance
checkForUpdates
public void checkForUpdates()
- Checks to see if any parsed resource has changed. If so, then all internal caches are cleared, and an
invalidation event is fired. This is brute force ... a more targeted dependency management strategy may come
later.
- Specified by:
checkForUpdates in interface UpdateListener
getInvalidationEventHub
public InvalidationEventHub getInvalidationEventHub()
- Description copied from interface:
ComponentTemplateSource
- Event hub used to notify listeners that underlying component template files have changed.
- Specified by:
getInvalidationEventHub in interface ComponentTemplateSource
- See Also:
ComponentTemplates
Copyright © 2006-2009 Apache Software Foundation. All Rights Reserved.