public void contributeApplicationInitializer(
OrderedConfiguration<ApplicationInitializerFilter> configuration,
final ApplicationGlobals applicationGlobals, final PropertyAccess propertyAccess,
final TypeCoercer typeCoercer)
{
ApplicationInitializerFilter setApplicationPackage = new ApplicationInitializerFilter()
{
public void initializeApplication(Context context, ApplicationInitializer initializer)
{
String packageName = context
.getInitParameter(InternalConstants.TAPESTRY_APP_PACKAGE_PARAM);
applicationGlobals.store(packageName);
_componentClassResolver.setApplicationPackage(packageName);
initializer.initializeApplication(context);
}
};
configuration.add("SetApplicationPackage", setApplicationPackage, "before:*.*");
final InvalidationListener listener = new InvalidationListener()
{
public void objectWasInvalidated()
{
propertyAccess.clearCache();
typeCoercer.clearCache();
}
};
ApplicationInitializerFilter clearCaches = new ApplicationInitializerFilter()
{
public void initializeApplication(Context context, ApplicationInitializer initializer)
{
// Snuck in here is the logic to clear the PropertyAccess service's cache whenever
// the component class loader is invalidated.