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

import org.jfox.ejb.ContainerImpl;

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

public class EJBMetaSupport implements EJBMeta {
    private EJBDescriptor ejbDescriptor = null;

    private static final String ejbJndiPrefix = "ejb";

    public EJBMetaSupport(EJBDescriptor ejbDescriptor) {
        this.ejbDescriptor = ejbDescriptor;
    }

    /**
     * default Remote Protocol
     * decide by Container default Remote Protocol
     *
     * @return
     */
    public Protocol getRemoteProtocol() {
        // empty will use container default protocol
        return ContainerImpl.getInstance().getRemoteProtocol();
    }


    /**
     * default Local Protocol
     * decide by Container default Local Protocol
     *
     * @return
     */
    public Protocol getLocalProtocol() {
        // empty will use container default protocol
        return ContainerImpl.getInstance().getLocalProtocol();
    }

    /**
     * defualt jndi name "ejb/$EJB_NAME$"
     *
     * @return
     */
    public String getJndiName() {
        return ejbJndiPrefix + "/" + ejbDescriptor.getEjbName();
    }

    public static void main(String[] args) {

    }
}

