Hi fellow Windsorers,
I've got an application where a particular component implementation is 
provided externally (by an Activator), but I only want it to be destroyed 
when the instance has been released the same number of times that it was 
resolved. I'm wondering if there is a particular lifestyle that implements 
reference counting such that the activator is called for the first resolve, 
and then for subsequent resolves the same instance is returned, then when 
the component is completely released (release called the same number of 
times as resolve) the instance is destroyed. I tried registering it with a 
transient lifestyle and always returning the same instance, but of course 
upon subsequent resolves I get an error that the particular instance is 
already being tracked.

Firstly: Given that the requirement for destroying the component once there 
are no remaining references to it is valid, does a resolve/release 
reference counting lifestyle sound like the right approach, or is the an 
alternative?
Secondly: Are there any reference implementations for the preferred 
approach? If not then creating a lifestyle similar to transient but with 
reference counting isn't too difficult.

Cheers,
Rob

-- 
You received this message because you are subscribed to the Google Groups 
"Castle Project Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to castle-project-users+unsubscr...@googlegroups.com.
To post to this group, send email to castle-project-users@googlegroups.com.
Visit this group at http://groups.google.com/group/castle-project-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to