Sold Out
Book Categories |
Foreword | xiii | |
Preface | xv | |
1 | From Objects to Components | 1 |
2 | The Class Loader Architecture | 11 |
2.1 | Assembling an Application | 11 |
2.2 | Goals of the Class Loader Architecture | 14 |
2.2.1 | Transparency | 15 |
2.2.2 | Extensibility | 15 |
2.2.3 | Capability | 16 |
2.2.4 | Configurability | 16 |
2.2.5 | Handling Name and Version Conflicts | 16 |
2.2.6 | Security | 17 |
2.3 | Explicit and Implicit Class Loading | 17 |
2.3.1 | Explicit Loading with URL ClassLoader | 18 |
2.3.2 | Implicit Class Loading | 19 |
2.3.3 | Reference Type versus Referenced Class | 20 |
2.3.4 | ClassLoader.loadClass versus Class.forName | 21 |
2.3.5 | Loading Nonclass Resources | 22 |
2.4 | The Class Loader Rules | 23 |
2.4.1 | The Consistency Rule | 23 |
2.4.2 | The Delegation Rule | 24 |
2.4.3 | The Visibility Rule | 25 |
2.4.4 | Delegations as Namespaces | 27 |
2.4.5 | Static Fields Are Not Singletons | 28 |
2.4.6 | Implicit Loading Hides Most Details | 29 |
2.5 | Hot Deployment | 29 |
2.5.1 | Using Hot Deployment | 33 |
2.6 | Unloading Classes | 35 |
2.6.1 | Making Sure Classes Are Collectable | 35 |
2.7 | Bootclasspath, Extensions Path, and Classpath | 36 |
2.7.1 | The Classpath | 37 |
2.7.2 | The Extensions Path | 39 |
2.7.3 | The Bootclasspath | 41 |
2.8 | Debugging Class Loading | 43 |
2.8.1 | Instrumenting an Application | 44 |
2.8.2 | Using--verbose:class | 45 |
2.8.3 | Instrumenting the Core API | 46 |
2.9 | Inversion and the Context Class Loader | 49 |
2.10 | Onward | 55 |
2.11 | Resources | 56 |
3 | Type Information and Reflection | 57 |
3.1 | The Binary Class Format | 58 |
3.1.1 | Binary Compatibility | 58 |
3.1.2 | Binary Class Metadata | 63 |
3.1.3 | From Binary Classes to Reflection | 66 |
3.2 | Reflection | 66 |
3.2.1 | Reflecting on Fields | 68 |
3.2.2 | The Difference between get and getDeclared | 68 |
3.2.3 | Type Errors Occur at Runtime | 70 |
3.2.4 | Reflecting on Methods | 71 |
3.3 | Reflective Invocation | 72 |
3.3.1 | A Reflective Launcher | 73 |
3.3.2 | Wrapping Primitive Types | 74 |
3.3.3 | Bypassing Language Access Rules | 76 |
3.3.4 | Exceptions Caused by Reflective Invocation | 81 |
3.4 | Dynamic Proxies | 83 |
3.4.1 | Delegation instead of Implementation Inheritance | 83 |
3.4.2 | Dynamic Proxies Make Delegation Generic | 84 |
3.4.3 | Implementing InvocationHandler | 85 |
3.4.4 | Implementing a Forwarding Handler | 86 |
3.4.5 | The InvocationHandler as Generic Service | 87 |
3.4.6 | Handling Exceptions in an InvocationHandler | 89 |
3.4.7 | Either Client or Server Can Install a Proxy | 90 |
3.4.8 | Advantages of Dynamic Proxies | 91 |
3.5 | Reflection Performance | 92 |
3.6 | Package Reflection | 94 |
3.6.1 | Setting Package Metadata | 95 |
3.6.2 | Accessing Package Metadata | 96 |
3.6.3 | Sealing Packages | 97 |
3.6.4 | Weaknesses of the Versioning Mechanism | 97 |
3.7 | Custom Metadata | 98 |
3.8 | Onward | 103 |
3.9 | Resources | 103 |
4 | Serialization | 105 |
4.1 | Serialization and Metadata | 105 |
4.2 | Serialization Basics | 106 |
4.2.1 | Serialization Skips Some Fields | 109 |
4.2.2 | Serialization and Class Constructors | 110 |
4.3 | Using readObject and writeObject | 111 |
4.4 | Matching Streams with Classes | 113 |
4.4.1 | The serialVersionUID | 114 |
4.4.2 | Overriding the Default SUID | 115 |
4.4.3 | Compatible and Incompatible Changes | 117 |
4.5 | Explicitly Managing Serializable Fields | 119 |
4.5.1 | ObjectInputStream. GetField Caveats | 120 |
4.5.2 | Writer Makes Right | 121 |
4.5.3 | Overriding Class Metadata | 122 |
4.5.4 | Performance Problems | 123 |
4.5.5 | Custom Class Descriptors | 124 |
4.6 | Abandoning Metadata | 124 |
4.6.1 | Writing Custom Data after defaultWriteObject | 124 |
4.6.2 | Externalizable | 125 |
4.6.3 | Using writeObject to Write Raw Data Only: Bad Idea | 128 |
4.7 | Object Graphs | 130 |
4.7.1 | Pruning Graphs with Transient | 131 |
4.7.2 | Preserving Identity | 131 |
4.7.3 | Encouraging the Garbage Collector with reset | 132 |
4.8 | Object Replacement | 133 |
4.8.1 | Stream-Controlled Replacement | 134 |
4.8.2 | Class-Controlled Replacement | 137 |
4.8.3 | Ordering Rules for Replacement | 139 |
4.8.4 | Taking Control of Graph Ordering | 145 |
4.9 | Finding Class Code | 147 |
4.9.1 | Annotation in RMI | 148 |
4.9.2 | RMI MarshalledObjects | 150 |
4.10 | Onward | 150 |
4.11 | Resources | 151 |
5 | Customizing Class Loading | 153 |
5.1 | Java 2 Security | 155 |
5.1.1 | The Role of Class Loaders | 157 |
5.2 | Custom Class Loaders | 159 |
5.2.1 | Pre-Java 2 Custom Class Loaders | 159 |
5.2.2 | Class Loading since SDK 1.2 | 160 |
5.2.3 | A Transforming Class Loader | 162 |
5.3 | Protocol Handlers | 168 |
5.3.1 | Implementing a Handler | 169 |
5.3.2 | Installing a Custom Handler | 171 |
5.3.3 | Choosing between Loaders and Handlers | 174 |
5.4 | Getting Past Security to the Loader You Need | 175 |
5.5 | Reading Custom Metadata | 177 |
5.5.1 | Example: Version Attributes | 178 |
5.5.2 | Serializable Classes as Attributes | 179 |
5.5.3 | Reading Attributes during Class Loading | 183 |
5.5.4 | Debugging Support | 188 |
5.6 | Onward | 189 |
5.7 | Resources | 190 |
6 | Interop 1: JNI | 191 |
6.1 | Why Interoperate? | 191 |
6.2 | The Dangers of Native Code | 193 |
6.3 | Finding and Loading Native Code | 194 |
6.3.1 | Name Mappings | 195 |
6.3.2 | Type Mappings | 195 |
6.3.3 | Overloaded Names | 198 |
6.3.4 | Loading Native Libraries | 199 |
6.3.5 | Class Loaders and JNI | 202 |
6.3.6 | Common Errors Loading Native Libraries | 205 |
6.3.7 | Troubleshooting Native Loading | 207 |
6.4 | Calling Java from C++ | 208 |
6.4.1 | Minimizing Round Trips | 211 |
6.4.2 | Performance Comparisons | 214 |
6.4.3 | Differences between JNI and Reflective Invocation | 214 |
6.5 | Error Handling in JNI | 217 |
6.5.1 | Failures in Native Code | 217 |
6.5.2 | Handling C++ Exceptions | 218 |
6.5.3 | Handling Java Exceptions from Native Code | 219 |
6.5.4 | Throwing Java Exceptions from Native Code | 222 |
6.6 | Resource Management | 223 |
6.6.1 | Interacting with the Garbage Collector | 224 |
6.6.2 | Managing Native Resources | 231 |
6.6.3 | Managing Arrays | 233 |
6.6.4 | Managing Strings | 239 |
6.7 | Onward | 240 |
6.8 | Resources | 241 |
7 | Generative Programming | 243 |
7.1 | Why Generate Code? | 243 |
7.1.1 | Object-Oriented Approaches to Modeling Variabilities | 244 |
7.1.2 | Thinking in Terms of Bind Time | 246 |
7.1.3 | Separating Specification from Bind Time | 247 |
7.1.4 | Choosing a Specification Language | 249 |
7.1.5 | Reuse Requires More Than One Use | 249 |
7.1.6 | A Little Domain Analysis Is a Dangerous Thing | 250 |
7.2 | Why Generate Code with Java? | 250 |
7.2.1 | Type Information Acts as a Free Specification Document | 250 |
7.2.2 | Class Loading Supports Flexible Binding Modes | 251 |
7.2.3 | Java Source Is Easy to Generate | 251 |
7.2.4 | Java Binary Classes Are Easy to Generate | 252 |
7.2.5 | Code Generation Boosts Performance | 252 |
7.2.6 | Levels of Commitment to Code Generation | 252 |
7.3 | A Taxonomy of Bind Times and Modes | 253 |
7.4 | Code Generation in RMI | 255 |
7.5 | Code Generation in JSP | 257 |
7.6 | Code Generation in EJB | 260 |
7.6.1 | The Deployment Descriptor | 263 |
7.6.2 | Alternate Implementations | 265 |
7.7 | Generating Strongly Typed Collections | 267 |
7.7.1 | Code Generation Language versus Target Language | 270 |
7.8 | Generating Custom Serialization Code | 271 |
7.9 | Onward | 276 |
7.10 | Resources | 279 |
8 | Onward | 281 |
8.1 | Where We Are | 281 |
8.2 | Where We Are Going | 282 |
8.3 | Resources | 283 |
A | Interop 2: Bridging Java and Win32/COM | 285 |
Index | 319 |
Login|Complaints|Blog|Games|Digital Media|Souls|Obituary|Contact Us|FAQ
CAN'T FIND WHAT YOU'RE LOOKING FOR? CLICK HERE!!! X
You must be logged in to add to WishlistX
This item is in your Wish ListX
This item is in your CollectionComponent Development for the Java Platform
X
This Item is in Your InventoryComponent Development for the Java Platform
X
You must be logged in to review the productsX
X
X
Add
Component Development for the Java Platform, Java is an object-oriented language, but it is also a component-oriented platform. Java's class-loading model and rich type information makes it possible to build flexible and reusable binary components. COMPONENT DEVELOPMENT FOR THE JAVA PLATFORM
X
X
Add
Component Development for the Java Platform, Java is an object-oriented language, but it is also a component-oriented platform. Java's class-loading model and rich type information makes it possible to build flexible and reusable binary components. COMPONENT DEVELOPMENT FOR THE JAVA PLATFORM
|