public void reconfigure()

in src/java/org/apache/fulcrum/yaafi/framework/component/AvalonServiceComponentImpl.java [145:198]


    public void reconfigure() throws Exception
    {
        Throwable lastThrowable = null;

        this.getParentLogger().debug( "Reconfiguring " + this.getShorthand() );

        try
        {
            this.suspend();
        }
        catch (Throwable t)
        {
            String msg = "Suspending the following service failed : " + this.getShorthand();
            this.getParentLogger().error( msg, t );
            lastThrowable = t;
        }

        try
        {
            if( this.getConfiguration() != null )
            {
                this.reconfigure( this.getConfiguration() );
            }
        }
        catch (Throwable t)
        {
            String msg = "Reconfiguring the following service failed : " + this.getShorthand();
            this.getParentLogger().error( msg, t );
            lastThrowable = t;
        }

        try
        {
            this.resume();
        }
        catch (Throwable t)
        {
            String msg = "Resuming the following service failed : " + this.getShorthand();
            this.getParentLogger().error( msg, t );
            lastThrowable = t;
        }

        if( lastThrowable != null )
        {
            if( lastThrowable instanceof Exception )
            {
                throw (Exception) lastThrowable;
            }
            else
            {
                throw new RuntimeException( lastThrowable.getMessage() );
            }
        }
    }