/// <summary> /// Initialize the proxy. /// </summary> private void InitializeProxy() { if (this.adviceChain.Length == 0) { return; } var factory = new ProxyFactory(); foreach (var advice in this.adviceChain) { factory.AddAdvisor(new DefaultPointcutAdvisor(TruePointcut.True, advice)); } factory.ProxyTargetType = false; factory.AddInterface(typeof(IContainerDelegate)); factory.Target = this.containerDelegate; this.proxy = (IContainerDelegate)factory.GetProxy(); }
/// <summary>Initializes a new instance of the <see cref="SimpleMessageListenerContainer"/> class. Create a listener container from the connection factory (mandatory).</summary> /// <param name="connectionFactory">The connection factory.</param> public SimpleMessageListenerContainer(IConnectionFactory connectionFactory) { this.ConnectionFactory = connectionFactory; this.containerDelegate = new ContainerDelegate(this); this.proxy = this.containerDelegate; }
/// <summary> /// Initializes a new instance of the <see cref="SimpleMessageListenerContainer"/> class. /// Default constructor for convenient dependency injection via setters. /// </summary> public SimpleMessageListenerContainer() { this.containerDelegate = new ContainerDelegate(this); this.proxy = this.containerDelegate; }
/// <summary> /// Initialize the proxy. /// </summary> private void InitializeProxy() { if (this.adviceChain.Length == 0) { return; } var factory = new ProxyFactory(); foreach (var advice in this.adviceChain) { factory.AddAdvisor(new DefaultPointcutAdvisor(TruePointcut.True, advice)); } factory.ProxyTargetType = false; factory.AddInterface(typeof(IContainerDelegate)); // TODO: Is this really the right target??? Doesn't seem right. factory.Target = this; this.proxy = (IContainerDelegate)factory.GetProxy(); }