1. Trang chủ
  2. » Ngoại Ngữ

Advanced java 2 platform how to program

1,9K 117 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 1.875
Dung lượng 20,51 MB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

Web-Based Training published by Prentice Hall How to Program Series Advanced Java ™ 2 Platform How to Program C How to Program, 3/E C++ How to Program, 3/E C# How to Program e-Business a

Trang 1

Advanced Java 2 Platform

Trang 2

Web-Based Training published by Prentice Hall

How to Program Series

Advanced Java ™ 2 Platform How to Program

C How to Program, 3/E

C++ How to Program, 3/E

C# How to Program

e-Business and e-Commerce How to Program

Internet and World Wide Web How

to Program, 2/E

Java ™ How to Program, 4/E

Perl How to Program

Visual Basic ® 6 How to Program

Visual Basic ® NET How to Program

Visual C++ ® NET How to Program

Wireless Internet & Mobile Business How

to Program

XML How to Program

Multimedia Cyber Classroom and

Web-Based Training Series

(for information regarding Deitel™ Web-based

training visit www.ptgtraining.com)

Advanced Java ™ 2 Platform Multimedia

Cyber Classroom

C++ Multimedia Cyber Classroom, 3/E

C# Multimedia Cyber Classroom, 3/E

e-Business and e-Commerce Multimedia

Cyber Classroom

Internet and World Wide Web Multimedia

Cyber Classroom, 2/E

Java ™ 2 Multimedia Cyber Classroom, 4/E

Perl Multimedia Cyber Classroom

Visual Basic ® 6 Multimedia Cyber Classroom

Visual Basic ® NET Multimedia Cyber

Classroom

Visual C++ ® NET Multimedia Cyber Classroom

Wireless Internet & Mobile Business

Programming Multimedia Cyber Classroom

XML Multimedia Cyber Classroom

The Complete Training Course Series

The Complete Advanced Java ™ 2 Platform Training Course

The Complete C++ Training Course, 3/E The Complete C# Training Course, 3/E The Complete e-Business and e-Commerce Programming Training Course The Complete Internet and World Wide Web Programming Training Course The Complete Java ™ 2 Training Course, 3/E The Complete Perl Training Course The Complete Visual Basic ® 6 Training Course The Complete Visual Basic ® NET

Training Course The Complete Visual C++ ® NET Training Course

The Complete Wireless Internet & Mobile Business Programming Training Course The Complete XML Training Course

.NET Series

C# How to Program Visual Basic ® NET How to Program Visual C++ ® NET How to Program

Visual Studio ® Series

Getting Started with Microsoft ® Visual C++ ™ 6 with an Introduction to MFC

Visual Basic ® 6 How to Program C# How to Program

Visual Basic ® NET How to Program Visual C++ ® NET How to Program

For Managers Series

e-Business and e-Commerce for Managers

Coming Soon

e-books and e-whitepapers

To communicate with the authors, send email to:

Trang 3

Deitel & Associates, Inc.

PRENTICE HALL, Upper Saddle River, New Jersey 07458

Trang 4

Vice President and Editorial Director: Marcia Horton

Acquisitions Editor: Petra J Recter

Assistant Editor: Sarah Burrows

Project Manager: Crissy Statuto

Editorial Assistant: Karen Schultz

Production Editor: Camille Trentacoste

Managing Editor: David A George

Executive Managing Editor: Vince O’Brien

Chapter Opener and Cover Designer: Tamara Newnam Cavallo

Art Director: Heather Scott

Marketing Manager: Jennie Burger

Manufacturing Buyer: Pat Brown

Manufacturing Manager: Trudy Pisciotti

Assistant Vice President of Production and Manufacturing: David W Riccardi

© 2001 by Prentice-Hall, Inc.

Upper Saddle River, New Jersey 07458

The authors and publisher of this book have used their best efforts in preparing this book These efforts include the development, research, and testing of the theories and programs to determine their effectiveness The authors and publisher make no warranty of any kind, expressed or implied, with regard to these programs or to the docu- mentation contained in this book The authors and publisher shall not be liable in any event for incidental or con- sequential damages in connection with, or arising out of, the furnishing, performance, or use of these programs Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trade- marks and registered trademarks Where those designations appear in this book, and Prentice Hall and the authors were aware of a trademark claim, the designations have been printed in initial caps or all caps All product names mentioned remain trademarks or registered trademarks of their respective owners.

All rights reserved No part of this book may be

reproduced, in any form or by any means,

without permission in writing from the publisher.

Printed in the United States of America

10 9 8 7 6 5 4 3 2 1

ISBN 0-13-034151-7

Prentice-Hall International (UK) Limited, London

Prentice-Hall of Australia Pty Limited, Sydney

Prentice-Hall Canada Inc., Toronto

Prentice-Hall Hispanoamericana, S.A., Mexico

Prentice-Hall of India Private Limited, New Delhi

Prentice-Hall of Japan, Inc., Tokyo

Pearson Education Asia Pte Ltd., Singapore

Editora Prentice-Hall do Brasil, Ltda., Rio de Janeiro

Trang 5

Joseph Deitel:

“His pleasure was giving.”

Harvey and Paul Deitel

For my brother Tim, who, by his example, always has challenged me to excel.

Sean

Trang 6

Java and all Java-based marks are trademarks or registered trademarks of Sun Microsystems, Inc in the United States and other countries Prentice Hall is independent of Sun Microsystems, Inc Copyright © 2000 Microsoft Corporation, One Microsoft Way, Redmond, Washington 98052-6399 U.S.A All rights reserved

Netscape Communicator browser window© 1999 Netscape Communications Corporation Used with permission Netscape Communications has not authorized, sponsored, endorsed, or approved this publication and is not responsible for its content

Openwave, the Openwave logo, and UP.SDK are trademarks of Openwave Systems Inc All rightsreserved."

Palm OS, Palm Computing, HandFAX, HandSTAMP, HandWEB, Graffiti, HotSync, iMEssenger, MultiMail, Palm.Net, PalmConnect, PalmGlove, PalmModem, PalmPoint, PalmPrint, PalmSource, and the Palm Platform Compatible Logo are registered trademarks of Palm, Inc Palm, the Palm logo, MyPalm, PalmGear, PalmPix, PalmPower, AnyDay, EventClub, HandMAIL, the HotSync Logo, PalmGlove, Palm Powered, the Palm trade dress, Smartcode, Simply Palm, We Sync and Wireless Refresh are trademarks of Palm, Inc

Trang 7

1.2.1 Advanced GUI, Graphics and JavaBeans 3

1.5.5 Further Study on Design Patterns 27

2 Advanced Swing Graphical User Interface

Trang 8

3.6.2 Custom TreeModel Implementation 123

4.5 A Java 3D Case Study: A 3D Game with Custom Behaviors 179

5 Case Study: Java 2D GUI Application with

5.6 Deitel Drawing Controller Logic 2605.6.1 MyShapeControllers for Processing User Input 2605.6.2 MyShapeControllers and Factory Method Design Pattern 272

Trang 9

7.12 Digital Signatures for Java Code 413

7.13.3 Java Authentication and Authorization Service (JAAS) 418

7.14.1 Java Secure Socket Extension (JSSE) 4247.15 Java Language Security and Secure Coding 4297.16 Internet and World Wide Web Resources 430

8.4.4 Merging Data from Multiple Tables: Joining 459

Trang 10

8.5 Creating Database books in Cloudscape 4638.6 Manipulating Databases with JDBC 4648.6.1 Connecting to and Querying a JDBC Data Source 4648.6.2 Querying the books Database 4708.7 Case Study: Address-Book Application 479

9.3.1 Setting Up the Apache Tomcat Server 5439.3.2 Deploying a Web Application 5459.4 Handling HTTP get Requests Containing Data 549

9.6 Redirecting Requests to Other Resources 556

10.3 A First JavaServer Page Example 596

Trang 11

10.6.1 <jsp:include> Action 60510.6.2 <jsp:forward> Action 61010.6.3 <jsp:plugin> Action 61310.6.4 <jsp:useBean> Action 617

10.8.2 Custom Tag with Attributes 64310.8.3 Evaluating the Body of a Custom Tag 64710.9 Internet and World Wide Web Resources 653

11.4 Obtaining the Book List from the Database 667

11.6 Adding an Item to the Shopping Cart 683

11.10 Deploying the Bookstore Application in J2EE 1.2.1 69411.10.1 Configuring the books Data Source 69511.10.2 Launching the Cloudscape Database and J2EE Servers 69511.10.3 Launching the J2EE Application Deployment Tool 69611.10.4 Creating the Bookstore Application 69711.10.5 Creating BookServlet and AddToCartServlet Web Components 69811.10.6 Adding Non-Servlet Components to the Application 70411.10.7 Specifying the Web Context, Resource References, JNDI

11.10.8 Deploying and Executing the Application 709

12 Java-Based Wireless Applications

12.4.1 Connected Limited Device Configuration (CLDC) 75812.4.2 Mobile Information Device Profile (MIDP) 759

Trang 12

12.6 Internet and World Wide Web Resources 785

13.2 Case Study: Creating a Distributed System with RMI 79213.3 Defining the Remote Interface 79213.4 Implementing the Remote Interface 79313.5 Compiling and Executing the Server and the Client 80713.6 Case Study: Deitel Messenger with Activatable Server 80913.6.1 Activatable Deitel Messenger ChatServer 81013.6.2 Deitel Messenger Client Architecture and Implementation 82013.6.3 Running the Deitel Messenger Server and Client Applications 83613.7 Internet and World Wide Web Resources 840

14.4.1 MoneyTransfer EJB Home and Remote Interfaces 87914.4.2 Bean-Managed Transaction Demarcation 88114.4.3 Container-Managed Transaction Demarcation 88614.4.4 MoneyTransfer EJB Client 89214.4.5 Deploying the MoneyTransfer EJB 89814.5 Internet and World Wide Web Resources 900

15.4 Employee EJB Home and Remote Interfaces 90615.5 Employee EJB with Bean-Managed Persistence 90815.5.1 Employee EJB Implementation 90815.5.2 Employee EJB Deployment 91815.6 Employee EJB with Container-Managed Persistence 920

15.8 Internet and World Wide Web Resources 934

Trang 13

16.4.1 Weather Application: Overview 95216.4.2 Weather Application: Publisher Side 95316.4.3 Weather Application: Subscriber Side 95816.4.4 Weather Application: Configuring and Running 96716.5 Message-Driven Enterprise JavaBeans 96816.5.1 Voter Application: Overview 96816.5.2 Voter Application: Receiver Side 96916.5.3 Voter Application: Configuring and Running 978

17 Enterprise Java Case Study: Architectural Overview 990

18 Enterprise Java Case Study: Presentation

Trang 15

22.8 Introduction to High-Level Helper Utilities 1232

Trang 16

23.11 Updating Entries with Jini Transaction Service 128423.11.1 Defining the User Interface 128523.11.2 Discovering the TransactionManager Service 1287

23.12 Case Study: Distributed Image Processing 129423.12.1 Defining an Image Processor 129523.12.2 Partitioning an Image into Smaller Pieces 130123.12.3 Compiling and Running the Example 131223.13 Internet and World Wide Web Resources 1314

Trang 17

26.10 Internet and World Wide Web Resources 1499

27.2 Static Invocation Interface (SII), Dynamic Invocation Interface (DII)

and Dynamic Skeleton Interface (DSI) 1510

27.4.5 Event and Notification Services 1520

27.7 RMIMessenger Case Study Ported to RMI-IIOP 153127.7.1 ChatServer RMI-IIOP Implementation 153227.7.2 ChatClient RMI-IIOP Implementation 153827.7.3 Compiling and Running the ChatServer and ChatClient 1542

27.9 Internet and World Wide Web Resources 1543

28.2 Client/Server and Peer-to-Peer Applications 154928.3 Centralized vs Decentralized Network Applications 155028.4 Peer Discovery and Searching 1551

Trang 18

28.5 Case Study: Deitel Instant Messenger 155128.6 Defining the Service Interface 155328.7 Defining the Service implementation 1555

28.10 Compiling and Running the Example 157128.11 Improving Deitel Instant Messenger 157128.12 Deitel Instant Messenger with Multicast Sockets 1572

28.14 Internet and World Wide Web Resources 1590

29.2 Simple Object Access Protocol (SOAP) 1596

29.4 Internet and World Wide Web Resources 1608

A.3 Parsers and Well-Formed XML Documents 1615

A.4.2 White Space, Entity References and Built-In Entities 1616

A.7 Internet and World Wide Web Resources 1623

B.2 Parsers, Well-Formed and Valid XML Documents 1628

B.4.1 Sequences, Pipe Characters and Occurrence Indicators 1631

B.6.1 Tokenized Attribute Type (ID, IDREF, ENTITY, NMTOKEN) 1638

B.9 Internet and World Wide Web Resources 1647

Trang 19

C.7 Internet and World Wide Web Resources 1671

D.9 Internet and World Wide Web Resources 1695

Trang 20

G.2 Getting Started with Java Native Interface 1706G.3 Accessing Java Methods and Objects from Native Code 1710

G.6 Internet and World Wide Web Resources 1733

H.3.2 Problems with Recruiting on the Web 1745

H.5.6 Students and Young Professionals 1752

H.6 Internet and World Wide Web Resources 1754

Trang 21

2 Advanced Swing Graphical User Interface Components

2.1 WebBrowserPane subclass of JEditorPane for viewing Web

sites and maintaining URL history 312.2 Toolbars for navigating the Web in Internet Explorer and Mozilla 342.3 WebToolBar JToolBar subclass for navigating URLs in a

2.4 WebBrowser application for browsing Web sites using

2.5 ActionSample application demonstrating the Command design

2.6 Action class static keys for Action properties. 452.7 FavoritesWebBrowser application for displaying two Web pages

2.8 Tabbed interface of Display Properties dialog box in Windows 2000. 482.9 TabbedPaneWebBrowser application using JTabbedPane to browse

multiple Web sites concurrently 492.10 MDIWebBrowser application using JDesktopPane and

JInternalFrames to browse multiple Web sites concurrently 522.11 DnDWebBrowser application for browsing Web sites that also

accepts drag-and-drop operations for viewing HTML pages 572.12 WebToolBar that uses ResourceBundles for internationalization. 632.13 MyAbstractAction AbstractAction subclass that provides

Trang 22

3.1 Model-view-controller architecture 873.2 Delegate-model architecture in Java Swing components 873.3 AccountManager application MVC architecture 893.4 Account Observable class that represents a bank account 893.5 AbstractAccountView abstract base class for observing Accounts. 913.6 AccountTextView for displaying observed Account information

3.7 AccountBarGraphView for rendering observed Account

3.8 AssetPieChartView for rendering multiple observed asset

3.9 AccountController for obtaining user input to modify Account

3.10 AccountManager application for displaying and modifying Account

information using the model-view-controller architecture 1053.11 JList and ListModel delegate-model architecture. 1083.12 PhilosophersJList application demonstrating JList and

3.13 TableModel interface methods and descriptions 1113.14 JTable and TableModel delegate-model architecture. 1123.15 PhilosophersJTable application demonstrating JTable and

3.16 JTree showing a hierarchy of philosophers 1163.17 PhilosophersJTree application demonstrating JTree and

3.18 FileSystemModel implementation of interface TreeModel

3.19 FileTreeFrame application for browsing and editing a file system

using JTree and FileSystemModel. 129

Trang 23

4 Graphics Programming with Java 2D and Java 3D

4.1 Java coordinate system Units are measured in pixels 1374.2 Some Java 2D classes and interfaces 1384.3 The seven state attributes of a Java 2D graphics context 1394.4 Demonstrating some Java 2D shapes 140

4.6 Class ImagePanel allows for displaying and filtering BufferedImages. 1474.7 Java2DImageFilter interface for creating Java 2D image filters 1504.8 Classes that implement BufferedImageOp and RasterOp. 1514.9 InvertFilter inverts colors in a BufferedImage. 1524.10 SharpenFilter sharpens edges in a BufferedImage. 1534.11 BlurFilter blurs the colors in a BufferedImage. 1534.12 ColorFilter changes the colors in a BufferedImage. 1544.13 Java 2D image-processing application GUI 1564.14 Java 3D Group, Leaf and NodeComponent subclasses. 1624.15 Creating a Java 3D SimpleUniverse with content. 1634.16 Demonstrating MouseRotate behavior. 1704.17 Demonstrating MouseTranslate behavior. 1714.18 Demonstrating MouseZoom behavior. 1724.19 Demonstrating changing color in Java 3D 1734.20 Demonstrating texture mapping in Java 3D 1744.21 ControlPanel provides Swing controls for Java3DWorld. 1754.22 GUI for Java3DWorld and ControlPanel. 1794.23 Class Java3DWorld1 creates the 3D-game environment. 1814.24 Implementing collision detection in a Java 3D application 1984.25 Behavior that enables the user to navigate a 3D shape 2004.26 Keys for navigating the 3D scene in Navigator. 2044.27 Implementing a position-checking Behavior. 2054.28 Implementing Swing controls for the Java3DWorld1. 210

5 Case Study: Java 2D GUI Application with Design Patterns

5.1 Deitel Drawing application showing randomly drawn shapes

(Exercise 5.8) and a ZoomDrawingView (Fig 5.13). 2235.2 Large-scale view of drawing from Fig 5.1 2235.3 MyShape abstract base class for drawing objects 2245.4 MyLine subclass of class MyShape that represents a line. 2305.5 MyRectangle subclass of class MyShape that represents a rectangle. 2325.6 MyOval subclass of class MyShape that represents an oval. 2345.7 MyText subclass of class MyShape that represents a string of text. 2355.8 MyImage subclass of class MyShape that represents a JPEG

5.9 DrawingModel Observable class that represents a drawing

5.10 DrawingFileReaderWriter utility class for saving drawings

to files and loading drawings from files 2455.11 Sample XML document generated by DrawingFileReaderWriter. 252

Trang 24

5.15 BoundedShapeController MyShapeController subclass for

controlling MyLines, MyOvals and MyRectangles. 2665.16 MyLineController MyShapeController subclass for

5.17 MyTextController MyShapeController subclass for

adding MyText instances to a drawing. 2695.18 MyShapeControllerFactory class for creating appropriate

MyShapeController for given MyShape type. 2735.19 DragAndDropController for moving MyShapes between

drawings and adding JPEG images to drawings using drag and drop 2765.20 DragSourceListener interface methods and their descriptions 2845.21 DropTargetListener interface methods and their descriptions 2855.22 TransferableShape enables DragAndDropController

to transfer MyShape objects through drag-and-drop operations 2855.23 DrawingInternalFrame class that provides a user interface

5.24 DrawingFileFilter is a FileFilter subclass that enables

users to select Deitel Drawing files from JFileChooser dialogs. 3045.25 ZoomDialog for displaying DrawingModels in a scalable view. 3055.26 AbstractDrawingAction abstract base class for Actions. 3065.27 GradientIcon implementation of interface Icon that draws a gradient. 3075.28 DeitelDrawing application that uses a multiple-document interface for

displaying and modifying DeitelDrawing drawings. 3095.29 SplashScreen class for displaying a logo while the application loads 317

6.1 Forte for Java Community Edition 2.0 324

6.4 Select JavaBean and Palette Category dialogs. 3256.5 Beans tab in the Component Palette and tooltip for

6.6 Filesystems tab in the Explorer window. 3256.7 Development directory selected in Explorer window. 326

6.11 Component Inspector and Form windows. 327

6.13 Beans tab of the Component Palette. 328

6.15 LogoAnimator animation in the Form window. 329

Trang 25

6.16 Component Inspector with LogoAnimator Properties sheet. 3296.17 Component Inspector drop down-menu for the background property. 3306.18 Changing background color of LogoAnimator. 3306.19 AnimationWindow selected in Explorer. 3316.20 Selecting FlowLayout in the Explorer menu. 3316.21 Swing tab of the Component Palette. 3326.22 JButton icon in the Component Palette. 3326.23 Adding a JButton to AnimationWindow. 3326.24 Editing text property of JButton. 332

6.26 Component Palette Connection mode. 333

6.28 Connecting JButton and LogoAnimator. 334

6.30 Select actionPerformed event. 3356.31 Selecting method startAnimation for the target component. 3356.32 Select Execute from Explorer menu. 3366.33 AnimationWindow running in Forte. 3366.34 Definition of class LogoAnimator. 3376.35 Compile option in the Source Editor menu. 3416.36 Method file manifest.tmp for the LogoAnimator bean. 3416.37 Add images directory to LogoAnimator.jar. 3446.38 Manifest tab of JAR Packager dialog. 3446.39 LogoAnimator2 with property animationDelay. 3456.40 LogoAnimator2 bean with property animationDelay exposed

in Forte’s Component Inspector. 3476.41 Definition for class SliderFieldPanel. 3486.42 Manifest file for the SliderFieldPanel JavaBean. 3536.43 Change properties currentValue and maximumValue. 353

6.45 Select animationDelay property of LogoAnimator2. 3546.46 Select currentValue Bound Property. 3546.47 JFrame with LogoAnimator2 and SliderFieldPanel. 3556.48 ColorEvent custom-event class indicating a color change 3566.49 ColorListener interface for receiving colorChanged notifications. 3566.50 Definition of class ColorSliderPanel. 3576.51 Manifest file for the ColorSliderPanel JavaBean. 3626.52 Selecting colorChanged method in Connection Wizard. 3626.53 Selecting setBackground method for target LogoAnimator2. 3636.54 Entering user code in Connection Wizard. 3636.55 Using the ColorSliderPanel to change the background color of

Trang 26

6.59 MinimumValueEditor is a PropertyEditor for

SliderFieldPanel ’s minimumValue property. 3736.60 MaximumValueEditor and MinimumValueEditor pull-down

7.6 EncipherDecipher application for demonstrating Password-Based

7.7 EncipherDecipher before and after encrypting contents 4057.8 A portion of the VeriSign digital certificate (Courtesy of VeriSign, Inc.) 4087.9 Some permissions available in the Java 2 security model 4117.10 AuthorizedFileWriter writes to file using a security manager 4117.11 Policy file grants permission to write to file authorized.txt. 4137.12 Policy file grants permission to the specified codebase 4137.13 Applet that browses a user’s local filesystem 4147.14 File listing for FileTreeApplet.jar. 4147.15 HTML file for FileTreeApplet. 4157.16 Java Plug-in security warning when loading a signed applet 4167.17 FileTreeApplet browsing the D:\jdk1.3.1\ directory. 4167.18 AuthenticateNT uses the NTLoginModule to authenticate a

user and invoke a PrivilegedAction. 4197.19 WriteFileAction is a PrivilegedAction for writing a

7.20 Configuration file for authentication using NTLoginModule. 4227.21 JAAS policy file for granting permissions to a Principal and codebase. 4227.22 Policy file for JAAS application 4227.23 LoginServer uses an SSLServerSocket for secure communication. 4257.24 LoginClient communicates with LoginServer via SSL. 4277.25 Two sample executions of class LoginClient. 429

8 Java Database Connectivity (JDBC)

8.1 Relational-database structure of an Employee table. 4478.2 Result set formed by selecting Department and Location data

8.4 Data from the authors table of books. 448

Trang 27

8.6 Data from the publishers table of books. 448

8.8 Data from the authorISBN table of books. 449

8.10 Data from the titles table of books. 4508.11 Table relationships in books. 451

8.13 authorID and lastName from the authors table. 4538.14 Titles with copyrights after 1999 from table titles. 4558.15 Authors whose last name starts with D from the authors table. 4558.16 The only author from the authors table whose last name contains i

8.17 Authors from table authors in ascending order by lastName. 4578.18 Authors from table authors in descending order by lastName. 4578.19 Authors from table authors in ascending order by lastName

8.20 Books from table titles whose title ends with How to Program

8.21 Authors and the ISBN numbers for the books they have written in

ascending order by lastName and firstName. 4598.22 Table Authors after an INSERT INTO operation to add a record. 4618.23 Table authors after an UPDATE operation to change a record. 4628.24 Table authors after a DELETE operation to remove a record. 4628.25 Executing Cloudscape from a command prompt in Windows 2000 4648.26 Displaying the authors table from the books database. 464

for accessing the addressbook database. 4868.35 DataAccessException is thrown when there is a problem

8.36 CloudscapeDataAccess implements interface

AddressBookDataAccess to perform the connection to the

database and the database interactions 4888.37 AddressBookEntryFrame for viewing and editing an

8.38 AddressBook application class that enables the user to interact

8.39 Screen captures of the AddressBook application. 511

Trang 28

8.40 Statement and PreparedStatement methods for batch updates. 5158.41 Return values of method executeBatch. 5168.42 Statement methods that enable processing of multiple results returned

9.1 Methods of interface Servlet (package javax.servlet). 5359.2 Other methods of class HttpServlet. 5379.3 Some methods of interface HttpServletRequest. 5379.4 Some methods of interface HttpServletResponse. 5389.5 WelcomeServlet that responds to a simple HTTP get request. 5409.6 HTML document in which the form’s action invokes

WelcomeServlet through the alias welcome1 specified in web.xml. 549.7 Tomcat documentation home page (Courtesy of The Apache

9.8 Web application standard directories 5459.9 Deployment descriptor (web.xml) for the advjhtp1 Web application. 5469.10 Web application directory and file structure for WelcomeServlet. 5489.11 WelcomeServlet2 responds to a get request that contains data. 5499.12 HTML document in which the form’s action invokes

WelcomeServlet2 through the alias welcome2 specified in web.xml. 5519.13 Deployment descriptor information for servlet WelcomeServlet2. 5529.14 WelcomeServlet3 responds to a post request that contains data. 5539.15 HTML document in which the form’s action invokes

WelcomeServlet3 through the alias welcome3 specified in web.xml. 5549.16 Deployment descriptor information for servlet WelcomeServlet3. 5559.17 Redirecting requests to other resources 5569.18 RedirectServlet.html document to demonstrate redirecting

9.19 Deployment descriptor information for servlet RedirectServlet. 5599.20 Storing user data on the client computer with cookies 5619.21 CookieSelectLanguage.html document for selecting a

programming language and posting the data to the CookieServlet. 5659.22 Deployment descriptor information for servlet CookieServlet. 5689.23 Important methods of class Cookie. 5689.24 Maintaining state information with HttpSession objects. 5699.25 SessionSelectLanguage.html document for selecting a

programming language and posting the data to the SessionServlet. 5719.26 Deployment descriptor information for servlet WelcomeServlet2. 5779.27 Multi-tier Web-based survey using XHTML, servlets and JDBC 5789.28 Survey.html document that allows users to submit survey responses

9.29 Deployment descriptor information for servlet SurveyServlet. 584

10 JavaServer Pages (JSP)

10.1 Using a JSP expression to insert the date and time in a Web page 596

Trang 29

document created by Fig 10.10 608

10.10 JSP include.jsp Includes resources with <jsp:include>. 608

10.11 JSP forward1.jsp receives a firstName parameter, adds a

date to the request parameters and forwards the request to

forward2.jsp for further processing 611

10.12 JSP forward2.jsp receives a request (from forward1.jsp

in this example) and uses the request parameters as part of the response

10.13 Attributes of the <jsp:plugin> action. 613

10.14 An applet to demonstrate <jsp:plugin> in Fig 10.15. 614

10.15 Using <jsp:plugin> to embed a Java 2 applet in a JSP. 616

10.16 Attributes of the <jsp:useBean> action. 618

10.17 Rotator bean that maintains a set of advertisements. 618

10.18 JSP adrotator.jsp uses a Rotator bean to display a different

advertisement on each request to the page 620

10.19 Attributes of the <jsp:setProperty> action. 622

10.20 GuestBean stores information for one guest. 623

10.21 GuestDataBean performs database access on behalf of

10.22 JavaServer page guestBookLogin.jsp enables the user to submit a

first name, a last name and an e-mail address to be placed in the guest book 626

10.23 JavaServer page guestBookView.jsp displays the contents of the

10.24 JavaServer page guestBookErrorPage.jsp responds to exceptions

in guestBookLogin.jsp and guestBookView.jsp. 63110.25 JSP guest book sample output windows 633

10.27 Attributes of the page directive. 635

10.28 JSP includeDirective.jsp demonstrates including content

at translation-time with directive include. 637

10.29 Attributes of the taglib directive. 639

10.30 JSP customTagWelcome.jsp uses a simple custom tag. 639

10.31 WelcomeTagHandler custom tag handler. 641

10.32 Custom tag library descriptor file advjhtp1-taglib.tld. 64210.33 Specifying attributes for a custom tag 644

10.34 Welcome2TagHandler custom tag handler for a tag with an attribute. 645

Trang 30

10.35 Element tag for the welcome2 custom tag. 64610.36 Using a custom tag that interacts with its body 647

10.37 GuestBookTag custom tag handler. 649

10.38 GuestBookTagExtraInfo used by the container to define

scripting variables in a JSP that uses the guestlist custom tag. 652

10.39 Element tag for the guestlist custom tag. 653

11 Case Study: Servlet and JSP Bookstore

11.1 Bug2Bug.com bookstore component interactions 66211.2 Servlet and JSP components for bookstore case study 66311.3 Bookstore home page (index.html). 66511.4 Shared cascading style sheet (styles.css) used to apply

common formatting across XHTML documents rendered on the client 66611.5 TitlesBean for obtaining book information from the books

database and creating an ArrayList of BookBean objects. 66711.6 BookBean that represents a single book’s information and

defines the XML format of that information 67011.7 JSP books.jsp returns to the client an XHTML document

11.8 BookServlet obtains the XML representation of a book and

applies an XSL transformation to output an XHTML document

11.9 XSL style sheet (books.xsl) that transforms a book’s XML

representation into an XHTML document 681

11.10 CartItemBeans contain a BookBean and the quantity of

11.11 AddToCartServlet places an item in the shopping cart and

invokes viewCart.jsp to display the cart contents. 685

11.12 JSP viewCart.jsp obtains the shopping cart and outputs an

XHTML document with the cart contents in tabular format 686

11.13 Order form (order.html) in which the user inputs name, address

and credit-card information to complete an order 689

11.14 JSP process.jsp performs the final order processing. 693

11.15 Application Deployment Tool main window. 697

11.17 Application Deployment Tool main window after creating a

11.18 New Web Component Wizard - Introduction window. 699

11.19 New Web Component Wizard - WAR File General

11.20 Add Files to WAR - Add Content Files window. 700

11.21 Add Files to WAR - Add Class Files window. 700

11.22 Choose Root Directory window. 701

11.23 Add Files to WAR - Add Class Files window after selecting

the root directory in which the files are located 701

11.24 New Web Component Wizard - WAR File General Properties

window after selecting the file BookServlet.class. 702

Trang 31

11.25 New Web Component Wizard - Choose Component Type window. 703

11.26 New Web Component Wizard - Component General Properties

11.27 New Web Component Wizard - Component Aliases window. 703

11.28 Application Deployment Tool window after deploying

11.29 Add Files to WAR - Add Content Files window. 705

11.30 Add Files to WAR - Add Class Files window. 706

11.31 Specifying the Web Context in the Application Deployment Tool. 707

11.32 Specifying the Resource Ref’s in the Application Deployment Tool. 707

11.33 Specifying the Resource Ref’s in the Application Deployment Tool. 708

11.34 Specifying the welcome file in the File Ref’s tab of the Application

11.35 Application Deployment Tool toolbar buttons for updating

application files and deploying applications 709

11.36 Deploy JSP and Servlet Bookstore - Introduction window. 709

12 Java-Based Wireless Applications Development

and J2ME

12.1 Three-tier architecture for Tip Test 71812.2 Database contents of tips.sql. 71812.3 Class WelcomeServlet sends an introductory screen that

provides game directions to a client 72012.4 Interface ClientUserAgentHeaders contains unique

User-Agent header substrings for all clients 72312.5 WelcomeServlet output (index.html) for XHTML client. 72312.6 WelcomeServlet output (index.wml) for WAP client (Image of

UP.SDK courtesy Openwave Systems Inc Openwave, the Openwave logo,

and UP.SDK are trademarks of Openwave Systems Inc All rights reserved.) 72412.7 WelcomeServlet output (index.html) for i-mode client (Courtesy

12.8 WelcomeServlet output (index.txt) for J2ME client (Courtesy

12.9 TipTestServlet handles game logic and sends Tip Test to clients 726

12.10 XHTMLTipQuestion.xsl transforms XML Tip-Test question to

12.11 Internet Explorer Tip-Test question output screen 743

12.12 XHTMLTipAnswer.xsl transforms XML Tip-Test answer to

12.13 Internet Explorer Tip-Test answer output screen 746

12.14 WAPTipQuestion.xsl transforms XML Tip-Test question to

12.15 Openwave UP simulator Tip-Test question screen (Image of UP.SDK

courtesy Openwave Systems Inc Openwave, the Openwave logo, and

UP.SDK are trademarks of Openwave Systems Inc All rights reserved.) 748

12.16 WAPTipAnswer.xsl transforms answer to WML document. 749

Trang 32

12.17 Openwave UP simulator Tip-Test answer screen (Image of UP.SDK

courtesy Openwave Systems Inc Openwave, the Openwave logo, and

UP.SDK are trademarks of Openwave Systems Inc All rights reserved.) 750

12.18 IMODETipQuestion.xsl transforms XML Tip-Test question to

12.19 Pixo i-mode browser Tip-Test question screen (Courtesy of Pixo, Inc.) 753

12.20 IMODETipAnswer.xsl transforms XML Tip-Test answer to cHTML

12.21 Pixo i-mode browser Tip-Test answer screen (Courtesy of Pixo, Inc.) 75512.22 J2ME client Tip-Test question screen (Courtesy of Sun Microsystems, Inc.) 75712.23 J2ME client Tip-Test answer screen (Courtesy of Sun Microsystems, Inc.) 757

12.24 J2ME java.io, java.lang and java.util packages. 758

12.25 MIDP javax.microedition.lcdui and

12.29 TipTestMIDlet main screen (Courtesy of Sun Microsystems, Inc.) 775

12.30 TipTestMIDlet welcome screen (Courtesy of Sun Microsystems, Inc.) 777

12.31 TipTestMIDlet information screen (Courtesy of Sun Microsystems, Inc.) 777

12.32 TipTestMIDlet Tip-Test question screen (Courtesy of Sun

13.5 WeatherListModel is a ListModel implementation for

13.6 WeatherCellRenderer is a custom ListCellRenderer

for displaying WeatherBeans in a JList. 80513.7 WeatherItem displays weather information for one city 805

13.9 Executing the WeatherServiceImpl remote object. 808

13.10 WeatherServiceClient application window. 80813.11 Participants of DeitelMessenger case study 809

13.12 ChatServer remote interface for Deitel Messenger chat server. 810

Trang 33

13.13 StoppableChatServer remote interface for stopping a

13.14 ChatServerImpl implementation of remote interfaces ChatServer

and StoppableChatServer as Activatable remote objects. 811

13.15 ChatServerAdministrator application for starting and stopping

13.16 Policy file for ChatServer’s ActivationGroup. 818

13.17 ChatClient remote interface to enable RMI callbacks. 820

13.18 ChatMessage is a serializable class for transmitting messages over RMI. 821

13.19 MessageManager interface for classes that implement communication

13.20 RMIMessageManager remote object and MessageManager

implementation for managing ChatClient communication. 823

13.21 MessageListener interface for receiving new messages. 827

13.22 DisconnectListener interface for receiving server disconnect

13.27 Policy file for ChatServerAdministrator. 838

13.28 Policy file for the DeitelMessenger client. 83913.29 Sample conversation using Deitel Messenger 839

14 Session EJBs and Distributed Transactions

14.1 Methods of interface javax.ejb.EJBObject. 84814.2 Methods of interface javax.ejb.EJBHome. 84914.3 InterestCalculator remote interface for calculating simple interest 85014.4 InterestCalculatorHome interface for creating

14.10 Adding InterestCalculator EJB classes. 864

14.11 Selecting InterestCalculator EJB classes to add. 864

14.12 Result of adding InterestCalculator EJB classes. 865

14.13 Specifying Enterprise Bean Class for InterestCalculator EJB. 865

14.14 Specifying InterestCalculator EJB classes and Stateful

14.15 Specifying Container Managed Transactions for

Trang 34

14.16 XML deployment descriptor for InterestCalculator EJB. 867

14.17 Specifying JNDI Name for InterestCalculator EJB. 867

14.18 Deploying enterprise application to localhost. 868

14.19 Specifying the Application Deployment Tool should Return Client Jar. 86814.20 Successful completion of deployment process 869

14.21 MathTool remote interface for calculating factorials and generating

14.22 MathToolEJB implementation of MathTool remote interface. 870

14.23 MathToolHome interface for creating MathTool EJBs. 873

14.24 MathToolClient for interacting with MathTool EJB. 874

14.25 MoneyTransfer remote interface for transferring money and

14.26 MoneyTransferHome interface for creating MoneyTransfer EJBs. 880

14.27 MoneyTransferEJB implementation of MoneyTransfer remote

interface using bean-managed transaction demarcation 881

14.28 MoneyTransferEJB implementation of MoneyTransfer remote

interface using container-managed transaction demarcation 88714.29 Transaction types for container-managed transaction demarcation 891

14.30 MoneyTransferEJBClient for interacting with MoneyTransfer EJB 892 14.31 Resource References dialog of New Enterprise Bean Wizard. 898

14.32 Add Resource Reference for BankABC. 899

14.33 Add Resource Reference for BankXYZ. 899

14.34 Selecting Bean-Managed Transactions. 900

14.35 Selecting Container-Managed Transactions. 900

15 Entity EJBs

15.1 Employee remote interface for setting and getting Employee information. 90615.2 EmployeeHome interface for finding and creating Employee EJBs. 90815.3 EmployeeEJB implementation of Employee remote interface using

15.4 General dialog of New Enterprise Bean Wizard. 91915.5 Bean-Managed Persistence selected in Entity Settings dialog. 91915.6 Resource References dialog in New Enterprise Bean Wizard. 92015.7 EmployeeEJB implementation of Employee remote interface using

16.4 Voter class submits votes as messages to queue 94116.5 Voter application votes for favorite programming language 94516.6 VoteCollector class retrieves and tallies votes 94516.7 VoteCollector tallies and displays votes 94816.8 VoteListener class receives messages from the queue 949

Trang 35

16.9 TallyPanel class displays candidate name and tally 95016.10 Publish/subscribe messaging model 95216.11 Weather application overview 952

16.12 WeatherPublisher class publishes messages to Weather topic. 953

16.13 WeatherPublisher publishing weather update messages. 958

16.14 WeatherSubscriber class allows user to receive weather updates. 958

16.15 WeatherSubscriber selecting cities for weather updates. 963

16.16 WeatherSubscriber having received updated weather conditions. 964

16.17 WeatherListener class subscribes to Weather topic to receive

16.18 WeatherDisplay displays WeatherBeans in a JList using a |

16.20 CandidateHome interface for Candidate EJB. 969

16.21 Candidate remote interface for Candidate EJB. 969

16.22 CandidateEJB class to maintain candidate tallies. 970

16.23 VoteCollectorEJB class tallies votes from Votes queue. 972

16.24 TallyDisplay displays candidate tallies from database. 975

16.25 TallyDisplay displays candidate tallies from database. 977

16.26 TallyPanel class displays the name and tally for a candidate. 977

16.27 EJB JAR settings for VoteCollectorApp application. 979

16.28 Add class files for Candidate EJB. 979

16.29 General settings for Candidate EJB. 980

16.30 Entity settings for Candidate EJB. 980

16.31 Entity tab for Candidate EJB. 981

16.32 Database settings for Candidate EJB. 981

16.33 SQL generation for Candidate EJB. 982

16.34 SQL warning for Candidate EJB. 982

16.35 EJB JAR settings for VoteCollector EJB. 983

16.36 Add class file for VoteCollector EJB. 983

16.37 General settings for VoteCollector EJB. 984

16.38 Transaction management settings for the VoteCollector EJB. 984

16.39 Message-Driven Bean settings for VoteCollector EJB. 985

16.40 Enterprise Bean References for VoteCollector EJB. 985

16.41 Setting JNDI names for VoteCollectorApp. 986

16.42 Deploying the VoteCollector application. 986

17 Enterprise Java Case Study: Architectural Overview

17.1 Three-tier application model in Deitel Bookstore 99217.2 Detailed architecture of Deitel Bookstore Enterprise Java case study 99417.3 XML file generated by GetProductServlet. 99617.4 XSL transformation for generating XHTML from GetProductServlet. 99617.5 XHTML document generated by XSLT in GetProductServlet. 99817.6 XSL transformation for generating WML from GetProductServlet. 100017.7 WML document generated by XSLT in GetProductServlet.

(Image © 2001 Nokia Mobile Phones.) 100117.8 XSL transformation for generating cHTML from GetProductServlet 1003

Trang 36

17.9 cHTML document generated by XSLT in GetProductServlet.

(Image courtesy of Pixo, Inc.) 1004

18 Enterprise Java Case Study: Presentation and

18.9 ViewCartServlet XSL transformation for i-mode browsers

(cHTML/viewCart.xsl) (Image courtesy of Pixo, Inc.) 1031

18.10 ViewCartServlet XSL transformation for WML browsers

(WML/viewCart.xsl) (Image © 2001 Nokia Mobile Phones.) 1034

18.11 RemoveFromCartServlet for removing products from shopping cart. 1036

18.12 UpdateCartServlet for updating quantities of products in

18.13 CheckoutServlet for placing Orders (Images courtesy Pixo,

Inc or © 2001 Nokia Mobile Phones.) 1040

18.14 GetAllProductsServlet for viewing the product catalog

(Images courtesy Pixo, Inc or © 2001 Nokia Mobile Phones.) 1043

18.15 GetProductServlet for viewing product details (Images courtesy

Pixo, Inc or © 2001 Nokia Mobile Phones.) 1046

18.16 ProductSearchServlet for searching product catalog (Images

courtesy Pixo, Inc or © 2001 Nokia Mobile Phones.) 1050

18.17 RegisterServlet for registering new Customers. 1053

18.18 LoginServlet for authenticating registered Customers

(Images courtesy Pixo, Inc or © 2001 Nokia Mobile Phones.) 1057

18.19 ViewOrderHistoryServlet for viewing customer’s previously placed Orders (Images courtesy Pixo, Inc or © 2001 Nokia Mobile Phones.) 1061

18.20 ViewOrderServlet for viewing details of an order (Images courtesy

Pixo, Inc or © 2001 Nokia Mobile Phones.) 1065

18.21 GetPasswordHintServlet for viewing a Customer’s password

hint (Images courtesy Pixo, Inc or © 2001 Nokia Mobile Phones.) 1068

19 Enterprise Java Case Study: Business Logic Part 1

19.1 Communication between GetProductServlet and Product EJB. 107619.2 ShoppingCart remote interface for adding, removing and updating

Product s, checking out and calculating the Order’s total cost. 107619.3 ShoppingCartEJB implementation of ShoppingCart remote

Trang 37

19.4 ShoppingCartHome interface for creating ShoppingCart EJB

19.5 ShoppingCart general deployment settings 1084

19.7 Product remote interface for modifying details of Product EJB

19.8 ProductEJB implementation of Product remote interface. 108619.9 ProductHome interface for finding and creating Product EJB instances. 1089

19.10 ProductModel class for serializing Product data. 1089

19.11 XMLGenerator interface for generating XML Elements for

19.12 Product general deployment settings. 1093

19.13 Product Entity and deployment settings. 1093

19.14 Order remote interface for modifying details of Order EJB instances. 1095

19.15 OrderEJB implementation of Order remote interface. 1095

19.16 OrderHome interface for finding and creating Order EJB instances. 1101

19.17 OrderModel class for serializing Order data. 1102

19.18 Order general deployment settings. 1105

19.19 Order entity and deployment settings. 1105

19.21 OrderProduct remote interface for modifying details of

19.22 OrderProductEJB implementation of OrderProduct remote

19.23 OrderProductHome interface for finding and creating

19.24 OrderProductPK primary-key class for OrderProduct EJB. 1112

19.25 OrderProductModel class for serializing OrderProduct data. 1113

19.26 OrderProduct general deployment settings. 1115

19.27 OrderProduct entity and deployment settings. 1115

19.28 OrderProduct EJB references. 1116

20 Enterprise Java Case Study: Business Logic Part 2

20.1 Customer remote interface for modifying Customer details, getting an

20.2 CustomerEJB implementation of Customer remote interface. 112020.3 CustomerHome interface for creating and finding Customer

20.4 CustomerModel for serializing Customer data. 112720.5 Customer general deployment settings 113220.6 Customer entity and deployment settings 1132

20.8 Address remote interface for modifying Address details. 113420.9 AddressEJB implementation of Address remote interface. 1134

20.10 AddressHome interface for creating and finding Address EJB instances. 1138

20.11 AddressModel for serializing Address EJB data. 1139

20.12 Address General deployment settings. 1143

Trang 38

20.13 Address entity and deployment settings. 1143

20.15 SequenceFactory remote interface for generating primary keys. 1145

20.16 SequenceFactoryEJB implementation of SequenceFactory

20.17 SequenceFactoryHome interface for finding SequenceFactory

20.18 SequenceFactory general deployment settings. 1147

20.19 SequenceFactory entity and deployment settings. 114820.20 AddAing an EJB to an enterprise application 1149

20.22 Specifying the Root Directory for EJB classes. 115020.23 Adding EJB classes to an EJB JAR file 115120.24 Results of adding EJB classes to an EJB JAR file 115120.25 Specifying classes for EJB, home interface and remote interface 1152

20.26 Setting Bean Type to Entity. 115220.27 Configuring container-managed fields and primary-key class 115320.28 Specifying other EJBs referenced by this EJB 1154

20.29 Specifying Container-Managed Transactions for EJB business

20.30 XML descriptor generated by Application Deployment Tool. 1155

20.31 Specifying EJB Deployment Settings. 1155

20.32 Configuring EJB Database Settings. 1156

20.33 Dialog indicating methods that require WHERE clauses for SQL queries. 1156

20.34 Specifying SQL query for method findByCustomerID. 115720.35 Deployment settings for Deitel Bookstore servlets 1157

20.36 Setting the Context Root for the Deitel Bookstore servlets. 1158

20.37 Setting the CLIENT_LIST Context Parameter for the Deitel

20.39 Supporting files for inclusion in servlet WAR file 1159

21 Application Servers

21.1 Application server required APIs 116321.2 WebLogic administration console (Courtesy BEA Systems.) 116721.3 JDBC Connection pool properties (Courtesy of BEA Systems, Inc.) 116721.4 Weblogic-ejb-jar.xml defines WebLogic deployment

properties for Bookstore case study 116821.5 Optional tags for weblogic-ejb-jar.xml not used in text. 117621.6 Weblogic-cmp-rdbms-jar-address.xml defines WebLogic

CMP database properties for EJB Address. 117821.7 WebLogic-cmp-rdbms-jar-Customer.xml defines WebLogic

CMP database properties for EJB CustomerEJB. 118021.8 Some WebLogic Query Language operations and examples 118321.9 Weblogic-cmp-rdbms-jar-order.xml defines WebLogic CMP

database properties for EJB OrderEJB. 1184

Trang 39

21.10 Weblogic-cmp-rdbms-jar-orderProduct.xml defines

WebLogic CMP database properties for the OrderProduct EJB. 1185

21.11 weblogic-cmp-rdbms-jar-product.xml defines WebLogic

CMP database properties for the Product EJB. 1187

21.12 Weblogic-cmp-rdbms-jar-sequence.xml defines WebLogic

CMP database properties for the SequenceFactory EJB. 1189

21.13 Weblogic.xml Web application deployment descriptor. 1190

21.14 WHERE clauses for bookstore finder methods. 1193

22 Jini

22.4 Specifying the RMID log directory. 120122.5 Reggie lookup service configuration tab. 120222.6 Run panel for starting and stopping Jini basic services. 1202

22.8 LookupBrowser application window. 120422.9 Registrar menu for viewing computers that provide lookup services. 1204

22.10 UnicastDiscovery performs unicast discovery to locate Jini

22.11 Policy file that grants AllPermission to all code. 1208

22.12 UnicastDiscovery application output. 1209

22.13 MulticastDiscovery performs multicast discovery to locate

22.14 MulticastDiscovery application output. 1213

22.15 Seminar maintains the location and title of a seminar. 1215

22.16 SeminarInterface defines the methods available from the

22.17 BackEndInterface defines methods available to the

22.18 SeminarProxy is a service proxy that clients use to communicate

22.19 SeminarInfo implements the SeminarInfo Jini service. 1218

22.20 Content of SeminarInfo.txt. 1220

22.21 SeminarInfoService registers the SeminarInfo service

22.22 UnicastSeminarInfoClient is a client for the SeminarInfo service. 1224

22.23 SeminarService.jar contents. 1228

22.24 SeminarClient.jar contents. 1230

22.25 SeminarServiceDownload.jar contents. 1230

22.26 Web server configuration for SeminarInfo service. 1230

22.27 UnicastSeminarInfoClient application output. 1231

22.28 UnicastDiscoveryUtility uses class

LookupLocatorDiscovery to facilitate lookup service discovery 1232

22.29 Using MulticastDiscovery to obtain sample data for testing

Trang 40

22.30 UnicastDiscoveryUtility application output. 1237

22.31 GeneralDiscoveryUtility uses class LookupDiscoveryManager

o perform both unicast and multicast lookup service discovery 1238

22.32 GeneralDiscoveryUtility application output. 1242

22.33 Standard Jini Entry attributes. 1242

22.34 SeminarProvider subclass of Entry for describing the Seminar

22.35 SeminarInfoLeaseService uses class LeaseRenewalManager

to manage SeminarInfo service leasing. 1244

22.36 SeminarServiceWithLeasing.jar contents. 1248

22.37 SeminarInfoJoinService uses class JoinManager to facilitate

registering the SeminarInfo service and manage its leasing. 1249

23.10 Receiving notifications when matching Entrys are written into JavaSpace. 1278

23.11 NotifyOperation Output samples. 1280

23.12 Removing entries from JavaSpaces service using method snapshot. 1281

23.13 SnapshotUsage Output window. 1284

23.14 UpdateInputWindow user interface. 1285

23.15 Finding Jini TransactionManager. 1288

23.16 Updating an entry using Jini TransactionManager. 1290

23.17 WriteOperation Output and UpdateInputWindow user interface. 1293

23.18 UpdateOperation Output and ReadOperation Output. 1294

23.19 Structure of the ImageProcessor distributed application. 1294

23.20 ImageEntry defines the Entrys to store in the JavaSpaces service. 129523.21 Image processing node that uses the JavaSpaces service 1296

23.22 Class Filters applies a Java 2D filter to an image. 129923.23 Image-processing distributed system client 130223.24 Partitioning an image into smaller pieces and storing subimages in a

Ngày đăng: 20/10/2017, 12:27

w