Daniel Dekany wrote:
Saturday, December 13, 2003, 6:34:55 AM, Stephen McConnell wrote:
Normal VM termination triggers a shutdown hook. The shutdown hook triggers shutdown of the kernel. Kernel shutdown triggers decommissioning of the root application block. Block decomissioning triggers orderly decommissioning of the appliances contained within it. Appliance decommissioning trigers disposal of the associated lifestyle handler. The lifestyle handler maintains a soft references queue and from this can locate and non-finalized component instances and invoke component decommissioning.
Are you sure? A soft reference to object O my cleared (=> get() returns null, so you can access O anymore) before O.finlaize() is invoked. So it can happen that you can't access O with soft reference, but it is not finalized yet either.
The soft reference is to the proxy so if the reference returns null we know that the proxy has been finalized which means that the corresponding component has been decommissioned.
[snip](Ammm... I don't know what's "startup policy enabled" :), but these were
plain simple components. They had no entry in block.xml or something
like that... I smell bug here...)
For any component the default collection policy is CONSERVATIVE which
basically transles to a component that will stick around until its
appliance terminates it. Alternative collection policies include
DEMOCRAT and LIBERAL. A DEMOCRAT sticks around unless there is memory
contention (soft ref) and a LIBERAL basically translates to a weak
ref.
If I quess well, the appliance object stores a reference to the proxy
(where the proxy wraps the actual component instance). And this
reference (applicance -ref-> proxy) is soft for DEMOCRAT and weak for
LIBERAL? And, for CONSERVATIVE it is hard? That would be a dangerous
default for transient objects, as that will leak memory.
Good point - have just corrected this locally at the lifestyle handler level to ensure we only ever hold soft or weak refs for transients. Once I've tested things I'll update CVS and include the change in the next RC.
To kick in LIBERAL or DEMOCRAT collection policies you nbeed to declare this at the component type level. For example, the following declares that a component implementation expects weak reference semantics:
@avalon.component name="fred" collection="liberal"
I see... then cleanly the lack of "collection" setting causes the problem in my case. (However, I use the 3.2 release, and seems it doesn't understand "collection"...)
You need to build the meta package which will update the avalon-meta-plugin.
Cheers, Steve.
--
Stephen J. McConnell mailto:[EMAIL PROTECTED]
|------------------------------------------------| | Magic by Merlin | | Production by Avalon | | | | http://avalon.apache.org/merlin | | http://dpml.net/ | |------------------------------------------------|
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
