Enumerate Types Registered in Windsor

1 view
Skip to first unread message

James Thigpen

unread,
Sep 30, 2008, 5:20:06 PM9/30/08
to Castle Project Users
Is it possible to enumerate all the components (id, interface, type)
registered in Windsor? It's just for debugging.

Thanks,

-jt

hammett

unread,
Sep 30, 2008, 5:59:25 PM9/30/08
to castle-pro...@googlegroups.com
Yeah. You can either enumerate the handlers or use the naming service subsystem.

--
Cheers,
hammett
http://hammett.castleproject.org/

James Thigpen

unread,
Sep 30, 2008, 7:29:29 PM9/30/08
to Castle Project Users
Thanks!

I ended up with this (should anyone else ever google this).

public void LogComponentsInContainer(IWindosrContainer container)
{
INamingSubSystem naming =
container.Kernel.GetSubSystem(SubSystemConstants.NamingKey) as
INamingSubSystem;
foreach (var handler in naming.GetHandlers())
{
Log.Debug("Registered on IoC: {0}, {1}, {2}",
handler.ComponentModel.Name,
handler.Service.FullName,
handler.ComponentModel.Implementation.FullName);
}
}

-jt

On Sep 30, 2:59 pm, hammett <hamm...@gmail.com> wrote:
> Yeah. You can either enumerate the handlers or use the naming service subsystem.
>
> On Tue, Sep 30, 2008 at 2:20 PM, James Thigpen
>
Reply all
Reply to author
Forward
0 new messages