private void writeFile(TimerImpl timer) { final File file = fileName(timer.getTimedObjectId(), timer.getId()); //if the timer is expired or cancelled delete the file if (timer.getState() == TimerState.CANCELED || timer.getState() == TimerState.EXPIRED) { if (file.exists()) { file.delete(); } return; } try { FileOutputStream out = new FileOutputStream(file); try { XMLStreamWriter writer = XMLOutputFactory.newInstance().createXMLStreamWriter(out); XMLMapper mapper = createMapper(timer.getTimerService()); mapper.deparseDocument(new EjbTimerXmlPersister(factory, configuration), Collections.singletonList(timer), writer); writer.flush(); writer.close(); } finally { safeClose(out); } } catch (Exception e) { throw new RuntimeException(e); } }
public static void marshal(final Writer writer, final BundledPatch patches) throws XMLStreamException { final XMLOutputFactory outputFactory = OUTPUT_FACTORY; final XMLStreamWriter streamWriter = outputFactory.createXMLStreamWriter(writer); MAPPER.deparseDocument(XML1_0, patches, streamWriter); streamWriter.close(); }
public static void marshal(final Writer writer, final Patch patch) throws XMLStreamException { final XMLOutputFactory outputFactory = OUTPUT_FACTORY; final XMLStreamWriter streamWriter = outputFactory.createXMLStreamWriter(writer); final XMLElementWriter<?> xmlWriter = XML1_0; MAPPER.deparseDocument(xmlWriter, patch, streamWriter); streamWriter.close(); }
public static void marshal(final Writer writer, final BundledPatch patches) throws XMLStreamException { final XMLOutputFactory outputFactory = OUTPUT_FACTORY; final XMLStreamWriter streamWriter = outputFactory.createXMLStreamWriter(writer); MAPPER.deparseDocument(XML1_0, patches, streamWriter); streamWriter.close(); }
public static void marshal(final Writer writer, final Patch patch) throws XMLStreamException { final XMLOutputFactory outputFactory = OUTPUT_FACTORY; final XMLStreamWriter streamWriter = outputFactory.createXMLStreamWriter(writer); final XMLElementWriter<?> xmlWriter = XML1_0; MAPPER.deparseDocument(xmlWriter, patch, streamWriter); streamWriter.close(); }
public static void marshal(final OutputStream os, final BundledPatch patches) throws XMLStreamException { final XMLOutputFactory outputFactory = OUTPUT_FACTORY; final XMLStreamWriter streamWriter = outputFactory.createXMLStreamWriter(os); MAPPER.deparseDocument(XML1_0, patches, streamWriter); streamWriter.close(); }
public static void marshal(final OutputStream os, final BundledPatch patches) throws XMLStreamException { final XMLOutputFactory outputFactory = OUTPUT_FACTORY; final XMLStreamWriter streamWriter = outputFactory.createXMLStreamWriter(os); MAPPER.deparseDocument(XML1_0, patches, streamWriter); streamWriter.close(); }
protected static void marshal(final OutputStream os, final Patch patch, final XMLElementWriter<? extends Patch> xmlWriter) throws XMLStreamException { final XMLOutputFactory outputFactory = OUTPUT_FACTORY; final XMLStreamWriter streamWriter = outputFactory.createXMLStreamWriter(os); MAPPER.deparseDocument(xmlWriter, patch, streamWriter); streamWriter.close(); }
protected static void marshal(final OutputStream os, final Patch patch, final XMLElementWriter<? extends Patch> xmlWriter) throws XMLStreamException { final XMLOutputFactory outputFactory = OUTPUT_FACTORY; final XMLStreamWriter streamWriter = outputFactory.createXMLStreamWriter(os); MAPPER.deparseDocument(xmlWriter, patch, streamWriter); streamWriter.close(); }
public static void marshal(final Writer writer, final Distribution root) throws XMLStreamException { final XMLOutputFactory outputFactory = OUTPUT_FACTORY; final XMLStreamWriter streamWriter = outputFactory.createXMLStreamWriter(writer); MAPPER.deparseDocument(INSTANCE, root, streamWriter); streamWriter.close(); }
public static void marshal(final OutputStream os, final Distribution root) throws XMLStreamException { final XMLOutputFactory outputFactory = OUTPUT_FACTORY; final XMLStreamWriter streamWriter = outputFactory.createXMLStreamWriter(os); MAPPER.deparseDocument(INSTANCE, root, streamWriter); streamWriter.close(); }
mapper.deparseDocument(rootDeparser, extensibleModel, streamWriter); streamWriter.close(); } finally {
mapper.deparseDocument(rootDeparser, extensibleModel, streamWriter); streamWriter.close(); } finally {
mapper.deparseDocument(rootDeparser, extensibleModel, streamWriter); streamWriter.close(); } finally {
mapper.deparseDocument(rootDeparser, extensibleModel, streamWriter); streamWriter.close(); } finally {