|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.avalon.fortress.impl.factory.BCELWrapperGenerator
final class BCELWrapperGenerator
Create the BCELWrapper for the component. The generated wrapper classes will be assigned the same ProtectionDomain as the actual classes which they are wrapping. This simplifies the configuration of a SecurityManager by making the existence of the BCEL generated classes transparent to the policy file author.
Nested Class Summary | |
---|---|
private class |
BCELWrapperGenerator.BCELClassLoader
|
Field Summary | |
---|---|
private BCELWrapperGenerator.BCELClassLoader |
m_bcelClassLoader
The ClassLoader to use when loading a class generated by this
BCELWrapperGenerator . |
private org.apache.bcel.generic.ClassGen |
m_classGenerator
The ClassGen instance to use for byte code generation. |
private BCELCodeGenerator |
m_codeGenerator
The BCELCodeGenerator to use for
byte code generation. |
private org.apache.bcel.util.Repository |
m_repository
The BCEL util.Repository instance to use when loading JavaClass instances. |
private static java.lang.String |
WRAPPER_CLASS_INTERFACE_NAME
The name of the interface each generated wrapper class has to implement. |
private static java.lang.String |
WRAPPER_CLASS_SUFFIX
The suffix to be appended to the name of the wrapped class when creating the name of the wrapper class. |
private static java.lang.String |
WRAPPER_SUPERCLASS_NAME
The name of the superclass of the wrapper class to be generated. |
Constructor Summary | |
---|---|
BCELWrapperGenerator()
No-args default constructor. |
Method Summary | |
---|---|
private byte[] |
buildWrapper(org.apache.bcel.classfile.JavaClass[] interfacesToImplement)
Generates the wrapper byte code for a given interface. |
java.lang.Class |
createWrapper(java.lang.Class classToWrap)
|
private java.lang.String[] |
extractInterfaceNames(java.lang.Class[] interfaces)
Takes an array of Class instances supposed to represent
interfaces and returns a list of the names of those interfaces. |
private org.apache.bcel.classfile.JavaClass |
lookupClass(java.lang.Class clazz)
Takes a Class instance as a its parameter and returns corresponding
the JavaClass instance as used by BCEL. |
private org.apache.bcel.classfile.JavaClass[] |
lookupClasses(java.lang.Class[] classes)
Takes an array of Class instances and returns an array holding
the corresponding JavaClass instances as used by BCEL. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private org.apache.bcel.util.Repository m_repository
private static final java.lang.String WRAPPER_CLASS_SUFFIX
private static final java.lang.String WRAPPER_SUPERCLASS_NAME
private static final java.lang.String WRAPPER_CLASS_INTERFACE_NAME
private final BCELCodeGenerator m_codeGenerator
BCELCodeGenerator
to use for
byte code generation.
private org.apache.bcel.generic.ClassGen m_classGenerator
ClassGen
instance to use for byte code generation.
private final BCELWrapperGenerator.BCELClassLoader m_bcelClassLoader
ClassLoader
to use when loading a class generated by this
BCELWrapperGenerator
.
Constructor Detail |
---|
public BCELWrapperGenerator()
Method Detail |
---|
public java.lang.Class createWrapper(java.lang.Class classToWrap) throws java.lang.Exception
java.lang.Exception
private org.apache.bcel.classfile.JavaClass lookupClass(java.lang.Class clazz) throws java.lang.Exception
Class
instance as a its parameter and returns corresponding
the JavaClass
instance as used by BCEL.
clazz
- The Class
instance we want to turn into a
JavaClass
JavaClass
representing the given Class
instance
java.lang.Exception
private org.apache.bcel.classfile.JavaClass[] lookupClasses(java.lang.Class[] classes) throws java.lang.Exception
Class
instances and returns an array holding
the corresponding JavaClass
instances as used by BCEL.
classes
- An array holding Class
instances we
want to turn into JavaClass
instances
JavaClass
instances representing
the given Class
instances
java.lang.Exception
private java.lang.String[] extractInterfaceNames(java.lang.Class[] interfaces)
Class
instances supposed to represent
interfaces and returns a list of the names of those interfaces.
interfaces
- An array of Class
instances
Class
instancesprivate byte[] buildWrapper(org.apache.bcel.classfile.JavaClass[] interfacesToImplement) throws java.lang.Exception
interfacesToImplement
- The interfaces we want to generate wrapper
byte code for
java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |