Package org.codehaus.plexus.registry

Examples of org.codehaus.plexus.registry.Registry


    }

    private Configuration load()
    {
        // TODO: should this be the same as section? make sure unnamed sections still work (eg, sys properties)
        Registry subset = registry.getSubset( KEY );
        if ( subset.getString( "version" ) == null )
        {
            // a little autodetection of v1, even if version is omitted (this was previously allowed)
            if ( subset.getSubset( "repositoryScanning" ).isEmpty() )
            {
                // only for empty, or v < 1
                subset = readDefaultConfiguration();
            }
        }
View Full Code Here


    }

    public void save( Configuration configuration )
        throws RegistryException, IndeterminateConfigurationException
    {
        Registry section = registry.getSection( KEY + ".user" );
        if ( section == null )
        {
            section = registry.getSection( KEY + ".base" );
            if ( section == null )
            {
                section = createDefaultConfigurationFile();
            }
        }
        else if ( registry.getSection( KEY + ".base" ) != null )
        {
            this.configuration = null;

            throw new IndeterminateConfigurationException(
                "Configuration can not be saved when it is loaded from two sources" );
        }

        new ConfigurationRegistryWriter().write( configuration, section );
        section.save();

        this.configuration = configuration;
    }
View Full Code Here

        listeners.add( listener );
    }

    private void addRegistryChangeListener( RegistryListener listener )
    {
        Registry section = registry.getSection( KEY + ".user" );
        if ( section != null )
        {
            section.addChangeListener( listener );
        }
        section = registry.getSection( KEY + ".base" );
        if ( section != null )
        {
            section.addChangeListener( listener );
        }
    }
View Full Code Here

    }

    public void save( Configuration configuration )
        throws RegistryException
    {
        Registry section = registry.getSection( KEY + ".user" );
        if ( section == null )
        {
            section = registry.getSection( KEY + ".base" );
        }
        new ConfigurationRegistryWriter().write( configuration, section );
        section.save();

        this.configuration = configuration;
    }
View Full Code Here

        this.configuration = configuration;
    }

    public void addChangeListener( RegistryListener listener )
    {
        Registry section = registry.getSection( KEY + ".user" );
        if ( section != null )
        {
            section.addChangeListener( listener );
        }
        section = registry.getSection( KEY + ".base" );
        if ( section != null )
        {
            section.addChangeListener( listener );
        }
    }
View Full Code Here

    }

    private Configuration load()
    {
        // TODO: should this be the same as section? make sure unnamed sections still work (eg, sys properties)
        Registry subset = registry.getSubset( KEY );
        if ( subset.getString( "version" ) == null )
        {
            // a little autodetection of v1, even if version is omitted (this was previously allowed)
            if ( subset.getSubset( "repositoryScanning" ).isEmpty() )
            {
                // only for empty, or v < 1
                subset = readDefaultConfiguration();
            }
        }
View Full Code Here

    }

    public synchronized void save( Configuration configuration )
        throws RegistryException, IndeterminateConfigurationException
    {
        Registry section = registry.getSection( KEY + ".user" );
        Registry baseSection = registry.getSection( KEY + ".base" );
        if ( section == null )
        {
            section = baseSection;
            if ( section == null )
            {
                section = createDefaultConfigurationFile();
            }
        }
        else if ( baseSection != null )
        {
            Collection keys = baseSection.getKeys();
            boolean foundList = false;
            for ( Iterator i = keys.iterator(); i.hasNext() && !foundList; )
            {
                String key = (String) i.next();
View Full Code Here

        listeners.add( listener );
    }

    private void addRegistryChangeListener( RegistryListener listener )
    {
        Registry section = registry.getSection( KEY + ".user" );
        if ( section != null )
        {
            section.addChangeListener( listener );
        }
        section = registry.getSection( KEY + ".base" );
        if ( section != null )
        {
            section.addChangeListener( listener );
        }
    }
View Full Code Here

    }

    private Configuration load()
    {
        // TODO: should this be the same as section? make sure unnamed sections still work (eg, sys properties)
        Registry subset = registry.getSubset( KEY );
        if ( subset.getString( "version" ) == null )
        {
            // a little autodetection of v1, even if version is omitted (this was previously allowed)
            if ( subset.getSubset( "repositoryScanning" ).isEmpty() )
            {
                // only for empty, or v < 1
                subset = readDefaultConfiguration();
            }
        }
View Full Code Here

    }

    public synchronized void save( Configuration configuration )
        throws RegistryException, IndeterminateConfigurationException
    {
        Registry section = registry.getSection( KEY + ".user" );
        Registry baseSection = registry.getSection( KEY + ".base" );
        if ( section == null )
        {
            section = baseSection;
            if ( section == null )
            {
                section = createDefaultConfigurationFile();
            }
        }
        else if ( baseSection != null )
        {
            Collection<String> keys = baseSection.getKeys();
            boolean foundList = false;
            for ( Iterator<String> i = keys.iterator(); i.hasNext() && !foundList; )
            {
                String key = i.next();
View Full Code Here

TOP

Related Classes of org.codehaus.plexus.registry.Registry

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.