Package org.apache.avalon.framework.configuration

Examples of org.apache.avalon.framework.configuration.DefaultConfigurationSerializer


        throws Exception
    {
        Configuration stateConfig = saveStateToConfiguration();

        // Ride on top of the Configuration classes to save the state.
        DefaultConfigurationSerializer serializer = new DefaultConfigurationSerializer();
        serializer.setIndent( true );
        serializer.serialize( os, stateConfig );
    }
View Full Code Here


     * No-arg constructor.
     */
    public ResultCollector()
    {
        current = -1;
        serializer = new DefaultConfigurationSerializer();
        setErrorLogging(false);
    }
View Full Code Here

        public static void saveSubTree(HashTree subTree,OutputStream writer) throws
                        IOException
        {
                Configuration config = (Configuration)getConfigsFromTree(subTree).get(0);
                DefaultConfigurationSerializer saver = new DefaultConfigurationSerializer();
                saver.setIndent(true);
                try
                {
                        saver.serialize(writer,config);
                }
                catch(SAXException e)
                {
                        throw new IOException("SAX implementation problem");
                }
View Full Code Here

                result.setSaveConfig(config);
                try {
                    if (config.saveAsXml()) {
                        if (SaveService.isSaveTestLogFormat20()) {
                            if (serializer == null) {
                                serializer = new DefaultConfigurationSerializer();
                            }
                            out.write(OldSaveService.getSerializedSampleResult(result, serializer, config));
                        } else { // !LogFormat20
                            SaveService.saveSampleResult(event, out);
                        }
View Full Code Here

            removeChildren(config.getMutableChild(ELEMENT_MODULES), ELEMENT_MODULE);
            removeChildren(config.getMutableChild(ELEMENT_RESOURCE_TYPES), ELEMENT_RESOURCE_TYPE);

            OutputStream oStream = configSource.getOutputStream();
            new DefaultConfigurationSerializer().serialize(oStream, config);
            if (oStream != null) {
                oStream.flush();
                try {
                    oStream.close();
                } catch (Throwable t) {
View Full Code Here

        DefaultConfiguration config = new DefaultConfiguration("root", "");
        config.setAttribute( "attribute", "value" );
       
        File file = new File( testDirectory, "DefaultConfigurationSerializerTestCase.xml" );
       
        DefaultConfigurationSerializer serializer = new DefaultConfigurationSerializer();
        serializer.serializeToFile( file, config );
       
        //
        // This will not work if the serializeToFile method keeps the stream open.
        //
        assertTrue( testDirectory.renameTo( testDirectory2 ) );
View Full Code Here

        DefaultConfiguration config = new DefaultConfiguration("root", "");
        config.setAttribute( "attribute", "value" );
       
        File file = new File( testDirectory, "DefaultConfigurationSerializerTestCase.xml" );
       
        DefaultConfigurationSerializer serializer = new DefaultConfigurationSerializer();
        serializer.serializeToFile( file, config );
       
        //
        // This will not work if the serializeToFile method keeps the stream open.
        //
        assertTrue( testDirectory.renameTo( testDirectory2 ) );
View Full Code Here

  }

   
    public static void saveSubTree(HashTree subTree, OutputStream writer) throws IOException {
    Configuration config = (Configuration) getConfigsFromTree(subTree).get(0);
    DefaultConfigurationSerializer saver = new DefaultConfigurationSerializer();

    saver.setIndent(true);
    try {
      saver.serialize(writer, config);
    } catch (SAXException e) {
      throw new IOException("SAX implementation problem");
    } catch (ConfigurationException e) {
      throw new IOException("Problem using Avalon Configuration tools");
    }
View Full Code Here

  private void recordResult(SampleEvent event) throws Exception {
    SampleResult result = event.getResult();
    if (!isResultMarked(result) && !this.isStats) {
      if (SaveService.isSaveTestLogFormat20()) {
        if (serializer == null) {
          serializer = new DefaultConfigurationSerializer();
        }
        out.write(OldSaveService.getSerializedSampleResult(result, serializer, getSaveConfig()));
      } else {
        SaveService.saveSampleResult(event, out);
      }
View Full Code Here

    /**
     * @see org.apache.lenya.ac.User#save()
     */
    public void save() throws AccessControlException {
        DefaultConfigurationSerializer serializer = new DefaultConfigurationSerializer();
        Configuration config = createConfiguration();

        try {
            serializer.serializeToFile(getFile(), config);
        } catch (Exception e) {
            throw new AccessControlException(e);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.avalon.framework.configuration.DefaultConfigurationSerializer

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.