org.apache.avalon.framework.configuration.Configuration.getAttributeAsLong()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(5.3k)|赞(0)|评价(0)|浏览(224)

本文整理了Java中org.apache.avalon.framework.configuration.Configuration.getAttributeAsLong()方法的一些代码示例,展示了Configuration.getAttributeAsLong()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Configuration.getAttributeAsLong()方法的具体详情如下:
包路径:org.apache.avalon.framework.configuration.Configuration
类名称:Configuration
方法名:getAttributeAsLong

Configuration.getAttributeAsLong介绍

[英]Returns the value of the attribute specified by its name as a long.
[中]返回由其名称指定为long的属性的值。

代码示例

代码示例来源:origin: org.apache.fulcrum/fulcrum-cache

/**
 * Avalon component lifecycle method
 */
public void configure(Configuration conf) throws ConfigurationException
{
  this.cacheCheckFrequency = conf.getAttributeAsLong(
      CACHE_CHECK_FREQUENCY, DEFAULT_CACHE_CHECK_FREQUENCY);
  this.cacheInitialSize = conf.getAttributeAsInteger(INITIAL_CACHE_SIZE,
      DEFAULT_INITIAL_CACHE_SIZE);
}

代码示例来源:origin: org.apache.excalibur.containerkit/excalibur-instrument-mgr-impl

/**
 * Used to load the state, called from AbstractInstrumentSample.loadState();
 * <p>
 * Should only be called when synchronized.
 *
 * @param value Current value loaded from the state.
 * @param state Configuration object to load state from.
 *
 * @throws ConfigurationException If there were any problems loading the
 *                                state.
 */
protected void loadState( int value, Configuration state )
  throws ConfigurationException
{
  super.loadState( value, state );
  
  m_valueTotal = state.getAttributeAsLong( "value-total" );
}

代码示例来源:origin: org.apache.excalibur.component/excalibur-component

/**
 * Create a PoolableComponentHandler which manages a pool of Components
 *  created by the specified factory object.
 *
 * @param factory The factory object which is responsible for creating the components
 *                managed by the ComponentHandler.
 * @param config The configuration to use to configure the pool.
 */
public PoolableComponentHandler( final DefaultComponentFactory factory,
                 final Configuration config )
  throws Exception
{
  m_factory = factory;
  int poolMax = config.getAttributeAsInteger( "pool-max", DEFAULT_MAX_POOL_SIZE );
  boolean poolMaxStrict = config.getAttributeAsBoolean( "pool-max-strict", false );
  boolean poolBlocking = config.getAttributeAsBoolean( "pool-blocking", true );
  long poolTimeout = config.getAttributeAsLong( "pool-timeout", 0 );
  long poolTrimInterval = config.getAttributeAsLong( "pool-trim-interval", 0 );
  m_pool = new InstrumentedResourceLimitingPool( m_factory, poolMax, poolMaxStrict, poolBlocking,
                    poolTimeout, poolTrimInterval );
  // Initialize the Instrumentable elements.
  addChildInstrumentable( m_pool );
}

代码示例来源:origin: org.apache.cocoon/cocoon-core

/**
 * @param conf
 * @throws ConfigurationException
 */
private void setupSingleRefreshJob(final Configuration conf) throws ConfigurationException {
  try {
    String key = NetUtils.decode(conf.getAttribute(ATTR_KEY), "utf-8");
    String uri = NetUtils.decode(conf.getAttribute(ATTR_URI), "utf-8");
    long interval = conf.getAttributeAsLong(ATTR_INTERVAL);
    addRefreshSource(key, uri, 10, interval);
  } catch (UnsupportedEncodingException e) {
    /* Won't happen */
  }
}

代码示例来源:origin: org.apache.excalibur.containerkit/excalibur-instrument-mgr-impl

long savedTime = m_time = state.getAttributeAsLong( "time" );
long leaseExpirationTime = state.getAttributeAsLong( "lease-expiration", 0 );
if ( ( m_leaseExpirationTime != 0 ) && ( leaseExpirationTime > m_leaseExpirationTime ) )

代码示例来源:origin: org.apache.cocoon/cocoon-sitemap-impl

/**
 * Configure the tree processor:
 * &lt;processor file="{Location of the sitemap}"
 *               check-reload="{true|false}"
 *               config="{Location of sitemap tree processor config}&gt;
 *   &lt;reload delay="10"/&gt;
 * &lt;/processor&gt;
 *
 * Only the file attribute is required; everything else is optional.
 *
 * @see org.apache.avalon.framework.configuration.Configurable#configure(org.apache.avalon.framework.configuration.Configuration)
 */
public void configure(Configuration config)
throws ConfigurationException {
  this.checkReload = config.getAttributeAsBoolean("check-reload",
             this.settings.isReloadingEnabled("sitemap"));
  // Reload check delay. Default is 1 second.
  this.lastModifiedDelay = config.getChild("reload").getAttributeAsLong("delay", this.settings.getReloadDelay("sitemap"));
  String fileName = config.getAttribute("file", "sitemap.xmap");
  
  try {
    this.source = new DelayedRefreshSourceWrapper(this.resolver.resolveURI(fileName), lastModifiedDelay);
  } catch (Exception e) {
    throw new ConfigurationException("Cannot resolve " + fileName, e);
  }
}

代码示例来源:origin: org.apache.excalibur.containerkit/excalibur-instrument-mgr-impl

long sampleInterval = instrumentSampleConf.getAttributeAsLong( "interval" );
int sampleSize = instrumentSampleConf.getAttributeAsInteger( "size", 1 );
    instrumentSampleConf.getAttributeAsLong( "lease-expiration", 0 );
  if ( leaseExpirationTime > 0 )

代码示例来源:origin: org.apache.excalibur.containerkit/excalibur-instrument-mgr-impl

m_stateInterval = stateFileConf.getAttributeAsLong( "interval", 60000 );

代码示例来源:origin: org.apache.excalibur.containerkit/excalibur-instrument-mgr-impl

long sampleInterval = sampleConf.getAttributeAsLong( "interval" );
int sampleSize = sampleConf.getAttributeAsInteger( "size", 1 );

代码示例来源:origin: org.apache.excalibur.containerkit/excalibur-instrument-mgr-impl

long sampleInterval = sampleConf.getAttributeAsLong( "interval" );
  int sampleSize = sampleConf.getAttributeAsInteger( "size" );
long leaseExpirationTime = sampleConf.getAttributeAsLong( "lease-expiration", 0 );
if ( leaseExpirationTime == 0 )

相关文章