Package org.apache.avalon.fortress

Examples of org.apache.avalon.fortress.MetaInfoEntry


            {
                className = config.getAttribute("class");
            }
            else
            {
                final MetaInfoEntry roleEntry = m_metaManager.getMetaInfoForShortName( config.getName() );
                if ( null == roleEntry )
                {

                    final String message = "No class found matching configuration name " +
                        "[name: " + config.getName() + ", location: " + config.getLocation() + "]";
                    throw new ConfigurationException( message );
                }

                className = roleEntry.getComponentClass().getName();
            }
        }

        return className;
    }
View Full Code Here


            }
            return m_classLoader.loadClass( handlerClassName ) ;
        }
        else
        {
            final MetaInfoEntry roleEntry = m_metaManager.getMetaInfoForShortName( shortName );
            if ( null == roleEntry )
            {

                final String message = "No class found matching configuration name " +
                        "[name: " + shortName + "]";
                throw new ConfigurationException( message );
            }

            return roleEntry.getHandlerClass();
        }
    }
View Full Code Here

    protected void addComponent( final ComponentHandlerMetaData metaData )
            throws IllegalArgumentException, Exception
    {
        // figure out Role
        final String classname = metaData.getClassname();
        final MetaInfoEntry metaEntry = m_metaManager.getMetaInfoForClassname( classname );
        if ( null == metaEntry )
        {
            final String message = "No role defined for " + classname;
            throw new IllegalArgumentException( message );
        }

        if ( DEFAULT_ENTRY.equals( metaData.getName() ) ||
                SELECTOR_ENTRY.equals( metaData.getName() ) )
        {
            throw new IllegalArgumentException( "Using a reserved id name" + metaData.getName() );
        }

        Iterator it = metaEntry.getRoles();
        // create a handler for the combo of Role+MetaData
        final ComponentHandler handler =
                getComponentHandler( metaEntry, metaData );

        while ( it.hasNext() )
View Full Code Here

                v = new Vertex( name, entry.getHandler() );
                vertexMap.put( name, v );
                vertices.add( v );
            }

            MetaInfoEntry meta = m_metaManager.getMetaInfoForClassname( metaData.getClassname() );

            Iterator dit = meta.getDependencies().iterator();
            while ( dit.hasNext() )
            {
                Map deps = (Map) m_mapper.get( dit.next() );

                /* Ignore for now...  It is probably due to a component requiring a Container
View Full Code Here

        {
            className = config.getAttribute( "class" );
        }
        else
        {
            final MetaInfoEntry roleEntry = m_metaManager.getMetaInfoForShortName( config.getName() );
            if ( null == roleEntry )
            {
                final String message = "No class found matching configuration name " +
                    "[name: " + config.getName() + ", location: " + config.getLocation() + "]";
                throw new ConfigurationException( message );
            }

            className = roleEntry.getComponentClass().getName();
        }

        if ( getLogger().isDebugEnabled() )
        {
            getLogger().debug( "Configuration processed for: " + className );
View Full Code Here

                              final String[] roles,
                              final String className,
                              final String handlerClassname )
        throws ClassNotFoundException
    {
        final MetaInfoEntry metaEntry = m_manager.getMetaInfoForShortName( shortname );
        assertNotNull( "MetaInfoEntry", metaEntry );

        assertEquals( "componentClass:",
            metaEntry.getComponentClass(), Class.forName( className ) );

        for ( int i = 0; i < roles.length; i++ )
        {
            assertTrue( "Role:", metaEntry.containsRole( roles[i] ) );
        }
        assertEquals( "Handler:",
            metaEntry.getHandlerClass(), Class.forName( handlerClassname ) );
    }
View Full Code Here

        m_lifecycleMap = Collections.unmodifiableMap( lifecycleMap );
    }

    public void testFullySpecified() throws Exception
    {
        MetaInfoEntry entry = new MetaInfoEntry( m_componentClass, m_properties, m_dependencies );
        checkMetaInfoEntry( entry, ThreadSafeComponentHandler.class, "component1", false );
    }
View Full Code Here

        m_properties.remove( "x-avalon.lifestyle" );
        m_properties.remove( "x-avalon.name" );
        m_properties.setProperty( "fortress.handler", ThreadSafeComponentHandler.class.getName() );
        m_componentClass = MetaInfoEntry.class;

        MetaInfoEntry entry = new MetaInfoEntry( m_componentClass, m_properties, m_dependencies );

        checkMetaInfoEntry( entry, ThreadSafeComponentHandler.class, "meta-info-entry", false );
    }
View Full Code Here

        Iterator it = m_lifecycleMap.keySet().iterator();
        while ( it.hasNext() )
        {
            String type = (String) it.next();
            m_properties.setProperty( "x-avalon.lifestyle", type );
            MetaInfoEntry entry = new MetaInfoEntry( m_componentClass, m_properties, m_dependencies );
            checkMetaInfoEntry( entry, (Class) m_lifecycleMap.get( type ), name, false );
        }
    }
View Full Code Here

    public void testRoleEntryParent() throws Exception
    {
        RoleEntry roleEntry = new RoleEntry( Role1.class.getName(), "component1",
            m_componentClass, ThreadSafeComponentHandler.class );

        MetaInfoEntry entry = new MetaInfoEntry( roleEntry );

        checkMetaInfoEntry( entry, ThreadSafeComponentHandler.class, "component1", true );
    }
View Full Code Here

TOP

Related Classes of org.apache.avalon.fortress.MetaInfoEntry

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.