/* JFox, the OpenSource J2EE Application Server
 *
 * Distributable under GNU LGPL license by gun.org
 * more details please visit http://www.huihoo.org/jfox
 */
package org.jfox.framework.extra;

import java.lang.reflect.Method;

import org.jfox.framework.Component;

/**
 * @author <a href="mailto:young_yy@hotmail.com">Young Yang</a>
 */

public interface MethodInterceptable extends Component {

    /**
     * do something before invoke a method defined in component interface
     * example: want to log, or repack the params
     *
     * @param method
     * @param params
     */
    void preInvoke(Method method, Object[] params);

    /**
     * do something after invoke a method
     * example: want to repack the result
     *
     * @param method
     * @param result result return by the method
     * @return the last object return, may not be the result parameter
     */
    Object postInvoke(Method method, Object result);
}