jsr372-experts@javaserverfaces-spec-public.java.net

[jsr372-experts] Re: [1346-FaceletCacheFactoryProtectedMethod] PROPOSAL

From: manfred riem <manfred.riem_at_oracle.com>
Date: Wed, 04 Feb 2015 15:14:40 -0600

Hi Ed,

I would like to suggest using setCacheFactories() instead of the
setMemberFactoriesPublic()

Thanks!
Manfred

On 2/4/15, 3:12 PM, Edward Burns wrote:
> The existing contract for creating the FaceletCache is the following:
>
> FaceletCacheFactory cacheFactory = (FaceletCacheFactory)
> FactoryFinder.getFactory(FactoryFinder.FACELET_CACHE_FACTORY);
> FaceletCache cache = cacheFactory.getFaceletCache();
>
> followed by a reflective invocation of the setMemberFactories() on the cache.
>
> This is wrong in two ways.
>
> 1. It requires reflection
>
> 2. It is impossible to decorate the cache so that the setMemberFactories
> call happens.
>
> I propose modify the contract to remove the need for the reflective call.
>
> The following steps must be taken.
>
> * Deprecate FaceletCache method
>
> protected void setMemberFactories()
>
> * Add FaceletCache method
>
> public void FaceletCache.setMemberFactoriesPublic().
>
> With a default implementation that calls setMemberFactories(). This
> is necessary because we can't make an existing protected method public
> without breaking existing classes that extend FaceletCacheFactory.
>
> Ed
>