Return-Path: Delivered-To: apmail-commons-dev-archive@www.apache.org Received: (qmail 38517 invoked from network); 12 Oct 2010 15:00:52 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 12 Oct 2010 15:00:52 -0000 Received: (qmail 17140 invoked by uid 500); 12 Oct 2010 15:00:52 -0000 Delivered-To: apmail-commons-dev-archive@commons.apache.org Received: (qmail 16744 invoked by uid 500); 12 Oct 2010 15:00:51 -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 16736 invoked by uid 99); 12 Oct 2010 15:00:50 -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 15:00:50 +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 simone.tripodi@gmail.com designates 74.125.82.49 as permitted sender) Received: from [74.125.82.49] (HELO mail-ww0-f49.google.com) (74.125.82.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Oct 2010 15:00:44 +0000 Received: by wwd20 with SMTP id 20so2724832wwd.6 for ; Tue, 12 Oct 2010 08:00:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=7m8iJBz7zK6dUdfF3Q2OkekzDpA2UkbQktCiq3OjgrE=; b=XDrYBuloPLWDigZrEMz0VCi6nRH7M65EtzVScpZpJADI3dKqLWcMjb/uZ8AyHhqhYo DjK8N0PcU2jTiizp8MYbR9MLGn2YL1i+Ri18wW5HptpTzaCx2kwyT/j+b5SFMBM7MouT lqDZM+jTEaQx3HMXSOSw5sYaYMjvvytyJ1wm0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=jjfzzoNSQRDzxXoEhlcpXZ0rr+qFGTCclF8txDuDLmAEWES7BsqAKHqPP+X/dIwEn9 H+sR5b6e73D7UmMPREKkoynC809zNsTXg9l+IuGEeyv0GlbSi4pWdw8Pq466wyjpiLjq hVCf4rwWojK6uNkcSsLR+7mYuvR5zhkWLobBQ= MIME-Version: 1.0 Received: by 10.216.11.129 with SMTP id 1mr5065503wex.90.1286895623901; Tue, 12 Oct 2010 08:00:23 -0700 (PDT) Received: by 10.216.36.195 with HTTP; Tue, 12 Oct 2010 08:00:23 -0700 (PDT) In-Reply-To: References: <4CB462A3.30803@gmail.com> Date: Tue, 12 Oct 2010 17:00:23 +0200 Message-ID: Subject: Re: [POOL] generics on KeyedObjectPool From: Simone Tripodi To: Commons Developers List Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org Hi Matt!! :) nope, the [pool] component is totally self-contained, it doesn't have any dependency. Have a nice day, Simo http://people.apache.org/~simonetripodi/ http://www.99soft.org/ On Tue, Oct 12, 2010 at 4:54 PM, Matt Benson wrote: > Looks like their javadoc is a little off, recommending new MetaDataKey(Ro= le.class) { } when I believe they meant new MetaDataKey() { } . =C2= =A0This resonates with the optionality I did for the type parameter in the = proxy2-stub module's StubConfigurer class: =C2=A0if the implementation has = the variable assigned as by an anonymous inner class declaration, no need t= o pass the class reference explicitly. =C2=A0This does necessitate some gen= erics-smart code; does [pool] depend on [lang]? =C2=A0lang3's TypeUtils tak= es care of this nicely. > > -Matt > > > On Oct 12, 2010, at 8:38 AM, James Carman wrote: > >> If you're going to do that, I'd recommend doing something similar to >> what the Wicket folks did: >> >> http://wicket.apache.org/apidocs/1.4/org/apache/wicket/MetaDataKey.html >> >> http://wicket.apache.org/apidocs/1.4/org/apache/wicket/Application.html#= getMetaData%28org.apache.wicket.MetaDataKey%29 >> >> This way, the key has type information "baked in." >> >> On Tue, Oct 12, 2010 at 9:29 AM, Brent Worden w= rote: >>> =C2=A0The javadoc on KeyedObjectPool states 'A keyed pool pools instanc= es of >>> multiple types.' =C2=A0However, the new parametrization on KeyedObjectP= ool allows >>> for only a single instance type. >>> >>> 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? =C2=A0In other words, replace: >>> >>> public interface KeyedObjectPool { >>> ... >>> } >>> >>> with: >>> >>> public interface KeyedObjectPool { >>> >>> V borrowObject(K key); >>> >>> void invalidateObject(K key, V obj); >>> >>> void returnObject(K key, V obj); >>> ... >>> } >>> >>> Thoughts? >>> >>> Brent. >>> >>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org >>> For additional commands, e-mail: dev-help@commons.apache.org >>> >>> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org >> For additional commands, e-mail: dev-help@commons.apache.org >> > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org > For additional commands, e-mail: dev-help@commons.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org For additional commands, e-mail: dev-help@commons.apache.org