Daniel Dekany wrote:
Friday, December 12, 2003, 5:09:03 PM, Timothy Bennett wrote:
[snip]
The Sun GC guys highly discourage the use of pooling due to alot of
improvements and optimizations in the JDK1.4+ garbage collector. The JDK1.5 GC will even smarter and self-tuning. The only exception to the "do-not-pool" recommendation is when you have objects that are very expensive to create, such as database connections.
How to invoke the life-cycle events (dispose, etc.) when the GC is responsible to releases the component? Stephen McConnell said that it works so in Merlin, but I'm pessimistic about that it can be implemented correctly on Java platform. What's the trick?
:-)
The trick is that a proxy is generated that holds a reference to the actual component. If the proxy is finalized it knows that the component it is referencing has no outstanding references - but the proxy has a reference to the appliance managing the component - so the proxy invokes the decommissioning cycle on the appliance which invokes decomissioning actions on the component which results in component disposal.
Stephen.
(specialist in the dark-arts)
--
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]
