Package javolution.xml

Examples of javolution.xml.XMLObjectWriter


    }
  }

  public void store() {
    try {
      XMLObjectWriter writer = XMLObjectWriter.newInstance(new FileOutputStream(persistFile.toString()));
      writer.setBinding(binding);
      // Enables cross-references.
      // writer.setReferenceResolver(new XMLReferenceResolver());
      writer.setIndentation(TAB_INDENT);

            writer.write(this.connectDelay, CONNECT_DELAY_PROP, Integer.class);
            writer.write(this.workerThreads, WORKER_THREADS_PROP, Integer.class);
            writer.write(this.singleThread, SINGLE_THREAD_PROP, Boolean.class);

      writer.write(this.servers, SERVERS, FastList.class);
      writer.write(this.associations, ASSOCIATIONS, AssociationMap.class);

      writer.close();
    } catch (Exception e) {
      logger.error("Error while persisting the Rule state in file", e);
    }
  }
View Full Code Here


        /** ensure we can work undisturbed */
        synchronized (cm)
        {
            /** get the snapshot construct */
            this.processExport(name, binding);
            XMLObjectWriter writer = openWriter(exportFileName);
            writer.setBinding(binding);

            if (this.getDefaultIndent() != null)
                writer.setIndentation(this.getDefaultIndent());

            try
            {
                logMe("*********Writing data*********");
                writer.write(getSnapshot(),  getSerializerDataTag(),
                    getSerializerDataClass());

            } catch (Exception e)
            {
                throw new SerializerException(
                        SerializerException.FILE_PROCESSING_ERROR
                                .create(new String[]
                                { exportFileName, e.getMessage()}));
            } finally
            {
                /** ensure the writer is closed */
                try
                {
                    logMe("*********closing up********");
                    writer.close();
                } catch (Exception e)
                {
                    logMe("Error in closing writer " + e.getMessage());
                    /**
                     * don't do anything with this exception - never let the
View Full Code Here

                f.renameTo(ftemp);
            }
        }
        try
        {
            XMLObjectWriter writer = XMLObjectWriter
                    .newInstance(new FileOutputStream(filename));
            return writer;
        } catch (Exception e)
        {
            throw new SerializerException(SerializerException.FILE_WRITER_ERROR
View Full Code Here

                f.renameTo(ftemp);
            }
        }
        try
        {
            XMLObjectWriter writer = XMLObjectWriter
                    .newInstance(new FileOutputStream(filename));
            return writer;
        } catch (Exception e)
        {
            throw new SerializerException(SerializerException.FILE_WRITER_ERROR
View Full Code Here

        /** ensure we can work undisturbed */
        synchronized (sem)
        {
            /** get the snapshot construct */
            this.processExport(name, binding);
            XMLObjectWriter writer = openWriter(exportFileName);
            writer.setBinding(binding);

            if (this.getDefaultIndent() != null)
                writer.setIndentation(this.getDefaultIndent());

            try
            {
                logMe("*********Writing data*********");
                writer.write(getSnapshot(),  getSerializerDataTag(),
                    getSerializerDataClass());

            } catch (Exception e)
            {
                throw new SerializerException(
                        SerializerException.FILE_PROCESSING_ERROR
                                .create(new String[]
                                { exportFileName, e.getMessage()}));
            } finally
            {
                /** ensure the writer is closed */
                try
                {
                    logMe("*********closing up********");
                    writer.close();
                } catch (Exception e)
                {
                    logMe("Error in closing writer " + e.getMessage());
                    /**
                     * don't do anything with this exception - never let the
View Full Code Here

   * @param didl
   * @throws XMLStreamException
   */

  public void marshall(D didl, OutputStream out, String encoding) throws XMLStreamException {
    XMLObjectWriter writer = encoding != null ? XMLObjectWriter.newInstance(out, encoding) : XMLObjectWriter.newInstance(out);
    if(indentation != null) {
      writer.setIndentation(indentation);
    }

    writer.setBinding(binding);
    try {
      writer.write(didl);
      writer.flush();
    } finally {
      writer.close();
    }
  }
View Full Code Here

      writer.close();
    }
  }
 
  public void marshall(D didl, Writer writer) throws XMLStreamException {
    XMLObjectWriter xmlObjectWriter = XMLObjectWriter.newInstance(writer);
    if(indentation != null) {
      xmlObjectWriter.setIndentation(indentation);
    }

    xmlObjectWriter.setBinding(binding);
    try {
      xmlObjectWriter.write(didl);
      xmlObjectWriter.flush();
    } finally {
      xmlObjectWriter.close();
    }
  }
View Full Code Here

        /** ensure we can work undisturbed */
        synchronized (cm)
        {
            /** get the snapshot construct */
            this.processExport(name, binding);
            XMLObjectWriter writer = openWriter(exportFileName);
            writer.setBinding(binding);

            if (this.getDefaultIndent() != null)
                writer.setIndentation(this.getDefaultIndent());

            try
            {
                logMe("*********Writing data*********");
                writer.write(getSnapshot(),  getSerializerDataTag(),
                    getSerializerDataClass());

            } catch (Exception e)
            {
                throw new SerializerException(
                        SerializerException.FILE_PROCESSING_ERROR
                                .create(new String[]
                                { exportFileName, e.getMessage()}));
            } finally
            {
                /** ensure the writer is closed */
                try
                {
                    logMe("*********closing up********");
                    writer.close();
                } catch (Exception e)
                {
                    logMe("Error in closing writer " + e.getMessage());
                    /**
                     * don't do anything with this exception - never let the
View Full Code Here

                f.renameTo(ftemp);
            }
        }
        try
        {
            XMLObjectWriter writer = XMLObjectWriter
                    .newInstance(new FileOutputStream(filename));
            return writer;
        } catch (Exception e)
        {
            throw new SerializerException(SerializerException.FILE_WRITER_ERROR
View Full Code Here

        /** ensure we can work undisturbed */
        synchronized (sem)
        {
            /** get the snapshot construct */
            this.processExport(name, binding);
            XMLObjectWriter writer = openWriter(exportFileName);
            writer.setBinding(binding);

            if (this.getDefaultIndent() != null)
                writer.setIndentation(this.getDefaultIndent());

            try
            {
                logMe("*********Writing data*********");
                writer.write(getSnapshot(),  getSerializerDataTag(),
                    getSerializerDataClass());

            } catch (Exception e)
            {
                throw new SerializerException(
                        SerializerException.FILE_PROCESSING_ERROR
                                .create(new String[]
                                { exportFileName, e.getMessage()}));
            } finally
            {
                /** ensure the writer is closed */
                try
                {
                    logMe("*********closing up********");
                    writer.close();
                } catch (Exception e)
                {
                    logMe("Error in closing writer " + e.getMessage());
                    /**
                     * don't do anything with this exception - never let the
View Full Code Here

TOP

Related Classes of javolution.xml.XMLObjectWriter

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.