org.apache.ojb.performance
Class PerfHandle

java.lang.Object
  extended byorg.apache.ojb.performance.PerfHandle
All Implemented Interfaces:
java.lang.Runnable

public abstract class PerfHandle
extends java.lang.Object
implements java.lang.Runnable

Derivate this class to implement a test client for the performance test.

Version:
$Id: PerfHandle.java,v 1.11 2004/04/05 12:16:22 tomdz Exp $
Author:
Armin Waibel

Constructor Summary
PerfHandle(PerfTest test)
           
 
Method Summary
abstract  void deleteArticles(PerfArticle[] arr)
          Delete all given article from the database.
abstract  void deleteArticlesStress(PerfArticle[] arr)
          Delete all given article from the database in a really resource sressing way.
 java.lang.String getTestObjectName()
          The returned name was used as 'articleName' for all created PerfArticles for this thread.
abstract  void init()
          Init the test.
abstract  void insertNewArticles(PerfArticle[] arr)
          Store the given articles to database.
abstract  void insertNewArticlesStress(PerfArticle[] arr)
          Store the given articles to database.
 PerfArticle newPerfArticle()
          Called to get a new instance class of the PerfArticle interface, override this method if you need your own implementation (with default constructor) of the PerfArticle-Interface.
abstract  java.util.Collection readArticlesByCursor(java.lang.String articleName)
          Read all stored articles from the database and return the result as collection of PerfArticles.
 void run()
          Runnable implementation method.
abstract  void tearDown()
          Do clean up.
abstract  void updateArticles(PerfArticle[] arr)
          Update the given articles.
abstract  void updateArticlesStress(PerfArticle[] arr)
          Update the given articles.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PerfHandle

public PerfHandle(PerfTest test)
Method Detail

init

public abstract void init()
                   throws java.lang.Exception
Init the test. do setup stuff here

Throws:
java.lang.Exception

tearDown

public abstract void tearDown()
                       throws java.lang.Exception
Do clean up.

Throws:
java.lang.Exception

insertNewArticles

public abstract void insertNewArticles(PerfArticle[] arr)
                                throws java.lang.Exception
Store the given articles to database. Do optimize performance.

Throws:
java.lang.Exception

insertNewArticlesStress

public abstract void insertNewArticlesStress(PerfArticle[] arr)
                                      throws java.lang.Exception
Store the given articles to database. Implement a really resource stressing way.

Throws:
java.lang.Exception

readArticlesByCursor

public abstract java.util.Collection readArticlesByCursor(java.lang.String articleName)
                                                   throws java.lang.Exception
Read all stored articles from the database and return the result as collection of PerfArticles. Do optimize performance.

Parameters:
articleName - article name used for all PerfArticle created by this instance/thread. Use this name in your query to match all belonging articles
Throws:
java.lang.Exception

deleteArticles

public abstract void deleteArticles(PerfArticle[] arr)
                             throws java.lang.Exception
Delete all given article from the database. Do optimize performance.

Throws:
java.lang.Exception

deleteArticlesStress

public abstract void deleteArticlesStress(PerfArticle[] arr)
                                   throws java.lang.Exception
Delete all given article from the database in a really resource sressing way.

Throws:
java.lang.Exception

updateArticles

public abstract void updateArticles(PerfArticle[] arr)
                             throws java.lang.Exception
Update the given articles. Do optimize performance.

Throws:
java.lang.Exception

updateArticlesStress

public abstract void updateArticlesStress(PerfArticle[] arr)
                                   throws java.lang.Exception
Update the given articles. Implement a really resource stressing way.

Throws:
java.lang.Exception

newPerfArticle

public PerfArticle newPerfArticle()
Called to get a new instance class of the PerfArticle interface, override this method if you need your own implementation (with default constructor) of the PerfArticle-Interface.
By default this method returns a new instance of the PerfArticleImpl class.


getTestObjectName

public java.lang.String getTestObjectName()
The returned name was used as 'articleName' for all created PerfArticles for this thread. This allows an easy build of the query statement to match the created PerfArticle for this instance/thread.


run

public void run()
Runnable implementation method.

Specified by:
run in interface java.lang.Runnable


(C) 2002 - 2004 Apache Software Foundation
All rights reserved. Published under the Apache License 2.0.
http://db.apache.org/ojb
Version: 1.0.3, 2005-04-2