Ha, very interesting! I've spent a considerable amount of time on this
problem space "factories implemented automagically by the container".
You may bump into interesting problems.

As for your questions. As interceptor are standard components, you can
"depend" on IKernel, and an instance will be provided for you.

> Is there a way to override the setting of a handler from within a facility?

Yes. But why you want to do that?

> Failing that, is there a way for a component activator to access the kernel?

All activators are created using a conventional constructor which has
the kernel as parameter.


On Mon, Dec 29, 2008 at 9:57 AM, Julian Birch <[email protected]> wrote:
> Hi, basically I'm trying to provide a nicer way of calling Resolve with
> additional arguments.  The crucial code is the following:
> public void Intercept(IInvocation invocation)
>         {
>             var arguments = ToArguments(invocation.Method.GetParameters(),
> invocation.Arguments);
>             var returnType = invocation.Method.ReturnType;
>             var result = container.Resolve(returnType,
> ToHashtable(arguments));
>             invocation.ReturnValue = result;
>         }
> I'm finding it a bit hard to explain what exactly it's for, but it's
> basically a way of using Windsor and dynamic proxy to auto-implement
> abstract factories.  The basic code works, but what I'd like to do is to
> allow these factories to be placed into the container they use.  This would
> prevent the behaviour that you see occasionally of people registering
> the Windsor container into itself.  Ideally, it would mean that the only
> time you needed to take a dependency on Windsor was in the set up code.
>
> Thanks,
> Julian
> 2008/12/29 Ayende Rahien <[email protected]>
>>
>> Let us go back several steps, explain what you are trying to _do_.
>>
>> On Mon, Dec 29, 2008 at 6:46 PM, Julian Birch <[email protected]>
>> wrote:
>>>
>>> Hi, I've got a little piece of code that uses a simple convention system
>>> to proxy calls to Windsor.  I'll admit right now that I'm not on first name
>>> terms with most of this code case.  I've been trying to turn the feature
>>> into a facility that would be easy to use, but I've run into a couple of
>>> snags.  I've got a couple of questions, sorry if they're obvious:
>>>
>>> An interceptor can be informed of the component model on behalf of which
>>> it is acting.  Can it obtain any more information?  In particular, can it
>>> get the kernel?
>>> Is there a way to override the setting of a handler from within a
>>> facility?
>>> Failing that, is there a way for a component activator to access the
>>> kernel?
>>>
>>> In general terms, it seems like my problem is that I need an instance,
>>> but the system is designed to not pass this level of information around.
>>> Thank you,
>>> Julian
>>>
>>
>>
>>
>
>
> >
>



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

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Castle Project Development List" 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-devel?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to