Use the finalize() method of the proxy.

Alternatively, do this in the component manager:

   HashMap objectsOutput = new HashMap ();

   public Object lookup (String role) {
       Object component = ... however you look it up ...

       Exception snapshot = new Exception ();
       objectsOutput.put (component, snapshot);

       return component;
   }

   public void release (Object o) {
       objectsOutput.remove (o);

       ... normal release ...
   }

   public void dispose () {
       // Print out anything in objectsOutput - 
       // those are the components that were looked up
       // but never released.
   }

ThreadSafe components are trickier, as you keep returning 
different instances, but also not as ciritcal to test.

Then again, if you always wrap the component you return
from lookup() in a proxy, then you use a new proxy every
time, and the above should work.

/LS

> From: Niclas Hedhman [mailto:[EMAIL PROTECTED] 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to