<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Message</TITLE>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2800.1492" name=GENERATOR></HEAD>
<BODY><!-- Converted from text/plain format -->
<P><FONT size=2>"For each client that is no<BR>longer connected to the ORB (by
checking a hit() method on the Listener<BR>interface), I destory() the POA
associated with that clients connection. "<BR><BR>There is a great example, I
believe called the "Pacific Ocean Problem", in Henning & Vinoski. The
idea is that once you've shipped out the object reference (in the example, a
message in a bottle), it's out of your control, i.e. it's hard to say whether
the client is disconnected or not.<BR><BR>Therefore, how does your hit() method
work? Is it that you have someway of telling that the connection is
active, i.e. you are either sending or receiving (or processing), and once that
completes, the reference would not be reused? If so, what if it fails to
complete?<BR><BR>-Mike<BR><BR><BR>-----Original Message-----<BR>From:
omniorb-list-bounces@omniorb-support.com [<A
href="mailto:omniorb-list-bounces@omniorb-support.com">mailto:omniorb-list-bounces@omniorb-support.com</A>]
On Behalf Of Steven King<BR>Sent: Friday, April 15, 2005 2:28 AM<BR>To:
omniorb-list@omniorb-support.com<BR>Subject: Re: [omniORB] Dynamic destruction
of servants when no clientreferences<BR><BR><BR>Okeefe, Michael K
wrote:<BR><BR>>"Duncan has made a game example application that shows how to
do the<BR>>child poa<BR>>creation and registering of the objects. Google
for it. "<BR>><BR>>Here's the link I think you're referring to, it covers
factory pattern,<BR>>garbage collection, and more:<BR>><A
href="http://www.grisby.org/presentations/py10tut.pdf">http://www.grisby.org/presentations/py10tut.pdf</A><BR>><BR>><BR>>_______________________________________________<BR>>omniORB-list
mailing list<BR>>omniORB-list@omniorb-support.com<BR>><A
href="http://www.omniorb-support.com/mailman/listinfo/omniorb-list">http://www.omniorb-support.com/mailman/listinfo/omniorb-list</A><BR>> <BR>><BR>Thanks
for you help,<BR><BR>I thought that I would let the list know of the solution we
ended up<BR>using for reference, please comment and critique.<BR><BR>Each client
connection made to request a DOM Document causes a new<BR>Document servant to be
created. This servant is registered on new<BR>unique POA (using the
rootPOA and the POA Manager of the root POA).<BR> Each client is also
required to implement a Listener interface and pass<BR>it with the request for
the Document. This listener and the created POA<BR>is registered onto a
Document Clients register. <BR>Each servant created by operations on the
Document are attached to the<BR>same POA as that Document.<BR><BR>Upon
initialisation, a cleaning thread is created which runs every 30<BR>seconds or
so. The cleaning thread iterates through the list of known<BR>clients from
the DocumentClients register. For each client that is no<BR>longer
connected to the ORB (by checking a hit() method on the Listener<BR>interface),
I destory() the POA associated with that clients connection.<BR> This
destroy in turn cleans up all of the servants registered to this<BR>POA (calls
all of their destructors).<BR><BR>This was done because:<BR>1) We wanted to know
when a client was finished and not just remove the<BR>servants without the
clients knowledge. <BR> Some clients will be
connected for very long periods of time - with<BR>potentially long wait times
between requests.<BR>2) Elegantly clean up all of the servants created from
within the<BR>context of DOM Document servant.<BR>3) Fitted in well with our DOM
Document caching mechanism (the cache<BR>needed to be reevaluated every so
often)<BR><BR>Please feel free to
comment,<BR><BR>Thanks,<BR><BR>Steve<BR>--<BR><BR><<A
href="http://www.eminence.com.au/">http://www.eminence.com.au/</A>> Eminence
Technology Pty Ltd<BR>PO Box 118, Moorooka QLD 4105<BR>Web: www.eminence.com.au
<<A
href="http://www.eminence.com.au/">http://www.eminence.com.au/</A>><BR>Ph:
+61-7-3277-4100<BR>Fax: +61-7-3277-4577<BR><BR></FONT></P></BODY></HTML>