JBoss Reflection 2.2.1.SP1

org.jboss.reflect.plugins.javassist
Class JavassistReflectionFactory

java.lang.Object
  extended by org.jboss.reflect.plugins.javassist.JavassistReflectionFactory

public class JavassistReflectionFactory
extends Object

JavassistReflectionFactory.

Creates instances of JavassistMethod, JavassistConstructor and JavassistField that invoke methods, constructors, and accesses fields without the use of reflection. Although a lot faster, there is an overhead associated with generating these classes, so they should only be used for frequently used members

To output the generated classes to disk, so the bytecode can be inspected, specify -Dorg.jboss.reflect.plugins.javassist.JavassistReflectionFactory.debug=true.

To enable metrics, which can be useful in determining which members accessors should be generated, specify -Dorg.jboss.reflect.plugins.javassist.JavassistReflectionFactory.enableMetrics=true.

Version:
$Revision: 105060 $
Author:
Adrian Brock, Ales Justin, Kabir Khan

Field Summary
static JavassistReflectionFactory INSTANCE
           
protected static Class<?> MAGIC_ACCESSOR_IMPL
           
 
Method Summary
 void addForceGenerate(String s)
           
 JavassistConstructor createConstructor(JavassistConstructorInfo info)
          Create a javassist constructor
 JavassistField createField(JavassistFieldInfo info)
          Create a javassist field
 JavassistMethod createMethod(JavassistMethodInfo info)
          Creates a javassist method.
 void removeForceGenerate(String s)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

public static final JavassistReflectionFactory INSTANCE

MAGIC_ACCESSOR_IMPL

protected static final Class<?> MAGIC_ACCESSOR_IMPL
Method Detail

addForceGenerate

public void addForceGenerate(String s)

removeForceGenerate

public void removeForceGenerate(String s)

createMethod

public JavassistMethod createMethod(JavassistMethodInfo info)
                             throws Throwable
Creates a javassist method. This method generates an implementation of JavassistMethod, loads the generated class and instantiates it.

Parameters:
ctMethod - the method
Returns:
the method
Throws:
Throwable - for any error

createConstructor

public JavassistConstructor createConstructor(JavassistConstructorInfo info)
                                       throws Throwable
Create a javassist constructor

Parameters:
ctConstructor - the constructor
Returns:
the constructor
Throws:
Throwable - for any error

createField

public JavassistField createField(JavassistFieldInfo info)
                           throws Throwable
Create a javassist field

Parameters:
ctField - the field
Returns:
the field
Throws:
Throwable - for any error

JBoss Reflection 2.2.1.SP1

Copyright © 2012 JBoss, a division of Red Hat, Inc.. All Rights Reserved.