Package com.quickwebframework.viewrender.freemarker

Source Code of com.quickwebframework.viewrender.freemarker.Activator

package com.quickwebframework.viewrender.freemarker;

import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;

import com.quickwebframework.viewrender.ViewRenderService;
import com.quickwebframework.viewrender.freemarker.service.impl.ViewRenderServiceImpl;

public class Activator implements BundleActivator {
  public final static String BUNDLE_NAME = "qwf-vr-freemarker";
  private static BundleContext context;
  private static ViewRenderService viewRenderService;

  public static ViewRenderService getViewRenderService() {
    return viewRenderService;
  }

  static BundleContext getContext() {
    return context;
  }

  public void start(BundleContext bundleContext) throws Exception {
    Activator.context = bundleContext;
    // 注册视图渲染服务
    viewRenderService = new ViewRenderServiceImpl();
    viewRenderService.registerService(bundleContext);
  }

  public void stop(BundleContext bundleContext) throws Exception {
    // 取消注册视图渲染服务
    viewRenderService.unregisterService(bundleContext);
    Activator.context = null;
  }
}
TOP

Related Classes of com.quickwebframework.viewrender.freemarker.Activator

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.