Package org.apache.avalon.framework.configuration

Examples of org.apache.avalon.framework.configuration.Configuration


        AffineTransform resolutionScaling = new AffineTransform();
        resolutionScaling.scale(s, s);

        //Controls whether text painted by Batik is generated using text or path operations
        boolean strokeText = false;
        Configuration cfg = pdfInfo.cfg;
        if (cfg != null) {
            strokeText = cfg.getChild("stroke-text", true).getValueAsBoolean(strokeText);
        }

        BridgeContext ctx = new PDFBridgeContext(ua,
                (strokeText ? null : pdfInfo.fi),
                userAgent.getFactory().getImageManager(),
View Full Code Here


        log.debug("Role File:   " + roleConfigFilename);

        // process configuration files

        DefaultConfigurationBuilder builder = new DefaultConfigurationBuilder();
        Configuration sysConfig  = builder.buildFromFile(sysConfigFilename);
        Configuration roleConfig = builder.buildFromFile(roleConfigFilename);

        // Create the LoggerManager for Log4J
        LoggerManager lm = new Log4JLoggerManager();

        // Setup the RoleManager
View Full Code Here

        Hierarchy hier = Hierarchy.getDefaultHierarchy();
        LogKitLoggerManager manager = new LogKitLoggerManager(null, hier, null, null);

        DefaultConfigurationBuilder builder = new DefaultConfigurationBuilder();
        try {
            Configuration c = builder.buildFromFile(cfg);
            Context ctx = new DefaultContext();
            manager.contextualize(ctx);
            manager.configure(c);
        } catch (IllegalArgumentException e) {
            // This happens if the default log-target id-ref specifies a non-existent target
View Full Code Here

            try
            {
                Class[] params;
                Object[] values;
                Configuration entry = entrys[ i ];

                if( entry.getAttribute( "value", null ) != null )
                {
                    // Single argument String-constructor
                    params = new Class[ 1 ];
                    params[ 0 ] = Class.forName( "java.lang.String" );
                    Class[] consObjects = {Class.forName( "java.lang.String" )};
                    Constructor cons = params[ 0 ].getConstructor( consObjects );
                    values = new Object[ 1 ];
                    Object[] consValues = {
                        getContextValue( map, entry.getAttribute( "value" ) )
                    };
                    values[ 0 ] = cons.newInstance( consValues );

                    if( log != null )
                    {
                        log.debug( "add context-attr '" + paramName
                                   + "' class '" + className
                                   + "' with value '" + consValues[ 0 ] + "'" );
                    }
                }
                else
                {
                    // Multiple argument constructor
                    Configuration[] entryChilds = entry.getChildren( "parameter" );

                    params = new Class[ entryChilds.length ];
                    values = new Object[ entryChilds.length ];

                    if( log != null )
View Full Code Here

    {
        if( createNew )
        {
            return getChild( child );
        }
        Configuration c = m_base.getChild( child, false );
        if( c != null )
        {
            return c;
        }
        return m_parent.getChild( child, false );
View Full Code Here

        final Configuration[] bc = base.getChildren();
        final Set baseUsed = new HashSet();

        for( int i = 0; i < lc.length; i++ )
        {
            final Configuration mergeWith = getMergePartner( lc[ i ], layer, base );

            if( null == mergeWith )
            {
                merged.addChild( lc[ i ] );
            }
View Full Code Here

    {
        final Configuration[] kids = merged.getChildren();

        for( int i = 0; i < kids.length; i++ )
        {
            final Configuration mergedChild = kids[ i ];
            final String name = mergedChild.getName();
            final Configuration[] mc = merged.getChildren( name );
            final Configuration[] bc = base.getChildren( name );

            Configuration mergedWith;
            String keyAttr = null;

            if( bc.length > mc.length )
            {
                throw new UnsupportedOperationException( "Unable to mask children from base "
View Full Code Here

     * @see org.apache.avalon.framework.configuration.Configurable#configure(Configuration)
     */
    public void configure(final Configuration configuration) throws ConfigurationException {
        super.configure(configuration);
        if (isEnabled()) {
            Configuration handlerConfiguration = configuration.getChild("handler");
            authRequired =
                handlerConfiguration.getChild("authRequired").getValueAsBoolean(false);
            if (getLogger().isDebugEnabled()) {
                if (authRequired) {
                    getLogger().debug("NNTP Server requires authentication.");
                } else {
                    getLogger().debug("NNTP Server doesn't require authentication.");
View Full Code Here

     */
    public void configure(final Configuration configuration) throws ConfigurationException {
        super.configure(configuration);
        if (isEnabled()) {
            mailetcontext.setAttribute(Constants.HELLO_NAME, helloName);
            Configuration handlerConfiguration = configuration.getChild("handler");
            authRequired = handlerConfiguration.getChild("authRequired").getValueAsBoolean(false);
            verifyIdentity = handlerConfiguration.getChild("verifyIdentity").getValueAsBoolean(false);
            if (authRequired) {
                if (verifyIdentity) {
                    getLogger().info("This SMTP server requires authentication and verifies that the authentication credentials match the sender address.");
                } else {
                    getLogger().info("This SMTP server requires authentication, but doesn't verify that the authentication credentials match the sender address.");
                }
            } else {
                getLogger().info("This SMTP server does not require authentication.");
            }
            // get the message size limit from the conf file and multiply
            // by 1024, to put it in bytes
            maxMessageSize = handlerConfiguration.getChild( "maxmessagesize" ).getValueAsLong( maxMessageSize ) * 1024;
            if (maxMessageSize > 0) {
                getLogger().info("The maximum allowed message size is " + maxMessageSize + " bytes.");
            } else {
                getLogger().info("No maximum message size is enforced for this server.");
            }
View Full Code Here

                ("Malformed sqlFile - Must be of the format \"file://<filename>\".");
        }

        // Get other sql parameters from the configuration object,
        // if any.
        Configuration sqlParamsConfig = configuration.getChild("sqlParameters");
        String[] paramNames = sqlParamsConfig.getAttributeNames();
        for (int i = 0; i < paramNames.length; i++ ) {
            String paramName = paramNames[i];
            String paramValue = sqlParamsConfig.getAttribute(paramName);
            m_sqlParameters.put(paramName, paramValue);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.avalon.framework.configuration.Configuration

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.