/* 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;

import java.io.Serializable;
import javax.ejb.EJBHome;
import javax.ejb.EJBMetaData;

/**
 * 实现 EJBMetaData 接口，为了实现数据交换最小化，只包括最简单的数据
 *
 * @author <a href="mailto:young_yy@hotmail.com">Young Yang</a>
 */

public class EJBMetaDataImpl implements EJBMetaData, Serializable {
    private EJBHome EJBHome = null;
    private Class HomeInterfaceClass = null;
    private Class RemoteInterfaceClass = null;

    private Class PrimaryKeyClass = null;
    private boolean isSession = true;
    private boolean isStatelessSession = true;

    public EJBMetaDataImpl(Class homeInterfaceClass, Class remoteInterfaceClass, boolean isSession, boolean isStatelessSession) {
        this.HomeInterfaceClass = homeInterfaceClass;
        this.RemoteInterfaceClass = remoteInterfaceClass;
        this.isSession = isSession;
        this.isStatelessSession = isStatelessSession;
    }

    public EJBHome getEJBHome() {
        return EJBHome;
    }

    public void setEJBHome(EJBHome home) {
        this.EJBHome = home;
    }

    public Class getHomeInterfaceClass() {
        return HomeInterfaceClass;
    }

    public Class getRemoteInterfaceClass() {
        return RemoteInterfaceClass;
    }

    public Class getPrimaryKeyClass() {
        return PrimaryKeyClass;
    }

    public boolean isSession() {
        return isSession;
    }

    public boolean isStatelessSession() {
        return isStatelessSession;
    }

    public String toString() {
        StringBuffer sb = new StringBuffer("EJBMetaData");
        sb.append("[");
        sb.append("Home=").append(HomeInterfaceClass.getName()).append(",");
        sb.append("Remote=").append(RemoteInterfaceClass.getName()).append(",");
        sb.append("isSession=").append(isSession);
        sb.append("]");
        return sb.toString();
    }

    public static void main(String[] args) {

    }


}
