void processScanAttrib(InterpretationContext ic, Attributes attributes) { String scanAttrib = ic.subst(attributes.getValue(SCAN_ATTR)); if (!OptionHelper.isEmpty(scanAttrib) && !"false".equalsIgnoreCase(scanAttrib)) { ScheduledExecutorService scheduledExecutorService = context.getScheduledExecutorService(); URL mainURL = ConfigurationWatchListUtil.getMainWatchURL(context); if (mainURL == null) { addWarn("Due to missing top level configuration file, reconfiguration on change (configuration file scanning) cannot be done."); return; } ReconfigureOnChangeTask rocTask = new ReconfigureOnChangeTask(); rocTask.setContext(context); context.putObject(CoreConstants.RECONFIGURE_ON_CHANGE_TASK, rocTask); String scanPeriodAttrib = ic.subst(attributes.getValue(SCAN_PERIOD_ATTR)); Duration duration = getDuration(scanAttrib, scanPeriodAttrib); if (duration == null) { return; } addInfo("Will scan for changes in [" + mainURL + "] "); // Given that included files are encountered at a later phase, the complete list of files // to scan can only be determined when the configuration is loaded in full. // However, scan can be active if mainURL is set. Otherwise, when changes are detected // the top level config file cannot be accessed. addInfo("Setting ReconfigureOnChangeTask scanning period to " + duration); ScheduledFuture<?> scheduledFuture = scheduledExecutorService.scheduleAtFixedRate(rocTask, duration.getMilliseconds(), duration.getMilliseconds(), TimeUnit.MILLISECONDS); context.addScheduledFuture(scheduledFuture); } }
public static void setConfigurationWatchListResetFlag(Context context, boolean val) { context.putObject(CoreConstants.CONFIGURATION_WATCH_LIST_RESET, new Boolean(val)); }
/** * Register the current event list in currently in the interpreter as a safe * configuration point. * * @since 0.9.30 */ public void registerSafeConfiguration() { context.putObject(SAFE_JORAN_CONFIGURATION, interpreter.getEventPlayer().getCopyOfPlayerEventList()); }
if(ruleRegistry == null) { ruleRegistry = new HashMap<String, String>(); context.putObject(CoreConstants.PATTERN_RULE_REGISTRY, ruleRegistry);
public static void setMainWatchURL(Context context, URL url) { ConfigurationWatchList cwl = getConfigurationWatchList(context); if (cwl == null) { cwl = new ConfigurationWatchList(); cwl.setContext(context); context.putObject(CoreConstants.CONFIGURATION_WATCH_LIST, cwl); } else { cwl.clear(); } setConfigurationWatchListResetFlag(context, true); cwl.setMainURL(url); }
/** * Register the current event list in the interpreter as a safe * configuration point. * * @since 0.9.30 */ public void registerSafeConfiguration(List<SaxEvent> eventList) { context.putObject(SAFE_JORAN_CONFIGURATION, eventList); }
/** * Register the current event list in currently in the interpreter as a safe * configuration point. * * @since 0.9.30 */ public void registerSafeConfiguration(List<SaxEvent> eventList) { context.putObject(SAFE_JORAN_CONFIGURATION, eventList); }
/** * Register the current event list in currently in the interpreter as a safe * configuration point. * * @since 0.9.30 */ public void registerSafeConfiguration(List<SaxEvent> eventList) { context.putObject(SAFE_JORAN_CONFIGURATION, eventList); }
/** * Register the current event list in currently in the interpreter as a safe * configuration point. * * @since 0.9.30 */ public void registerSafeConfiguration(List<SaxEvent> eventList) { context.putObject(SAFE_JORAN_CONFIGURATION, eventList); }
/** * Register the current event list in currently in the interpreter as a safe * configuration point. * * @since 0.9.30 */ public void registerSafeConfiguration() { context.putObject(SAFE_JORAN_CONFIGURATION, interpreter.getEventPlayer().getCopyOfPlayerEventList()); }
/** * Register the current event list in currently in the interpreter as a safe * configuration point. * * @since 0.9.30 */ public void registerSafeConfiguration() { context.putObject(SAFE_JORAN_CONFIGURATION, interpreter.getEventPlayer().getCopyOfPlayerEventList()); }
/** * Register the current event list in currently in the interpreter as a safe * configuration point. * * @since 0.9.30 */ public void registerSafeConfiguration() { context.putObject(SAFE_JORAN_CONFIGURATION, interpreter.getEventPlayer().getCopyOfPlayerEventList()); }
/** * Instantiates an layout of the given class and sets its name. * */ public void begin(InterpretationContext ec, String name, Attributes attributes) { Integer i = (Integer) ec.getContext().getObject(KEY); if(i == null) { ec.getContext().putObject(KEY, 1); } else { ec.getContext().putObject(KEY, i+1); } }
public static void setMainWatchURL(Context context, URL url) { ConfigurationWatchList cwl = getConfigurationWatchList(context); if (cwl == null) { cwl = new ConfigurationWatchList(); cwl.setContext(context); context.putObject(CoreConstants.CONFIGURATION_WATCH_LIST, cwl); } else { cwl.clear(); } //setConfigurationWatchListResetFlag(context, true); cwl.setMainURL(url); }
public static void setMainWatchURL(Context context, URL url) { ConfigurationWatchList cwl = getConfigurationWatchList(context); if (cwl == null) { cwl = new ConfigurationWatchList(); cwl.setContext(context); context.putObject(CoreConstants.CONFIGURATION_WATCH_LIST, cwl); } else { cwl.clear(); } //setConfigurationWatchListResetFlag(context, true); cwl.setMainURL(url); }
public static void setMainWatchURL(Context context, URL url) { if (context == null) return; ConfigurationWatchList cwl = getConfigurationWatchList(context); if (cwl == null) { cwl = new ConfigurationWatchList(); cwl.setContext(context); context.putObject(CoreConstants.CONFIGURATION_WATCH_LIST, cwl); } else { cwl.clear(); } //setConfigurationWatchListResetFlag(context, true); cwl.setMainURL(url); }
public static void setMainWatchURL(Context context, URL url) { ConfigurationWatchList cwl = getConfigurationWatchList(context); if (cwl == null) { cwl = new ConfigurationWatchList(); cwl.setContext(context); context.putObject(CoreConstants.CONFIGURATION_WATCH_LIST, cwl); } else { cwl.clear(); } //setConfigurationWatchListResetFlag(context, true); cwl.setMainURL(url); }
public static void setMainWatchURL(Context context, URL url) { ConfigurationWatchList cwl = getConfigurationWatchList(context); if (cwl == null) { cwl = new ConfigurationWatchList(); cwl.setContext(context); context.putObject(CoreConstants.CONFIGURATION_WATCH_LIST, cwl); } else { cwl.clear(); } setConfigurationWatchListResetFlag(context, true); cwl.setMainURL(url); }
public static void setMainWatchURL(Context context, URL url) { ConfigurationWatchList cwl = getConfigurationWatchList(context); if (cwl == null) { cwl = new ConfigurationWatchList(); cwl.setContext(context); context.putObject(CoreConstants.CONFIGURATION_WATCH_LIST, cwl); } else { cwl.clear(); } setConfigurationWatchListResetFlag(context, true); cwl.setMainURL(url); }
public static void setMainWatchURL(Context context, URL url) { ConfigurationWatchList cwl = getConfigurationWatchList(context); if (cwl == null) { cwl = new ConfigurationWatchList(); cwl.setContext(context); context.putObject(CoreConstants.CONFIGURATION_WATCH_LIST, cwl); } else { cwl.clear(); } setConfigurationWatchListResetFlag(context, true); cwl.setMainURL(url); }