getLogger().info( "writing to temp file: " + file );
getLogger().debug( "writing to temp file: " + file );
    public void flush() throws IOException    {        synchronized( getLock() )        {            if( null == m_url )            {                return;            }                        File file = File.createTempFile( "dpml-station", ".xml" );            getLogger().info( "writing to temp file: " + file );            file.createNewFile();            FileOutputStream output = new FileOutputStream( file );            Entry[] entries = getEntries();            RegistryDescriptor descriptor = new RegistryDescriptor( entries );            RegistryWriter writer = new RegistryWriter();            writer.writeRegistryDescriptor( descriptor, output, "" );            FileInputStream input = new FileInputStream( file );            OutputStream dest = m_url.openConnection().getOutputStream();            StreamUtils.copyStream( input, dest, true );            getLogger().debug( "updated registry: " + m_url );            /*            ClassLoader current = Thread.currentThread().getContextClassLoader();            ClassLoader context = StartupPolicy.class.getClassLoader();            Thread.currentThread().setContextClassLoader( context );            File file = File.createTempFile( "dpml-station", ".xml" );            FileOutputStream output = new FileOutputStream( file );            Entry[] entries = getEntries();                        RegistryDescriptor descriptor = new RegistryDescriptor( entries );            BufferedOutputStream buffer = new BufferedOutputStream( output );            XMLEncoder encoder = new XMLEncoder( buffer );            encoder.setExceptionListener( new RegistryEncoderListener() );            try            {                encoder.writeObject( descriptor );            }            catch( Throwable e )            {                final String error =                   "Encoding error.\n"                  + context.toString();                getLogger().error( error, e );                IOException exception = new IOException( error );                exception.initCause( e );                throw exception;            }            finally            {                encoder.close();                Thread.currentThread().setContextClassLoader( current );            }                        FileInputStream input = new FileInputStream( file );            OutputStream dest = m_url.openConnection().getOutputStream();            StreamUtils.copyStream( input, dest, true );            getLogger().debug( "updated registry: " + m_url );            */        }    }