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

import javax.naming.Context;

import org.jfox.framework.extra.ActiveComponent;
import org.jfox.jndi.InitialContextHelper;
import org.jfox.system.AbstractService;

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

public class EnterpriseJNDIService extends AbstractService implements ActiveComponent {
    private Context initCtx = null;

    protected void doStart() throws Exception {
        // binding java:comp/env
        initCtx.bind(EnterpriseContextFactory.ENC_JNDI_NAME, new ENCReference());
    }

    protected void doStop() throws Exception {
        initCtx.unbind(EnterpriseContextFactory.ENC_JNDI_NAME);
    }

    protected void doInit() throws Exception {
        initCtx = InitialContextHelper.getInitialContext();
    }

    protected void doDestroy() throws Exception {
        initCtx = null;
    }

    public void run() {
    }

    public static void main(String[] args) {

    }
}
