Package org.codehaus.dna

Examples of org.codehaus.dna.Configuration


        final String qName = "myElement";
        final AttributesImpl attributes = new AttributesImpl();
        attributes.addAttribute( "", "", "key", "CDATA", "value" );
        handler.startElement( "", "", qName, attributes );
        handler.endElement( "", "", qName );
        final Configuration configuration = handler.getConfiguration();
        assertEquals( "configuration.name", qName, configuration.getName() );
        assertEquals( "configuration.location", "", configuration.getLocation() );
        assertEquals( "configuration.path", "", configuration.getPath() );
        final String[] names = configuration.getAttributeNames();
        assertEquals( "names.length", 1, names.length );
        assertEquals( "names[0]", "key", names[ 0 ] );
        assertEquals( "configuration.getAttribute( names[ 0 ] )",
                      MockSAXConfigurationHandler.REPLACEMENT,
                      configuration.getAttribute( names[ 0 ] ) );
    }
View Full Code Here


            new DefaultConfiguration( "myElement", "file.xml:20", "" );
        final DefaultConfiguration child =
            new DefaultConfiguration( "mychild", "file.xml:20", "/myElement" );
        configuration.addChild( child );

        final Configuration test = configuration.getChild( "mychild" );
        assertEquals( child, test );
    }
View Full Code Here

        final DefaultConfiguration child =
            new DefaultConfiguration( "meep", "file.xml:20", "/myElement" );
        configuration.addChild( child );

        final Configuration test = configuration.getChild( "mychild", false );
        assertEquals( null, test );
    }
View Full Code Here

        throws Exception
    {
        final DefaultConfiguration configuration =
            new DefaultConfiguration( "myElement", "file.xml:20", "" );

        final Configuration test = configuration.getChild( "mychild", false );
        assertEquals( null, test );
    }
View Full Code Here

        throws Exception
    {
        final DefaultConfiguration configuration =
            new DefaultConfiguration( "myElement", "file.xml:20", "" );

        final Configuration test = configuration.getChild( "mychild", true );
        assertNotNull( test );
        assertEquals( "mychild", test.getName() );
    }
View Full Code Here

        throws Exception
    {
        final DefaultConfiguration configuration =
            new DefaultConfiguration( "myElement", "file.xml:20", "" );

        final Configuration child = configuration.getChild( "test" ).getChild( "blah" );
        assertEquals( "child.path", "/myElement/test", child.getPath() );
        assertTrue( "child.location", child.getLocation().endsWith( "<autogen>" ) );
    }
View Full Code Here

        try
        {
            //m_baseWorkDirectory
            installation = m_installer.install( name, location );

            final Configuration config =
                getConfigurationFor( installation,
                                     ContainerConstants.INSTALL_CONFIG,
                                     null );
            final Configuration environment =
                getConfigurationFor( installation,
                                     ContainerConstants.INSTALL_ENVIRONMENT,
                                     null );
            final Configuration assembly =
                getConfigurationFor( installation,
                                     ContainerConstants.INSTALL_ASSEMBLY,
                                     ConfigurationBuilder.ASSEMBLY_SCHEMA );

            final File homeDirectory =
                (File)installation.get( ContainerConstants.INSTALL_HOME );
            final File workDirectory =
                (File)installation.get( ContainerConstants.INSTALL_WORK );

            final Map data = new HashMap();
            data.put( BlockContext.APP_NAME, name );
            data.put( BlockContext.APP_HOME_DIR, homeDirectory );

            final Configuration logs = environment.getChild( "logs", false );
            //Load hierarchy before classloader placed in context as
            //that way the logFactory will not try to use the application
            //specific classloader to load the targets which will cause
            //CastClassExceptions
            final LoggerStore store =
                m_logManager.createHierarchy( logs,
                                              homeDirectory,
                                              workDirectory,
                                              data );

            final ClassLoaderSet classLoaderSet =
                m_classLoaderManager.createClassLoaderSet( environment,
                                                           data,
                                                           homeDirectory,
                                                           workDirectory );

            //TODO: Add classLoaderSet to application resources

            final ClassLoader classLoader =
                classLoaderSet.getDefaultClassLoader();

            final Configuration newConfig =
                processConfiguration( name, config );

            final Map parameters = new HashMap();
            parameters.put( ContainerConstants.ASSEMBLY_NAME, name );
            parameters.put( ContainerConstants.ASSEMBLY_DESCRIPTOR, assembly );
View Full Code Here

                                      configuration.getPath(),
                                      configuration.getLocation() );
        final Configuration[] configurations = configuration.getChildren();
        for( int i = 0; i < configurations.length; i++ )
        {
            final Configuration config = configurations[i];
            try
            {
                final Configuration newConfig =
                    m_repository.processConfiguration( application,
                                                       config.getName(),
                                                       config );
                newConfiguration.addChild( newConfig );
            }
View Full Code Here

            profile.getPartition( ContainerConstants.LISTENER_PARTITION );
        final PartitionProfile blockPartition =
            profile.getPartition( ContainerConstants.BLOCK_PARTITION );
        for( int i = 0; i < configurations.length; i++ )
        {
            final Configuration configuration = configurations[i];
            final String name = configuration.getName();
            ComponentProfile component = listenerPartition.getComponent( name );
            if( null == component )
            {
                component = blockPartition.getComponent( name );
            }
View Full Code Here

        final Set baseUsed = new HashSet();
        final List toMergeUsed = new ArrayList();

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

            if( null == mergeWith )
            {
                toMergeUsed.add( lc[ i ] );
View Full Code Here

TOP

Related Classes of org.codehaus.dna.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.