Package org.codehaus.loom.components.util.profile

Examples of org.codehaus.loom.components.util.profile.PartitionProfile


            getLogger().info( "Exception loading listeners:" + t.getMessage() + "\n", t );
            throw new LoomException( t.getMessage(), t );
        }
        try
        {
            final PartitionProfile partition =
                m_context.getPartitionProfile().getPartition( ContainerConstants.BLOCK_PARTITION );
            final ComponentProfile[] blocks = partition.getComponents();
            for( int i = 0; i < blocks.length; i++ )
            {
                final String blockName = blocks[i].getTemplate().getName();
                final BlockEntry blockEntry = new BlockEntry( blocks[i] );
                m_entries.put( blockName, blockEntry );
View Full Code Here


        }
    }

    private ComponentProfile[] getComponentsInPartition( final String key )
    {
        final PartitionProfile partition =
            m_context.getPartitionProfile().getPartition( key );
        return partition.getComponents();
    }
View Full Code Here

        //All blocks about to be processed ...
        if( PHASE_STARTUP == name )
        {
            //... for startup, so indicate to applicable listeners
            final PartitionProfile partition = m_context.getPartitionProfile();
            final File homeDirectory = m_context.getHomeDirectory();
            final SarMetaData sarMetaData =
                ComponentMetaDataConverter.toSarMetaData( partition,
                                                          homeDirectory );
            m_listenerSupport.fireApplicationStartingEvent( sarMetaData );
View Full Code Here

            parameters.put( ContainerConstants.CONFIG_DESCRIPTOR, newConfig );
            parameters.put( ContainerConstants.ASSEMBLY_CLASSLOADER,
                            classLoader );

            //assemble all the blocks for application
            final PartitionProfile profile =
                m_builder.buildProfile( parameters );

            m_verifier.verifySar( profile, classLoader );

            //Setup configuration for all the applications blocks
View Full Code Here

    private void verifyConfiguration( final PartitionProfile profile,
                                      final Configuration config )
        throws LoomException
    {
        final Configuration[] configurations = config.getChildren();
        final PartitionProfile listenerPartition =
            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 );
            }
            if( null == component )
            {
                final String message =
                    REZ.format( "deploy.error.extra.config",
View Full Code Here

        final PartitionTemplate blockPartition =
            metaData.getPartition( ContainerConstants.BLOCK_PARTITION );
        final PartitionTemplate listenerPartition =
            metaData.getPartition( ContainerConstants.LISTENER_PARTITION );

        final PartitionProfile blockProfile = assembleProfile( blockPartition,
                                                               factory );
        final PartitionProfile listenerProfile =
            assembleListenerProfile( listenerPartition, classLoader );

        final PartitionProfile[] profiles = new PartitionProfile[]{
            blockProfile, listenerProfile};
        return new PartitionProfile( metaData,
                                     profiles,
                                     ComponentProfile.EMPTY_SET );
    }
View Full Code Here

            componentSet.add( profile );
        }

        final ComponentProfile[] profiles =
            (ComponentProfile[])componentSet.toArray( new ComponentProfile[componentSet.size()] );
        return new PartitionProfile( metaData,
                                     PartitionProfile.EMPTY_SET,
                                     profiles );
    }
View Full Code Here

        final ArrayList partitionSet = new ArrayList();
        final PartitionTemplate[] partitions = metaData.getPartitions();
        for( int i = 0; i < partitions.length; i++ )
        {
            final PartitionTemplate partition = partitions[i];
            final PartitionProfile profile = assembleProfile( partition,
                                                              factory );
            partitionSet.add( profile );
        }

        final ArrayList componentSet = new ArrayList();
        final ComponentTemplate[] components = metaData.getComponents();
        for( int i = 0; i < components.length; i++ )
        {
            final ComponentTemplate component = components[i];
            final ComponentInfo info =
                factory.createInfo( component.getImplementationKey() );
            final ComponentProfile profile = new ComponentProfile( info,
                                                                   component );
            componentSet.add( profile );
        }

        final PartitionProfile[] partitionProfiles =
            (PartitionProfile[])partitionSet.toArray( new PartitionProfile[partitionSet.size()] );
        final ComponentProfile[] componentProfiles =
            (ComponentProfile[])componentSet.toArray( new ComponentProfile[componentSet.size()] );
        return new PartitionProfile( metaData,
                                     partitionProfiles,
                                     componentProfiles );
    }
View Full Code Here

    }

    public static SarMetaData toSarMetaData( final PartitionProfile partition,
                                             final File homeDirectory )
    {
        final PartitionProfile blockPartition =
            partition.getPartition( ContainerConstants.BLOCK_PARTITION );
        final PartitionProfile listenerPartition =
            partition.getPartition( ContainerConstants.LISTENER_PARTITION );
        final BlockListenerMetaData[] listeners =
            toBlockListeners( listenerPartition.getMetaData().getComponents() );
        final BlockMetaData[] blocks =
            toBlocks( blockPartition.getComponents() );
        return new SarMetaData( partition.getMetaData().getName(),
                                homeDirectory,
                                blocks,
View Full Code Here

                               null );
        final ComponentProfile c1Profile =
            new ComponentProfile( c1Info, c1MetaData );
        final ComponentProfile c2Profile =
            new ComponentProfile( c2Info, c2MetaData );
        final PartitionProfile blockProfile =
            new PartitionProfile( blockMetaData,
                                  PartitionProfile.EMPTY_SET,
                                  new ComponentProfile[]{c1Profile, c2Profile} );
        final PartitionProfile listenerProfile =
            new PartitionProfile( listenerMetaData,
                                  PartitionProfile.EMPTY_SET,
                                  ComponentProfile.EMPTY_SET );
        final PartitionProfile profile =
            new PartitionProfile( metaData,
                                  new PartitionProfile[]{blockProfile,
                                                         listenerProfile},
                                  ComponentProfile.EMPTY_SET );
        verify( profile );
    }
View Full Code Here

TOP

Related Classes of org.codehaus.loom.components.util.profile.PartitionProfile

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.