Advanced Programming for the Java 2 Platform with CD-ROM

Advanced Programming for the Java 2 Platform with CD-ROM

Multimedia Set(BK&CD-ROM)

$44.95

Temporarily Out of Stock Online

Eligible for FREE SHIPPING

Overview

Advanced Programming for the Java 2 Platform with CD-ROM by Calvin Austin, Monica Pawlan

Experienced developers know how fast moving and comprehensive the Java™ platform is. A good deal of know-how is required to fully exploit the wealth of functionality provided by its many application programming interfaces (APIs). Advanced programmers now have a new resource.

Advanced Programming for the Java™ 2 Platform uses all the best APIs to construct an advanced business application. It will efficiently guide you through the maze of Java APIs, while providing coverage of some key elements in developing advanced applications, such as:
  • Enterprise JavaBeans™ technology
  • Security and permissions
  • Data and transaction management
  • Performance tuning
  • Debugging
  • Distributed computing
  • Database access
  • Servlets
  • Project Swing
  • Native methods

In this practical, hands-on guide, the authors create an auction application to provide an in-depth look at the development, testing, and deployment of an enterprise-worthy application. They explore many common situations, leaving you with the knowledge you need to design, build, debug, and deploy your own solutions with the Java platform. After reading Advanced Programming for the Java™ 2 Platform you'll be able to create advanced applications faster than ever before.

The accompanying CD contains all the source code referenced in the book, the text of the book itself in html, and a Linux version of the J2SE™ SDK 1.2.2 and 1.3 beta update.



Product Details

ISBN-13: 9780201715019
Publisher: Addison Wesley Professional
Publication date: 09/20/2000
Edition description: BK&CD-ROM
Pages: 400
Product dimensions: 7.36(w) x 9.22(h) x 0.80(d)

Read an Excerpt

PREFACE:

As an experienced developer on the Java platform, you undoubtedly know how fast moving and comprehensive the platform is. Its many application programming interfaces (APIs) provide a wealth of functionality for all aspects of application and system-level programming. Although there are many good books and online documents that detail all the parameters of an API, finding a book that brings these APIs together and uses them to solve an advanced business problem has always been a challenge.

This book fills that void by presenting the design, development, test, deployment, and debugging phases for an enterprise-worthy auction application. It is not purely a reference for the Java APIs, but a practical, hands-on guide to building successful projects with the Java platform. Like any good handbook on your car or house, it includes an entire section on what to do if things do not go so well. You will find sections that detail everything from what steps to take when troubleshooting bugs to tips on performance.

The example application does not cover every possible programming scenario, but it explores many common situations and leaves you with a solid base of knowledge so you can go on and use the Java platform to design, build, debug, and deploy your own solutions. The use of one application throughout the book provides a tool to help you fast-track learning new features. For example, you gain a working knowledge of RMI in one section, and a following section on CORBA explains the similarities and differences between the two.

You can get a download of the example application source code and explore more information on any topic presented here byvisiting the Java Developer ConnectionSM (JDC) Web site at ...

Table of Contents

Preface xv
Matching Project Requirements with Technology
1(10)
Project Requirements
2(3)
Interview User Base
2(1)
Auction House Requirements
2(1)
User Requirements
2(1)
Model the Project
2(3)
Activity Diagram
5(1)
Choosing the Software
5(2)
Duke's Auction Demonstration
7(4)
Home Page
7(1)
Registration Page
8(1)
New Auction Items Today
8(1)
Items Closing Today
9(1)
All Items
9(1)
Search for Items
10(1)
Sell Item
10(1)
Auction House Application
11(26)
A Multitiered Application with Enterprise Beans
12(5)
Thin Client Programs and Multitiered Architecture
12(2)
Entity and Session Bean Differences
14(1)
Auction House Workings
15(1)
Developing and Running Applications
16(1)
How Multitiered Applications Work
16(1)
How Enterprise Beans Are Used in the Example
17(1)
AuctionServlet
18(1)
Entity Bean Classes
19(3)
AuctionItem Entity Beam
19(2)
Auction Items Table
21(1)
Registration Entity Bean
22(1)
Registration Table
22(1)
Session Bean Classes
22(2)
Bidder Session Bean
23(1)
Seller Session Bean
24(1)
Container Classes
24(1)
Examining a Container-Managed Bean
24(3)
Member Variables
24(1)
Create Method
25(1)
Entity Context Methods
25(1)
Load Method
26(1)
Store Method
26(1)
Connection Pooling
26(1)
Deployment Descriptor
26(1)
XML Deployment Descriptor
27(1)
Container-Managed Finder Methods
27(3)
Finder-Based Search
28(1)
AuctionServlet. SearchItems
29(1)
BidderBean.getMatchingItemsList
29(1)
AuctionItemHome.findA1MatchingItems
30(1)
AuctionItemBean Deployment Descriptor
30(1)
AuctionItemBean
30(3)
BidderBean
33(4)
Data and Transaction Management
37(20)
Bean-Managed Persistence and the JDBC Platform
38(3)
Connect to Database
38(1)
Create Method
38(1)
Load Method
39(1)
Refresh Method
39(1)
Store Method
40(1)
Find Method
41(1)
Managing Transactions
41(8)
Why Manage Transactions?
42(1)
Session Synchronization
42(1)
Container-Managed Example
43(1)
Session Synchronization Code
43(2)
Transaction Commit Mode
45(4)
Bean-Managed Finder Methods
49(5)
AuctionServlet.searchItems
50(2)
SearchBean
52(1)
Database Connection
52(1)
Get Matching Items List
52(1)
Creat Method
53(1)
SearchBean
54(3)
Distributed Computing
57(78)
Lookup Services
58(1)
Java Naming and Directory Interface
59(5)
CORBA Naming Service
60(3)
Interoperable Object References
63(1)
RMI Lookup Service
64(3)
RMI over Internet Inter-ORB Protocol
65(1)
Improving Lookup Performance
66(1)
RMI Registration Server
67(16)
About RMI
67(1)
RMI in the Auction Application
68(4)
Establishing Remote Communications
72(2)
RegistrationServer Class
74(5)
Registration Interface
79(1)
RegistrationHome Interface
79(1)
ReturnResults Interface
80(1)
SellerBean Class
80(3)
Common Object Request Broker Architecture
83(20)
IDL Mapping Scheme
83(1)
Quick Reference
83(4)
Other IDL Keywords and Types
87(2)
CORBA in the Auction Application
89(3)
Object Request Broker
92(3)
Helper and Holder Classes
95(1)
Garbage Collection
95(1)
CORBA Callbacks
96(3)
Using the Any Type
99(4)
In Conclusion
103(1)
JDBC Technology
103(15)
JDBC Drivers
103(2)
Database Connections
105(1)
Statements
105(2)
Caching Database Results
107(1)
Result Sets
108(1)
Scrolling Result Sets
108(6)
Controlling Transactions
114(2)
Escaping Characters
116(1)
Mapping Database Types
117(1)
Mapping Date Types
118(1)
Servlets
118(17)
HttpServlet
119(1)
The init Method
119(1)
The destroy Method
120(1)
The service Method
120(2)
HTTP Requests
122(1)
Using Cookies in Servlets
122(4)
HTTP Error Codes
126(1)
Reading GET and POST Values
127(5)
Threading
132(1)
HTTPS
132(3)
JNI Technology
135(24)
JNI Examples
136(4)
About the Example
136(1)
Generate the Header File
137(1)
Method Signature
137(1)
Implement the native Method
138(1)
Compile the Dynamic or Shared Object Library
139(1)
Run the Example
140(1)
Strings and Arrays
140(8)
Passing Strings
140(1)
Passing Arrays
141(2)
Pinning Arrays
143(1)
Object Arrays
144(1)
Multidimensional Arrays
145(3)
Other Programming Issues
148(11)
Language Issues
148(1)
Calling Methods
149(4)
Accessing Fields
153(1)
Threads and Synchronization
154(1)
Memory Issues
155(1)
Invocation
156(1)
Attaching Threads
157(2)
Project Swing: Building a User Interface
159(50)
Components and Data Models
160(21)
Lightweight Components
160(1)
Ordering Components
161(19)
Specialized Event Handling
180(1)
Project Swing Directions
180(1)
Printing API
181(7)
What Is in the Package?
181(1)
Printing an AWT Component
182(1)
Printing a Project Swing Component
183(1)
Printing Graphics in Project Swing
184(1)
Pring Dialog
184(2)
Page Setup Dialog
186(1)
Printing a Collection of Pages
187(1)
Advanced Printing
188(5)
Multiple Components per Page
188(1)
Components Larger Than One Page
189(2)
Printing a JTable Component
191(1)
Printing a Sales Report
192(1)
AuctionClient
193(9)
Report
202(2)
SalesReport
204(5)
Debugging Applets, Applications, and Servlets
209(38)
In a Rush?
210(1)
Collecting Evidence
210(6)
Installation and Environment
210(1)
CLASSPATH
211(1)
Class Loading
212(1)
Including Debug Code
213(1)
Turning Debug Information on at Run Time
213(1)
Creating Debug and Production Releases at Run Time
214(1)
Using Diagnostic Methods
214(1)
Adding Debug Information
215(1)
Running Tests and Analyzing
216(10)
Getting Behind the Seat with Jdb
216(1)
Simple Jdb Test Drive
216(6)
Remote Debugging
222(2)
Using Auto-Pilot
224(1)
Creating a Session Log
225(1)
Servlet Debugging
226(3)
Running Servletrunner in Debug Mode
226(1)
Running Java Web Server in Debug Mode
227(2)
Abstract Window Toolkit Debugging
229(2)
Using AWTEventListener
230(1)
Analyzing Stack Traces
231(13)
Sending a Signal to the Java VM
231(1)
The Java VM Generates a Stack Trace
232(1)
Core Files
232(1)
Using Debugging Tools or API Calls
232(1)
Which Release Generated the Stack Trace?
232(1)
Which Platform Generated the Stack Trace?
233(1)
Which Thread Package Was Used?
233(1)
What Are the Thread States?
233(1)
Examining Monitors
234(3)
Putting the Steps into Practice
237(3)
Expert's Checklist
240(1)
Stack Trace Examples
240(4)
Version Issues
244(3)
JDK 1.0.2 Deployment
244(1)
JDK 1.1 Deployment
244(1)
Java 2 Platform Deployment
245(1)
Netscape Deployment
245(1)
Internet Explorer Deployment
246(1)
Performance Techniques
247(42)
Improving Applet Download Speed
247(3)
Packaging Images into One Class
248(1)
Using JAR Files
249(1)
Thread Pooling
250(2)
Connection Pooling
252(11)
Wrapper Classes
253(5)
Deadlocks and Hangs
258(1)
Closing Connections
259(1)
Example Application
259(4)
Performance Features and Tools
263(6)
Java Virtual Machine Features
263(4)
Just-In-time Compilers
267(2)
Third-Party Tools
269(1)
Performance Analysis
269(8)
Profiling
269(1)
Analyze a Program
270(5)
Operating System Performance Tools
275(2)
Caching Client/Server Applications
277(5)
Caching One Object
277(2)
Caching Many Objects
279(3)
Pool
282(2)
Worker
284(1)
HttpServerWorker
285(1)
HttpServer
286(3)
Deploying the Auction Application
289(16)
JAR File Format
290(5)
Bundle and Deploy the HTML Files
290(1)
Bundle and Dpeloy the Enterprise Beans
291(3)
Bundle and Deploy the Applet Program
294(1)
Deploy to Solaris Operating System
295(5)
Get Downloads
295(1)
Extract Downloaded Files
296(1)
Install Java Plug-In
296(1)
Install Java Plug-In Patches
296(1)
Install Netscape Communicator
297(1)
Check the Installation
297(1)
Install the HTML Converter
298(1)
Security Policy File
298(1)
Run the Administration Applet
299(1)
Deploy to Win32 Platform
300(5)
Get Downloads
300(1)
Install JRE with Java Plug-In
301(1)
Install the HTML Converter
301(1)
Security Policy File
301(1)
Run the Administration Applet
302(1)
How Does It Work?
303(2)
Signed Applets and Security Managers
305(14)
Signed Applets
305(6)
Signed Applet Example
306(2)
Intranet Developer
308(1)
End User
309(2)
Running an Application with a Policy File
311(1)
Signed Applets in JDK 1.1
311(1)
Writing a Security Manager
311(8)
The FileIO Program
311(3)
The PasswordSecurityManager Class
314(3)
Reference Information
317(2)
Appendix A Security and Permissions 319(16)
Overview
320(1)
Knowing Which Permissions
321(1)
AllPermission
321(1)
AWTPermission
322(1)
FilePermission
323(1)
NetPermission
324(1)
PropertyPermission
324(1)
ReflectPermission
325(1)
RuntimePermission
325(3)
SecurityPermission
328(4)
SerializablePermission
332(1)
SocketPermission
332(3)
Appendix B Classes, Methods, and Permissions 335(16)
java.awt.Graphics2D
337(1)
java.awt.Toolkit
337(1)
java.awt.Window
337(1)
java.beans.Beans
338(1)
java.beans.Introspector
338(1)
java.beans.PropertyEditorManager
338(1)
java.io.File
338(1)
java.io.FileInputStream
339(1)
java.io.FileOutputStream
339(1)
java.io.ObjectInputStream
339(1)
java.io.ObjectOutputStream
339(1)
java.io.RandomAccessFile
339(1)
java.lang.Class
340(1)
java.lang.ClassLoader
341(1)
java.lang.Runtime
341(1)
java.lang.SecurityManager
342(1)
java.lang.System
342(1)
java.lang.Thread
342(2)
java.lang.ThreadGroup
344(1)
java.lang.reflect.AccessibleObject
344(1)
java.net.Authenticator
344(1)
java.net.DatagramSocket
345(1)
java.net.HttpURL Connection
345(1)
java.net.InetAddress
346(1)
java.net.MulticastSocket
346(1)
java.net.ServerSocket
346(1)
java.net.Socket
347(1)
java.net.URL
347(1)
java.net.URLConnection
347(1)
java.net.URLClassLoader
347(1)
java.rmi.activation.ActivationGroup
347(1)
java.rmi.server.RMISocketFactory
348(1)
java.security.Identity
348(1)
java.security.IdentityScope
348(1)
java.security.Permission
348(1)
java.security.Policy
348(1)
java.security.Provider
348(1)
java.security.SecureClassLoader
349(1)
java.security.Security
349(1)
java.security.Signer
349(1)
java.util.Locale
349(1)
java.util.zip.ZipFile
349(2)
Appendix C Security manager Methods 351(4)
Appendix D API Reference 355(14)
ActionListener Interface
355(1)
WindowListener Interface
355(1)
Graphics Class
356(1)
Graphics2D Class
356(1)
Book Class
356(1)
PageFormate Class
356(1)
Printable Interface
356(1)
PrinterJob Class
357(1)
Toolkit Class
357(1)
ByteArrayOutputStream Class
357(1)
DataOutputStream Class
357(1)
Double Class
357(1)
SecurityManager Class
357(1)
System Class
358(1)
Naming Class
358(1)
RMISocketFactory Class
358(1)
CallableStatement Interface
358(1)
Connection Interface
358(1)
DatabaseMetaData Interface
359(1)
DriverManager Class
359(1)
PreparedStatement Interface
359(1)
ResultSet Interface
359(1)
Statement Interface
360(1)
ArrayList Class
360(1)
Calendar Class
360(1)
Date Class
360(1)
Enumeration Interface
361(1)
HashMap Class
361(1)
Iterator Interface
361(1)
LinkedList Class
361(1)
List Class
361(1)
EntityBean Interface
361(1)
SessionBean Interface
362(1)
UserTransaction Interface
362(1)
RemoteObject Class
362(1)
Cookie Class
362(1)
HttpServlet Class
362(1)
HttpServletRequest Interface
363(1)
HttpServletResponse Interface
363(1)
ServletConfig Interface
363(1)
ServletRequest Interface
363(1)
ServletResponse Interface
363(1)
Box Class
363(1)
DefaultCellEditor Class
364(1)
JButton Class
364(1)
JComponent Class
364(1)
JFrame Class
364(1)
JLabel Class
364(1)
JScrollPane Class
364(1)
JTable Class
364(1)
JTree Class
365(1)
JViewPort Class
365(1)
ListSelectionModel Interface
365(1)
SwingUtilities Class
365(1)
DefaultTableCellRenderer Class
365(1)
DefaultTableModel Class
366(1)
TableColumn Class
366(1)
TableColumnModel Interface
366(1)
DefaultMutableTreeNode Class
366(1)
TreePath Class
366(1)
Any Class
366(1)
IntHolder Class
366(1)
ORB Class
367(1)
NameComponent Class
367(1)
NamingContext Interface
367(1)
JNI C Methods
367(2)
Index 369

Preface

As an experienced developer on the Java platform, you undoubtedly know how fast moving and comprehensive the platform is. Its many application programming interfaces (APIs) provide a wealth of functionality for all aspects of application and system-level programming. Although there are many good books and online documents that detail all the parameters of an API, finding a book that brings these APIs together and uses them to solve an advanced business problem has always been a challenge.

This book fills that void by presenting the design, development, test, deployment, and debugging phases for an enterprise-worthy auction application. It is not purely a reference for the Java APIs, but a practical, hands-on guide to building successful projects with the Java platform. Like any good handbook on your car or house, it includes an entire section on what to do if things do not go so well. You will find sections that detail everything from what steps to take when troubleshooting bugs to tips on performance.

The example application does not cover every possible programming scenario, but it explores many common situations and leaves you with a solid base of knowledge so you can go on and use the Java platform to design, build, debug, and deploy your own solutions. The use of one application throughout the book provides a tool to help you fast-track learning new features. For example, you gain a working knowledge of RMI in one section, and a following section on CORBA explains the similarities and differences between the two.

You can get a download of the example application source code and explore more information on any topic presented here by visiting theJava Developer ConnectionSM (JDC) Web site at http://developer.java.sun.com, or the main Java Web site at http://java.sun.com.

The example for this book is an auction application, chosen because of the growing popularity of and interest in Web-based electronic commerce. The example runs on a real application server using Enterprise JavaBeans technology, which is particularly well-suited to electronic commerce applications. Later chapters expand the core example by adding advanced functionality, improvements, and alternative solutions to do some of the things you get for free when you use the Enterprise JavaBeans platform. Additional topics important to applications development such as security, transaction management, and performance tuning are also presented.

This book is for developers with more than a beginning level of understanding of writing programs in the Java programming language. The example application is written with the Java 2 platform APIs and explained in terms of functional hows and whys, so if you need help installing the Java platform, setting up your environment, or getting your first application to work, you should first read a more introductory book such as Essentials of the Java Programming Langauge: A Hands-On Guide Paw00 or The Java Tutorial, Second Edition Cam98.



Customer Reviews

Most Helpful Customer Reviews

See All Customer Reviews