<p>
Called during creation of the <code>Scheduler</code> in order to give the
<code>SchedulerPlugin</code> a chance to initialize.
</p>

@throws SchedulerConfigException
if there is an error initializing.
767808
public void initialize (final String pname,
                          final IScheduler scheduler,
                          final IClassLoadHelper classLoadHelper) throws SchedulerException
  {
    m_sName = pname;

    scheduler.getListenerManager ().addTriggerListener (this, EverythingMatcher.allTriggers ());
  }
900535
@Override
  public void start() throws SchedulerException {

    if (shuttingDown || closed) {
      throw new SchedulerException(
          "The Scheduler cannot be restarted after shutdown() has been called.");
    }

    if (initialStart == null) {
      initialStart = new Date();
      quartzSchedulerResources.getJobStore().schedulerStarted();
      startPlugins();
    }

    this.quartzSchedulerThread.togglePause(false);

    logger.info("Scheduler started.");

    notifySchedulerListenersStarted();
  }
211843
@Override
    public void configureTasks(ScheduledTaskRegistrar taskRegistrar) {
        BugsnagScheduledTaskExceptionHandler bugsnagErrorHandler =
                new BugsnagScheduledTaskExceptionHandler(bugsnag);

        // Decision process for finding a TaskScheduler, in order of preference:
        //
        // 1. use the scheduler from the task registrar
        // 2. search for a TaskScheduler bean, by type, then by name
        // 3. search for a ScheduledExecutorService bean by type, then by name,
        //    and wrap it in a TaskScheduler
        // 4. create our own TaskScheduler

        TaskScheduler registrarScheduler = taskRegistrar.getScheduler();
        TaskScheduler taskScheduler = registrarScheduler != null
                ? registrarScheduler : beanLocator.resolveTaskScheduler();

        if (taskScheduler != null) {
            configureExistingTaskScheduler(taskScheduler, bugsnagErrorHandler);
        } else {
            ScheduledExecutorService executorService
                    = beanLocator.resolveScheduledExecutorService();
            taskScheduler = createNewTaskScheduler(executorService, bugsnagErrorHandler);
            taskRegistrar.setScheduler(taskScheduler);
        }
    }
1110831
protected void initJobExecutor() {
    if (jobExecutor == null) {
      jobExecutor = new DefaultJobExecutor();
    }

    jobHandlers = new HashMap<String, JobHandler>();
    TimerExecuteNestedActivityJobHandler timerExecuteNestedActivityJobHandler = new TimerExecuteNestedActivityJobHandler();
    jobHandlers.put(timerExecuteNestedActivityJobHandler.getType(), timerExecuteNestedActivityJobHandler);

    TimerCatchIntermediateEventJobHandler timerCatchIntermediateEvent = new TimerCatchIntermediateEventJobHandler();
    jobHandlers.put(timerCatchIntermediateEvent.getType(), timerCatchIntermediateEvent);

    TimerStartEventJobHandler timerStartEvent = new TimerStartEventJobHandler();
    jobHandlers.put(timerStartEvent.getType(), timerStartEvent);

    TimerStartEventSubprocessJobHandler timerStartEventSubprocess = new TimerStartEventSubprocessJobHandler();
    jobHandlers.put(timerStartEventSubprocess.getType(), timerStartEventSubprocess);

    AsyncContinuationJobHandler asyncContinuationJobHandler = new AsyncContinuationJobHandler();
    jobHandlers.put(asyncContinuationJobHandler.getType(), asyncContinuationJobHandler);

    ProcessEventJobHandler processEventJobHandler = new ProcessEventJobHandler();
    jobHandlers.put(processEventJobHandler.getType(), processEventJobHandler);

    TimerSuspendProcessDefinitionHandler suspendProcessDefinitionHandler = new TimerSuspendProcessDefinitionHandler();
    jobHandlers.put(suspendProcessDefinitionHandler.getType(), suspendProcessDefinitionHandler);

    TimerActivateProcessDefinitionHandler activateProcessDefinitionHandler = new TimerActivateProcessDefinitionHandler();
    jobHandlers.put(activateProcessDefinitionHandler.getType(), activateProcessDefinitionHandler);

    TimerSuspendJobDefinitionHandler suspendJobDefinitionHandler = new TimerSuspendJobDefinitionHandler();
    jobHandlers.put(suspendJobDefinitionHandler.getType(), suspendJobDefinitionHandler);

    TimerActivateJobDefinitionHandler activateJobDefinitionHandler = new TimerActivateJobDefinitionHandler();
    jobHandlers.put(activateJobDefinitionHandler.getType(), activateJobDefinitionHandler);

    BatchSeedJobHandler batchSeedJobHandler = new BatchSeedJobHandler();
    jobHandlers.put(batchSeedJobHandler.getType(), batchSeedJobHandler);

    BatchMonitorJobHandler batchMonitorJobHandler = new BatchMonitorJobHandler();
    jobHandlers.put(batchMonitorJobHandler.getType(), batchMonitorJobHandler);

    HistoryCleanupJobHandler historyCleanupJobHandler = new HistoryCleanupJobHandler();
    jobHandlers.put(historyCleanupJobHandler.getType(), historyCleanupJobHandler);

    for (JobHandler batchHandler : batchHandlers.values()) {
      jobHandlers.put(batchHandler.getType(), batchHandler);
    }

    // if we have custom job handlers, register them
    if (getCustomJobHandlers() != null) {
      for (JobHandler customJobHandler : getCustomJobHandlers()) {
        jobHandlers.put(customJobHandler.getType(), customJobHandler);
      }
    }

    jobExecutor.setAutoActivate(jobExecutorActivate);

    if (jobExecutor.getRejectedJobsHandler() == null) {
      if (customRejectedJobsHandler != null) {
        jobExecutor.setRejectedJobsHandler(customRejectedJobsHandler);
      } else {
        jobExecutor.setRejectedJobsHandler(new NotifyAcquisitionRejectedJobsHandler());
      }
    }

  }
1041096
public IScheduler getSchedulerInstance(Config config, Config runtime)
      throws SchedulerException {
    String schedulerClass = Context.schedulerClass(config);
    IScheduler scheduler;
    try {
      // create an instance of scheduler
      scheduler = ReflectionUtils.newInstance(schedulerClass);
    } catch (IllegalAccessException | InstantiationException | ClassNotFoundException e) {
      throw new SchedulerException(String.format("Failed to instantiate scheduler using class '%s'",
          schedulerClass));
    }

    scheduler.initialize(config, runtime);
    return scheduler;
  }
78563
protected void initConfig() {
        CollectorConfiguration config = configurationService.getCollector(null, null, null, null);

        if (config != null) {
            configLastUpdated = System.currentTimeMillis();

            filterManager = new FilterManager(config);
            try {
                processorManager = new ProcessorManager(config);
            } catch (Throwable t) {
                if (t != null) {
                    log.log(Level.SEVERE, "Failed to initialise Process Manager", t);
                }
            }

            initRefreshCycle();
        } else {
            // Wait for a period of time and try doing the initial config again
            Executors.newSingleThreadScheduledExecutor(new ThreadFactory() {
                public Thread newThread(Runnable r) {
                    Thread t = Executors.defaultThreadFactory().newThread(r);
                    t.setDaemon(true);
                    return t;
                }
            }).schedule(new Runnable() {
                @Override
                public void run() {
                    initConfig();
                }
            }, configRetryInterval, TimeUnit.SECONDS);
        }
    }
305311
static void initBuilder() {
		try {
			DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
			docBuilderFactory.setNamespaceAware(true);
			docBuilder = docBuilderFactory.newDocumentBuilder();
		} catch (ParserConfigurationException ex) {
			throw new RuntimeException(ex);
		}
	}
718987
public static synchronized void init(LogProviderConfig config) {
        if (config == null)
            throw new NullPointerException("LogProviderConfig must not be null");

        if (loggingConfig.compareAndSet(null, config)) {
            // Only initialize FFDC once -- all subsequent changes go through update
            // The synchronization of this method is gratuitous (just makes us feel better), 
            // it is called while the system is single threaded at startup. 

            // config.getTrDelegate() must not return null -- it should either
            // return a dummy/disabled delegate, or throw an exception so that startup
            // does not proceed.
            delegate = config.getFfdcDelegate();
            if (delegate == null)
                throw new NullPointerException("LogProviderConfig must provide a FFDCFilterService delegate");

            delegate.init(config);
        }
    }
1146670
public void initImpl()
    throws ConfigException
  {
    if (_handler != null) {
    }
    else if (_pathHandler != null) {
    }
    else {
      setPath(Paths.get("."));
    }

    /*
    if (_formatter instanceof ELFormatter) {
      ((ELFormatter)_formatter).init();
    }
    */

    if (_formatter != null) {
    }
    else if (_handler != null && _handler.getFormatter() != null) {
    }
    else {
      _formatter = new PatternFormatter(PatternFormatter.DEFAULT_PATTERN);
    }
    
    if (_pathHandler != null) {
      _pathHandler.init();

      _handler = _pathHandler;
    }
    
    if (_handler == null) {
      throw new ConfigException(L.l("<log-handler> requires a configured log handler"));
    }
    
    // env/02s9
    if (_level != null) {
      _handler.setLevel(_level);
    }

    /* JDK defaults to Level.ALL
    if (_level != null)
      _handler.setLevel(_level);
    else
      _handler.setLevel(Level.INFO);
    */

    if (_formatter != null) {
      _handler.setFormatter(_formatter);
    }

    if (_filter != null) {
      _handler.setFilter(_filter);
    }
    
    if (_names.size() == 0) {
      _names.add("");
    }

    for (String name : _names) {
      Logger logger = Logger.getLogger(name);

      if (! (logger instanceof EnvironmentLogger)) {
        if (_handler instanceof AutoCloseable) {
          EnvLoader.addCloseListener((AutoCloseable) _handler);
        }
      }

      logger.addHandler(_handler);
    }
  }
1177617
void scheduleInitializationDone() {

        Scheduler.get().scheduleDeferred(new ScheduledCommand() {

            public void execute() {

                m_initialized = true;
                if (m_active) {
                    removeEditorDisabledStyle();
                } else {
                    setEditorDisabledStyle();
                }
            }
        });
    }
564085
public void initialize() {

        if (m_taskFuture != null) {
            // in case initialize has been called before on this object, cancel the existing task
            m_taskFuture.cancel(false);
            m_taskFuture = null;
        }
        m_state = readCompleteConfiguration();
        // In debug mode, use a shorter delay to speed up the test cases
        long delay = DEBUG ? 500 : TASK_DELAY_MILLIS;
        m_taskFuture = OpenCms.getExecutor().scheduleWithFixedDelay(new Runnable() {

            public void run() {

                performUpdate();
            }
        }, delay, delay, TimeUnit.MILLISECONDS);
    }
1349558
void initialize() {
        // Cancel any running tasks
        Timer oldTimer = timer;
        timer = new Timer(true);
        if (Objects.nonNull(oldTimer)) {
            oldTimer.cancel();
        }
        // (re)initialize
        LoaderConfigurator configurator = new LoaderConfigurator(this);
        defaultLoaderServiceFacade = new DefaultLoaderServiceFacade(timer, listener, resources);
        configurator.load();
    }
62992
public void setSchedules(java.util.Collection<Schedule> schedules) {
        if (schedules == null) {
            this.schedules = null;
            return;
        }

        this.schedules = new java.util.ArrayList<Schedule>(schedules);
    }
245019
@SuppressWarnings("UnusedDeclaration")
    public void init() throws Exception {
        initBuilderSpecific();
        resetFields();
        if (!UserPluginInfo.NO_PLUGIN_KEY.equals(getSelectedStagingPluginName())) {
            PluginSettings selectedStagingPluginSettings = getSelectedStagingPlugin();
            try {
                stagingStrategy = getArtifactoryServer().getStagingStrategy(selectedStagingPluginSettings, Util.rawEncode(project.getName()), project);
            } catch (Exception e) {
                log.log(Level.WARNING, "Failed to obtain staging strategy: " + e.getMessage(), e);
                strategyRequestFailed = true;
                strategyRequestErrorMessage = "Failed to obtain staging strategy '" +
                        selectedStagingPluginSettings.getPluginName() + "': " + e.getMessage() +
                        ".\nPlease review the log for further information.";
                stagingStrategy = null;
            }
            strategyPluginExists = (stagingStrategy != null) && !stagingStrategy.isEmpty();
        }

        prepareDefaultVersioning();
        prepareDefaultGlobalModule();
        prepareDefaultModules();
        prepareDefaultVcsSettings();
        prepareDefaultPromotionConfig();
    }
854894
@FFDCIgnore({ ConfigStartException.class })
    private Future<?> start() {
        Future<?> future = null;
        boolean startUpFailure = false;
        try {
            update();
        } catch (ConfigStartException cse) {
            //Swallow the exception, don't FFDC
            //At the moment this exception means that we could not properly query the config source
            //It was introduced as a quick fix for issue #3997 but we might reconsider the design at some point
            startUpFailure = true;
        } catch (Exception e) {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "start: Initial Update failed: {0}. Exception: {1}", this, e);
            }
            future = Futures.immediateFailure(e);
        }

        //if there was an initial startup failure, don't start the polling thread
        if (!startUpFailure && future == null && interval > 0) {
            Refresher refresher = new Refresher(this);
            future = executor.scheduleWithFixedDelay(refresher, interval, interval, units);
            refresher.future = future;
        }
        return future;
    }
1167837
public static void startScheduler(int threadPoolSize, String annotatedJobsPackageName)
      throws SundialSchedulerException {

    try {
      createScheduler(threadPoolSize, annotatedJobsPackageName);
      getScheduler().start();
    } catch (SchedulerException e) {
      throw new SundialSchedulerException("COULD NOT START SUNDIAL SCHEDULER!!!", e);
    }
  }
208710
protected void setScheduler(CFMLEngine engine, Resource scheduleDirectory) throws PageException {
	if (scheduleDirectory == null) {
	    if (this.scheduler == null) this.scheduler = new SchedulerImpl(engine, "<?xml version=\"1.0\"?>\n<schedule></schedule>", this);
	    return;
	}

	if (!isDirectory(scheduleDirectory)) throw new ExpressionException("schedule task directory " + scheduleDirectory + " doesn't exist or is not a directory");
	try {
	    if (this.scheduler == null) this.scheduler = new SchedulerImpl(engine, this, scheduleDirectory, SystemUtil.getCharset().name());
	}
	catch (Exception e) {
	    throw Caster.toPageException(e);
	}
    }