commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Phil Steitz (JIRA)" <>
Subject [jira] [Closed] (POOL-293) Allow for simpler extending of EvictionConfig for use with custom EvictionPolicies
Date Mon, 01 Jun 2015 20:03:17 GMT


Phil Steitz closed POOL-293.

Fix released in 2.4.1.

> Allow for simpler extending of EvictionConfig for use with custom EvictionPolicies
> ----------------------------------------------------------------------------------
>                 Key: POOL-293
>                 URL:
>             Project: Commons Pool
>          Issue Type: Improvement
>    Affects Versions: 2.3
>            Reporter: Nick Johnson
>            Priority: Minor
>             Fix For: 2.4.1
> Presently, EvictionConfig contains just three items of configuration: the minEvictableIdleTimeMillis,
softMinEvictableIdleTimeMillis, and minIdle.  In the case of GenericObjectPool, these are
set inside the evict() method and passed along to the evictionPolicy.evict method.  The evictionPolicy
cannot be set directly, but rather is only instantiated by specifying a class name.  The evictionPolicy
also cannot be read in a subclass.
> Consequently if it is desired to pass along some additional parameter to the evictionPolicy,
it has to either be a constant or a static variable applying to every instance of the policy.
 It isn't possible to easily pass it along using a subclass of EvictionConfig because it's
being created inside evict(), and because there isn't a way to get a handle to the EvictionPolicy
once it's created, it also can't be set on the policy after the fact.
> It would be nice if BaseGenericObjectPool#getEvictionPolicy() were protected instead
of default security so that a subclass could invoke a setter on the evictionPolicy instance
to configure it, or if GenericObjectPool#evict could call a protected method like createEvictionConfigInstance(...),
so that a subclass could provide a custom EvictionConfig instance containing the additional
configuration for a subclassed EvictionPolicy to use.

This message was sent by Atlassian JIRA

View raw message