Beispiel #1
0
  public static synchronized void initWithSpring(boolean force, List<String> extraConfigLocations) {

    if (force) {
      _initialized = false;
    }

    if (_initialized) {
      return;
    }

    if (!_neverInitialized) {
      PropsUtil.reload();
    } else {
      _neverInitialized = false;
    }

    init();

    SpringUtil.loadContext(extraConfigLocations);

    _initialized = true;
  }
Beispiel #2
0
  public static synchronized void initWithSpringAndModuleFramework(
      boolean force, List<String> extraConfigLocations) {

    if (force) {
      _initialized = false;
    }

    if (_initialized) {
      return;
    }

    if (!_neverInitialized) {
      PropsUtil.reload();
    } else {
      _neverInitialized = false;
    }

    try {
      PropsValues.LIFERAY_WEB_PORTAL_CONTEXT_TEMPDIR = System.getProperty(SystemProperties.TMP_DIR);

      init();

      ModuleFrameworkUtilAdapter.startFramework();

      SpringUtil.loadContext(extraConfigLocations);

      BeanLocatorImpl beanLocatorImpl = (BeanLocatorImpl) PortalBeanLocatorUtil.getBeanLocator();

      ModuleFrameworkUtilAdapter.registerContext(beanLocatorImpl.getApplicationContext());

      ModuleFrameworkUtilAdapter.startRuntime();
    } catch (Exception e) {
      throw new RuntimeException(e);
    }

    _initialized = true;
  }