Return-Path: Delivered-To: apmail-jakarta-hivemind-user-archive@www.apache.org Received: (qmail 11437 invoked from network); 6 Feb 2006 08:23:43 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 6 Feb 2006 08:23:43 -0000 Received: (qmail 24857 invoked by uid 500); 6 Feb 2006 08:23:41 -0000 Delivered-To: apmail-jakarta-hivemind-user-archive@jakarta.apache.org Received: (qmail 24842 invoked by uid 500); 6 Feb 2006 08:23:41 -0000 Mailing-List: contact hivemind-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: hivemind-user@jakarta.apache.org List-Id: Delivered-To: mailing list hivemind-user@jakarta.apache.org Received: (qmail 24831 invoked by uid 99); 6 Feb 2006 08:23:41 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Feb 2006 00:23:41 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of jason@buberel.org designates 69.57.148.76 as permitted sender) Received: from [69.57.148.76] (HELO mail.buberel.org) (69.57.148.76) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Feb 2006 00:23:40 -0800 Received: from thumper (ppp-71-139-116-30.dsl.snfc21.pacbell.net [::ffff:71.139.116.30]) (AUTH: PLAIN jason, SSL: TLSv1/SSLv3,256bits,AES256-SHA) by mail.buberel.org with esmtp; Mon, 06 Feb 2006 02:23:18 -0600 id 0049433E.43E70776.000016DC From: "Jason L. Buberel" To: hivemind-user@jakarta.apache.org Subject: Re: Discardable.threadDidDiscard not being invoked problem Date: Mon, 6 Feb 2006 00:23:19 -0800 User-Agent: KMail/1.9.1 References: <200602051110.22161.jason@buberel.org> <360173eb0602060007h46c1aa7btfafed9ce3832e14f@mail.gmail.com> In-Reply-To: <360173eb0602060007h46c1aa7btfafed9ce3832e14f@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200602060023.19084.jason@buberel.org> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N That would explain why threadDidDiscardService() is not invoked. But is the use of the ThreadPoolExecutor also the cause of the finalize() method never being called? As for the cleanupThread() , I will read through the docs (and possibly steal some code from Tapestry :) to figure out what i need to do). It looks like I need to have each of the objects that I insert into my threadpool register listener themselves as listeners with the registry. Is that correct? Thanks, jason On Monday 06 February 2006 00:07, Knut Wannheden wrote: > Jason, > > The threads will have to clean up after them selves in order to make > HiveMind discard the service implementations. See > http://jakarta.apache.org/hivemind/hivemind/apidocs/org/apache/hivemind/Reg >istry.html#cleanupThread() > > HTH, > > --knut > > On 2/5/06, Jason L. Buberel wrote: > > I am using HiveMind v1.1.1 with Hibernate to manage a multi-threaded > > database application that uses HiveMind as the central factory for all > > interfaces/classes. I have adopted the ISessionOwner/SessionOwnerImpl > > session Hibernate management pattern from Kent Truong's e-book 'Enjoying > > Web Development with Tapestry'. > > > > I have defined the following interface: > > > > public interface ISessionOwner extends Discardable { > > Session getSession(); > > } > > > > And the following implementation: > > > > public class SessionOwnerImpl implements ISessionOwner, Discardable { > > public Session getSession() { > > ... > > } > > > > public void threadDidDiscardService() { > > LOGGER.debug("discarding instance of SessionOwner"); > > ... > > } > > } > > > > The hivemodule.xml snippet for this service point is: > > > > > interface="com.altosresearch.ISessionOwner"> > > > > > > > > > > > > I have confirmed that the basic functionality (instantiation) works just > > fine. Callers to Registry.getService(ISessionOwner.class) are indeed > > being returned instances of SessionOwnerImpl on a per-thread basis. > > > > The objects that are obtaining references to these instances are running > > in the 'main' thread as well as from within one of several > > ThreadPoolExecutors that I use. > > > > However, when any of these threads terminate or the application exits, I > > do not see the log message "discarding instance of SessionOwner" ever > > appear in my log files. > > > > I have inserted similar statments into the finalize() method for this > > class, but I do not see those being recorded either. > > > > I am using JDK1.5_06 on RedHat ES3.0. I invoke the application via an > > ant task, from the command line, with fork="true". > > > > I'm hoping that I am just doing something obviously wrong here. Anyone > > have any pointers/suggestions? > > > > Thanks, > > jason > > > > -- > > Jason L. Buberel -- www.buberel.org -- skype:jbuberel > > +1.650.483.1989 -- im:jason@im.buberel.org > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org > > For additional commands, e-mail: hivemind-user-help@jakarta.apache.org > > --------------------------------------------------------------------- > To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: hivemind-user-help@jakarta.apache.org -- Jason L. Buberel -- www.buberel.org -- skype:jbuberel +1.650.483.1989 -- im:jason@im.buberel.org --------------------------------------------------------------------- To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: hivemind-user-help@jakarta.apache.org