Package org.codehaus.plexus.registry

Examples of org.codehaus.plexus.registry.Registry


        registryListeners.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


    @SuppressWarnings( "unchecked" )
    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

    @SuppressWarnings( "unchecked" )
    public synchronized void save( Configuration configuration )
        throws IndeterminateConfigurationException, RegistryException
    {
        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

            addRegistryChangeListener( regListener );
        }

        triggerEvent( ConfigurationEvent.SAVED );

        Registry section = registry.getSection( KEY + ".user" );
        return section == null ? new CommonsConfigurationRegistry( new BaseConfiguration( ) ) : section;
    }
View Full Code Here

        registryListeners.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

  
    public String getGuest()
    {
        if( guest == null || "".equals( guest ) )
        {
            Registry subset = registry.getSubset( KEY );
            guest = subset.getString( "redback.default.guest", ArchivaRoleConstants.PRINCIPAL_GUEST );
        }
       
        return guest;
    }
View Full Code Here

    // ------------------------------------------------
   
    public void initialize()
        throws InitializationException
    {
        Registry continuumRegistry = getContinuumRegistry();
        if (continuumRegistry != null)
        {
            this.footer = continuumRegistry.getString( FOOTER_REGISTRY_KEY );
        }

        if ( StringUtils.isEmpty( this.footer ) )
        {
            // initiate with default footer (save in registry ?)
View Full Code Here

     * @see org.apache.maven.continuum.web.appareance.AppareanceConfiguration#saveFooter(java.lang.String)
     */
    public void saveFooter( String footerHtmlContent )
        throws RegistryException
    {
        Registry continuumRegistry = getContinuumRegistry();
       
        continuumRegistry.setString( FOOTER_REGISTRY_KEY, footerHtmlContent );
        continuumRegistry.save();
        this.footer = footerHtmlContent;
    }
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.