Index
Index
 
A
 
Abstract Factory pattern 51, 54, 134
AccessibleObject
     isAccessible 39
     setAccessible 39, 41, 65, 67, 86, 139
active class 132
Amdahl' s Law 218
AnnotationElement
     getAnnotation 234
     getAnnotations 234
     getDeclaredAnnotations 234
     getParameterAnnotations 234
     isAnnotationPresent 234
Apache 50, 100, 109
Args 152?153
     complete 153
     getFlagValue 152
     getFlagValues 152
     getLast 153
     hasFlagValue 153
     toString 153
Array
     get 40
     getBoolean 41
     getLength 40
     newInstance 40, 65, 171
     set 41, 67
     setBoolean 41
array types 14
arrays
     class objects 56
     name encoding 56
AspectJ 238
Aspect-Oriented Programming 175?176
assert statement 151
atomic class 74
attributes 29
Axis 100
 
B
 
base level 9, 19, 243
Base level object 9
base program 9
BCEL 176
benchmark 210
Builder pattern 54, 205
bytecode verifier 139
 
C
 
C# 236
C++ 246
C2C 148, 150
     command line flags 155
     command line processing 152
C2CConstructor 155, 157
C2CException 147, 169
C2CTransformation 158
C2ExtentManagedC 160
C2IdentitySubclassOfC 168, 188
C2InvariantCheckingC 188
C2ProxyForC 198, 208
C2SingletonC 183, 186
call stack introspection 108, 111?112, 191, 226
Castor 70
cglib 176
Chain of Responsibility pattern 205
checkAndProcessArgs 151
checkPostconditions 152
Class
     forName 53, 61?62, 65, 67, 84, 146, 158
     getClassLoader 81, 88, 96, 136
     getComponentType 13, 41, 65, 67
     getConstructor 58, 61
     getConstructors 58
     getDeclaredConstructor 58, 65
     getDeclaredConstructors 58, 183
     getDeclaredField 32, 67, 87
     getDeclaredFields 32, 38
     getDeclaredMethod 11, 20, 134
     getDeclaredMethods 11, 193
     getDeclaringClass 158
     getExceptionTypes 166
     getField 32
     getFields 32
     getInterfaces 22
         getAllInterfaces and 82
         uses 81, 88
     getMethod 6, 11, 146
     getModifiers 194
     getName 13, 167, 188
     getSuperclass 20, 22, 32, 38
     isArray 13, 158
     isAssignableFrom 22, 86, 183
     isInstance 22, 86
     isInterface 13, 183, 198
     isPrimitive 13, 44, 158
     newInstance 62, 84, 94, 130
class diagram 256
class invariant 116
Class literals 11
class loader
     delegation model 123, 126
     dynamic class replacement and 132
     security and 139
class object 10
ClassCastException 56?57, 83
ClassLoader
     defineClass 125, 127
     findClass 125
     findLoadedClass 125
     getParent 125
     getSystemClassLoader 125
     loadClass 125
ClassNotFoundException 55?56, 125
class-to-class transformation 144, 251
     Decorator pattern 187
     extent management 159
     Proxy pattern 197
     Singleton pattern 181
class-to-class transformations
     problematic language features 201
clone 80, 96, 116, 162, 181
Cloneable 14, 19, 160, 162, 181, 185, 203
     proxies and 80
CLOS 237
code generation
     class management 159
     Decorator pattern 187
     HelloWorld.java 145
     Proxy pattern 197
     reflection and 143
     Singleton pattern 181
com.sun.tools.javac 146
command line argurment processing 152
Composition Filters 238
construction overhead 209
ConstructOnce 131
Constructor
     getDeclaringClass 58
     getExceptionTypes 58, 183
     getModifiers 58, 65, 183
     getName 58
     getParameterTypes 59, 166
     newInstance 59, 61, 65
constructor objects 57
ConstructorgetParameterTypes 183
convenience facility 40, 48, 59, 165
cooperative method 148
createClass 151
createCooperativeWrapper 190, 196
createDBFacade 53
createRenamedConstructor 166, 183
 
D
 
Decorator pattern 170, 187, 197, 202, 205
delegation 51
deserialization 63
     assignFieldValues 67
     createInstances 65
     deserializeObject 65
     deserializeValue 68
design patterns
     Abstract Factory 54, 134
     Builder 54, 205
     Chain of Responsibility 205
     Decorator 170, 187, 197, 202, 205
     Facade 51
     Factory Method 51, 54, 181
     Flyweight 205
design patterns (continued)
     Memento 205
     Null Object 93
     Prototype 205
     Proxy 136, 197, 205
     Singleton 181, 205
     Strategy 133
     Template Method 148
direct superclass 22, 247
direct superinterface 22, 248
document 29
dynamic class replacement 132
dynamic invocation 7, 26, 142
     latency of 8
     using primitives with 16
dynamic loading 9, 31, 34, 48, 53, 105, 122
     array classes and 56
     construction overhead 209
     delegation and 71
     designing for 60
     disadvantages of constructors with arguments and 61
     no argument constructors and 70
     reflective construction and 54, 60, 71
 
E
 
element 29
encryption of class files 141
endorsed standard 142
equalSignatures 194
Error 202
exception
     C2CException 147, 169
     ClassCastException 56?57, 83
     ClassNotFoundException 55?56, 125
     IllegalAccessException 18, 21, 35, 57, 59
     IllegalArgumentException 8, 17?18, 35, 77
     IllegalStateException 117, 130?131
     IllegalThreadStateException 254
     InstantiationException 57
     InvocationTargetException 18
     NoSuchFieldException 31, 88
     NoSuchMethodException 12, 21, 58
     NullPointerException 83
     RuntimeException 169, 202
     SecurityException 31, 39, 58, 125
     UndeclaredThrowableException 83
     WrappedException 92, 96
execution overhead 209
extent of a class 145, 159
extrinsic property 138, 159
 
F
 
Facade pattern 51
Factory Method 54, 181
Field
     get 33, 86
     getBoolean 33
     getDeclaringClass 33, 41
     getModifiers 33, 38, 41, 67
     getName 33
     getType 33, 41
     set 34, 67
     setBoolean 34
finalize 96
findField 87
flexibility 28, 48, 69, 71, 105, 108, 218, 224, 226, 238
     class loaders and 142
     delayed binding and 208
     delegation and 51
     dynamically linked libraries and 50
     in use of C2C framework 175
Flyweight pattern 205
forName 53, 55?56, 122, 128, 130, 144, 152
     primitives and 56
 
G
 
generateClassNamePrefix 151
generateConstructors 151
generateFields 151
generateImports 151
generateInterfaces 151
generateMethods 151
generateNestedClasses 151
getAllInterfaces 195
getInstanceVariables 38
getMethodsLackingImplementation 190, 192
getModifiersWithout 192
getSecurityManager 139
granularity overhead 209
 
H
 
Hacker' s Dictionary, The 122
HelloWorldBenchmark 210
Hibernate 176
Hyper/J 238
 
I
 
IBM 140, 237
identity class-to-class transformation 168
IllegalAccessException 18, 21, 35, 57, 59
IllegalArgumentException 8, 17?18, 35, 77
IllegalStateException 117, 130?131
IllegalThreadStateException 254
infinite recursion 108, 118, 187, 191
initiating loader 125
instance variables 35
instanceOf dependency 19, 23, 256
InstantiationException 57
intercession 74
     class loading and 122
introspection 7, 26
     accessing constructors 57
     accessing fields 31
     argument interfaces and 105
     dynamic invocation and 9
invariant 116
invariant checking 187
InvariantChecker 119
InvariantSupporter 117
InvocationHandler
     invoke 79
InvocationHandlerBase 86
InvocationTargetException 18
 
J
 
Java 1.5 226
     annotation facility 229
     generics 173, 227
     impact on reflective code 235
     language extensions 234
Java Community Process 227
Java compiler dynamically invoked 146, 148, 150
Java Language Specification 22, 37, 241
Java reflection
     limitations 144
Java Specification Requests 227
Javassist 140, 176
JDOM 30, 46, 71
Jikes 140, 176
JSR 14 227
JSR 175 229
JSR 201 234
JUnit 129
 
K
 
Kiczales, Gregor 175
 
L
 
LISP 242
loaded class 132
Logger 110
logging 108?109
 
M
 
Member 36
     getDeclaringClass 36
     getModifiers 36
     getName 36
Memento pattern 205
memory leaks 28
metaclass 23
metadata 48
metalevel 9, 19, 245, 252
metaobject 48, 57?58, 71
metaobject class 9, 15, 26, 59, 235
metaobject protocol 250
metaobjects 9
Method
     getDeclaringClass 15
     getExceptionTypes 15, 196
     getModifiers 15, 171, 192?193
     getName 15, 81, 194, 196, 198
     getParameterTypes 15, 100, 171, 194, 196, 198
     getReturnType 15, 94, 171, 196
     invoke 6, 15, 21, 81, 88, 96, 134, 136, 146
method invocation intercession 74
method objects 14
Microsoft 236
Modifier
     isAbstract 37
     isFinal 37
     isInterface 37
     isNative 37
     isPrivate 36
     isProtected 36
     isPublic 36, 41, 65, 67
     isStatic 36, 38
     isStrict 37
     isSynchronized 37
     isTransient 37, 41
Modifier (continued)
     isVolatile 37
     isStatic 171
modifying bytecodes 140
Monkey 118
Moore' s Law 221
Mopex 20, 165, 191
     actualParametersToString 166?167, 183, 198
     classArrayToString 166?167, 183
     createCooperativeWrapper 188, 196
     createRenamedConstructor 160, 166, 168, 183
     equalSignatures 193?194
     findField 86?87
     formalParametersToString 166, 183
     getAllInterfaces 82, 194?195
     getInstanceVariables 38, 41
     getMethodsLackingImplementation 188, 192
     getModifiersWithout 188, 192, 198
     getSupportedMethod 21
     getTypeName 166?167
     headerSuffixToString 198
     selectAncestors 193?194
     selectMethods 188, 193, 198
multithreading 80, 89, 108, 119, 138, 175, 218
 
N
 
namespaces 130, 137
NoSuchFieldException 31, 88
NoSuchMethodException 12, 21, 58
NTime 219
Null Object pattern 93
NullPointerException 83
 
O
 
Object
     clone 116
object diagram 256
 
P
 
parent class loader 123
pattern application 180
Perl 63
persistence 75
pitfalls
     class-to-class transformation 201
     infinite recursion 118, 191
     of call stack introspection 114
     of dynamic invocation 17
     of dynamic proxy 103
     of interface introspection 37
     of microbenchmarking 211
property sheets 28
Prototype pattern 205
Proxy
     getInvocationHandler 77, 86, 134
     getProxyClass 77, 174
     isProxyClass 77
     newProxyInstance 77, 81, 88, 96, 100, 136
     use of 208
proxy 74, 134, 142
     clone and 80
     for tracing 81
     invocation handlers and 79
proxy classes 78
proxy instance 78
proxy interfaces 78
Proxy pattern 136, 197, 205
Python 236
Python Software Foundation 236
 
R
 
readObject 69, 162, 182
referent 136
reflection
     call stack introspection 111
     class loading 122
     code generation and 140, 143
     dynamic loading 50
     evolution in Java 226
     flexibility and 8
     introspection and 8
     reflective construction 50, 57
reflective access 26, 34, 69
     setAccessible and 38
     to annotations 233
     to array elements 40
reflective construction 48, 53?54, 209
     delegation and 71
     disadvantages of constructors with arguments 61
     dynamic loading and 54, 60, 71
     factory method and 54
reflective programming 9?10, 23, 227?228
regression testing 122
reify operation
     getStackTrace 111
reusability 226
root element 29
RTime 219
Runtime.exec 253
RuntimeException 169, 202
 
S
 
SecureClassLoader 139
security manager 31, 39, 58, 139
SecurityException 31, 39, 58, 125, 139
selectAncestors 194
selectMethods 193
Self (programming language) 245
self-representation 9
sequence diagram 256
Serializable 182
serialization 28
     limitations 69
     serializeObject 41
     serializeVariable 44
Servlets 50
setProperty 128
Simple Object Access Protocol 99
SimpleClassLoader 127, 139
SimpleClassLoaderTest 130
Singleton pattern 181, 205
slowdown 218
Smalltalk 236?237, 244, 246
SOAP 99
software rot 122
stack frame 108, 112, 114, 243
StackTraceElement 226
     getClassName 112?113, 119, 188
     getFileName 112
     getLineNumber 112?113
     getMethodName 112?113, 119, 188
     isNativeMethod 112
Strategy pattern 133
SynchronizedInvariantChecker 119
system class loader 122
 
T
 
target of a proxy 74
Template Method 148
test stub 90
Throwable
     getStackTrace 111, 113, 119, 188
     printStackTrace 111
Tomcat 50, 109
tracing 74, 76, 81, 89, 109, 170, 230
types, represented as class objects 12
 
U
 
UML 9, 19, 256
     class diagram 18, 92, 232
         annotations 233
         C2C framework 148, 174, 204
         CustomerDatabase facade 52
         Decorator pattern 188
         dynamic class replacement 133
         example of C2ExtentManagedC 163
         java.lang.reflect 59
         Parrot example 61
         Proxy pattern 197
         Singleton pattern 182
         Squirrel example 164?165
         support for generics 229
         zoo application 45
     class/object diagram 10, 19, 84
         class loader delegation model 124
         metalevel boundary 24?25, 245, 247?248
         set of metaclasses 251
     object diagram
         zoo application 45
     sequence diagram
         actual objects in method forwarding 80
         class loader delegation model 126
         intervals timed 217
         proxy chaining 90
         proxy definition 75
         use of getMethod and invoke 17
UndeclaredThrowableException 83
unit testing 90
unloaded class 132
UQueue 151
     definition 171
     uses
         Args 153
         C2CConstructor 155
         getAllInterfaces 195
         getMethodsLackingImplementation 192
         selectAncestor 194
         selectMethod 193
URLClassLoader 139
URLStreamHandler 139
 
V
 
Venn diagram
     set of metaclasses 251
 
W
 
WeakReference 136, 159, 182, 185
Web services 29, 99, 101, 103
Web Services Description Language 102
WrappedException 92, 96
writeObject 69
WSDL 99, 102
 
X
 
Xerox PARC 175, 236
XMethods 99, 102
XML 29?30, 99
     illegal characters 70
 
Z
 
ZooTest 46
     output 46