Component Development for the Java™ Platform - Stuart Dabbs Halloway

Component Development for the Java™ Platform

Buch | Softcover
360 Seiten
2002
Addison Wesley (Verlag)
978-0-201-75306-6 (ISBN)
38,40 inkl. MwSt
  • Titel ist leider vergriffen;
    keine Neuauflage
  • Artikel merken
Java' is an object-oriented language, but it is also a component-oriented platform. This book reveals both the potential and pitfalls of developing components using the Java platform. It delves into the component-oriented features of the Java platform, discussing class loading, reflection, serialization, native interoperation, and code generation.
If you're serious about writing components in Java, this book focuses on the component services you need to master. DevelopMentor Chief Scientist Stuart Halloway presents unprecedented, in-depth coverage of writing, deploying, and maintaining Java components. Halloway begins by showing how to use, control, and troubleshoot components. He offers real-world guidance on reflection performance, and demonstrates how reflection is used to build the Java serialization architecture. He also offers detailed coverage of using the Java Native Interface (JNI) to control the boundaries between Java code and components written in other environments. In Part II, Halloway presents a practical vision for using component services to become a more effective Java developer. Through examples and sample code, he introduces generative programming techniques that leverage Java into high performance. Finally, building on these techniques, he shows how to construct robust interoperability between Java and Win32/COM.

Stuart Dabbs Halloway is responsible for the Java curriculum at DevelopMentor, where he teaches the Guerrilla Java and Intensive Java courses. He writes for Sun¿s Java Developer Connection(SM) and for JavaPro magazine, and regularly speaks at industry events such as JavaOne. Stuart received his B.S. and M.P.P. degrees from Duke University. 0201753065AB06182002

Preface.


1. From Objects to Components.


2. The Class Loader Architecture.


Assembling an Application.



Goals of the Class Loader Architecture.



Transparency.



Extensibility.



Capability @



Configurability.



Handling Name and Version Conflicts.



Security.



Explicit and Implicit Class Loading.



Explicit Loading with URLClassLoader.



Implicit Class Loading.



Reference Type vs. Referenced Class.



ClassLoader.loadClass vs. Class.forName.



Loading Nonclass Resources.



The Class Loader Rules.



The Consistency Rule.



The Delegation Rule.



The Visibility Rule.



Delegations as Namespaces.



Static Fields are Not Singletons.



Implicit Loading Hides Most Details.



Hot Deployment.



Using Hot Deployment.



Unloading Classes.



Making Sure Classes are Collectable.



Bootclasspath, Extensions Path, and Classpath.



The Classpath.



The Extensions Path.



The Bootstrap Loader.



Debugging Class Loading.



Instrumenting an Application.



Using -verbose:class.



Instrumenting the Core API.



Inversion and the Context Class Loader.



Onward.



Resources.



3. Type Information and Reflection.


The Binary Class Format.



Binary Compatibility.



Binary Class Metadata.



From Binary Classes to Reflection.



Reflection.



Reflecting on Fields.



The Difference between get and getDeclared.



Type Errors Occur at Runtime.



Reflecting on Methods.



Reflective Invocation.



A Reflective Launcher.



Wrapping Primitive Types.



Bypassing Language Access Rules.



Exceptions Caused by Reflective Invocation.



Dynamic Proxies.



Delegation Instead of Implementation Inheritance.



Dynamic Proxies Make Delegation Generic.



Implementing InvocationHandler.



Implementing a Forwarding Handler.



The InvocationHandler as Generic Service.



Handling Exceptions in an InvocationHandler.



Either Client or Server can Install a Proxy.



Advantages of Dynamic Proxies.



Reflection Performance.



Package Reflection.



Setting Package Metadata.



Accessing Package Metadata.



Sealing Packages.



Weaknesses of the Versioning Mechanism.



Custom Metadata.



Onward.



Resources.



4. Serialization.


Serialization and Metadata.



Serialization Basics.



Serialization Skips Some Fields.



Serialization And Class Constructors.



Using readObject and writeObject.



Matching Streams With Classes.



The serialVersionUID.



Overriding the Default SUID.



Compatible and Incompatible Changes.



Explicitly Managing Serializable Fields.



ObjectInputStream.GetField Caveats.



Writer Makes Right.



Overriding Class Metadata.



Performance Problems.



Custom Class Descriptors.



Abandoning Metadata.



Writing Custom Data After defaultWriteObject.



Externalizable.



Using writeObject to Write Raw Data Only: Bad Idea.



Object Graphs.



Pruning Graphs with Transient.



Preserving Identity.



Encouraging the Garbage Collector with Reset.



Object Replacement.



Stream-Controlled Replacement.



Class-Controlled Replacement.



Ordering Rules for Replacement.



Taking Control of Graph Ordering.



Finding Class Code.



Annotation in RMI.



RMI MarshalledObjects.



Onward.



Resources.



5. Customizing Class Loading.


Java 2 Security.



The Role of Class Loaders.



Custom Class Loaders.



Pre-Java 2 Custom Class Loaders.



Class Loading Since SDK 1.2.



A Transforming Class Loader.



Protocol Handlers.



Implementing a Handler.



Installing a Custom Handler.



Choosing Between Loaders and Handlers.



Getting Past Security to the Loader You Need.



Reading Custom Metadata.



Example: Version Attributes.



Serializable Classes as Attributes.



Reading Attributes During Class Loading.



Debugging Support.



Onward.



Resources.



6. Interop 1: JNI.


Why Interoperate?



The Dangers of Native Code.



Finding and Loading Native Code.



Name Mappings.



Type Mappings.



Overloaded Names.



Loading Native Libraries.



Class Loaders and JNI.



Common Errors Loading Native Libraries.



Troubleshooting Native Loading.



Calling Java from C++.



Minimizing Round Trips.



Performance Comparisons.



Differences Between JNI and Reflective Invocation.



Error Handling in JNI.



Failures in Native Code.



Handling C++ Exceptions.



Handling Java Exceptions from Native Code.



Throwing Java Exceptions from Native Code.



Resource Management.



Interacting with the Garbage Collector.



Managing Native Resources.



Managing Arrays.



Managing Strings.



Onward.



Resources.



7. Generative Programming.


Why Generate Code?



Object Oriented Approaches to Modeling Variabilities.



Thinking in Terms of Bind Time.



Separating Specification From Bind Time.



Choosing a Specification Language.



Reuse Requires More than One Use.



A Little Domain Analysis is a Dangerous Thing.



Why Generate Code with Java?



Type Information Acts As a Free Specification Document.



Class Loading Supports Flexible Binding Modes.



Java Source is Easy To Generate.



Java Binary Classes are Easy To Generate.



Code Generation Boosts Performance.



Levels of Commitment to Code Generation.



A Taxonomy of Bind Times and Modes.



Code Generation in RMI.



Code Generation in JSP.



Code Generation in EJB.



The Deployment Descriptor.



Alternate Implementations.



Generating Strongly Typed Collections.



Code Generation Language versus Target Language.



Generating Custom Serialization Code.



Onward.



Resources.



8. Onward.


Where We Are.



Where We Are Going.



Resources.



Appendix—Interop 2: Bridging Java and Win32/COM.


Index. 0201753065T11262001

Erscheint lt. Verlag 7.1.2002
Verlagsort Boston
Sprache englisch
Maße 186 x 232 mm
Gewicht 730 g
Themenwelt Informatik Programmiersprachen / -werkzeuge Java
Mathematik / Informatik Informatik Web / Internet
ISBN-10 0-201-75306-5 / 0201753065
ISBN-13 978-0-201-75306-6 / 9780201753066
Zustand Neuware
Haben Sie eine Frage zum Produkt?
Mehr entdecken
aus dem Bereich
mit über 150 Workouts in Java und Python

von Luigi Lo Iacono; Stephan Wiefling; Michael Schneider

Buch (2023)
Carl Hanser (Verlag)
29,99
Einführung, Ausbildung, Praxis

von Christian Ullenboom

Buch | Hardcover (2023)
Rheinwerk (Verlag)
49,90