Example usage for org.springframework.aop.framework ProxyFactory addAdvisor

List of usage examples for org.springframework.aop.framework ProxyFactory addAdvisor

Introduction

In this page you can find the example usage for org.springframework.aop.framework ProxyFactory addAdvisor.

Prototype

@Override
    public void addAdvisor(int pos, Advisor advisor) throws AopConfigException 

Source Link

Usage

From source file:org.mule.providers.soap.axis.wsdl.wsrf.util.AdviceAdderHelper.java

/**
 * addAdvisors to ProxyfactoryBean given using reflection to find Advices class
 * end with "Advice" suffix. All advisors are mapped on "extend*" pattern string
 * method refer to Target bean.//from w  w  w. j  ava  2s .c  o m
 * 
 * @param targetImpl Target Object
 * @return new Proxy
 */
public static IExtendCall addAdvisorsTo(IExtendCall targetImpl) {
    ProxyFactory factory = new ProxyFactory(targetImpl);

    List l = getListAdvisorClass();
    ListIterator li = l.listIterator();
    Advisor advisor = null;

    if (order.size() == 0) {

        while (li.hasNext()) {
            advisor = (Advisor) li.next();
            order.add(advisor);
        }
    }
    Iterator it = order.iterator();

    while (it.hasNext()) {
        advisor = (Advisor) it.next();
        factory.addAdvisor(countAdvice, advisor);
        Logger.getLogger(factory.getClass()).log(Level.DEBUG, factory.getClass().getName() + " : added "
                + advisor.getAdvice().getClass().getName() + " at index position " + countAdvice);
        countAdvice++;
    }

    countAdvice = 0;
    return (IExtendCall) factory.getProxy();
}