Adam,
you'd have to create a new lifestylemanager that works like SingletonLM
but it's release does what TransientLM does.
Should be very straightforward.
Krzysztof
On 28/07/2010 10:03 AM, Adam Langley wrote:
Hi,
I have noticed that the ContainerWrapper (an instance of
System.ComponentModel.IContainer) class registers components with the Kernel
using AddComponentInstance.
This eventually results in a singleton lifestyle being applied - which is not
particularly desirable, because it means that the added component will hang
around in the lifestyle pool until the Kernel is disposed, even if the
component is removed from the ContainerWrapper collection.
How can I change this call to AddComponentInstance to a Register call, with
arguments that will allow a component instance to be registered in a way that
will allow the same instance to be returned from all Resolve calls (singleton
behavior), but will be removed when Release is called (transient behavior)?
Thanks
Adam Langley
Senior Developer
+64 9 486 9010
[email protected]
www.winscribe.com
Please consider the environment before printing this email!
--
You received this message because you are subscribed to the Google Groups "Castle
Project Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/castle-project-users?hl=en.