/* 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.ejb.handler;

import java.util.Iterator;

import org.jfox.ejb.Bucket;
import org.jfox.ejb.Invocation;

/**
 * 执行器插件用来建立调用链，执行器用来执行具体的方法
 *
 * @author <a href="mailto:young_yy@hotmail.com">Young Yang</a>
 */

public interface Handler {
    /**
     * 执行 invokeHome 方法
     *
     * @param invocation
     * @param iter       Invoker 调用链
     * @return
     * @throws Exception
     */
    Object invokeHome(final Bucket bucket, final Invocation invocation, final Iterator iter) throws Exception;

    /**
     * 执行 invokeBean 方法
     *
     * @param invocation
     * @param iter       Invoker 调用链
     * @return
     * @throws Exception
     */
    Object invokeBean(final Bucket bucket, final Invocation invocation, final Iterator iter) throws Exception;

}