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

import javax.ejb.CreateException;
import javax.ejb.EJBException;
import javax.ejb.SessionBean;
import javax.ejb.SessionContext;

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

public class TestStatelessBean implements SessionBean {
    private int count = 0;

    public TestStatelessBean() {
    }

    public void ejbCreate() throws CreateException, EJBException {

    }

    public void setSessionContext(SessionContext sessionContext) throws EJBException {
    }

    public void ejbRemove() throws EJBException {
    }

    public void ejbActivate() throws EJBException {
    }

    public void ejbPassivate() throws EJBException {
    }

    public String getVoice() {
        count++;
        return "Hello,Stateless SessionBean!";
    }

    /**
     * 访问另外一个 Bean,将默认使用 LOCAL 协议进行本地调用
     */
    public int getCount() {
        return count;
    }
}
