« Return to Thread: JMS11Support in Mule2.0 not comaptible with that in Mule 1.4.x

Re: JMS11Support in Mule2.0 not comaptible with that in Mule 1.4.x

by rshah :: Rate this Message:

Reply to Author | View in Thread

Thanks a lot. It works.

- Raj

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.

 « Return to Thread: JMS11Support in Mule2.0 not comaptible with that in Mule 1.4.x