Server-Based Java Programming
Ted Neward
  • June 2000
  • ISBN 9781884777714
  • 592 pages
  • printed in black & white

Java on the server is here to stay. Whether you're using J2EE or writing your own, you will need to understand the fundamental concepts of server-based Java. Server-Based Java Programming teaches those concepts of Java that underlie the J2EE APIs and the best ways to use them. An ongoing focus on the full lifecycle, including administration and deployment, makes this book a rare, practical guide. One of its themes is the theoretical "three-zeroes" goal for server development--zero development, zero administration, and zero deployment.

Table of Contents detailed table of contents

foreword

preface

acknowledgments

about this book

goals of this book

about the author

about the cover illustration

1. Enterprise Java

1.1. Enterprise development

1.1.1. What is enterprise development?

1.1.2. Developing the enterprise application

1.1.3. Reinventing the wheel

1.2. Three zeroes

1.2.1. Zero development

1.2.2. Zero deployment

1.2.3. Zero administration

1.3. Java in the enterprise

1.3.1. Sun’s view

1.3.2. Alternate views

1.4. Why Java?

1.4.1. Criticisms of Java as a server-side language

1.5. Summary

1.6. Additional reading

2. ClassLoaders

2.1. Dynamic linking

2.1.1. Run-time dynamic loading

2.1.2. Reflection

2.2. ClassLoaders: rules and expectations

2.2.1. Java .class file format

2.2.2. Using ClassLoader

2.2.3. java.lang.ClassLoader

2.2.4. Java name spaces

2.3. Java’s built-in ClassLoaders

2.3.1. java.security.SecureClassLoader

2.3.2. java.net.URLClassLoader

2.3.3. sun.applet.AppletClassLoader

2.3.4. java.rmi.server.RMIClassLoader

2.3.5. Bootstrap ClassLoader

2.3.6. sun.misc.Launcher$ExtClassLoader

2.4. Summary

2.5. Additional reading

3. Custom ClassLoaders

3.1. Extending ClassLoader

3.1.1. FileSystemClassLoader

3.1.2. HashtableClassLoader

3.1.3. CompilerClassLoader

3.1.4. StrategyClassLoader and ClassLoaderStrategy

3.1.5. CompositeClassLoader

3.1.6. Other ClassLoader tricks

3.1.7. Other ClassLoaders

3.2. On-the-fly code upgrades

3.3. GJAS: first steps

3.3.1. Goals 85 Service

3.3.2. Server

3.3.3. ServerManager

3.4. Summary

4. Extensions

4.1. Types of extensions

4.1.1. Installed extensions

4.1.2. Building an installed extension

4.1.3. Download extensions

4.1.4. Building a download extension

4.2. Implications of the extensions mechanism

4.2.1. Distributed libraries through download extensions

4.2.2. Java EXEs; relation to C++ static linking

4.3. Packaging extensions

4.3.1. The build-time vs. run-time dilemma

4.4. The plug-in

4.4.1. The plug-in concept

4.4.2. Enter plug-ins

4.4.3. Marking a .jar file as a plug-in

4.4.4. PluginClassLoader

4.4.5. Example: PluginApp

4.4.6. Uses for plug-ins

4.5. Summary

5. Threads

5.1. Why threads?

5.1.1. Concurrent processing

5.1.2. Scalability per machine

5.1.3. Encapsulation

5.1.4. Design and implementation

5.2. Java threads

5.2.1. java.lang.Thread and java.lang.Runnable

5.2.2. Starting threads

5.2.3. Stopping threads

5.2.4. Daemon threads

5.2.5. Threads and ClassLoaders

5.2.6. java.lang.ThreadGroup

5.3. Thread implementations in Java

5.3.1. Green threads

5.3.2. Native threads

5.3.3. Hybrids

5.3.4. Implications

5.4. Summary

5.5. Additional reading

6. Threading issues

6.1. Synchronization

6.1.1. Thread-local storage

6.2. Exception-handling with multiple threads

6.3. Thread idioms and patterns

6.3.1. Client-Dispatcher-Server

6.3.2. Fire-and-forget

6.3.3. Active Object

6.3.4. SpinLoop

6.3.5. Polling (PeriodicThread)

6.3.6. DelayedFire (ScheduledThread)

6.3.7. Futures

6.4. GJAS

6.4.1. Adding thread support to GJAS

6.5. Summary

6.6. Additional reading

7. Control

7.1. GJAS

7.1.1. Local implementation

7.1.2. Example: HelloService

7.2. Testing the LocalServer implementation

7.3. ExecService

7.4. HelloAgainService

7.4.1. ThreadServer

7.4.2. Example: ConsoleControlService

8. Remote control

8.1. RMI implementation

8.1.1. Analysis

8.2. Other implementations

8.3. Necessary improvements

8.4. Additional reading

9. Configuration

9.1. Java models

9.1.1. Interface: ConfigProperty and ConfigProperties

9.1.2. Usage

9.1.3. Configuration front ends

9.2. Summary

10. Sockets

10.1. Simple socket services

10.1.1. SocketClient

10.1.2. EchoService

10.1.3. TimeService

10.1.4. Analysis

10.2. Encapsulation and refactoring

10.2.1. SocketServer

10.2.2. Example: Echo2Service

10.3. Connection and ConnectionManager

10.3.1. Example: EchoConnection

10.3.2. Example: HTTPConnection

10.3.3. Servlets

10.4. Advanced Socket services

10.4.1. SocketClassLoader and SocketClassService

10.4.2. Concept: RedirectorService

10.4.3. Concept: FilterService

10.4.4. Other types

10.5. Summary

10.6. Additional reading

11. Servlets

11.1. Relationship to sockets

11.1.1. CodeServlet: A filtering servlet

11.1.2. HeaderFooter: a redirecting servlet

11.1.3. Server-side scripting capabilities

11.1.4. Servlets: Not just about HTML anymore

11.2. Servlets and the n-tier application

11.2.1. Separating logic from content

11.3. Servlets as a poor man’s RMI

11.3.1. Example: RemoteStorageServlet

11.3.2. Concept: poor man’s RMI

11.3.3. Concept: SOAP

11.4. Summary

11.5. Additional reading

12. Persistence

12.1. Java Serialization

12.1.1. Serialization to other places

12.1.2. Security and Serialization

12.1.3. Customized Serialization

12.1.4. Serialization and evolution

12.1.5. Replacement

12.2. Beyond the specification

12.2.1. Remote storage of objects

12.2.2. Example: RemoteStorageService and RemoteStorageClient

12.2.3. Remote construction of objects

12.2.4. Example: RemoteObjectFactory

12.3. JDBC

12.3.1. Transient data, state data, data that Isn’t data

12.3.2. Example: JDBCClassLoader

12.4. Summary

12.5. Additional reading

13. Business objects

13.1. Modeling data

13.1.1. Two-tier Systems vs. n-tier Systems

13.1.2. One-tier systems

13.1.3. Two-tier systems

13.1.4. n-tier systems

13.1.5. Benefits of an n-tier model

13.1.6. Business objects, entity relationships

13.1.7. Example: employee directory

13.1.8. Business objects layer interface layer

13.2. Using the Business Object layer

13.2.1. Classic Presentation Code: GUIs

13.2.2. Example: OrgTree

13.2.3. Feeling cheated?

13.3. Summary

13.4. Additional reading

14. Business object models

14.1. Example: HashtableModel

14.1.1. Overview

14.1.2. HashtablePerson, HashtableEmployee, HashtableManager

14.1.3. HashtableModel: Creating objects

14.1.4. HashtableModel: Finding objects

14.1.5. HashtableModel: Removing objects

14.1.6. Conclusion

14.2. Example: RDBMSModel

14.2.1. RDBMSModel: Storing Business Objects in an RDBMS

14.2.2. Overview

14.2.3. RDBMSPerson, RDBMSEmployee, RDBMSManager

14.2.4. RDBMSModel: Creating objects

14.2.5. RDBMSModel: Finding objects

14.2.6. RDBMSModel: Removing objects

14.2.7. Conclusion

14.3. Summary

14.4. Additional reading

15. Middleware

15.1. Why distribute?

15.1.1. Communication

15.1.2. Performance

15.1.3. Economics (clustering/fault-tolerance)

15.1.4. Reliability (clustering/load-balancing)

15.2. Distributed object design vs. classic object design

15.2.1. Stateful vs. stateless

15.3. Technologies

15.3.1. Raw access: Sockets

15.3.2. Java RPC: remote method invocation

15.3.3. Analysis

15.3.4. RMI/JRMP

15.3.5. Object Request Brokers: CORBA

15.3.6. Object Request Brokers: Distributed Component Object Model

15.3.7. Message-Oriented Middleware: JMS

15.3.8. Objects across the wire: Mobile objects

15.3.9. Objects across the wire: shared objects

15.4. Employee middleware models

15.4.1. RMI implementation

15.4.2. JSDTModel: Shared-object implementation

15.4.3. Analysis

15.5. Additional reading

16. Java Native Interface

16.1. ava Native Interface

16.1.1. Native code on the server

16.2. JNI essentials

16.2.1. Java calling native

16.2.2. Native calling Java

16.2.3. JNI invocation

16.2.4. JNI changes in JDK 1.2

16.3. Other methods of Java-to-native interaction

16.3.1. Sockets

16.3.2. CORBA

16.4. Integrating the server: GJAS goes native

16.4.1. Making GJAS an NT service

16.4.2. Using NT IPC mechanisms: Named pipe

16.5. Other JNI uses

16.5.1. Debugging support

16.5.2. JVMDI

16.5.3. JVMPI

16.6. Summary

16.7. Additional reading

17. Monitoring

17.1. Importance grows

17.1.1. Liveness

17.1.2. Notification

17.2. Summary

Epilogue

Where to go from here

Parting advice

Read all about COM, DCOM, and MTS

Read all about EJB

Read all about CORBA

Participate

Summary

index

About the book

Server-Based Java Programming isn't just about implementation—it's also about architecture, and design. You'll learn how to write the code that sustains a cutting-edge enterprise. You will learn nuts-and-bolts topics like ClassLoaders, threads, CORBA, RMI/IIOP, and JNI, as well as how to make each of these contribute to enterprise-wide goals such as fault-tolerance, easier system administration, five-nine availability, deployment without headaches, and lower development costs.

Translation rights for Server Based Java Programming have been granted for India and Korea. If you are interested in learning where to buy this book in a language other than English, please inquire at your local bookseller.

What's inside

What's Inside:

  • Concepts underlying J2EE such as:
    • EJB
    • Servlets
    • JDBC
    • JMS
    • JNDI
    • Lifecycle
  • Data and code distribution with:
    • Servlets
    • Sockets
    • Serialization
    • Mobile objects
  • Extensions
  • Threads
  • Distributing objects over a network
  • Making servers robust and scalable
  • Clustering, fault tolerance, and failover
  • ClassLoaders
  • System monitoring

About the author

Ted Neward is a C++ and Java developer, architect, consultant and instructor in the Sacramento area. He is the author of two other Manning books.


combo $49.95 pBook + PDF
eBook $39.99 PDF only

FREE domestic shipping on three or more pBooks