本文整理了Java中org.apache.avalon.framework.configuration.Configuration.getValueAsLong()
方法的一些代码示例,展示了Configuration.getValueAsLong()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Configuration.getValueAsLong()
方法的具体详情如下:
包路径:org.apache.avalon.framework.configuration.Configuration
类名称:Configuration
方法名:getValueAsLong
[英]Return the long
value of the node.
[中]返回节点的long
值。
代码示例来源:origin: org.apache.fulcrum/fulcrum-cache
/**
* @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);
}
代码示例来源:origin: org.apache.cocoon/cocoon-sitemap-impl
/**
* @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"));
}
代码示例来源:origin: org.apache.fulcrum/fulcrum-cache
/**
* @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");
}
代码示例来源:origin: org.apache.cocoon/cocoon-sitemap-impl
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);
}
}
代码示例来源:origin: org.apache.cocoon/cocoon-core
/**
* 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 + "'");
}
}
代码示例来源:origin: org.apache.fulcrum/fulcrum-yaafi
/**
* @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);
}
代码示例来源:origin: org.apache.turbine/fulcrum-yaafi
/**
* @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);
}
代码示例来源:origin: org.apache.fulcrum/fulcrum-yaafi
/**
* @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);
}
代码示例来源:origin: org.apache.turbine/fulcrum-yaafi
/**
* @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);
}
代码示例来源:origin: org.apache.cocoon/cocoon-pipeline-components
/**
* 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));
}
内容来源于网络,如有侵权,请联系作者删除!