Package org.apache.avalon.framework.configuration

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


    /**
     * @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


    /**
     * Save this group
     * @throws AccessControlException if the save failed
     */
    public void save() throws AccessControlException {
        DefaultConfigurationSerializer serializer = new DefaultConfigurationSerializer();
        Configuration config = createConfiguration();
        File xmlfile = getFile();

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

    /**
     * Save the role
     * @throws AccessControlException if the save fails
     */
    public void save() throws AccessControlException {
        DefaultConfigurationSerializer serializer = new DefaultConfigurationSerializer();
        Configuration config = createConfiguration();
        File xmlPath = getConfigurationDirectory();
        File xmlfile = new File(xmlPath, getId() + FileRoleManager.SUFFIX);

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

    /**
     * @see org.apache.lenya.ac.impl.AbstractIPRange#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

     */
    public Configuration getConfiguration() throws SAXException, ConfigurationException {

        if (this.conf == null) return null;
        InterpolatingConfigurationHandler handler = new InterpolatingConfigurationHandler(this.vars, this.conf.getLocation());
        DefaultConfigurationSerializer ser = new DefaultConfigurationSerializer();
        ser.serialize(handler, this.conf);
        return handler.getConfiguration();
    }
View Full Code Here

    void saveStateToStream( OutputStream os ) 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

    //////////////////////////////////////////////////////////////////////////////////////////
    //              Start of Avalon methods
   
    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(SampleResult result) throws Exception {
    if (out != null) {
      if (!isResultMarked(result) && !this.isStats) {
        if (SaveService.isSaveTestLogFormat20()) {
          if (serializer == null)
            serializer = new DefaultConfigurationSerializer();
          out.write(getSerializedSampleResult(result));
        } else {
          SaveService.saveSampleResult(result, out);
        }
      }
View Full Code Here

     */
    public Configuration getConfiguration() throws SAXException, ConfigurationException {

        if (this.conf == null) return null;
        InterpolatingConfigurationHandler handler = new InterpolatingConfigurationHandler(this.vars, this.conf.getLocation());
        DefaultConfigurationSerializer ser = new DefaultConfigurationSerializer();
        ser.serialize(handler, this.conf);
        return handler.getConfiguration();
    }
View Full Code Here

  /**
   * @see org.apache.lenya.cms.ac.IPRange#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.