Return-Path: X-Original-To: apmail-commons-issues-archive@minotaur.apache.org Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6BFCE18B8B for ; Fri, 15 May 2015 21:59:01 +0000 (UTC) Received: (qmail 41228 invoked by uid 500); 15 May 2015 21:59:01 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 41125 invoked by uid 500); 15 May 2015 21:59:01 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 41113 invoked by uid 99); 15 May 2015 21:59:01 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 May 2015 21:59:01 +0000 Date: Fri, 15 May 2015 21:59:01 +0000 (UTC) From: "Mark Thomas (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (POOL-293) Allow for simpler extending of EvictionConfig for use with custom EvictionPolicies MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/POOL-293?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14546240#comment-14546240 ] Mark Thomas commented on POOL-293: ---------------------------------- None here. > Allow for simpler extending of EvictionConfig for use with custom EvictionPolicies > ---------------------------------------------------------------------------------- > > Key: POOL-293 > URL: https://issues.apache.org/jira/browse/POOL-293 > Project: Commons Pool > Issue Type: Improvement > Affects Versions: 2.3 > Reporter: Nick Johnson > Priority: Minor > > 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 (v6.3.4#6332)