Return-Path: Delivered-To: apmail-commons-dev-archive@www.apache.org Received: (qmail 48225 invoked from network); 12 Oct 2010 21:40:44 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 12 Oct 2010 21:40:44 -0000 Received: (qmail 55252 invoked by uid 500); 12 Oct 2010 21:40:44 -0000 Delivered-To: apmail-commons-dev-archive@commons.apache.org Received: (qmail 55154 invoked by uid 500); 12 Oct 2010 21:40:44 -0000 Mailing-List: contact dev-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Developers List" Delivered-To: mailing list dev@commons.apache.org Received: (qmail 55145 invoked by uid 99); 12 Oct 2010 21:40:44 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Oct 2010 21:40:44 +0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of gudnabrsam@gmail.com designates 209.85.216.43 as permitted sender) Received: from [209.85.216.43] (HELO mail-qw0-f43.google.com) (209.85.216.43) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Oct 2010 21:40:34 +0000 Received: by qwi4 with SMTP id 4so3213756qwi.30 for ; Tue, 12 Oct 2010 14:40:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:content-type:mime-version :subject:from:in-reply-to:date:content-transfer-encoding:message-id :references:to:x-mailer; bh=wDtmEnzIl7ekzpsHhFulNdXcU5zhjitAx4LDZfVeXvM=; b=dToSKpBggMukpaufhHv8yiigJRYYYCH27FcXvK8tPZA8ZWkvmHDWEPFfpGMAU0Ivqx BqlrJZGhJsQ6sRfLQtt76EL957DIDxEjVE5GqiaslwT8dgCz1L0uiKgFQ06UfRLR5xpz Zch/i3Q1gkElXm2BD8I0lM9otJVDnZWt9nBr0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to:x-mailer; b=g5h0M19/VZKmpJ1RJFx92KR6wdoJYDbTxgzUpZlE76bZQN4ExlATfRZF+wINot5TQG i4k15bF97ynq5zkN7ohpv2zfZtX/a4q+hjhk7JDdc26/PPmtE/7b5ERM26e+KL9V6C5a W2UTQHaHZXgi6zBv+umKPH22YpjZyhBU0xKDI= Received: by 10.229.211.71 with SMTP id gn7mr6713921qcb.209.1286919613786; Tue, 12 Oct 2010 14:40:13 -0700 (PDT) Received: from [192.168.0.4] ([72.169.48.55]) by mx.google.com with ESMTPS id t35sm3876920qco.30.2010.10.12.14.40.08 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 12 Oct 2010 14:40:13 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Apple Message framework v1081) Subject: Re: [POOL] generics on KeyedObjectPool From: Matt Benson In-Reply-To: Date: Tue, 12 Oct 2010 16:39:54 -0500 Content-Transfer-Encoding: quoted-printable Message-Id: References: <4CB462A3.30803@gmail.com> To: "Commons Developers List" X-Mailer: Apple Mail (2.1081) X-Virus-Checked: Checked by ClamAV on apache.org On Oct 12, 2010, at 3:14 PM, James Carman wrote: > You don't need generic-smart code for what they do in Wicket. Here's > the signature of the "get" method: >=20 > public final T getMetaData(MetaDataKey key) >=20 > So, when you're using an object of type MetaDataKey you can > only set/get string objects using it. >=20 At compile time. -Matt > On Tue, Oct 12, 2010 at 10:54 AM, Matt Benson = wrote: >> Looks like their javadoc is a little off, recommending new = MetaDataKey(Role.class) { } when I believe they meant new = MetaDataKey() { } . This resonates with the optionality I did for = the type parameter in the proxy2-stub module's StubConfigurer class: if = the implementation has the variable assigned as by an anonymous inner = class declaration, no need to pass the class reference explicitly. This = does necessitate some generics-smart code; does [pool] depend on [lang]? = lang3's TypeUtils takes care of this nicely. >>=20 >> -Matt >>=20 >>=20 >> On Oct 12, 2010, at 8:38 AM, James Carman wrote: >>=20 >>> If you're going to do that, I'd recommend doing something similar to >>> what the Wicket folks did: >>>=20 >>> = http://wicket.apache.org/apidocs/1.4/org/apache/wicket/MetaDataKey.html >>>=20 >>> = http://wicket.apache.org/apidocs/1.4/org/apache/wicket/Application.html#ge= tMetaData%28org.apache.wicket.MetaDataKey%29 >>>=20 >>> This way, the key has type information "baked in." >>>=20 >>> On Tue, Oct 12, 2010 at 9:29 AM, Brent Worden = wrote: >>>> The javadoc on KeyedObjectPool states 'A keyed pool pools = instances of >>>> multiple types.' However, the new parametrization on = KeyedObjectPool allows >>>> for only a single instance type. >>>>=20 >>>> To allow for pooling multiple typed instances, should the instance = type >>>> parameter be removed from the interface declaration and placed on = the >>>> relevant method declarations? In other words, replace: >>>>=20 >>>> public interface KeyedObjectPool { >>>> ... >>>> } >>>>=20 >>>> with: >>>>=20 >>>> public interface KeyedObjectPool { >>>>=20 >>>> V borrowObject(K key); >>>>=20 >>>> void invalidateObject(K key, V obj); >>>>=20 >>>> void returnObject(K key, V obj); >>>> ... >>>> } >>>>=20 >>>> Thoughts? >>>>=20 >>>> Brent. >>>>=20 >>>>=20 >>>> = --------------------------------------------------------------------- >>>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org >>>> For additional commands, e-mail: dev-help@commons.apache.org >>>>=20 >>>>=20 >>>=20 >>> = --------------------------------------------------------------------- >>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org >>> For additional commands, e-mail: dev-help@commons.apache.org >>>=20 >>=20 >>=20 >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org >> For additional commands, e-mail: dev-help@commons.apache.org >>=20 >>=20 >=20 > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org > For additional commands, e-mail: dev-help@commons.apache.org >=20 --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org For additional commands, e-mail: dev-help@commons.apache.org