I don’t think it would be impossible, but there’s nothing OOTB in Windsor to
support such scenario, mostly because it would be non-trivial to provide a
generic solution.
But, if you keep track of IExceptionHandlers you register it should be fairly
straightforward to then pick the right one and resolve it by name using
ITypedFactoryComponentSelector
--
Krzysztof Kozmic
On Tuesday, 4 March 2014 at 3:46 am, Scott_M wrote:
> Looking for good way to do selection via inheritance chain with Windsor for
> the following scenario:
>
> IExceptionHandler<T> : where T : Exception
>
> IException<Exception> //default IMPL
>
> IExceptionHandler<SqlException> IMPL for SQL errors.
>
> IExceptionHandler<OracleException> IMPL for Oracle errors
>
> .
> .
> .
> etc
>
>
> So ideally you would have a typed factory interface that looks like this:
>
> public interface IExceptionHandlerFactory : where T : Exception
> {
> IExceptionHandler<T> GetHandler(Exception ex);
> }
>
> The idea being that the most specific exception handler (based upon Exception
> inheritance chain) is selected for creation based upon the current exception
> being passed in.
>
> Example, passing a SQLException into the factory would return
> IExceptionHandler<SqlException> but passing a ArgumentNullException into the
> factory would return IExceptionHandler<Exception>.
>
> Is this possible using Windsor?
>
> --
> 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 [email protected]
> (mailto:[email protected]).
> To post to this group, send email to [email protected]
> (mailto:[email protected]).
> Visit this group at http://groups.google.com/group/castle-project-users.
> For more options, visit https://groups.google.com/groups/opt_out.
--
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/castle-project-users.
For more options, visit https://groups.google.com/groups/opt_out.