Initializes presets and cache it into preset map. As presets do not change while server is up,
this initialization happens only once per JVM.
189828
private void initializePresets() {
    if (gobblinPresets == null) {
      synchronized (GobblinHadoopJob.class) {
        if (gobblinPresets == null) {
          gobblinPresets = Maps.newHashMap();
          String gobblinPresetDirName = getSysProps()
              .getString(GobblinConstants.GOBBLIN_PRESET_DIR_KEY);
          File gobblinPresetDir = new File(gobblinPresetDirName);
          File[] presetFiles = gobblinPresetDir.listFiles();
          if (presetFiles == null) {
            return;
          }

          File commonPropertiesFile = new File(gobblinPresetDir,
              GOBBLIN_PRESET_COMMON_PROPERTIES_FILE_NAME);
          if (!commonPropertiesFile.exists()) {
            throw new IllegalStateException("Gobbline preset common properties file is missing "
                + commonPropertiesFile.getAbsolutePath());
          }

          for (File f : presetFiles) {
            if (GOBBLIN_PRESET_COMMON_PROPERTIES_FILE_NAME
                .equals(f.getName())) { //Don't load common one itself.
              continue;
            }

            if (f.isFile()) {
              Properties prop = new Properties();
              try (InputStream commonIs = new BufferedInputStream(
                  new FileInputStream(commonPropertiesFile));
                  InputStream presetIs = new BufferedInputStream(new FileInputStream(f))) {
                prop.load(commonIs);
                prop.load(presetIs);

                String presetName = f.getName().substring(0,
                    f.getName().lastIndexOf('.')); //remove extension from the file name
                gobblinPresets.put(GobblinPresets.fromName(presetName), prop);
              } catch (IOException e) {
                throw new RuntimeException(e);
              }
            }
          }
        }
      }
    }
  }
626513
private void initialize(Map context) {
    // Guard against recursion.
    context.put(jsTypeTree, this);

    // Create temporary accumulators for the contents of the fields and variants instance
    // variables.
    List tmpFields = new ArrayList();
    List tmpVariants = new ArrayList();

    // Perform tasks assigned to the recursive 'number' subroutine (see comment there)
    number(jsTypeTree, context, false, 0, tmpFields, tmpVariants);

    // Move information from temporaries into permanent instance variables
    fields = (JSField[])tmpFields.toArray(new JSField[0]);
    variants = (JSVariant[])tmpVariants.toArray(new JSVariant[0]);

    // Compute the contents of the 'boxed' instance variable, which is deriveable from the
    // contents of those JSVariants which have found their way into 'fields.'  These are
    // all intended to be boxed variants because they were detected to be underneath
    // JSRepeated nodes during the 'number' process.
    int boxLen = 0; // accumulate total length of boxed array
    for (int i = 0; i < fields.length; i++)
      if (fields[i] instanceof JSVariant)
        // On the first pass, we box the variant and accumulate its accessor count
        boxLen += ((JSVariant)fields[i]).box(context).getAccessorCount();
    boxed = new int[boxLen][];
    int boxIndex = 0;

    // On the second pass through the boxed variants, we get their accessor count a second
    // time and use it this time to fill in the contents of the 'boxed' instance variable
    // proper.
    for (int i = 0; i < fields.length; i++)
      if (fields[i] instanceof JSVariant)
        for (int j = 0; j < ((JSVariant)fields[i]).getBoxed().getAccessorCount(); j++)
          boxed[boxIndex++] = new int[] { i, j };

    // Set the 'accessor' property of every JSField in the tree (see comment on
    // setAccessors).
    setAccessors(0, this);

    // Set the multiChoiceCount for each node in the tree.  Note this must be done
    // after boxing any variants found underneath JSRepeated nodes, since boxing changes
    // the multiChoiceCount.  setMultiChoiceCount is a recursive method that will set
    // counts starting from the leaves working back to the root.
    jsTypeTree.setMultiChoiceCount();

    // Compute the serialForm if it isn't already there due to the deserializing
    // constructor
    if (serialForm == null) {
      // Store the name in a convenient non-null form
      name = jsTypeTree.getFeatureName();
      if (name == null)
        name = "";
      try {
        byte[] utfname = name.getBytes("UTF8");
        serialForm = new byte[2 + utfname.length + 2 + jsTypeTree.encodedTypeLength()];
        ArrayUtil.writeShort(serialForm, 0, (short)utfname.length);
        System.arraycopy(utfname, 0, serialForm, 2, utfname.length);
        int limits[] = new int[] { 2 + utfname.length, serialForm.length };
        JSType.setCount(serialForm, limits, version);
        jsTypeTree.encodeType(serialForm, limits);
      } catch (UnsupportedEncodingException e) {
        FFDCFilter.processException(e, "initialize", "604");
        IllegalArgumentException ex = new IllegalArgumentException();
        ex.initCause(e);
        throw ex;
      }
    }

    // Compute the schemaID, which is a 64-bit truncated SHA-1 hash over the serialForm.
    schemaID = CryptoHash.hash(serialForm);
    schemaLongID = Long.valueOf(schemaID);
  }
1301806
protected function init()
    {

        $this->prependOptions([
            'path' => './cache',
            'formatAliases' => [],
            'format' => 'json'
        ]);

        $this->_path = $this->getOption('path');
        $this->_formatFactory = new Factory(__NAMESPACE__.'\\File\\FormatBase', [
            'json'      => __NAMESPACE__.'\\File\\Format\\Json',
            'serialize' => __NAMESPACE__.'\\File\\Format\\Serialize',
            'export'    => __NAMESPACE__.'\\File\\Format\\Export'
        ]);

        $this->_formatFactory->registerAliases($this->getOption('formatAliases'));

        $this->_format = $this->_formatFactory->createInstance($this->getOption('format'));
        $this->_lifeTimePath = implode('', [$this->_path, '/.life-times', $this->_format->getExtension()]);
        $this->_lifeTimes = [];

        if (file_exists($this->_lifeTimePath))
            $this->_lifeTimes = $this->_format->load($this->_lifeTimePath);
    }
952478
protected final void initialize() {
        // Enabling development mode forces these settings. This is somewhat inelegant, because to configure one of
        // these values differently will require disabling development mode and manually configure the remaining values.
        if (development) {
            loggingSettings.getLoggers().put("org.hibernate.SQL", Level.DEBUG);
            loggingSettings.getLoggers().put("com.metrink.croquet", Level.DEBUG);
        }

        // call the class's init method
        init();
    }
952109
@SuppressWarnings("unchecked")
    public void setSettings(Object presets) {

        if (presets == null) {
            m_settingPresets = null;
        } else if (!(presets instanceof Map)) {
            throw new IllegalArgumentException(
                "cms:container -- value of 'settings' attribute  should be a map, but is "
                    + ClassUtils.getCanonicalName(presets));
        } else {
            m_settingPresets = new HashMap<>((Map<String, String>)presets);
        }
    }
255391
public static void initialize()
    {
        if (InfinispanCache.get().exists(Field.IDCACHE)) {
            InfinispanCache.get().<Long, Field>getCache(Field.IDCACHE).clear();
        } else {
            InfinispanCache.get().<Long, Field>getCache(Field.IDCACHE);
            InfinispanCache.get().<Long, Field>getCache(Field.IDCACHE).addListener(new CacheLogListener(Field.LOG));
        }
    }
1231743
public void init() {
        int numProcessors = Runtime.getRuntime().availableProcessors();
        cacheRedisClientPools = CacheBuilder.newBuilder().concurrencyLevel(numProcessors)
                .expireAfterAccess(3600, TimeUnit.SECONDS)
                .removalListener(new RemovalListener<String, JedisClientPool>() {
                    @Override
                    public void onRemoval(RemovalNotification<String, JedisClientPool> notification) {
                        JedisClientPool pool = notification.getValue();
                        pool.destroy();
                    }
                }).build();
    }
149417
public static function init()
    {
        if(static::$isInited)
        {
            throw new \RuntimeException('AtomicManager can not repeated init');
        }
        foreach(static::$atomics as $name => $value)
        {
            static::$atomics[$name] = new \Swoole\Atomic((int)$value);
        }
        static::$isInited = true;
    }
584103
private void preloadCaches() throws IOException, XmlException {
        Map<String,Properties> caches = getPreloadCacheSpecs();
        for (String cacheName : caches.keySet()) {
            Properties cacheProps = caches.get(cacheName);
            String cacheClassName = cacheProps.getProperty("ClassName");
            logger.info(" - loading cache " + cacheName);
            CacheService cachingObj = getCacheInstance(cacheClassName, cacheProps);
            if (cachingObj != null) {
                long before = System.currentTimeMillis();
                if (cachingObj instanceof PreloadableCache) {
                    ((PreloadableCache)cachingObj).loadCache();
                }
                synchronized(allCaches) {
                    allCaches.put(cacheName, cachingObj);
                }
                logger.debug("    - " + cacheName + " loaded in " + (System.currentTimeMillis() - before) + " ms");
            }
            else {
                logger.warn("Caching Class is  invalid. Name-->"+cacheClassName);
            }
        }
    }
1110442
private synchronized static void initialize() {
    if(MASTER_CACHE != null) {
      return;
    }
    try {
      Enumeration<URL> cps = CLASSLOADER.getResources("");
      List<Class<?>> res = new ArrayList<>();
      while(cps.hasMoreElements()) {
        URL u = cps.nextElement();
        // Scan file sources only.
        if(!"file".equals(u.getProtocol())) {
          continue;
        }
        try {
          Iterator<String> it = new DirClassIterator(new File(u.toURI()));
          while(it.hasNext()) {
            try {
              Class<?> cls = CLASSLOADER.loadClass(it.next());
              // skip classes where we can't get a full name.
              if(cls.getCanonicalName() == null) {
                continue;
              }
              res.add(cls);
            }
            catch(Exception | Error e) {
              continue;
            }
          }
        }
        catch(URISyntaxException e) {
          LOG.warning("Incorrect classpath entry: " + u);
          continue;
        }
      }
      MASTER_CACHE = Collections.unmodifiableList(res);
      if(LOG.isDebuggingFinest()) {
        LOG.debugFinest("Classes found by scanning the development classpath: " + MASTER_CACHE.size());
      }
    }
    catch(IOException e) {
      LOG.exception(e);
      return;
    }
  }
1239486
public static void initialize()
    {
        if (InfinispanCache.get().exists(Company.UUIDCACHE)) {
            InfinispanCache.get().<UUID, Company>getCache(Company.UUIDCACHE).clear();
        } else {
            InfinispanCache.get().<UUID, Company>getCache(Company.UUIDCACHE)
                            .addListener(new CacheLogListener(Company.LOG));
        }
        if (InfinispanCache.get().exists(Company.IDCACHE)) {
            InfinispanCache.get().<Long, Company>getCache(Company.IDCACHE).clear();
        } else {
            InfinispanCache.get().<Long, Company>getCache(Company.IDCACHE)
                            .addListener(new CacheLogListener(Company.LOG));
        }
        if (InfinispanCache.get().exists(Company.NAMECACHE)) {
            InfinispanCache.get().<String, Company>getCache(Company.NAMECACHE).clear();
        } else {
            InfinispanCache.get().<String, Company>getCache(Company.NAMECACHE)
                            .addListener(new CacheLogListener(Company.LOG));
        }
    }
908644
public void initConfiguration(Map<?, ?> configurationMap) {
		ConfigurationPropertyReader propertyReader = new ConfigurationPropertyReader( configurationMap );

		this.configUrl = propertyReader
				.property( InfinispanProperties.CONFIGURATION_RESOURCE_NAME, URL.class )
				.withDefault( InfinispanConfiguration.class.getClassLoader().getResource( INFINISPAN_DEFAULT_CONFIG ) )
				.getValue();

		this.jndi = propertyReader
				.property( InfinispanProperties.CACHE_MANAGER_JNDI_NAME, String.class )
				.getValue();

		log.tracef( "Initializing Infinispan from configuration file at %1$s", configUrl );
	}
980758
public void initialise() {
        if (log.isDebugEnabled()) {
            log.debug("now initialising conf");
        }

        initDecodeUsing(decodeUsing);

        boolean rulesOk = true;
        for (int i = 0; i < rules.size(); i++) {
            final Rule rule = (Rule) rules.get(i);
            if (!rule.initialise(context)) {
                // if we failed to initialise anything set the status to bad
                rulesOk = false;
            }
        }
        for (int i = 0; i < outboundRules.size(); i++) {
            final OutboundRule outboundRule = (OutboundRule) outboundRules.get(i);
            if (!outboundRule.initialise(context)) {
                // if we failed to initialise anything set the status to bad
                rulesOk = false;
            }
        }
        for (int i = 0; i < catchElems.size(); i++) {
            final CatchElem catchElem = (CatchElem) catchElems.get(i);
            if (!catchElem.initialise(context)) {
                // if we failed to initialise anything set the status to bad
                rulesOk = false;
            }
        }
        if (rulesOk) {
            ok = true;
        }
        if (log.isDebugEnabled()) {
            log.debug("conf status " + ok);
        }
    }
1134235
public synchronized static void init() {
    if (!isInitialized()) {
      if (processEngines == null) {
        // Create new map to store process-engines if current map is
        // null
        processEngines = new HashMap<String, ProcessEngine>();
      }
      ClassLoader classLoader = ReflectUtil.getClassLoader();
      Enumeration<URL> resources = null;
      try {
        resources = classLoader.getResources("activiti.cfg.xml");
      } catch (IOException e) {
        throw new ActivitiIllegalArgumentException("problem retrieving activiti.cfg.xml resources on the classpath: " + System.getProperty("java.class.path"), e);
      }

      // Remove duplicated configuration URL's using set. Some
      // classloaders may return identical URL's twice, causing duplicate
      // startups
      Set<URL> configUrls = new HashSet<URL>();
      while (resources.hasMoreElements()) {
        configUrls.add(resources.nextElement());
      }
      for (Iterator<URL> iterator = configUrls.iterator(); iterator.hasNext();) {
        URL resource = iterator.next();
        log.info("Initializing process engine using configuration '{}'", resource.toString());
        initProcessEngineFromResource(resource);
      }

      try {
        resources = classLoader.getResources("activiti-context.xml");
      } catch (IOException e) {
        throw new ActivitiIllegalArgumentException("problem retrieving activiti-context.xml resources on the classpath: " + System.getProperty("java.class.path"), e);
      }
      while (resources.hasMoreElements()) {
        URL resource = resources.nextElement();
        log.info("Initializing process engine using Spring configuration '{}'", resource.toString());
        initProcessEngineFromSpringResource(resource);
      }

      setInitialized(true);
    } else {
      log.info("Process engines already initialized");
    }
  }
866204
public static void initialize()
    {
        if (InfinispanCache.get().exists(SystemConfiguration.UUIDCACHE)) {
            InfinispanCache.get().<UUID, SystemConfiguration>getCache(SystemConfiguration.UUIDCACHE).clear();
        } else {
            InfinispanCache.get().<UUID, SystemConfiguration>getCache(SystemConfiguration.UUIDCACHE)
                            .addListener(new CacheLogListener(SystemConfiguration.LOG));
        }
        if (InfinispanCache.get().exists(SystemConfiguration.IDCACHE)) {
            InfinispanCache.get().<Long, SystemConfiguration>getCache(SystemConfiguration.IDCACHE).clear();
        } else {
            InfinispanCache.get().<Long, SystemConfiguration>getCache(SystemConfiguration.IDCACHE)
                            .addListener(new CacheLogListener(SystemConfiguration.LOG));
        }
        if (InfinispanCache.get().exists(SystemConfiguration.NAMECACHE)) {
            InfinispanCache.get().<String, SystemConfiguration>getCache(SystemConfiguration.NAMECACHE).clear();
        } else {
            InfinispanCache.get().<String, SystemConfiguration>getCache(SystemConfiguration.NAMECACHE)
                            .addListener(new CacheLogListener(SystemConfiguration.LOG));
        }

        SystemConfiguration.ENCRYPTOR = new StandardPBEStringEncryptor();
        SystemConfiguration.ENCRYPTOR.setConfig(SystemConfiguration.getPBEConfig());
    }
765615
@Before
    public void setUp() {
        defineApplicationLocales();

        clearKeys();

        List<Key> keys = new ArrayList<>();
        keys.add(createKey(KEY_DEFAULT, false, false, false));

        Key outdatedKey = createKey(KEY_OUTDATED, false, false, false);
        outdatedKey.setOutdated();
        keys.add(outdatedKey);

        keys.add(createKey(KEY_TLN_APPROX, true, false, false));
        keys.add(createKey(KEY_TLN_OUTDATED, false, true, false));
        keys.add(createKey(KEY_TLN_MISSING, false, false, true));

        Key key = keyFactory.createKey(KEY_WITH_MISSING_TRANSLATION);
        key.addTranslation(FR, TRANSLATION_FR);
        keys.add(key);

        for (Key keyToPersist : keys) {
            keyRepository.add(keyToPersist);
        }
    }
575668
void initialized() {
    LOG.info("initialized with " + size() + " entries " + lookups + " lookups");
    this.initialized = true;
    transientMap.clear();
    transientMap = null;
  }