org.datanucleus.jdo
Class JDODataNucleusEnhancer

java.lang.Object
  extended by org.datanucleus.jdo.JDODataNucleusEnhancer
All Implemented Interfaces:
java.lang.instrument.ClassFileTransformer, javax.jdo.JDOEnhancer

public class JDODataNucleusEnhancer
extends java.lang.Object
implements javax.jdo.JDOEnhancer

Implementation of a JDO-compliant Enhancer.


Constructor Summary
JDODataNucleusEnhancer()
          Constructor for a JDO enhancer.
JDODataNucleusEnhancer(java.util.Properties props)
          Constructor for a JDO enhancer specifying optional properties.
 
Method Summary
 javax.jdo.JDOEnhancer addClass(java.lang.String className, byte[] bytes)
           
 javax.jdo.JDOEnhancer addClasses(java.lang.String... classNames)
           
 javax.jdo.JDOEnhancer addFiles(java.lang.String... metadataFiles)
           
 javax.jdo.JDOEnhancer addJar(java.lang.String jarFileName)
           
 javax.jdo.JDOEnhancer addPersistenceUnit(java.lang.String persistenceUnitName)
           
 int enhance()
           
 byte[] getEnhancedBytes(java.lang.String className)
           
 java.util.Properties getProperties()
           
 javax.jdo.metadata.JDOMetadata newMetadata()
           
 void registerMetadata(javax.jdo.metadata.JDOMetadata metadata)
           
 javax.jdo.JDOEnhancer setClassLoader(java.lang.ClassLoader loader)
           
 javax.jdo.JDOEnhancer setOutputDirectory(java.lang.String dir)
           
 javax.jdo.JDOEnhancer setVerbose(boolean verbose)
           
 byte[] transform(java.lang.ClassLoader loader, java.lang.String className, java.lang.Class<?> classBeingRedefined, java.security.ProtectionDomain protectionDomain, byte[] classfileBuffer)
           
 int validate()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JDODataNucleusEnhancer

public JDODataNucleusEnhancer()
Constructor for a JDO enhancer.


JDODataNucleusEnhancer

public JDODataNucleusEnhancer(java.util.Properties props)
Constructor for a JDO enhancer specifying optional properties.

Parameters:
props - Properties
Method Detail

newMetadata

public javax.jdo.metadata.JDOMetadata newMetadata()
Specified by:
newMetadata in interface javax.jdo.JDOEnhancer

registerMetadata

public void registerMetadata(javax.jdo.metadata.JDOMetadata metadata)
Specified by:
registerMetadata in interface javax.jdo.JDOEnhancer

addClass

public javax.jdo.JDOEnhancer addClass(java.lang.String className,
                                      byte[] bytes)
Specified by:
addClass in interface javax.jdo.JDOEnhancer

addClasses

public javax.jdo.JDOEnhancer addClasses(java.lang.String... classNames)
Specified by:
addClasses in interface javax.jdo.JDOEnhancer

addFiles

public javax.jdo.JDOEnhancer addFiles(java.lang.String... metadataFiles)
Specified by:
addFiles in interface javax.jdo.JDOEnhancer

addJar

public javax.jdo.JDOEnhancer addJar(java.lang.String jarFileName)
Specified by:
addJar in interface javax.jdo.JDOEnhancer

addPersistenceUnit

public javax.jdo.JDOEnhancer addPersistenceUnit(java.lang.String persistenceUnitName)
Specified by:
addPersistenceUnit in interface javax.jdo.JDOEnhancer

enhance

public int enhance()
Specified by:
enhance in interface javax.jdo.JDOEnhancer

getEnhancedBytes

public byte[] getEnhancedBytes(java.lang.String className)
Specified by:
getEnhancedBytes in interface javax.jdo.JDOEnhancer

getProperties

public java.util.Properties getProperties()
Specified by:
getProperties in interface javax.jdo.JDOEnhancer

setClassLoader

public javax.jdo.JDOEnhancer setClassLoader(java.lang.ClassLoader loader)
Specified by:
setClassLoader in interface javax.jdo.JDOEnhancer

setOutputDirectory

public javax.jdo.JDOEnhancer setOutputDirectory(java.lang.String dir)
Specified by:
setOutputDirectory in interface javax.jdo.JDOEnhancer

setVerbose

public javax.jdo.JDOEnhancer setVerbose(boolean verbose)
Specified by:
setVerbose in interface javax.jdo.JDOEnhancer

validate

public int validate()
Specified by:
validate in interface javax.jdo.JDOEnhancer

transform

public byte[] transform(java.lang.ClassLoader loader,
                        java.lang.String className,
                        java.lang.Class<?> classBeingRedefined,
                        java.security.ProtectionDomain protectionDomain,
                        byte[] classfileBuffer)
                 throws java.lang.instrument.IllegalClassFormatException
Specified by:
transform in interface java.lang.instrument.ClassFileTransformer
Throws:
java.lang.instrument.IllegalClassFormatException


Copyright © 2009. All Rights Reserved.