Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@apache.org Received: (qmail 79103 invoked from network); 28 Feb 2003 21:08:13 -0000 Received: from exchange.sun.com (192.18.33.10) by daedalus.apache.org with SMTP; 28 Feb 2003 21:08:13 -0000 Received: (qmail 21633 invoked by uid 97); 28 Feb 2003 21:09:56 -0000 Delivered-To: qmlist-jakarta-archive-commons-dev@nagoya.betaversion.org Received: (qmail 21626 invoked from network); 28 Feb 2003 21:09:55 -0000 Received: from daedalus.apache.org (HELO apache.org) (208.185.179.12) by nagoya.betaversion.org with SMTP; 28 Feb 2003 21:09:55 -0000 Received: (qmail 78044 invoked by uid 500); 28 Feb 2003 21:08:01 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 77984 invoked from network); 28 Feb 2003 21:08:00 -0000 Received: from umbongo.flamefew.net (64.253.103.114) by daedalus.apache.org with SMTP; 28 Feb 2003 21:08:00 -0000 Received: by umbongo.flamefew.net (Postfix on Linux (i386), from userid 500) id 359EC3A2482; Fri, 28 Feb 2003 16:08:04 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by umbongo.flamefew.net (Postfix on Linux (i386)) with ESMTP id 2D123296E95 for ; Fri, 28 Feb 2003 16:08:04 -0500 (EST) Date: Fri, 28 Feb 2003 16:08:04 -0500 (EST) From: Henri Yandell X-X-Sender: To: Jakarta Commons Developers List Subject: RE: [POOL] Pool listeners In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Ah. Sorry :) Yeah. If you look in java AWT, there are often Adaptor classes for the Events. So if we take an event group named 'Xxx', then we have: XxxEvent - the Event itself. Inherits EventObject. Has a Source. XxxListener - the Listener. Inherits EventListener. There may be more than one for a particular XxxEvent, or even one listener with different events for each method. XxxAdaptor - a default implementation of a Listener. Does nothing. Probably some bits I'm missing. Hen On Fri, 28 Feb 2003, Quinton McCombs wrote: > Forgive my ignorance... I am not sure that I understood what you meant. > Where you suggesting a default implementation of PoolListener called > PoolAdaptor? > > > -----Original Message----- > > From: Henri Yandell [mailto:bayard@generationjava.com] > > Sent: Friday, February 28, 2003 2:20 PM > > To: Jakarta Commons Developers List > > Subject: RE: [POOL] Pool listeners > > > > > > > > They're both correct spelling. > > > > There are 7 times as many google replies to Adapter than > > Adaptor, which I know the Java i18n author suggests is the > > fair way to lookup which spelling to use, but I suspect it's > > more likely that adaptor is the UK/European spelling. > > > > Hen > > > > On Fri, 28 Feb 2003, Quinton McCombs wrote: > > > > > PoolAdapter? > > > > > > > -----Original Message----- > > > > From: Henri Yandell [mailto:bayard@generationjava.com] > > > > Sent: Friday, February 28, 2003 2:01 PM > > > > To: Jakarta Commons Developers List > > > > Subject: Re: [POOL] Pool listeners > > > > > > > > > > > > > > > > Also a PoolAdaptor. > > > > > > > > On Fri, 28 Feb 2003, David Graham wrote: > > > > > > > > > I would make PoolListener more closely match the Java > > > > listener style. > > > > > That > > > > > is: > > > > > 1. PoolListener extends java.util.EventListener > > > > > > > > > > 2. The methods accept an event object that extends > > > > > java.util.EventObject (maybe call it PoolEvent). > > > > > > > > > > 3. The methods shouldn't throw Exception. They should > > > > throw specific > > > > > exception types or non at all. > > > > > > > > > > I like the concept. > > > > > > > > > > David > > > > > > > > > > > > > > > > > > > > > > > > > >From: "Quinton McCombs" > > > > > >Reply-To: "Jakarta Commons Developers List" > > > > > > > > > > > >To: > > > > > >Subject: [POOL] Pool listeners > > > > > >Date: Fri, 28 Feb 2003 13:19:48 -0600 > > > > > > > > > > > >I am working on a patch to allow listeners to be added to > > > > pools that > > > > > >will receive notifications on various events. Does anyone > > > > object to > > > > > >having this functionality included? > > > > > > > > > > > >Here is the design - > > > > > > > > > > > >I was thinking about adding support for a PoolListener > > > > interface for > > > > > >the pool component. Object which implement this interface > > > > could be > > > > > >added to any ObjectPool or KeyedObjectPool. The > > listener would > > > > > >be notified on the following events: > > > > > > > > > > > >- An object is borrowed from the pool > > > > > >- An object is returned to the pool > > > > > >- An new object is created and added to the pool > > > > > >- An object is removed from the pool > > > > > > > > > > > >addListener(PoolListener) would be defined in ObjectPool and > > > > > >KeyedObjectPool. It would be implemented in > > BaseObjectPool and > > > > > >BaseKeyedObjectPool. Also in the previous two Base* classes, > > > > > >protected methods would be added to handle sending out the > > > > > >notifications to the list of listeners. > > > > > > > > > > > >public interface PoolListener > > > > > >{ > > > > > > /** > > > > > > * Executed immediatedly before an object is returned > > > > from the pool. > > > > > > * > > > > > > * @param obj The object being returned > > > > > > * @throws Exception generic exception > > > > > > */ > > > > > > void onBorrow(Object obj) throws Exception; > > > > > > > > > > > > /** > > > > > > * Executed immediately after an object is returned > > > > to the pool. > > > > > > * > > > > > > * @param obj the object being returned > > > > > > * @throws Exception generic exception > > > > > > */ > > > > > > void onReturn(Object obj) throws Exception; > > > > > > > > > > > > /** > > > > > > * Executed immediately after a new object is created > > > > but before it > > > > > > * is added to the pool. > > > > > > * > > > > > > * @param obj the newly created object > > > > > > * @throws Exception generic exception > > > > > > */ > > > > > > void onCreate(Object obj) throws Exception; > > > > > > > > > > > > /** > > > > > > * Executed when an object is removed from the pool. > > > > > > * > > > > > > * @param obj The object being removed. > > > > > > * @throws Exception generic exception > > > > > > */ > > > > > > void onDestroy(Object obj) throws Exception; > > > > > > > > > > > > > > > > > >------------------------------------------------------------------- > > > > >-- > > > > > >To unsubscribe, e-mail: > > > > > >commons-dev-unsubscribe@jakarta.apache.org > > > > > >For additional commands, e-mail: > > > > commons-dev-help@jakarta.apache.org > > > > > > > > > > > > > > > > > _________________________________________________________________ > > > > > Tired of spam? Get advanced junk mail protection with MSN 8. > > > > > http://join.msn.com/?page=features/junkmail > > > > > > > > > > > > > > > > > > > > > -------------------------------------------------------------------- > > > > - > > > > > To unsubscribe, e-mail: > > commons-dev-unsubscribe@jakarta.apache.org > > > > > For additional commands, e-mail: > > > > > commons-dev-help@jakarta.apache.org > > > > > > > > > > > > > > > > > > > > > > > > -------------------------------------------------------------------- > > > > - > > > > To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org > > > > For additional commands, e-mail: > > commons-dev-help@jakarta.apache.org > > > > > > > > > > > > > > > > --------------------------------------------------------------------- > > > To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org > > > For additional commands, e-mail: commons-dev-help@jakarta.apache.org > > > > > > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org > > For additional commands, e-mail: commons-dev-help@jakarta.apache.org > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org > For additional commands, e-mail: commons-dev-help@jakarta.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org