PDA

View Full Version : Serialize IMethodInterceptor


michael.delaney@rbos.com
03-03-2007, 12:58 AM
Hi Guys,

i'm working on a project and a requirement has appeared where i need to authorise a certain percentage of actions in an app. basically methods on a facade layer of an app.. basically i'm wondering whether i can serialize the invocation when i intercept it and then later deserialise it and invoke it??
anyone done anything similar?

regards..

Aleks Seovic
03-16-2007, 05:10 AM
As of today, you can ;)

You can also serialize and deserialize the whole AOP proxy, as long as both the target object and all of the advices are serializable.

One caveat is that you have to call Spring.Util.SystemUtils.RegisterLoadedAssemblyReso lver() on application startup if you need to serialize and deserialize dynamically generated proxy types. Unless you do that, serialization engine will throw an exception saying that it cannot find assembly Spring.Proxy, even though it is already loaded!? Basically, binary deserializer always tries to load assembly from the disk, even if it is already in memory... Shame on Microsoft.

HTH,

Aleks