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

[jsr372-experts] [1346-FaceletCacheFactoryProtectedMethod] PROPOSAL

From: Edward Burns <edward.burns_at_oracle.com>
Date: Wed, 4 Feb 2015 13:12:14 -0800

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

-- 
| edward.burns_at_oracle.com | office: +1 407 458 0017
| 23 days til DevNexus 2015
| 33 days til JavaLand 2015
| 43 days til CONFESS 2015