Package org.codehaus.loom.components.util.info

Examples of org.codehaus.loom.components.util.info.ComponentInfo


        invalidate();

        if( null != object &&
            !m_componentProfile.getTemplate().isDisableProxy() )
        {
            final ComponentInfo blockInfo = m_componentProfile.getInfo();
            final Class[] interfaces = getServiceClasses( object,
                                                          blockInfo.getServices() );
            m_invocationHandler =
            new BlockInvocationHandler( object, interfaces );
        }
        m_object = object;
    }
View Full Code Here


        final ComponentTemplate[] components = metaData.getComponents();
        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 );
        }
View Full Code Here

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

     *
     * @return the ComponentInfo for listener
     */
    private static ComponentInfo createListenerInfo( final Class type )
    {
        return new ComponentInfo( type,
                                  ServiceDescriptor.EMPTY_SET,
                                  DependencyDescriptor.EMPTY_SET,
                                  null );
    }
View Full Code Here

        configuration = info.getChild( "block" );
        final SchemaDescriptor schema = buildConfigurationSchema(
            type.getName(), configuration );

        return new ComponentInfo( type, services, dependencies, schema );
    }
View Full Code Here

        final DependencyDescriptor[] dependencies =
            buildDependencies( type );

        final SchemaDescriptor schema = buildConfigurationSchema( type );

        return new ComponentInfo( type,
                                  services,
                                  dependencies,
                                  schema );
    }
View Full Code Here

        m_legacyBlockInfoReader = new LegacyBlockInfoReader( classLoader, logger );
    }

    public ComponentInfo buildComponentInfo( final Class type ) throws Exception
    {
        final ComponentInfo legacyComponentInfo = m_legacyBlockInfoReader.buildComponentInfo( type );

        if( null == legacyComponentInfo )
        {
            return m_metaClassBlockInfoReader.buildComponentInfo( type );
        }
View Full Code Here

    private Map createServiceMap( final Object entry )
        throws Exception
    {
        final ComponentTemplate component = getMetaData( entry );
        final String impl = component.getImplementationKey();
        final ComponentInfo info = m_factory.createInfo( impl );
        final DependencyDirective[] dependencies = component.getDependencies();

        final HashMap services = new HashMap();

        for( int i = 0; i < dependencies.length; i++ )
        {
            final DependencyDirective dependency = dependencies[ i ];
            final String key = dependency.getKey();
            final String providerName = dependency.getProviderName();
            final boolean optional = info.getDependency( key ).isOptional();

            final Object service =
                getService( providerName, entry );
            if( null == service )
            {
View Full Code Here

     * @see ComponentFactory#createInfo
     */
    public ComponentInfo createInfo( final String implementationKey )
        throws Exception
    {
        ComponentInfo bundle = (ComponentInfo)m_infos.get( implementationKey );
        if( null == bundle )
        {
            bundle = createComponentInfo( implementationKey );
            m_infos.put( implementationKey, bundle );
        }
View Full Code Here

    protected void verifyDependencyReferences(
        final ComponentProfile component,
        final ComponentProfile[] others )
        throws Exception
    {
        final ComponentInfo info = component.getInfo();
        final DependencyDirective[] dependencies = component.getTemplate()
            .getDependencies();

        for( int i = 0; i < dependencies.length; i++ )
        {
            final DependencyDirective dependency = dependencies[ i ];
            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",
                                providerName,
View Full Code Here

TOP

Related Classes of org.codehaus.loom.components.util.info.ComponentInfo

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.