com.triactive.jdo.enhance
Class Enhancer

java.lang.Object
  extended bycom.triactive.jdo.enhance.Enhancer
Direct Known Subclasses:
SunReferenceEnhancer

public abstract class Enhancer
extends java.lang.Object

Abstract class for JDO bytecode enhancement utility. The expected command-line syntax is:

java com.triactive.jdo.enhance.Enhancer JDO-metadata-filename ...
Every class listed in the given metadata file(s) should be made persistence capable via bytecode enhancement. This class must be subclassed with an implementation that uses a working bytecode enhancer. The key method that needs to be overridden and implemented is callExternalEnhancer(String[]).


Constructor Summary
protected Enhancer()
          Protected constructor to prevent outside instantiation.
 
Method Summary
protected abstract  int callExternalEnhancer(java.lang.String[] classNames)
          Called by enhance() to enhance a list of classes.
protected  int enhance(java.util.List classNames)
           
protected static java.util.List getOrderedClassNames(java.lang.String[] metaDataFileNames)
          Returns a list of all classes declared in the given metadata files, ordered such that all superclasses occur before their subclasses.
protected static void writeClassListFile(java.lang.String filename, java.util.List classNames)
          Writes out the given list of classes to a file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Enhancer

protected Enhancer()
Protected constructor to prevent outside instantiation.

Method Detail

enhance

protected int enhance(java.util.List classNames)
               throws java.lang.Exception
Throws:
java.lang.Exception

callExternalEnhancer

protected abstract int callExternalEnhancer(java.lang.String[] classNames)
                                     throws java.lang.Exception
Called by enhance() to enhance a list of classes. Subclasses implement this method to invoke the 3rd-party class enhancer.

Parameters:
classNames - The list of class names to be enhanced
Throws:
java.lang.Exception

getOrderedClassNames

protected static java.util.List getOrderedClassNames(java.lang.String[] metaDataFileNames)
                                              throws java.io.IOException,
                                                     javax.xml.parsers.ParserConfigurationException,
                                                     org.xml.sax.SAXException
Returns a list of all classes declared in the given metadata files, ordered such that all superclasses occur before their subclasses.

Returns:
An ordered list of class name strings.
Throws:
java.io.IOException - If any I/O error occurs.
ParserConfigurationXException - If an XML document builder cannot be created.
org.xml.sax.SAXException - If any parse error occurs.
javax.xml.parsers.ParserConfigurationException

writeClassListFile

protected static void writeClassListFile(java.lang.String filename,
                                         java.util.List classNames)
                                  throws java.io.IOException
Writes out the given list of classes to a file.

Throws:
java.io.IOException


Copyright © 2001 TriActive, Inc. All Rights Reserved.