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

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


            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 )
View Full Code Here


            validateConfiguration( partitions[i], classLoader );
        }
        final ComponentProfile[] components = profile.getComponents();
        for( int i = 0; i < components.length; i++ )
        {
            final ComponentProfile component = components[i];
            boolean isValid = false;
            try
            {
                isValid = m_validator.isValid( component, classLoader );
            }
            catch( final Exception e )
            {
                getLogger().warn( e.getMessage(), e );
            }
            if( !isValid )
            {
                final String message =
                    "Unable to validate configuration of component " +
                    component.getTemplate().getName() +
                    " of type " +
                    component.getInfo().getType().getName();
                throw new LoomException( message );
            }
        }
    }
View Full Code Here

        for( int i = 0; i < components.length; i++ )
        {
            final ComponentTemplate component = components[i];
            final Class type = classLoader.loadClass( component.getImplementationKey() );
            final ComponentInfo info = createListenerInfo( type );
            final ComponentProfile profile = new ComponentProfile( info,
                                                                   component );
            componentSet.add( profile );
        }

        final ComponentProfile[] profiles =
View Full Code Here

        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 =
View Full Code Here

        final ComponentProfile[] components )
    {
        final ArrayList listenerSet = new ArrayList();
        for( int i = 0; i < components.length; i++ )
        {
            final ComponentProfile component = components[ i ];
            final BlockMetaData block =
                toBlockMetaData( component.getTemplate(),
                                 component.getInfo() );
            listenerSet.add( block );
        }
        return (BlockMetaData[])listenerSet.toArray(
            new BlockMetaData[ listenerSet.size() ] );
    }
View Full Code Here

        final ComponentProfile[] components )
        throws Exception
    {
        for( int i = 0; i < components.length; i++ )
        {
            final ComponentProfile component = components[ i ];

            final Stack stack = new Stack();
            stack.push( component );
            verifyNoCircularDependencies( component, components, stack );
            stack.pop();
View Full Code Here

    {
        final ComponentProfile[] dependencies = getDependencies( component,
                                                                 components );
        for( int i = 0; i < dependencies.length; i++ )
        {
            final ComponentProfile dependency = dependencies[ i ];
            if( stack.contains( dependency ) )
            {
                final String trace = getDependencyTrace( dependency, stack );
                final String message =
                    REZ.format( "assembly.circular-dependency.error",
View Full Code Here

        final String name = component.getTemplate().getName();
        final int size = stack.size();
        final int top = size - 1;
        for( int i = top; i >= 0; i-- )
        {
            final ComponentProfile other = (ComponentProfile)stack.get( i );
            if( top != i )
            {
                sb.append( ", " );
            }
            sb.append( other.getTemplate().getName() );

            if( other.getTemplate().getName().equals( name ) )
            {
                break;
            }
        }
View Full Code Here

            component.getTemplate().getDependencies();

        for( int i = 0; i < deps.length; i++ )
        {
            final String name = deps[ i ].getProviderName();
            final ComponentProfile other = getComponentProfile( name,
                                                                components );
            dependencies.add( other );
        }

        return (ComponentProfile[])dependencies.toArray(
View Full Code Here

            final String providerName = dependency.getProviderName();
            final String key = dependency.getKey();
            final String type = info.getDependency( key ).getComponentType();

            //Get the other component that is providing service
            final ComponentProfile provider = getComponentProfile(
                providerName, others );
            if( null == provider )
            {
                final String message =
                    REZ.format( "assembly.missing-dependency.error",
                                key,
                                providerName,
                                component.getTemplate().getName() );
                throw new Exception( message );
            }

            //make sure that the component offers service
            //that user expects it to be providing
            final ComponentInfo providerInfo = provider.getInfo();
            final ServiceDescriptor[] services = providerInfo.getServices();
            if( !hasMatchingService( type, services ) )
            {
                final String message =
                    REZ.format( "assembly.dependency-missing-service.error",
View Full Code Here

TOP

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

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.