org.ow2.petals.component.framework.util
Class JVMDocumentBuilders

java.lang.Object
  extended by org.ow2.petals.component.framework.util.JVMDocumentBuilders

public final class JVMDocumentBuilders
extends java.lang.Object

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


Constructor Summary
JVMDocumentBuilders()
           
 
Method Summary
static org.w3c.dom.Document newDocument()
          Create a new Document (with a JVM DocumentBuilder of the pool)
static void releaseJVMDocumentBuilder(javax.xml.parsers.DocumentBuilder jvmDocumentBuilder)
          Release a JVM DocumentBuilder to the pool
static javax.xml.parsers.DocumentBuilder takeJVMDocumentBuilder()
          Take a JVM DocumentBuilder from the pool
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JVMDocumentBuilders

public JVMDocumentBuilders()
Method Detail

takeJVMDocumentBuilder

public static final javax.xml.parsers.DocumentBuilder takeJVMDocumentBuilder()
                                                                      throws com.ebmwebsourcing.easycommons.pooling.PoolException
Take a JVM DocumentBuilder from the pool

Returns:
one JVM DocumentBuilder
Throws:
com.ebmwebsourcing.easycommons.pooling.PoolException - if the current thread waits for a JVM DocumentBuilder of the pool and is interrupted

releaseJVMDocumentBuilder

public static final void releaseJVMDocumentBuilder(javax.xml.parsers.DocumentBuilder jvmDocumentBuilder)
Release a JVM DocumentBuilder to the pool

Parameters:
jvmDocumentBuilder - a JVM DocumentBuilder to release

newDocument

public static final org.w3c.dom.Document newDocument()
Create a new Document (with a JVM DocumentBuilder of the pool)

Returns:
a new Document
Throws:
com.ebmwebsourcing.easycommons.pooling.PoolException - if the current thread waits for a JVM DocumentBuilder of the pool and is interrupted


Copyright © 2005-2011 Petals Link (EBM Websourcing). All Rights Reserved.