Expose HandlerPipeline for an instance

Topics: Development Team Discussion, User Discussion
Aug 15, 2007 at 7:43 PM
public class Foo : MarshalByRefObject { public void Do() {...} }
Foo foo = PolicyInjection.Create<Foo>();

I would like to have:
MethodBase method = typeof(Foo).GetMethod("Do");
HandlerPipeline pipeline = PolicyInjection.GetHanderPipeline(foo, method)

Or if we ever get Instance-wide CallHandlers as asked in my previous post,
HandlerPripeline pipeline = PolicyInjection.GetHandlerPipeline(foo);
Aug 15, 2007 at 10:57 PM
Since CallHandlers are reused across target-intances, you should be able to call:

MethodBase method = typeof(Foo).GetMethod("Do");
IEnumerable<ICallHandler> pipeline = PolicyThisOrThat.GetHandlersFor(method);

in which PolicyThisOrThat is an instance of Policy.

Policies are usually contained in a PolicySet, which can be created using the PolicySetFactory