avidgoffer
07-25-2007, 10:11 PM
Hello,
I am very new to spring and was wondering if there is a way to suppress attribute proxying when doing an introduction in the code? Also are there any examples available about introductions on complex structures?
In the following code I am creating a proxy for my policy class, basically following example 6 in the quickstart, and this works fine when I comment out the GUID attribute on the Policy class.
public IPolicy GetPolicy(StateId state, int policyNumber)
{
PolicyAdapter reader = (PolicyAdapter)CreateObject(ObjectNames.PolicyAdap ter);
IPolicy policy = reader.Fetch(state, policyNumber);
ProxyFactoryObject pf = new ProxyFactoryObject();
pf.Target = policy;
pf.AddAdvisor(new ModificationAdvisor(policy.GetType()));
pf.AddIntroduction(new IsModifiedAdvisor());
pf.ProxyTargetType = true;
return (IPolicy)pf.GetObject();
}
thanks
Aaron
I am very new to spring and was wondering if there is a way to suppress attribute proxying when doing an introduction in the code? Also are there any examples available about introductions on complex structures?
In the following code I am creating a proxy for my policy class, basically following example 6 in the quickstart, and this works fine when I comment out the GUID attribute on the Policy class.
public IPolicy GetPolicy(StateId state, int policyNumber)
{
PolicyAdapter reader = (PolicyAdapter)CreateObject(ObjectNames.PolicyAdap ter);
IPolicy policy = reader.Fetch(state, policyNumber);
ProxyFactoryObject pf = new ProxyFactoryObject();
pf.Target = policy;
pf.AddAdvisor(new ModificationAdvisor(policy.GetType()));
pf.AddIntroduction(new IsModifiedAdvisor());
pf.ProxyTargetType = true;
return (IPolicy)pf.GetObject();
}
thanks
Aaron