Book description
Java RMI contains a wealth of experience in designing and implementing Java's Remote Method Invocation. If you're a novice reader, you will quickly be brought up to speed on why RMI is such a powerful yet easy to use tool for distributed programming, while experts can gain valuable experience for constructing their own enterprise and distributed systems.With Java RMI, you'll learn tips and tricks for making your RMI code excel. The book also provides strategies for working with serialization, threading, the RMI registry, sockets and socket factories, activation, dynamic class downloading, HTTP tunneling, distributed garbage collection, JNDI, and CORBA. In short, a treasure trove of valuable RMI knowledge packed into one book.
Publisher resources
Table of contents
- Java RMI
- Dedication
- A Note Regarding Supplemental Files
- Preface
-
I. Designing and Building: The Basics of RMI Applications
- 1. Streams
- 2. Sockets
- 3. A Socket-Based Printer Server
- 4. The Same Server, Written Using RMI
- 5. Introducing the Bank Example
-
6. Deciding on the Remote Server
- A Little Bit of Bias
-
Important Questions WhenThinking About Servers
- Does Each Instance of the Server Requirea Shared/Scarce Resource?
- How Well Does the Given Server Replicate/Scaleto Multiple Machines?
- Can a Single Server Handle a Typical Client Interaction?
- How Easy Is It to Make a Server Handle Multiple Simultaneous Clients?
- How Easy Is It to Tell Whether the Code Is Correct?
- How Fatal Is a Server Failure?
- How Easy Is It to Gracefully Extend the Software and Add New Functionality?
- Should We Implement Bank or Account?
-
7. Designing the Remote Interface
-
Important Questions When Designing Remote Interfaces
- Should We Pass Method Objects?
- Should We Pass Objects as Argumentsor Use Primitive Values?
- Should We Receive Objects as Return Valuesor Receive Primitive Values?
- Do Individual Method Calls Waste Bandwidth?
- Is Each Conceptual Operation a Single Method Call?
- Does the Interface Expose the Right Amount of Metadata?
- Have We Identified a Reasonable Set of Distributed Exceptions?
- Building the Data Objects
- Accounting for Partial Failure
-
Important Questions When Designing Remote Interfaces
- 8. Implementing the Bank Server
- 9. The Rest of the Application
-
II. Drilling Down: Scalability
-
10. Serialization
- The Need for Serialization
- Using Serialization
- How to Make a Class Serializable
- The Serialization Algorithm
- Versioning Classes
- Performance Issues
- The Externalizable Interface
- 11. Threads
-
12. Implementing Threading
- The Basic Task
-
Guidelines for Threading
- Start with Code That Works
- Above All Else, Ensure Data Integrity
- Minimize Time Spent in Synchronized Blocks
- Be Careful When Using Container Classes
- Use Containers to Mediate Interthread Communication
- Immutable Objects Are Automatically Threadsafe
- Always Have a Safe Way to Stop Your Threads
- Background Threads Should Have Low Priority
- Pay Careful Attention to What You Serialize
- Use Threading to Reduce Response-Time Variance
- Limit the Number of Objects a Thread Touches
- Acquire Locks in a Fixed Order
- Use Worker Threads to Prevent Deadlocks
- Pools: An Extended Example
- Some Final Words on Threading
- 13. Testing a Distributed Application
- 14. The RMI Registry
-
15. Naming Services
- Basic Design, Terminology,and Requirements
- Requirements for Our Naming Service
- Federation and Threading
-
The Context Interface
- Value Objects Represent Sets and Lists
- Paths, Names, and Attributes Are All Distinct
- Null Arguments Are Okay
- Attributes Are Single Valued
- Contexts Are Handled by a Separate Set of Methods
- Contexts, When Bound as Contexts, Have No Attributes
- Contexts Can Create Subcontexts Directly
- There Are No Remote Iterators
- The Value Objects
- ContextImpl
- Switching Between Naming Services
- The Java Naming and Directory Interface (JNDI)
- 16. The RMI Runtime
-
17. Factories and the Activation Framework
- Resource Management
- Factories
- Implementing a Generic Factory
- A Better Factory
- Persistence and the Server Lifecycle
- Activation
- A Final Word About Factories
-
10. Serialization
-
III. Advanced Topics
- 18. Using Custom Sockets
- 19. Dynamic Classloading
- 20. Security Policies
- 21. Multithreaded Clients
- 22. HTTP Tunneling
- 23. RMI, CORBA, and RMI/IIOP
- Index
- About the Author
- Colophon
- Copyright
Product information
- Title: Java RMI
- Author(s):
- Release date: October 2001
- Publisher(s): O'Reilly Media, Inc.
- ISBN: 9781565924529
You might also like
book
Java NIO
Many serious Java programmers, especially enterprise Java programmers, consider the new I/O API--called NIO for New …
video
Java and JVM at OSCON 2012
Ready to dive into Java EE 7, tackle cloud computing with Akka, or learn concurrent programming …
book
Java Distributed Computing
Distributed computing and Java go together naturally. As the first language designed from the bottom up …
book
Developing Enterprise Java Applications with J2EE™ and UML
The Java 2 Platform Enterprise Edition (J2EE TM) offers great promise for dramatically improving the way …