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

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

From: Frank Caputo <frank_at_frankcaputo.de>
Date: Thu, 5 Feb 2015 19:12:43 +0100

+1 for the proposal with setCacheFactories()

Ciao Frank

> Am 04.02.2015 um 22:14 schrieb manfred riem <manfred.riem_at_oracle.com>:
>
> 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
>>
>