public void decommision()

in src/java/org/apache/fulcrum/yaafi/framework/component/AvalonServiceComponentImpl.java [204:246]


    public void decommision() throws Exception
    {
        this.getParentLogger().debug( "Decommisioning the service " + this.getShorthand() );

        try
        {
            this.stop();
        }
        catch (Throwable e)
        {
            String msg = "Stopping the following service failed : " + this.getShorthand();
            this.getParentLogger().error( msg, e );
        }

        try
        {
            Object rawInstance = this.getRawInstance(false);

            // dispose the service implementation class

            if( rawInstance instanceof Disposable )
            {
                try
                {
                    this.getParentLogger().debug( "Disposable.dispose() for " + this.getShorthand() );
                    ((Disposable) rawInstance).dispose();
                }
                catch (Exception e)
                {
                    String msg = "Disposing the following service failed : " + this.getShorthand();
                    this.getParentLogger().error(msg,e);
                    throw new RuntimeException(msg);
                }
            }
        }
        catch (Throwable e)
        {
            String msg = "Disposing the following service failed : " + this.getShorthand();
            this.getParentLogger().error( msg, e );
        }

        super.decommision();
    }