Examples of BlockMetaData


Examples of org.apache.avalon.phoenix.metadata.BlockMetaData

            final String roleName = roles[ i ].getRole();
            final ServiceDescriptor service =
                info.getDependency( roleName ).getService();

            //Get the other block that is providing service
            final BlockMetaData other = getBlock( blockName, others );
            if( null == other )
            {
                final String message =
                    REZ.getString( "dependency-noblock", blockName, block.getName() );
                throw new VerifyException( message );
            }

            //make sure that the block offers service
            //that user expects it to be providing
            final ServiceDescriptor[] services = other.getBlockInfo().getServices();
            if( !hasMatchingService( service, services ) )
            {
                final String message =
                    REZ.getString( "dependency-noservice", blockName, service, block.getName() );
                throw new VerifyException( message );
View Full Code Here

Examples of org.apache.avalon.phoenix.metadata.BlockMetaData

        throws AssemblyException
    {
        final ArrayList blockSet = new ArrayList();
        for( int i = 0; i < blocks.length; i++ )
        {
            final BlockMetaData blockMetaData =
                buildBlock( blocks[ i ], classLoader );
            blockSet.add( blockMetaData );
        }

        return (BlockMetaData[])blockSet.toArray( new BlockMetaData[ 0 ] );
View Full Code Here

Examples of org.apache.avalon.phoenix.metadata.BlockMetaData

            final DependencyMetaData[] roles = buildDependencyMetaDatas( provides );
            final BlockInfo info = getBlockInfo( name, classname, classLoader );


            return new BlockMetaData( name, roles, disableProxy, info );
        }
        catch( final ConfigurationException ce )
        {
            final String message =
                REZ.getString( "block-entry-malformed", block.getLocation(), ce.getMessage() );
View Full Code Here

Examples of org.apache.avalon.phoenix.metadata.BlockMetaData

        final DependencyMetaData[] deps = block.getDependencies();

        for( int i = 0; i < deps.length; i++ )
        {
            final String name = deps[ i ].getName();
            final BlockMetaData other = getBlock( name, blocks );
            dependencies.add( other );
        }

        return (BlockMetaData[])dependencies.toArray( new BlockMetaData[ 0 ] );
    }
View Full Code Here

Examples of org.apache.avalon.phoenix.metadata.BlockMetaData

            final String roleName = roles[ i ].getRole();
            final ServiceDescriptor service =
                info.getDependency( roleName ).getService();

            //Get the other block that is providing service
            final BlockMetaData other = getBlock( blockName, others );
            if( null == other )
            {
                final String message =
                    REZ.getString( "dependency-noblock", blockName, block.getName() );
                throw new VerifyException( message );
            }

            //make sure that the block offers service
            //that user expects it to be providing
            final ServiceDescriptor[] services = other.getBlockInfo().getServices();
            if( !hasMatchingService( service, services ) )
            {
                final String message =
                    REZ.getString( "dependency-noservice", blockName, service, block.getName() );
                throw new VerifyException( message );
View Full Code Here

Examples of org.apache.avalon.phoenix.metadata.BlockMetaData

     * @throws Exception
     */
    public Object createObject( final Object entry )
        throws Exception
    {
        final BlockMetaData metaData = getMetaDataFor( entry );
        final ClassLoader classLoader = m_context.getClassLoader();
        String classname = metaData.getBlockInfo().getBlockDescriptor().getClassname();
        final Class clazz = classLoader.loadClass( classname );
        return clazz.newInstance();
    }
View Full Code Here

Examples of org.apache.avalon.phoenix.metadata.BlockMetaData

     * @throws Exception if an error occurs
     */
    public Logger createLogger( final Object entry )
        throws Exception
    {
        final BlockMetaData metaData = getMetaDataFor( entry );
        final String name = metaData.getName();
        return m_context.getLogger( name );
    }
View Full Code Here

Examples of org.apache.avalon.phoenix.metadata.BlockMetaData

     * @return the created BlockContext
     */
    public Context createContext( final Object entry )
        throws Exception
    {
        final BlockMetaData metaData = getMetaDataFor( entry );
        return new DefaultBlockContext( metaData.getName(),
                                        m_context );
    }
View Full Code Here

Examples of org.apache.avalon.phoenix.metadata.BlockMetaData

     * @return the created ComponentManager
     */
    public ComponentManager createComponentManager( final Object entry )
        throws Exception
    {
        final BlockMetaData metaData = getMetaDataFor( entry );
        final DefaultComponentManager componentManager = new DefaultComponentManager();
        final DependencyMetaData[] roles = metaData.getDependencies();

        for( int i = 0; i < roles.length; i++ )
        {
            final DependencyMetaData role = roles[ i ];
            final Object dependency = m_application.getBlock( role.getName() );
            if( dependency instanceof Component )
            {
                componentManager.put( role.getRole(), (Component)dependency );
            }
            else
            {
                final String message =
                    REZ.getString( "lifecycle.nota-component.error",
                                   metaData.getName(),
                                   role.getRole(),
                                   role.getName() );
                throw new Exception( message );
            }
        }
View Full Code Here

Examples of org.apache.avalon.phoenix.metadata.BlockMetaData

     * @return the created ServiceManager
     */
    public ServiceManager createServiceManager( final Object entry )
        throws Exception
    {
        final BlockMetaData metaData = getMetaDataFor( entry );
        final DefaultServiceManager manager = new DefaultServiceManager();
        final DependencyMetaData[] roles = metaData.getDependencies();

        for( int i = 0; i < roles.length; i++ )
        {
            final DependencyMetaData role = roles[ i ];
            final Object dependency = m_application.getBlock( role.getName() );
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.