本文整理了Java中org.apache.avalon.framework.configuration.Configuration.getAttributeAsBoolean()
方法的一些代码示例,展示了Configuration.getAttributeAsBoolean()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Configuration.getAttributeAsBoolean()
方法的具体详情如下:
包路径:org.apache.avalon.framework.configuration.Configuration
类名称:Configuration
方法名:getAttributeAsBoolean
[英]Return the boolean
value of the specified parameter contained in this node.
[中]返回此节点中包含的指定参数的boolean
值。
代码示例来源:origin: org.apache.cocoon/cocoon-sitemap-impl
/**
* Should the default includes be read for this sitemap?
*/
protected static boolean isUsingDefaultIncludes(Configuration config) {
return config.getChild("components").getAttributeAsBoolean("use-default-includes", true);
}
代码示例来源:origin: org.apache.fulcrum/fulcrum-xslt
/**
* Avalon component lifecycle method
*
* This method processes the repository path, to make it relative to the web
* application root, if neccessary. It supports URL-style repositories.
*/
public void configure(Configuration conf) throws ConfigurationException
{
StringBuffer sb = new StringBuffer(conf.getAttribute(STYLESHEET_PATH,
"/"));
// is URL?
if (!sb.toString().matches("[a-zA-Z]{3,}://.*"))
{
// No
if (sb.charAt(0) != '/')
{
sb.insert(0, '/');
}
sb.insert(0, applicationRoot);
sb.insert(0, "file:");
}
if (sb.charAt(sb.length() - 1) != '/')
{
sb.append('/');
}
path = sb.toString();
caching = conf.getAttributeAsBoolean(STYLESHEET_CACHING, false);
}
代码示例来源: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.excalibur.containerkit/excalibur-logger
String location = target.getAttribute( "location" ).trim();
final String format = target.getAttribute( "format", DEFAULT_FORMAT );
final boolean append = target.getAttributeAsBoolean( "append", true );
代码示例来源:origin: org.apache.excalibur.containerkit/excalibur-logger
final boolean printCascading = conf.getAttributeAsBoolean( "cascading", AvalonFormatter.DEFAULT_PRINT_CASCADING );
return new AvalonFormatter( format, depth, printCascading );
代码示例来源:origin: org.apache.cocoon/cocoon-sitemap-impl
public ProcessingNode buildNode(Configuration config) throws Exception {
final Settings settings = (Settings)manager.lookup(Settings.ROLE);
MountNode node = new MountNode(
VariableResolverFactory.getResolver(config.getAttribute("uri-prefix"), manager),
VariableResolverFactory.getResolver(config.getAttribute("src"), manager),
this.treeBuilder.getProcessor().getWrappingProcessor(),
config.getAttributeAsBoolean("check-reload", settings.isReloadingEnabled("sitemap")),
config.getAttributeAsBoolean("pass-through", false)
);
return (this.treeBuilder.setupNode(node, config));
}
}
代码示例来源:origin: org.apache.cocoon/cocoon-sitemap-impl
config.getAttributeAsBoolean("session", false),
config.getAttributeAsBoolean("global", false),
config.getAttributeAsBoolean("permanent", false)
);
return this.treeBuilder.setupNode(URINode, config);
代码示例来源:origin: org.apache.excalibur.containerkit/excalibur-logger
/**
* Populates the underlying <code>Hierarchy</code>.
*
* @param configuration The configuration object.
* @throws ConfigurationException if the configuration is malformed
*/
public final void configure( final Configuration configuration )
throws ConfigurationException
{
final Configuration factories = configuration.getChild( "factories" );
final LogTargetFactoryManager targetFactoryManager = setupTargetFactoryManager( factories );
final Configuration targets = configuration.getChild( "targets" );
final LogTargetManager targetManager = setupTargetManager( targets, targetFactoryManager );
final Configuration categories = configuration.getChild( "categories" );
setupLoggers( targetManager,
null,
categories,
true,
categories.getAttributeAsBoolean( "additive", false ) );
}
代码示例来源:origin: org.apache.fulcrum/fulcrum-yaafi
name = entry.getAttribute("name", clazzName);
shorthand = entry.getAttribute("shorthand", name);
isEarlyInit = entry.getAttributeAsBoolean("early-init", true);
description = entry.getAttribute("description", null);
componentType = entry.getAttribute("component-type", "avalon");
componentFlavour = entry.getAttribute("component-flavour", AvalonYaafiConstants.AVALON_CONTAINER_YAAFI);
hasProxy = entry.getAttributeAsBoolean("has-proxy", true);
logCategory = entry.getAttribute("logger", shorthand);
代码示例来源:origin: org.apache.excalibur.containerkit/excalibur-logger
/**
* Reads a configuration object and creates the category mapping.
*
* @param configuration The configuration object.
* @throws ConfigurationException if the configuration is malformed
*/
public void configure( final Configuration configuration )
throws ConfigurationException
{
final Configuration factories = configuration.getChild( "factories" );
final LogTargetFactoryManager targetFactoryManager = setupTargetFactoryManager( factories );
final Configuration targets = configuration.getChild( "targets" );
final LogTargetManager targetManager = setupTargetManager( targets, targetFactoryManager );
final Configuration categories = configuration.getChild( "categories" );
final Configuration[] category = categories.getChildren( "category" );
setupLoggers( targetManager,
m_prefix,
category,
true,
categories.getAttributeAsBoolean( "additive", false ) );
}
代码示例来源:origin: com.cloudhopper.proxool/proxool
/**
* Check that all top level elements are named proxool and hand them to
* {@link XMLConfigurator}.
* @param configuration the configuration handed over by the Avalon Framework.
* @throws ConfigurationException if the configuration fails.
*/
public void configure(Configuration configuration) throws ConfigurationException {
final XMLConfigurator xmlConfigurator = new XMLConfigurator();
this.closeOnDispose = configuration.getAttributeAsBoolean(CLOSE_ON_DISPOSE_ATTRIBUTE, true);
final Configuration[] children = configuration.getChildren();
for (int i = 0; i < children.length; ++i) {
if (!children[i].getName().equals(ProxoolConstants.PROXOOL)) {
throw new ConfigurationException("Found element named " + children[i].getName() + ". Only "
+ ProxoolConstants.PROXOOL + " top level elements are alowed.");
}
}
try {
xmlConfigurator.startDocument();
reportProperties(xmlConfigurator, configuration.getChildren());
xmlConfigurator.endDocument();
} catch (SAXException e) {
throw new ConfigurationException("", e);
}
}
代码示例来源:origin: org.logicalcobwebs/com.springsource.org.logicalcobwebs.proxool
/**
* Check that all top level elements are named proxool and hand them to
* {@link XMLConfigurator}.
* @param configuration the configuration handed over by the Avalon Framework.
* @throws ConfigurationException if the configuration fails.
*/
public void configure(Configuration configuration) throws ConfigurationException {
final XMLConfigurator xmlConfigurator = new XMLConfigurator();
this.closeOnDispose = configuration.getAttributeAsBoolean(CLOSE_ON_DISPOSE_ATTRIBUTE, true);
final Configuration[] children = configuration.getChildren();
for (int i = 0; i < children.length; ++i) {
if (!children[i].getName().equals(ProxoolConstants.PROXOOL)) {
throw new ConfigurationException("Found element named " + children[i].getName() + ". Only "
+ ProxoolConstants.PROXOOL + " top level elements are alowed.");
}
}
try {
xmlConfigurator.startDocument();
reportProperties(xmlConfigurator, configuration.getChildren());
xmlConfigurator.endDocument();
} catch (SAXException e) {
throw new ConfigurationException("", e);
}
}
代码示例来源: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-sitemap-impl
/**
* Configure the tree processor:
* <processor file="{Location of the sitemap}"
* check-reload="{true|false}"
* config="{Location of sitemap tree processor config}>
* <reload delay="10"/>
* </processor>
*
* 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.fulcrum/fulcrum-json-jackson
for (int j = 0; j < features.length; j++) {
boolean featureValue = features[j]
.getAttributeAsBoolean("value", false);
String feature = features[j].getValue();
getLogger().debug(
代码示例来源:origin: org.apache.cocoon/cocoon-sitemap-impl
public void fill(Configuration config) {
// test model
final String componentModel = config.getAttribute("model", null);
if ( TYPE_POOLED.equals(componentModel) ) {
this.setModel(ComponentInfo.MODEL_POOLED);
this.setPoolInMethodName(config.getAttribute("pool-in", null));
this.setPoolOutMethodName(config.getAttribute("pool-out", null));
} else if (TYPE_NON_THREAD_SAFE_POOLED.equals(componentModel)) {
this.setModel(ComponentInfo.MODEL_POOLED);
this.setPoolInMethodName(config.getAttribute("pool-in", null));
this.setPoolOutMethodName(config.getAttribute("pool-out", null));
} else if ( TYPE_SINGLETON.equals(componentModel) ) {
this.setModel(ComponentInfo.MODEL_SINGLETON);
}
// init/destroy methods
this.setInitMethodName(config.getAttribute("init", null));
this.setDestroyMethodName(config.getAttribute("destroy", null));
// logging
this.setLoggerCategory(config.getAttribute("logger", null));
this.setRole(config.getAttribute("role", null));
// default value
final String newDefaultValue = config.getAttribute("default", null);
if ( newDefaultValue != null ) {
this.defaultValue = newDefaultValue;
}
this.lazyInit = config.getAttributeAsBoolean("lazy-init", this.lazyInit);
}
代码示例来源:origin: org.apache.cocoon/cocoon-sitemap-impl
node.setInternalOnly(false);
} else {
node.setInternalOnly(config.getAttributeAsBoolean(PipelineNodeBuilder.ATTRIBUTE_INTERNAL_ONLY, false));
代码示例来源:origin: org.apache.excalibur.containerkit/excalibur-logger
configuration.getAttributeAsBoolean( "close-wrapped-targets", true );
代码示例来源:origin: org.apache.avalon.cornerstone.scheduler/cornerstone-scheduler-api
conf.getChild( "year" ).getValueAsInteger( -1 );
final boolean dayOfWeek =
conf.getChild( "day" ).getAttributeAsBoolean( "week", false );
代码示例来源:origin: org.apache.cocoon/cocoon-sitemap-impl
if (!includeStatement.getAttributeAsBoolean("optional", false)) {
throw new ConfigurationException("Directory '" + directoryURI + "' does not exist (" +
includeStatement.getLocation() + ").");
内容来源于网络,如有侵权,请联系作者删除!