public object CreateClassProxy(Type classType, AspectDefinition aspect, params object[] constructorArgs) { AssertUtil.ArgumentNotNull(classType, "classType"); AssertUtil.ArgumentNotNull(aspect, "aspect"); IInvocationDispatcher dispatcher = _dispatcherFactory.Create(aspect, _engine); return(CreateAndInstantiateClassProxy(classType, aspect, dispatcher, constructorArgs)); }
public void SetInterceptedComponentModel(ComponentModel target) { AspectDefinition aspectDef = (AspectDefinition) target.ExtendedProperties["aop.aspect"]; System.Diagnostics.Debug.Assert( aspectDef != null ); _dispatcher = new ContainerInvocationDispatcher(aspectDef, _kernel); _dispatcher.Init(_engine); }
public object CreateInterfaceProxy(Type inter, object target, AspectDefinition aspect) { AssertUtil.ArgumentNotNull(inter, "inter"); AssertUtil.ArgumentNotNull(target, "target"); AssertUtil.ArgumentNotNull(aspect, "aspect"); IInvocationDispatcher dispatcher = _dispatcherFactory.Create(aspect, _engine); return(CreateAndInstantiateInterfaceProxy(inter, target, aspect, dispatcher)); }
public void SetInterceptedComponentModel(ComponentModel target) { AspectDefinition aspectDef = (AspectDefinition) target.ExtendedProperties["aop.aspect"]; System.Diagnostics.Debug.Assert(aspectDef != null); _dispatcher = new ContainerInvocationDispatcher(aspectDef, _kernel); _dispatcher.Init(_engine); }
private object CreateClassProxyInstance(Type proxyType, object[] mixins, IInvocationDispatcher dispatcher, params object[] constructorArgs) { object proxy; if (mixins.Length != 0) { proxy = Activator.CreateInstance(proxyType, Merge(new object[] { dispatcher, mixins }, constructorArgs)); } else { proxy = Activator.CreateInstance(proxyType, Merge(new object[] { dispatcher }, constructorArgs)); } return(proxy); }
private object CreateInterfaceProxyInstance(Type proxyType, object target, object[] mixins, IInvocationDispatcher dispatcher) { object proxy; if (mixins.Length != 0) { proxy = Activator.CreateInstance(proxyType, new object[] {dispatcher, target, mixins}); } else { proxy = Activator.CreateInstance(proxyType, new object[] {dispatcher, target}); } return proxy; }
private object CreateClassProxyInstance(Type proxyType, object[] mixins, IInvocationDispatcher dispatcher, params object[] constructorArgs) { object proxy; if (mixins.Length != 0) { proxy = Activator.CreateInstance(proxyType, Merge(new object[] {dispatcher, mixins}, constructorArgs)); } else { proxy = Activator.CreateInstance(proxyType, Merge(new object[] {dispatcher}, constructorArgs)); } return proxy; }
private object ObtainInterfaceProxyInstance(AspectDefinition aspect, object target, Type inter, object[] mixins, IInvocationDispatcher dispatcher) { Type proxyType = GetProxyTypeFromCache(aspect, target.GetType()); if (proxyType != null) { return CreateInterfaceProxyInstance(proxyType, target, mixins, dispatcher); } object proxy = _generator.CreateProxy(inter, target, mixins, dispatcher); RegisterProxyTypeInCache(aspect, target.GetType(), proxy.GetType()); return proxy; }
private object ObtainClassProxyInstance(AspectDefinition aspect, Type baseClass, object[] mixins, IInvocationDispatcher dispatcher, params object[] constructorArgs) { Type proxyType = GetProxyTypeFromCache(aspect, baseClass); if (proxyType != null) { return CreateClassProxyInstance(proxyType, mixins, dispatcher, constructorArgs); } object proxy = _generator.CreateClassProxy(baseClass, mixins, dispatcher, constructorArgs); RegisterProxyTypeInCache(aspect, baseClass, proxy.GetType()); return proxy; }
public DispatchingCallHandler(IInvocationDispatcher dispatcher) { Contract.Assert(dispatcher != null); _dispatcher = dispatcher; }
private object ObtainInterfaceProxyInstance(AspectDefinition aspect, object target, Type inter, object[] mixins, IInvocationDispatcher dispatcher) { Type proxyType = GetProxyTypeFromCache(aspect, target.GetType()); if (proxyType != null) { return(CreateInterfaceProxyInstance(proxyType, target, mixins, dispatcher)); } object proxy = _generator.CreateProxy(inter, target, mixins, dispatcher); RegisterProxyTypeInCache(aspect, target.GetType(), proxy.GetType()); return(proxy); }
protected virtual object CreateAndInstantiateInterfaceProxy(Type inter, object target, AspectDefinition aspect, IInvocationDispatcher dispatcher, params object[] constructorArgs) { object proxy = null; object[] mixins = InstantiateMixins(aspect.Mixins); proxy = ObtainInterfaceProxyInstance(aspect, target, inter, mixins, dispatcher); InitializeMixins(proxy, mixins); return(proxy); }
protected virtual object CreateAndInstantiateClassProxy(Type baseClass, AspectDefinition aspect, IInvocationDispatcher dispatcher, params object[] constructorArgs) { object proxy = null; object[] mixins = InstantiateMixins(aspect.Mixins); proxy = ObtainClassProxyInstance(aspect, baseClass, mixins, dispatcher, constructorArgs); InitializeMixins(proxy, mixins); return(proxy); }
private object CreateInterfaceProxyInstance(Type proxyType, object target, object[] mixins, IInvocationDispatcher dispatcher) { object proxy; if (mixins.Length != 0) { proxy = Activator.CreateInstance(proxyType, new object[] { dispatcher, target, mixins }); } else { proxy = Activator.CreateInstance(proxyType, new object[] { dispatcher, target }); } return(proxy); }
protected virtual object CreateAndInstantiateClassProxy(Type baseClass, AspectDefinition aspect, IInvocationDispatcher dispatcher, params object[] constructorArgs) { object proxy = null; object[] mixins = InstantiateMixins(aspect.Mixins); proxy = ObtainClassProxyInstance(aspect, baseClass, mixins, dispatcher, constructorArgs); InitializeMixins(proxy, mixins); return proxy; }
protected virtual object CreateAndInstantiateInterfaceProxy(Type inter, object target, AspectDefinition aspect, IInvocationDispatcher dispatcher, params object[] constructorArgs) { object proxy = null; object[] mixins = InstantiateMixins(aspect.Mixins); proxy = ObtainInterfaceProxyInstance(aspect, target, inter, mixins, dispatcher); InitializeMixins(proxy, mixins); return proxy; }
private object ObtainClassProxyInstance(AspectDefinition aspect, Type baseClass, object[] mixins, IInvocationDispatcher dispatcher, params object[] constructorArgs) { Type proxyType = GetProxyTypeFromCache(aspect, baseClass); if (proxyType != null) { return(CreateClassProxyInstance(proxyType, mixins, dispatcher, constructorArgs)); } object proxy = _generator.CreateClassProxy(baseClass, mixins, dispatcher, constructorArgs); RegisterProxyTypeInCache(aspect, baseClass, proxy.GetType()); return(proxy); }