com.ebmwebsourcing.easycommons.xml
Class XMLOutputFactories

java.lang.Object
  extended by com.ebmwebsourcing.easycommons.xml.XMLOutputFactories

public final class XMLOutputFactories
extends Object

A static pool of XMLOutputFactory to improve XMLOutputFactory creation efficiency. A XMLOutputFactory is initialized the first time this class is used. An infinite number (integer maximum value) of XMLOutputFactory may be created. They are never evicted.

Author:
Nicolas Oddoux - EBM WebSourcing

Constructor Summary
XMLOutputFactories()
           
 
Method Summary
static XMLStreamWriter createXMLStreamWriter(OutputStream outputStream)
          Create a XMLStreamWriter from a specified OutputStream by using the pool of XMLOutputFactory
static void releaseXMLOutputFactory(XMLOutputFactory xmlOutputFactory)
          Release a XMLOutputFactory to the pool
static XMLOutputFactory takeXMLOutputFactory()
          Take a XMLOutputFactory from the pool
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLOutputFactories

public XMLOutputFactories()
Method Detail

takeXMLOutputFactory

public static final XMLOutputFactory takeXMLOutputFactory()
                                                   throws PoolException
Take a XMLOutputFactory from the pool

Returns:
one XMLOutputFactory
Throws:
PoolException - if the current thread waits for a XMLOutputFactory of the pool and is interrupted

releaseXMLOutputFactory

public static final void releaseXMLOutputFactory(XMLOutputFactory xmlOutputFactory)
Release a XMLOutputFactory to the pool

Parameters:
xmlOutputFactory - a XMLOutputFactory to release

createXMLStreamWriter

public static final XMLStreamWriter createXMLStreamWriter(OutputStream outputStream)
                                                   throws XMLStreamException
Create a XMLStreamWriter from a specified OutputStream by using the pool of XMLOutputFactory

Parameters:
outputStream - an OutputStream
Returns:
the XMLStreamWriter
Throws:
XMLStreamException - if an unexpected processing errors occurs


Copyright © 2012 Petals Link. All Rights Reserved.