/** * @see org.apache.avalon.framework.configuration.Configurable#configure(org.apache.avalon.framework.configuration.Configuration) */ public void configure(Configuration config) throws ConfigurationException { this.cacheCheckFrequency = config.getChild("cacheCheckFrequency") .getValueAsLong(DEFAULT_CACHE_CHECK_FREQUENCY); this.cacheName = config.getChild("cacheName").getValue(DEFAULT_CACHE_NAME); this.configFile = config.getChild("configurationFile").getValue(null); }
/** * @see org.apache.avalon.framework.configuration.Configurable#configure(org.apache.avalon.framework.configuration.Configuration) */ public void configure(Configuration config) throws ConfigurationException { this.reloadScripts = config.getChild("reload-scripts").getValueAsBoolean(this.settings.isReloadingEnabled("flow")); this.checkTime = config.getChild("check-time").getValueAsLong(this.settings.getReloadDelay("flow")); }
/** * @see org.apache.avalon.framework.configuration.Configurable#configure(org.apache.avalon.framework.configuration.Configuration) */ public void configure(Configuration config) throws ConfigurationException { this.cacheCheckFrequency = config.getChild("cacheCheckFrequency") .getValueAsLong(DEFAULT_CACHE_CHECK_FREQUENCY); this.region = config.getChild("region").getValue("fulcrum"); this.configFile = config.getChild("configurationFile").getValue( "/cache.ccf"); }
public void configure(Configuration config) { this.defaultTimeToLive = config.getAttributeAsInteger("time-to-live", (3600 * 1000)); this.bindContinuationsToSession = config.getAttributeAsBoolean( "session-bound-continuations", false ); // create a global ContinuationsHolder if this the "session-bound-continuations" parameter is set to false if (!this.bindContinuationsToSession) { this.continuationsHolder = new WebContinuationsHolder(); } final Configuration expireConf = config.getChild("expirations-check"); final long initialDelay = expireConf.getChild("offset", true).getValueAsLong(180000); this.expirationCheckInterval = expireConf.getChild("period", true).getValueAsLong(180000); try { final RunnableManager runnableManager = (RunnableManager)serviceManager.lookup(RunnableManager.ROLE); runnableManager.execute( new Runnable() { public void run() { expireContinuations(); } }, initialDelay, expirationCheckInterval); serviceManager.release(runnableManager); } catch (Exception e) { getLogger().warn("Could not enqueue continuations expiration task. " + "Continuations will not automatically expire.", e); } }
/** * Configure the component. * * @param configuration the configuration */ public void configure(Configuration configuration) throws ConfigurationException { this.directory = configuration.getChild(ConfigurationKeys.ROOT_DIRECTORY).getValue(""); String cacheRole = configuration.getChild(ConfigurationKeys.STORE_ROLE).getValue(Store.TRANSIENT_STORE); try { this.cache = (Store) this.manager.lookup(cacheRole); } catch (ServiceException e) { throw new ConfigurationException("Unable to lookup store '" + cacheRole + "'"); } this.interval = configuration.getChild(ConfigurationKeys.RELOAD_INTERVAL).getValueAsLong(60000L); if (getLogger().isDebugEnabled()) { getLogger().debug("Bundle directory '" + this.directory + "'"); getLogger().debug("Store role '" + cacheRole + "'"); } }
/** * @see org.apache.avalon.framework.configuration.Configurable#configure(Configuration) */ public void configure(Configuration configuration) throws ConfigurationException { super.configure(configuration); this.reportTimeout = configuration.getChild("reportTimeout").getValueAsLong(0); // parse the performance monitor class name this.performanceMonitorClassName = configuration.getChild("performanceMonitorClassName") .getValue(DEFAULT_PERFORMANCEMONITOR_CLASSNAME); // parse the report file name String reportFileName = configuration.getChild("reportFile").getValue("./javasimon.html"); this.reportFile = this.makeAbsoluteFile(reportFileName); // determine when to create the next report this.nextReportTimestamp = System.currentTimeMillis() + this.reportTimeout; // do we create a report on disposal this.reportOnExit = configuration.getChild("reportOnExit").getValueAsBoolean(false); }
/** * @see org.apache.avalon.framework.configuration.Configurable#configure(org.apache.avalon.framework.configuration.Configuration) */ public void configure(Configuration configuration) throws ConfigurationException { super.configure(configuration); this.reportTimeout = configuration.getChild("reportTimeout").getValueAsLong(0); // parse the performance monitor class name this.performanceMonitorClassName = configuration.getChild("performanceMonitorClassName").getValue(DEFAULT_PERFORMANCEMONITOR_CLASSNAME); // parse the report file name String reportFileName = configuration.getChild("reportFile").getValue("./jamon.html"); this.reportFile = this.makeAbsoluteFile( reportFileName ); // determine when to create the next report this.nextReportTimestamp = System.currentTimeMillis() + this.reportTimeout; // do we create a report on disposal this.reportOnExit = configuration.getChild("reportOnExit").getValueAsBoolean(false); }
/** * @see org.apache.avalon.framework.configuration.Configurable#configure(org.apache.avalon.framework.configuration.Configuration) */ public void configure(Configuration configuration) throws ConfigurationException { super.configure(configuration); this.reportTimeout = configuration.getChild("reportTimeout").getValueAsLong(0); // parse the performance monitor class name this.performanceMonitorClassName = configuration.getChild("performanceMonitorClassName") .getValue(DEFAULT_PERFORMANCEMONITOR_CLASSNAME); // parse the report file name String reportFileName = configuration.getChild("reportFile").getValue("./jamon.html"); this.reportFile = this.makeAbsoluteFile(reportFileName); // determine when to create the next report this.nextReportTimestamp = System.currentTimeMillis() + this.reportTimeout; // do we create a report on disposal this.reportOnExit = configuration.getChild("reportOnExit").getValueAsBoolean(false); }
/** * @see org.apache.avalon.framework.configuration.Configurable#configure(Configuration) */ public void configure(Configuration configuration) throws ConfigurationException { super.configure(configuration); this.reportTimeout = configuration.getChild("reportTimeout").getValueAsLong(0); // parse the performance monitor class name this.performanceMonitorClassName = configuration.getChild("performanceMonitorClassName").getValue(DEFAULT_PERFORMANCEMONITOR_CLASSNAME); // parse the report file name String reportFileName = configuration.getChild("reportFile").getValue("./javasimon.html"); this.reportFile = this.makeAbsoluteFile( reportFileName ); // determine when to create the next report this.nextReportTimestamp = System.currentTimeMillis() + this.reportTimeout; // do we create a report on disposal this.reportOnExit = configuration.getChild("reportOnExit").getValueAsBoolean(false); }
/** * Read reader configuration * * @deprecated use property injection instead */ public void configure(Configuration configuration) throws ConfigurationException { // VG Parameters are deprecated as of 2.2.0-Dev/2.1.6-Dev final Parameters parameters = Parameters.fromConfiguration(configuration); this.setExpires(parameters.getParameterAsLong("expires", CONFIGURED_EXPIRES_DEFAULT)); this.setQuickTest(parameters.getParameterAsBoolean("quick-modified-test", CONFIGURED_QUICK_TEST_DEFAULT)); this.setBufferSize(parameters.getParameterAsInteger("buffer-size", CONFIGURED_BUFFER_SIZE_DEFAULT)); this.setByteRanges(parameters.getParameterAsBoolean("byte-ranges", CONFIGURED_BYTE_RANGES_DEFAULT)); // Configuration has precedence over parameters. setExpires(configuration.getChild("expires").getValueAsLong(configuredExpires)); setQuickTest(configuration.getChild("quick-modified-test").getValueAsBoolean(configuredQuickTest)); setBufferSize(configuration.getChild("buffer-size").getValueAsInteger(configuredBufferSize)); setByteRanges(configuration.getChild("byte-ranges").getValueAsBoolean(configuredByteRanges)); }