Examples of RoleEntry


Examples of org.apache.avalon.fortress.RoleEntry

  }

  @SuppressWarnings("unchecked")
  public static Class getClassForShortName(String shortName)
  {
    RoleEntry re = utilRoleManager.getRoleForShortName(shortName);

    if (re != null)
    {
      return re.getComponentClass();
    }

    MetaInfoEntry me = utilMetaInfoManager.getMetaInfoForShortName(shortName);

    if (me != null)
View Full Code Here

Examples of org.apache.avalon.fortress.RoleEntry

    }
  }

  public static Class getClassForShortName(String shortName)
  {
    RoleEntry re = utilRoleManager.getRoleForShortName(shortName);

    if (re != null)
    {
      return re.getComponentClass();
    }

    MetaInfoEntry me = utilMetaInfoManager.getMetaInfoForShortName(shortName);

    if (me != null)
View Full Code Here

Examples of org.apache.avalon.fortress.RoleEntry

        }
    }

    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

Examples of org.apache.avalon.fortress.RoleEntry

        String role = Role1.class.getName();
        String name = "component1";
        Class componentClass = Component1.class;
        Class handlerClass = ThreadSafeComponentHandler.class;

        RoleEntry entry = new RoleEntry( role, name, componentClass, handlerClass );

        assertNotNull( entry );
        assertNotNull( entry.getRole() );
        assertNotNull( entry.getShortname() );
        assertNotNull( entry.getComponentClass() );
        assertNotNull( entry.getHandlerClass() );

        assertEquals( role, entry.getRole() );
        assertEquals( name, entry.getShortname() );
        assertEquals( componentClass, entry.getComponentClass() );
        assertEquals( handlerClass, entry.getHandlerClass() );
    }
View Full Code Here

Examples of org.apache.avalon.fortress.RoleEntry

        Class componentClass = Component1.class;
        Class handlerClass = ThreadSafeComponentHandler.class;

        try
        {
            new RoleEntry( null, name, componentClass, handlerClass );
            fail( "Did not throw an exception" );
        }
        catch ( NullPointerException npe )
        {
            // SUCCESS!
        }
        catch ( Exception e )
        {
            fail( "threw the wrong exception: " + e.getClass().getName() );
        }

        try
        {
            new RoleEntry( role, null, componentClass, handlerClass );
            fail( "Did not throw an exception" );
        }
        catch ( NullPointerException npe )
        {
            // SUCCESS!
        }
        catch ( Exception e )
        {
            fail( "threw the wrong exception: " + e.getClass().getName() );
        }

        try
        {
            new RoleEntry( role, name, null, handlerClass );
            fail( "Did not throw an exception" );
        }
        catch ( NullPointerException npe )
        {
            // SUCCESS!
        }
        catch ( Exception e )
        {
            fail( "threw the wrong exception: " + e.getClass().getName() );
        }

        try
        {
            new RoleEntry( role, name, componentClass, null );
            fail( "Did not throw an exception" );
        }
        catch ( NullPointerException npe )
        {
            // SUCCESS!
View Full Code Here

Examples of org.apache.avalon.fortress.RoleEntry

                              final String role,
                              final String className,
                              final String handlerClassname )
        throws ClassNotFoundException
    {
        final RoleEntry roleEntry = roles.getRoleForShortName( shortname );
        assertNotNull( "RoleEntry for '" + shortname + "' is null", roleEntry );

        assertEquals( "componentClass:",
            roleEntry.getComponentClass(), Class.forName( className ) );
        assertEquals( "Role:", roleEntry.getRole(), role );
        assertEquals( "Handler:",
            roleEntry.getHandlerClass(), Class.forName( handlerClassname ) );
    }
View Full Code Here

Examples of org.apache.avalon.fortress.RoleEntry

     *
     * @return the proper {@link RoleEntry}
     */
    public MetaInfoEntry getMetaInfoForShortName( final String shortname )
    {
        final RoleEntry roleEntry = m_manager.getRoleForShortName( shortname );

        if ( roleEntry != null )
        {
            return new MetaInfoEntry( roleEntry );
        }
View Full Code Here

Examples of org.apache.avalon.fortress.RoleEntry

     *
     * @return the proper {@link RoleEntry}
     */
    public MetaInfoEntry getMetaInfoForClassname( final String classname )
    {
        final RoleEntry roleEntry = m_manager.getRoleForClassname( classname );

        if ( roleEntry != null )
        {
            return new MetaInfoEntry( roleEntry );
        }
View Full Code Here

Examples of org.apache.avalon.fortress.RoleEntry

        {
            getLogger().debug( "addRole role: name='" + shortName + "', role='" + role + "', "
                + "class='" + className + "', handler='" + handlerClassName + "'" );
        }

        final RoleEntry entry = new RoleEntry( role, shortName, clazz, handlerKlass );
        m_shorthands.put( shortName, entry );
        m_classnames.put( className, entry );

        return true;
    }
View Full Code Here

Examples of org.apache.avalon.fortress.RoleEntry

        return PerThreadComponentHandler.class;
    }

    public final RoleEntry getRoleForClassname( final String classname )
    {
        final RoleEntry roleEntry = (RoleEntry) m_classnames.get( classname );
        if ( null != roleEntry )
        {
            return roleEntry;
        }
        else if ( null != m_parent )
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.