Interceptors and Policies in configuration file

Oct 13, 2008 at 9:22 PM

I am attempting to use .config files to configure interceptors and policies using the latest drop of Unity (12774).  I have reviewed the test cases and a bit of the code.  I am unable to figure out how to make it all work.  Any direction on this would be greatly appreciated.

I have no problem creating a pipeline programmatically.  Everything works fine.


Oct 16, 2008 at 5:58 PM

Documentation is coming. In the meantime could you share an example of what you tried, what you expected, and what you actually got?


Oct 16, 2008 at 7:28 PM
Well, I've actually made a good bit of progress since starting this discussion.  I continued working through the various test cases for the container as well as for the interception code.  I have gotten a pipeline running now with some matching rules other than what I was looking to do.

The matching rule I wanted to use is the CustomAttributeMatchingRule, however, I was unable to figure out how to inject the attribute type in the constructor via the .config file.  I did not see any other way of instantiating the rule, so I figure that is the only mechanism.

Also, are these assumptions correct?

- Policies are processed in the order specified in the config file.  If a policy is "matched," processing stops by building that pipeline.
- Multiple matching rules are and'ed and not or'ed.

Finally, will the handlers in the PIAB be ported to Unity Interception?

Thanks for the information.  I have been exercising the code pretty well, and things appear to be in good shape for early release code.

Oct 16, 2008 at 10:19 PM
There's other ways; I'll try to cook up an example for you but I'm really slammed right now buttoning up the release.

Your assumptions are almost, but not quite correct as I'm reading your descriptions. For a single policy, all matching rules much match (they are and'ed together, not or'ed). If all matching rules match, then all handlers from that policy are added to the interception chain. However, that does not stop the evaluation of policies - other policies may also match, and if they do those handlers are added as well.

The PIAB handlers have been changed (not that it took much) to work with Unity interception. However, since most of them depend on Entlib stuff, they are staying in the PIAB assembly rather than being moved into the Unity standalone distribution.

Oct 17, 2008 at 12:05 PM
Thanks for the response!  I really appreciate the input and feedback.  I understand your explanation of the policies.  Very cool.  Sorry about the PIAB question.  If I would have just looked at the implementation, I would have seen that.

I completely understand being slammed for a release.  It's the nature of our wonderful industry :)  I look forward to seeing your example.

Thanks again.