Package org.codehaus.loom.extension

Examples of org.codehaus.loom.extension.Extension


        scanDependencies( required, available, dependencies, unsatisfied );

        if( 0 != unsatisfied.size() )
        {
            final Extension extension =
                (Extension)unsatisfied.iterator().next();
            throw new UnsatisfiedExtensionException( extension );
        }

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


    {
        //Check to see if extension is satisifed by the
        //list of available extensions passed in
        for( int i = 0; i < available.length; i++ )
        {
            final Extension other = available[ i ];
            if( other.isCompatibleWith( required ) )
            {
                return;
            }
        }
View Full Code Here

        if( optionalPackage.getAvailableExtensions().length == 0 )
        {
            return;
        }

        final Extension extension = optionalPackage.getAvailableExtensions()[ 0 ];
        ArrayList candidates = (ArrayList)m_packages.get(
            extension.getExtensionName() );
        if( null == candidates )
        {
            candidates = new ArrayList();
            m_packages.put( extension.getExtensionName(), candidates );
        }

        candidates.add( optionalPackage );
    }
View Full Code Here

    public int compare( final Object o1,
                        final Object o2 )
    {
        final OptionalPackage pkg1 = (OptionalPackage)o1;
        final OptionalPackage pkg2 = (OptionalPackage)o2;
        final Extension e1 = getMatchingExtension( pkg1 );
        final Extension e2 = getMatchingExtension( pkg2 );
        int result = compareSpecVersion( e1, e2 );
        if( 0 != result )
        {
            return result;
        }
View Full Code Here

    private Extension getMatchingExtension( final OptionalPackage pkg )
    {
        final Extension[] extensions = pkg.getAvailableExtensions();
        for( int i = 0; i < extensions.length; i++ )
        {
            final Extension extension = extensions[ i ];
            if( extension.getExtensionName().equals( m_name ) )
            {
                return extension;
            }
        }
View Full Code Here

        final ArrayList extensions = new ArrayList();

        final int length = configs.getLength();
        for( int i = 0; i < length; i++ )
        {
            final Extension extension =
                buildExtension( (Element)configs.item( i ) );
            extensions.add( extension );
        }

        return (Extension[])extensions.toArray(
View Full Code Here

        final String implVendorID =
            config.getAttribute( "implementation-vendor-id" );
        final String implURL =
            config.getAttribute( "implementation-url" );

        return new Extension( name, specVersion, specVendor,
                              implVersion, implVendor, implVendorID,
                              implURL );
    }
View Full Code Here

        if( 0 != size )
        {
            final Iterator iterator = unsatisfied.iterator();
            while( iterator.hasNext() )
            {
                final Extension extension = (Extension)iterator.next();
                final Object[] params = new Object[]
                {
                    extension.getExtensionName(),
                    extension.getSpecificationVendor(),
                    extension.getSpecificationVersion(),
                    extension.getImplementationVendor(),
                    extension.getImplementationVendorID(),
                    extension.getImplementationVersion(),
                    extension.getImplementationURL()
                };
                final String message = REZ.format( "missing.extension",
                                                   params );
                warn( message );
            }
View Full Code Here

                                    implVersion2 );
        final OptionalPackage[] pkgs = getOptionalPackages( manager );

        assertEquals( "pkgs.length", 2, pkgs.length );

        final Extension extension1 = pkgs[ 0 ].getAvailableExtensions()[ 0 ];
        final Extension extension2 = pkgs[ 1 ].getAvailableExtensions()[ 0 ];
        assertEquals( "pkgs[0].vendor",
                      vendor1,
                      extension1.getImplementationVendor() );
        assertEquals( "pkgs[1].vendor",
                      vendor2,
                      extension2.getImplementationVendor() );
    }
View Full Code Here

    private OptionalPackage[] getOptionalPackages(
        final ExtensionManager manager )
    {
        return manager.getOptionalPackages(
            new Extension( NAME, null, null, null, null, null, null ) );
    }
View Full Code Here

TOP

Related Classes of org.codehaus.loom.extension.Extension

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.