ddossot wrote:
Sure thing:
<spring:bean name="jndiDestinationAdvice"
class="mule.custom.JndiDestinationInterceptor" />
<spring:bean id="createDestinationAdvisor"
class="org.springframework.aop.support.RegexpMethodPointcutAdvisor">
<spring:property name="advice" ref="jndiDestinationAdvice" />
<spring:property name="patterns">
<spring:list>
<spring:value>.*createDestination.*</spring:value>
</spring:list>
</spring:property>
</spring:bean>
<spring:bean name="proxyCreator"
class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator">
<spring:property name="beanNames" value="jndiJmsSupport" />
<spring:property name="interceptorNames">
<spring:list>
<spring:value>createDestinationAdvisor</spring:value>
</spring:list>
</spring:property>
</spring:bean>
----
package mule.custom;
import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;
public class JndiDestinationInterceptor implements MethodInterceptor {
public Object invoke(final MethodInvocation invocation) throws Throwable {
// destination name is in: invocation.getArguments()[1]
// do JNDI lookup here or invocation.proceed()
return yourDestination;
}
}
---
HTH
D.