/*
(non-Javadoc)

@see com.abubusoft.kripton.processor.BaseProcessor#init(javax.annotation.processing.ProcessingEnvironment)
970025
@Override
	public synchronized void init(ProcessingEnvironment processingEnv) {
		super.init(processingEnv);

		KriptonProcessor.trees = Trees.instance(processingEnv);

		KriptonOptions.init(this, processingEnv);

		typeProcessor.init(processingEnv);
		many2ManyProcessor.init(processingEnv);
		sharedPreferencesProcessor.init(processingEnv);
		dataSourceProcessor.init(processingEnv);

		count = 0;
	}
916306
@Override
    public void init() throws InitializationException {
        List<String> options = getOptionsByCommand(getCommand());
        options.contains(ASYNC_OPTION);
        async = true;
    }
735099
@PostConstruct
    public final void init() {
        this.cleanUpTimer = Executors.newScheduledThreadPool(1, timerTask -> {
            final Thread thread = new Thread(timerTask, "Clean up old job records");
            thread.setDaemon(true);
            return thread;
        });
        this.cleanUpTimer.scheduleAtFixedRate(this::cleanup, this.cleanupInterval, this.cleanupInterval,
                                              TimeUnit.SECONDS);
    }
316003
private static void init(){
		String junittest = System.getProperty("JUNITTEST");
		if (junittest!=null && (junittest.equalsIgnoreCase("true")))
			return;
		StartBuiltInProducers.startbuiltin();
		//ensure plugins are loaded.
		PluginRepository.getInstance();
		//ensure accumulators are initialized.
		AccumulatorRepository.getInstance();
		//ensure thresholds are initialized.
		ThresholdRepository.getInstance();
	}
1111886
@Override
    public void setEnvironment(Environment env) {
    	if (env instanceof AbstractEnvironment) {
    		this.env = (AbstractEnvironment)env;
    	} else {
    		throw new RuntimeException("env is not an AbstractEnvironment. " + env.getClass().getCanonicalName());
    	}
    	
    }
223148
public static void init(Context context, String name, int version, int cacheSize) {
		init(context, name, version, cacheSize, LogLevel.NONE);
	}
467198
public static void initialize() {
		if (isInitialized) {
			return;
		}
		isInitialized = true;
		printLogo();
		try {
			logger.info("--- Para.initialize() [{}] ---", Config.ENVIRONMENT);

			for (InitializeListener initListener : INIT_LISTENERS) {
				if (initListener != null) {
					initListener.onInitialize();
					logger.debug("Executed {}.onInitialize().", initListener.getClass().getName());
				}
			}
			logger.info("Instance #{} initialized.", Config.WORKER_ID);
		} catch (Exception e) {
			logger.error("Failed to initialize Para.", e);
		}
	}
93114
static void init() {
        contextMap = null;
        final PropertiesUtil managerProps = PropertiesUtil.getProperties();
        disableAll = managerProps.getBooleanProperty(DISABLE_ALL);
        useStack = !(managerProps.getBooleanProperty(DISABLE_STACK) || disableAll);
        useMap = !(managerProps.getBooleanProperty(DISABLE_MAP) || disableAll);

        contextStack = new Log4jv2ThreadContextStack(useStack);
        contextMap = new Log4jv2ThreadContextMap();
    }
694006
@Override
    public List<ConfigMessage> init(Processor processor) {
        List<ConfigMessage> configMessages = super.init(processor);
        if (((ExpressionBasedAction) getAction()).getExpression() != null) {
            try {
                expression = ExpressionHandlerFactory.getHandler(
                        ((ExpressionBasedAction) getAction()).getExpression());

                expression.init(processor, getAction(), false);

                if (!isUsesHeaders()) {
                    setUsesHeaders(expression.isUsesHeaders());
                }
                if (!isUsesContent()) {
                    setUsesContent(expression.isUsesContent());
                }
            } catch (Throwable t) {
                log.severe(processor.getDescription() + ":" + getAction().getDescription()
                     + ":Failed to compile expression");
                ConfigMessage configMessage = new ConfigMessage();
                configMessage.setSeverity(Severity.Error);
                configMessage.setMessage(t.getMessage());
                configMessage.setField("expression");
                configMessage.setProcessor(processor.getDescription());
                configMessage.setAction(getAction().getDescription());
                configMessages.add(configMessage);
            }
        } else {
            String message = "Expression has not been defined";
            log.severe(processor.getDescription() + ":" + getAction().getDescription() + ":" + message);
            ConfigMessage configMessage = new ConfigMessage();
            configMessage.setSeverity(Severity.Error);
            configMessage.setMessage(message);
            configMessage.setField("expression");
            configMessage.setProcessor(processor.getDescription());
            configMessage.setAction(getAction().getDescription());
            configMessages.add(configMessage);
        }

        return configMessages;
    }
828542
private void init()
    {
        this.container = InfinispanCache.findCacheContainer();
        if (this.container == null) {
            try {
                this.container = new DefaultCacheManager(this.getClass().getResourceAsStream(
                                "/org/efaps/util/cache/infinispan-config.xml"));
                if (this.container instanceof EmbeddedCacheManager) {
                    this.container.addListener(new CacheLogListener(InfinispanCache.LOG));
                }
                InfinispanCache.bindCacheContainer(this.container);
                final Cache<String, Integer> cache = this.container
                                .<String, Integer>getCache(InfinispanCache.COUNTERCACHE);
                cache.put(InfinispanCache.COUNTERCACHE, 1);
            } catch (final FactoryConfigurationError e) {
                InfinispanCache.LOG.error("FactoryConfigurationError", e);
            } catch (final IOException e) {
                InfinispanCache.LOG.error("IOException", e);
            }
        } else {
            final Cache<String, Integer> cache = this.container
                            .<String, Integer>getCache(InfinispanCache.COUNTERCACHE);
            Integer count = cache.get(InfinispanCache.COUNTERCACHE);
            if (count == null) {
                count = 1;
            } else {
                count = count + 1;
            }
            cache.put(InfinispanCache.COUNTERCACHE, count);
        }
    }
610878
@SneakyThrows
    @SuppressWarnings("FutureReturnValueIgnored")
    public void init() {
        if (!validateConfiguration()) {
            return;
        }

        val results = this.fetcher.fetch(getResources());
        ResourceCRLRevocationChecker.this.addCrls(results);

        final Runnable scheduledFetcher = () -> {
            try {
                val fetchedResults = getFetcher().fetch(getResources());
                ResourceCRLRevocationChecker.this.addCrls(fetchedResults);
            } catch (final Exception e) {
                LOGGER.debug(e.getMessage(), e);
            }
        };

        this.scheduler.scheduleAtFixedRate(
            scheduledFetcher,
            this.refreshInterval,
            this.refreshInterval,
            TimeUnit.SECONDS);

    }
353553
void init(TransformerFactoryImpl processor)
  {
    m_stylesheetProcessor = processor;

    // Set the initial content handler.
    m_processors.push(m_schema.getElementProcessor());
    this.pushNewNamespaceSupport();

    // m_includeStack.push(SystemIDResolver.getAbsoluteURI(this.getBaseIdentifier(), null));
    // initXPath(processor, null);
  }
585670
private void initBeforeList() {
        final List<ProcessAdvice> beforeRequestProcessAdvices = new ArrayList<>();

        final Method invokeHolder = getInvokeHolder();
        final Class<?> processorClass = invokeHolder.getDeclaringClass();

        // 1. process class advice
        if (null != processorClass && processorClass.isAnnotationPresent(Before.class)) {
            final Class<? extends ProcessAdvice>[] bcs = processorClass.getAnnotation(Before.class).value();
            for (int i = 0; i < bcs.length; i++) {
                final Class<? extends ProcessAdvice> bc = bcs[i];
                final ProcessAdvice beforeRequestProcessAdvice = BeanManager.getInstance().getReference(bc);
                beforeRequestProcessAdvices.add(beforeRequestProcessAdvice);
            }
        }
        // 2. process method advice
        if (invokeHolder.isAnnotationPresent(Before.class)) {
            final Class<? extends ProcessAdvice>[] bcs = invokeHolder.getAnnotation(Before.class).value();
            for (int i = 0; i < bcs.length; i++) {
                final Class<? extends ProcessAdvice> bc = bcs[i];
                final ProcessAdvice beforeRequestProcessAdvice = BeanManager.getInstance().getReference(bc);
                beforeRequestProcessAdvices.add(beforeRequestProcessAdvice);
            }
        }

        this.beforeRequestProcessAdvices = beforeRequestProcessAdvices;
    }
951002
public void initialize() {
        val pair = buildLoggerContext(environment, resourceLoader);
        pair.ifPresent(it -> {
            this.logConfigurationFile = it.getKey();
            this.loggerContext = it.getValue();
        });
    }
80059
@Override
    public void init(FilterConfig filterConfig) {
        String m = "L init() ";
        try {
            logger.debug(m + ">");
            super.init(filterConfig);
            m = FilterSetup.getFilterNameAbbrev(FILTER_NAME) + " init() ";
            inited = false;
            if (!initErrors) {
                Set<String> temp = new HashSet<String>();
                if (ATTRIBUTES2RETURN == null) {
                    ATTRIBUTES2RETURN = EMPTY_STRING_ARRAY;
                } else {
                    for (String element : ATTRIBUTES2RETURN) {
                        temp.add(element);
                    }
                }
                if (AUTHENTICATE && PASSWORD != null && !PASSWORD.isEmpty()) {
                    temp.add(PASSWORD);
                }
                DIRECTORY_ATTRIBUTES_NEEDED =
                        (String[]) temp.toArray(StringArrayPrototype);

                boolean haveBindMethod = false;
                if (SECURITY_AUTHENTICATION != null
                        && !SECURITY_AUTHENTICATION.isEmpty()) {
                    haveBindMethod = true;
                }

                boolean haveSuperUser = false;
                if (SECURITY_PRINCIPAL != null
                        && !SECURITY_PRINCIPAL.isEmpty()) {
                    haveSuperUser = true;
                }

                boolean haveSuperUserPassword = false;
                if (SECURITY_CREDENTIALS != null
                        && !SECURITY_CREDENTIALS.isEmpty()) {
                    haveSuperUserPassword = true;
                }

                if (haveBindMethod && haveSuperUserPassword) {
                    initErrors = !haveSuperUser;
                }

            }
            if (initErrors) {
                logger.error(m + "not initialized; see previous error");
            }
            inited = true;
        } finally {
            logger.debug("{}<", m);
        }
    }
1098020
public void init() throws ConfigurationException {
		if(index == null) {
			throw new ConfigurationException("No index target");
		}
		if(!index.isUpdatable()) {
			throw new ConfigurationException("ResourceIndex is not updatable");
		}
		if(incoming == null) {
			throw new ConfigurationException("No incoming");			
		}
		if(runInterval > 0) {
			thread = new UpdateThread(this,runInterval);
			thread.start();
		}
	}
438843
@Override
    public void internalInitialize(BeanDeployerEnvironment environment) {
        getDeclaringBean().initialize(environment);
        super.internalInitialize(environment);
        initPassivationCapable();
    }