I remember to have read something similar on Krzysztof's tutorial on DP2: http://kozmic.pl/Tags/DynamicProxy/default.aspx
-Markus Am 20. Juni 2009 12:53 schrieb Volker Röppischer <[email protected] >: > Nobody any hint for me, how to do this? I thought about using factories > with the container but I can't do > this because one can register a specific TaskBuilder for a TaskDefinition. > > ITaskBuilder pBuilder = > ServiceResolver.doResolveByKey<ITaskBuilder>(i_pTaskDef.Identity, > pArguments); > if( pBuilder == null ) > { > //Is there a Default - ITaskBuilder - implementation? > pBuilder = > ServiceResolver.doResolveByKey<ITaskBuilder>("ITaskBuilder_default", > pArguments); > } > pTask = pBuilder.doBuild(); > > So i can't asure, that there is always a proxied instance of an ITask but i > need this because i want to check > if the Task meets all Specifications of the registered > TaskAvailabilityCheckers. I know this could be done > by the TaskBuilder itself but i have to be aware that a developer using > this thing simply writes pTask = new MyTask() > without checking anything. > So maybe i' completly wrong on that. Any suggestion would be fine. > > Thanks > > 2009/6/18 Belvasis <[email protected]> > > Hi, I have a short question. If i use the CreateInterfaceProxyWithTarget - >> method, the result is a proxy >> that allows to call and intercept all Methods defined by the specified >> interface. But i have the >> following situation: >> >> interface ITask >> { >> void doStart(); >> } >> >> [TaskImplementor] >> class MyTask : ITask >> { >> doStart() {}; >> [TaskImplementorMethod] >> void doStartToo() {}; >> } >> >> later on... >> >> void TaskRegistry.doExecuteTask(ITask i_pTask) >> { >> //Proxy the task to intercept the doStart() or all other method marked >> as [TaskImplementorMethod] >> } >> >> So now i want to intercept a method that is not provided by the Proxy >> generated by CreateInterfaceProxyWithTarget. I understand this >> but how can i do it to intercept other methods, unknown by the interface >> since my TaskRegistry doesn't know anything about >> the concrete Task Implementations. If i use >> CreateClassProxy(i_pTask.GetType()) the result is a correct object of type >> MyTask, but it >> is empty. So i thought if there would be a method like >> CreateClassProxyWithTarget(i_pTask.GetType(),i_pTask) it could solve my >> problem, but there isn't one :-) Maybe there is another way to do this? >> >> Thanks >> Volker >> >> >> > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Castle Project Users" 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-users?hl=en -~----------~----~----~----~------~----~------~--~---
