use of org.springframework.aop.support.NameMatchMethodPointcutAdvisor in project spring-integration by spring-projects.
the class MessageMetricsAdviceTests method exportAdvisedChannel.
@Test
public void exportAdvisedChannel() throws Exception {
DummyInterceptor interceptor = new DummyInterceptor();
NameMatchMethodPointcutAdvisor advisor = new NameMatchMethodPointcutAdvisor(interceptor);
advisor.addMethodName("send");
ProxyFactory factory = new ProxyFactory(channel);
factory.addAdvisor(advisor);
MessageChannel advised = (MessageChannel) factory.getProxy();
this.beanFactory.registerSingleton("test", advised);
this.beanFactory.initializeBean(advised, "test");
mBeanExporter.afterSingletonsInstantiated();
MessageChannel exported = this.beanFactory.getBean("test", MessageChannel.class);
exported.send(MessageBuilder.withPayload("test").build());
}
Aggregations