Apache JMeter
1.9

org.apache.jmeter.protocol.http.util
Class DOMPool

java.lang.Object
  |
  +--org.apache.jmeter.protocol.http.util.DOMPool

public class DOMPool
extends Object

Title: JMeter Access Log utilities
Copyright: Apache.org
Company: nobody
License:

Look at the apache license at the top.

Description:

The purpose of this class is to cache the DOM Documents in memory and by-pass parsing. For old systems or laptops, it's not practical to parse the XML documents every time. Therefore using a memory cache can reduce the CPU usage .

For now this is a simple version to test the feasibility of caching. If it works, this class will be replaced with an Apache commons or something equivalent. If I was familiar with Apache Commons Pool, I would probably use it, but since I don't know the API, it is quicker for Proof of Concept to just write a dumb one. If the number documents in the pool exceed several hundred, it will take a long time for the lookup.

Author: Peter Lin
Version: 0.1
Created on: Jun 17, 2003
Last Modified: 4:59:07 PM


Field Summary
protected static HashMap MEMCACHE
          The cache is created with an initial size of 50.
 
Constructor Summary
DOMPool()
           
 
Method Summary
static org.w3c.dom.Document getDocument(Object key)
          return a document
static void putDocument(Object key, Object data)
          add an object to the cache
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MEMCACHE

protected static HashMap MEMCACHE
The cache is created with an initial size of 50. Running a webservice test on an old system will likely run into memory or CPU problems long before the HashMap is an issue.

Constructor Detail

DOMPool

public DOMPool()
Method Detail

getDocument

public static org.w3c.dom.Document getDocument(Object key)
return a document

Returns:
Document

putDocument

public static void putDocument(Object key,
                               Object data)
add an object to the cache


Apache JMeter
1.9

Copyright © 1998-2003 Apache Software Foundation. All Rights Reserved.