Programming with Java and CORBA€¦ · CORBA Component Nirvana 25 3-Tier Client/Server,...

21
Client/Server Programming with Java and CORBA Second Edition Robert Orfali Dan Harkey U/IIEV COMPUTER P U U I S H I M HLuHB Darmstadt I III I I III JOHN IVILEY & SONS, INC. 1 ± 331670 NewVork Chichester tVeinheim Brisbane Singapore Toronto

Transcript of Programming with Java and CORBA€¦ · CORBA Component Nirvana 25 3-Tier Client/Server,...

Page 1: Programming with Java and CORBA€¦ · CORBA Component Nirvana 25 3-Tier Client/Server, Object-Style 27 From Business Objects to CORBA Beans 28 CORBA 3.0: The Next Generation 30

Client/ServerProgramming with

Java and CORBASecond Edition

Robert Orfali • Dan Harkey

U/IIEV COMPUTER PUUISHIM

HLuHB Darmstadt

I III I I IIIJOHN IVILEY & SONS, INC. 1±331670

NewVork Chichester tVeinheim Brisbane Singapore Toronto

Page 2: Programming with Java and CORBA€¦ · CORBA Component Nirvana 25 3-Tier Client/Server, Object-Style 27 From Business Objects to CORBA Beans 28 CORBA 3.0: The Next Generation 30

Contents

Foreword HiPreface v

Part 1 . CORBA Meets Java 1

Chapter 1 . Client/Server, CORBA-Style 3

Distributed Objects, CORBA-Style 4What Is a Distributed CORBA Object? 4Everything Is in IDL 5CORBA Components: From System Objects to Business Objects 6

OMG's Object Management Architecture 7The Object Request Broker (ORB) 7The Anatomy of a CORBA 2.0 ORB 10

CORBA 2 .0 : The Intergalactic ORB. 14CORBAservices 17

Object Sen/ices: Build-to-Order Middleware 19CORBAfacilities 20CORBA Business Objects 21

Cooperating Business Objects 22The Anatomy of a CORBA Business Object 11The Anatomy of a Client/Server Business Object 25CORBA Component Nirvana 25

3-Tier Client/Server, Object-Style 27From Business Objects to CORBA Beans 28CORBA 3.0: The Next Generation 30

Conclusion 32

Chapter 2. The Object Web: CORBA Meets Java 33

CORBA Meets Java 34Why the Shotguns? 34The Evolution of the Web 36

Page 3: Programming with Java and CORBA€¦ · CORBA Component Nirvana 25 3-Tier Client/Server, Object-Style 27 From Business Objects to CORBA Beans 28 CORBA 3.0: The Next Generation 30

Client/Server Programming with Java and CORBA

CGI: The Protocol That Won't Go Away 36CORBA/Java and the Web: Look Ma, No Cookies 38

How CORBA/Java Augment Today's Web 39Life Without CGI 40Scalable Servers 40What CORBA Brings to Java 40What Java Brings to CORBA 42

The CORBA/Java Object Web 43CORBA and JavaBeans 43The 3-Tier CORBA/Java Object Web 44Meet the Players 46The Next Client/Server Wave 48

Conclusion 50

Chapter 3. Meet the CORBA/Java ORBs SI

""" The New CORBA Java/IDL Mapping 52What These CORBA/Java Standards Cover 52The Just-in-Time CORBA/Java ORB 53

The CORBA/Java ORBs 53JavaSoft's Java IDL 54lona's OrbixWeb 3.0 55Borland/Visigenic's VisiBroker for Java 3.1 56

Which Java ORB? 57Conclusion 6 0

Part 2. Core CORBA/Java 61

C O D E « Chapter 4. Your First CORBA Program 63

The Static CORBA 6 4J CORBA Method Invocations: Static Versus Dynamic 64

CORBA Static Method Invocations: From IDL to Interface Stubs 67Your First CORBA Program 6 8

The Count IDL 69Mapping CORBA IDL to Java 70The Server Side of Count 72The Client Side of Count 75

Page 4: Programming with Java and CORBA€¦ · CORBA Component Nirvana 25 3-Tier Client/Server, Object-Style 27 From Business Objects to CORBA Beans 28 CORBA 3.0: The Next Generation 30

Contents ^ _.v)

Compile the Java Code Using Symantec Visual Cafe 78Run the Client/Server Program 80

Looking at Some Test Results 81Local Versus Remote Pings 81Symantec JIT Versus Sun JDK 82

Conclusion 8 2

CODE® Chapter S. ORBIets Meet Applets 83: J M L - Applets 101 84

^ Applet Life Cycle Management 84The HTML Applet Tag 85

Your First CORBA-Enabled Applet 8 6The Count IDL 86So, What Exactly Does This Applet Do? 86The Client Applet Code 88Compile the Java Applet 91Create a Web Page 92Test the Applet 92Run the Client/Server Program 92

Let's Look at Some Test Results 9 4Local Versus Remote Pings 94Applets Versus Applications 95

Conclusion 95

C O D E * Chapter 6. Java ORBs Meet C + + ORBs 97

W .'. The C + + Count Program 981 — T J The Count IDL 98

Mapping CORBA IDL to C + + .98The Server Side of the C + + Count 100The Client Side of C + + Count 104Compile the C + + Code 106Run the Client/Server Program 106

Looking At Some Test Results 107Local Versus Remote Pings 107C + + Client to Java Count Server 108Java Client to C + + Count Server 109

Conclusion I l l

Page 5: Programming with Java and CORBA€¦ · CORBA Component Nirvana 25 3-Tier Client/Server, Object-Style 27 From Business Objects to CORBA Beans 28 CORBA 3.0: The Next Generation 30

Client/Server Programming with Java and CORBA

Part 3. The Dynamic CORBA 113

C O D E * Chapter 7. The Portable Count 115

Hpj^ The CORBA Naming Service 116~~- *: Object Naming in a Nutshell. 116

What's in a CORBA Object Name? 116How Does It Work? 118Naming Service: The CORBA IDL 119Naming Service: The Java Interfaces 121Client/Server Naming Scenarios 123Scenario 1: Creating the Namespace 124Scenario 2: Finding Objects 127

The Portable Count 128The Portable Count Client 128The Portable Count Server 130

Compile The Client/Server Program 133Looking at Some Test Results 134Conclusion 134

Chapter 8. The Dynamic Count 13S

CORBA 101: Dynamic Invocations 136Dynamic Invocations: The Big Picture 136The Dynamic Invocation Interfaces 138Dynamic Invocation Scenarios 140Dynamic Invocation: The Do-lt-Yourself Scenario 141Dynamic Invocation: The ORB-Can-Help Scenario 142Dynamic Invocation: The Yet-Another-Way Scenario 144

The Dynamic Count 145The Count IDL 146The Client Side of Count 146Compile the Java Code Using The Symantec Compiler 149Run the Client/Server Program 150

Looking At Some Test Results 150When to Use Dynamic 151Conclusion 152

Page 6: Programming with Java and CORBA€¦ · CORBA Component Nirvana 25 3-Tier Client/Server, Object-Style 27 From Business Objects to CORBA Beans 28 CORBA 3.0: The Next Generation 30

Contents

Chapter 9. MultiCount: The Jazzed-Up Count 153

The Design of MultiCount 154Meet the Players 155The MultiCount CORBA Interfaces 156A MultiCount Callback Scenario 157

The MultiConsole Applet 159What the Applet Looks Like , 160The MultiConsole Applet HTML 160The MultiConsoleApplet Class 161

The Client 165Client Classes and Threads 165A Multithreaded Client/Server Scenario 167The Client Code 168

The Coordinator 175The Coordinator Classes 176The Coordinator Code 176

Compile the Client and Server Programs 179Run the Client/Server Programs 180Conclusion 181

Part 4. CORBA and Its Competitors 183

aJBE*' Chapter 10. Sockets Versus CORBA/Java ORBs 185" f o r

& 4 Berkeley Sockets 101 186What Is a Socket?. 186How Do You Like Your Socket? 186Socket Ports 189Java's InetAddress Class 189The Anatomy of a Sockets Exchange 190

Java Sockets 101 192The Java Datagram Sockets Classes 192A Java Datagram Scenario 195The Java Stream Sockets Classes 197

Java Streams 101 201The Java Output Stream Classes 203The Java Input Stream Classes 207A Java Buffered-Stream Socket Scenario 211

Page 7: Programming with Java and CORBA€¦ · CORBA Component Nirvana 25 3-Tier Client/Server, Object-Style 27 From Business Objects to CORBA Beans 28 CORBA 3.0: The Next Generation 30

Client/Server Programming with Java and CORBA

The Java Datagram Socket Count 215The Datagram Socket Count Client 215The Datagram Socket Count Server 217

The Buffered Socket Count 219The Buffered Socket Count Client 219The Buffered Socket Count Server 221

The Data Stream Socket Count 223The Data Stream Socket Coiint Client 223The Data Stream Socket Count Server 225

The Buffered Data Stream Count 227Compile the Socket Counts 227Run the Client/Server Programs 228Looking at Some Test Results 228Sockets Versus CORBA HOP 229Conclusion 230

Chapter 11 . HTTP/CGI Versus CORBA/Java ORBs 231

HTTP 101 232So What Exactly Is HTTP? 232HTTP Data Representations 233So What Does an HTTP Request Look Like? 233So What Does an HTTP Response Look Like? 234

CG1101 236HTML Forms 238

3-Tier Client/Server, CGI-Style 238CGI and State 241

The HTTP/CGI Count 243The CGI Count Client Applet 2 4 4The CGI Count Server 248

Compile the Client/Server Program 249Create a Web Page 250Run the Client/Server Programs 250Looking At Some Test Results 251Conclusion 253

Chapter 12. Servlets Versus CORBA/Java ORBs 255

Servlets 101 256The Life Cycle of a Servlet 256The Core Servlet Interfaces 256

Page 8: Programming with Java and CORBA€¦ · CORBA Component Nirvana 25 3-Tier Client/Server, Object-Style 27 From Business Objects to CORBA Beans 28 CORBA 3.0: The Next Generation 30

A

Contents ^ ^ -

The HTTP Servlet Interfaces 262Servlet Scenario 1: A Simple HTTP Request-Response 266Servlet Scenario 2: The Client/Server Count 269

The Servlet Count 271The Servlet Count Client 271The Servlet Count Server 274

Compile The Client/Server Program 276Create a Web Page ., 276Run The Client/Server Program 277Looking at Some Test Results 278Servlets Versus CORBA/IIOP 278Conclusion 280

Chapter 13. RMI Versus CORBA/Java ORBs 281

" * RM1101 281How RMI Extends Local Java Calls 282RMI's Garbage Collection of Remote Objects 282The RMI Development Process 283

RMI Interfaces and Classes 286The RMI Core 286The Java RMI Naming Service 291RMI's Dynamic Stub Loading Classes 294The RMI Marshaling Objects <. 299RMI-Over-llOP t 300The JDK 1.2 RMI , 300

RMI Scenario 301The RMI Count 303

The RMI Count Client 303The RMI Count Server 305

Compile the Client/Server Program 308Run the Client/Server Programs 308Looking At Some Test Results 309RMI-over-HOP Versus RMI-over-RMP 309RMI Versus CORBA/IIOP 310Conclusion 311

C O D E * Chapter 14. Caffeine: The "Pure" CORBA/Java ORB 313

_ ' Caffeine 101 314f l " ' Java2H0P—Look Ma, No IDL 314

Page 9: Programming with Java and CORBA€¦ · CORBA Component Nirvana 25 3-Tier Client/Server, Object-Style 27 From Business Objects to CORBA Beans 28 CORBA 3.0: The Next Generation 30

xxivf"'**1"' Client/Server Programming with Java and CORBA

Java2idl: CORBA IDL Without Pain 315The Caffeine Development Process 317The Caffeine URL Name Service 319A URL-Naming Scenario 321

The Caffeinated Count 323The Caffeinated Count Client 323The Caffeinated Count Server 325

Compile the Client/Server Program 327Run the Client/Server Programs 328Looking At Some Test Results 328Conclusion 329

C O D E ® Chapter 15. DCOM Versus CORBA/Java ORBs 331

J ^ DCOM 101 332r ~ ' : - -' Looking at DCOM Through CORBA Eyes 332

DCOM Style Interfaces 333So, What's a DCOM Object? 335What's a DCOM Server? 337DCOM Local/Remote Transparency 338The Ubiquitous lUnknown Interface 339Interface Negotiations Using Querylnterface 340ICIassFactory2: Object Creation and Licensing 342A DCOM Object Creation Scenario 344DCOM Style Inheritance: Aggregation and Containment 346The DCOM IDL 346DCOM's Dynamic Invocation Facilities 347What's a Dispinterface? 349The IDispatch Interface 349The DCOM ODL 353Building and Registering Type Libraries 355Finding and Loading a Type Library 355

DCOM and Java 356The DCOM for Java Development Process 356DCOM Programming: Java Vs. C + + 359DCOM/Java Mappings 361

The DCOM Java Count 3 6 2The DCOM Count Client 363The DCOM Count IDL 364Run MIDL and JavaTLB 365The DCOM Count Server 366

Page 10: Programming with Java and CORBA€¦ · CORBA Component Nirvana 25 3-Tier Client/Server, Object-Style 27 From Business Objects to CORBA Beans 28 CORBA 3.0: The Next Generation 30

X xxv I„. .3?--'

Compile The Client/Server Program 367Run the Client/Server Programs 368Looking At Some Test Results 369DCOM Versus CORBA/IIOP 369Conclusion 371

Chapter 16. And the Winner Is. 373

The Report Card : 374

Part 5. The Existential CORBA 381

Chapter 17. How Do I Find My ORB? 383

The CORBA 2.0 Initialization Interface 383An Initialization Scenario 384How You Find Your Other Objects 385

CORBA Trader 101 386Conclusion 388

Chapter 18. Who Activates My Objects? 389

The Server Side of CORBA 390The CORBA::BOA Interface 390BOA and Other Object Adapters 391BOA Shared Server. 392BOA Unshared Server 394BOA Server-per-Method .394BOA Persistent Server 395An Object Activation Scenario 396

The VisiBroker Activation Daemon 398CORBA 3.0's POA 4 0 0

Is It Goodbye BOA? 4 0 0POA: The Big Picture 401Persistent Object References 402Servant Managers 403POA Policies 404Playing the Policy Game 406POA: Creating Object References 407

Page 11: Programming with Java and CORBA€¦ · CORBA Component Nirvana 25 3-Tier Client/Server, Object-Style 27 From Business Objects to CORBA Beans 28 CORBA 3.0: The Next Generation 30

Client/Server Programming with Java and CORBA

Object Activation, POA-Style 408Finding the Target Object 409POA/Java 409The POA Interfaces 410POA Scenario 1 410POA Scenario 2 413

Conclusion 415

Chapter 19. Metadata: Who Am I? 417

The CORBA IDL: A Closer Look 418What Does an IDL Contract Cover? 419The Structure of the CORBA IDL 419An IDL Example 421Type Codes: CORBA's Self-Describing Data 423

The CORBA 2.0 Interface Repository 424What's an Interface Repository? 424Why Is an Interface Repository Needed Anyway? 424Interface Repository Classes: The Containment Hierarchy 425The Interface Repository Class Hierarchy 426Federated Interface Repositories 430What Does a Global Repository ID Look Like? 431CORBA IDL Without Pain 432

Conclusion 432

C O D E * Chapter 20. The CORBA IDL-to-Java Mapping 433!

< _ J 1 § Summary of IDL-to-Java Mappings 434£ - . - - . . . . ,:J g e n e r a | Constructs 436

CORBA Modules 436CORBA Exceptions 437CORBA Parameters and Holder Classes 438CORBA Helper Classes 441CORBA Attributes 443

CORBA Basic Types 443CORBA Constants 443The CORBA Primitive Types 445

CORBA Constructed Types 4 4 6CORBA Interface 446CORBA Sequence 447CORBA Array 448CORBA Structs 448

Page 12: Programming with Java and CORBA€¦ · CORBA Component Nirvana 25 3-Tier Client/Server, Object-Style 27 From Business Objects to CORBA Beans 28 CORBA 3.0: The Next Generation 30

Contents

CORBA Enums 450CORBA Union 451CORBA Typedef 454CORBA Any 455

CORBA/Java Server-Side Mappings 458Inheritance: The ImplBase Approach 459Delegation: The Tie Approach 460

Mapping CORBA Pseudo-Objects To Java 4 6 4CORBA::ORB Mapping 465CORBA::Object Mapping 470CORBA::NamedValue Mapping 471CORBA::NVList Mapping 472CORBA::Request Mapping 473CORBA::ServerRequest and the DSI Mappings 474CORBA::TypeCode 478CORBA::TCKind 480

Conclusion 483

C O D E * Chapter 2 1 . The CORBA Java-to-IDL Mapping 485! RMI Meets CORBA 4863 Why RMI to IDL? 486

Why RMI Over HOP? 487CORBA's New Objects-By-Value 488The Value Type 489Passing Objects By Value 490Boxed Values 492Mapping Value Types to Java 493An Example ./. 493

The Java-To-IDL Mapping 4 9 4RMI Meets CORBA 494The Java-to-IDL Mapping at a Glance 494RMI/IDL Remote Interfaces 497RMI/IDL Value Types 498

Conclusion 499

CODE®! Chapter 22. The Introspective CORBA/Java Object 501

_____ CORBA Introspection 502i s r ™ >L:3 Java Reflection 503

The Ask Me Program 504

Page 13: Programming with Java and CORBA€¦ · CORBA Component Nirvana 25 3-Tier Client/Server, Object-Style 27 From Business Objects to CORBA Beans 28 CORBA 3.0: The Next Generation 30

Client/Server Programming with Java and CORBA

The AskMe Code 504Compile AskMe 513Run AskMe 513

The Walk IR Program 514The WalkIR Code 515Compile WalkIR 516Run WalkIR 516

Conclusion .< 518

Part 6. JDBC 2-Tier Versus 3-Tier $19

Chapter 23. JDBC Primer 521

The Origins of JDBC 522The X/Open SAG CLI 522The Microsoft ODBC CLI 523CLI Versus Embedded SQL 526

The JDBC Architecture 528JDBC Drivers 528The JDBC URL Naming Conventions 529Registering Drivers 530JDBC Security 530Mapping SQL Data Types to Java 530JDBC Transactions 532JDBC Stored Procedures 532

JDBC Interfaces: An Overview 532The JDBC Core 533The JDBC Java Language Extensions 534The JDBC Java Utilities 536JDBC Metadata 536

JDBC Interfaces: In-Depth 537JDBC Core: The Driver Interfaces 537JDBC Core: The Connection Interface 540JDBC Core: The Statement Interfaces 542JDBC Core: The ResultSet Interfaces 547JDBC Java Language Extensions: The Exception Classes 552JDBC Date and Time Classes 555JDBC DatabaseMetaData Interface 558

Page 14: Programming with Java and CORBA€¦ · CORBA Component Nirvana 25 3-Tier Client/Server, Object-Style 27 From Business Objects to CORBA Beans 28 CORBA 3.0: The Next Generation 30

Contents

JDBC Scenarios 567JDBC Scenario 1: Invoking a SQL Query 567JDBC Scenario 2: Invoking a Prepared Command 569JDBC Scenario 3: Invoking a Stored Procedure 571

Conclusion 573

CCH>E« Chapter 24. The JDBC Debit-Credit Benchmark 575

Designing the Benchmark 576What to Look for in an OLTP Benchmark 576The Debit-Credit Benchmark 577The Debit-Credit Database 578The Debit-Credit Transaction 578The Debit-Credit Constraints 579Price/Performance of Debit-Credit 580

The JDBC Debit-Credit Benchmark Facility 580Build Your Java Debit-Credit Benchmark in One Afternoon 5812-Tier Versus 3-Tier 582JDBC 2-Tier 583JDBC 2-Tier Plus 584JDBC 3-Tier 586

Let's Create a Bank 587The CreateBank Class 587The BankAdmin Class 588

Compile the Create Bank Program 596Run the Create Bank Program 597

Debit-Credit: To Cheat or Not To Cheat? 597Conclusion 598

C(OHD;E« Chapter 25. 2-Tier Debit-Credit with JDBC 599

The Debit-Credit 2-Tier Environment 600

The 2-Tier Client/Server Code Structure 602

Meet the Players 602

A Multithreaded Scenario 603

The Debit-Credit 2-Tier Code 606

Compile Debit-Credit 2-Tier 615

Run the Debit-Credit 2-Tier Benchmark 616

Conclusion 619

Page 15: Programming with Java and CORBA€¦ · CORBA Component Nirvana 25 3-Tier Client/Server, Object-Style 27 From Business Objects to CORBA Beans 28 CORBA 3.0: The Next Generation 30

Client/Server Programming with Java and CORBA

E * Chapter 26. 3-Tier Debit-Credit with JDBC and CORBA 621

The 3-Tier Debit-Credit Environment 622' The Debit-Credit 3-Tier Code Structure 623

Meet the Client Players 624The Server: What the Client Sees 625Meet the New Server Players 625A 3-Tier Client/Server Scenario 629

The 3-Tier Debit-Credit Code. 631The Debit-Credit 3-Tier Client Code 631The 3-Tier Debit-Credit Server Code 638

Compile the 3-Tier Debit-Credit 645Run the Debit-Credit 3-Tier Benchmark 6462-Tier Versus 3-Tier 648Conclusion 650

Part 7. From JavaBeans To Enterprise JavaBeans 6S1

Chapter 27. The JavaBean Component Model 655

The Bean Component Model 6 5 6Beans Versus Applets 656JavaBeans: The Black-Box View 656JavaBeans: The JDK as a Component Framework .- 657JavaBeans: Design-Time Versus Run-Time 662

The So-Called Design Patterns 6 6 3Simple Property Naming Patterns 664Indexed Property Naming Patterns 665Event Naming Patterns 665Method Naming Patterns 666

The JavaBeans Classes: An Overview 6 6 6JDK 1.1 JavaBeans Classes 666JDK 1.2 JavaBeans Enhancements 668

Conclusion 672

. C O D E * Chapter 28. The Smiley JavaBean 673E i

_ jap The Minimalist Smiley Bean 673C Z T 1 The Minimalist Smiley Bean 674

Page 16: Programming with Java and CORBA€¦ · CORBA Component Nirvana 25 3-Tier Client/Server, Object-Style 27 From Business Objects to CORBA Beans 28 CORBA 3.0: The Next Generation 30

Contents

SmileyPlace: A Rudimentary Bean Container 675The Beans Class 678

First Guidelines for Writing Portable Beans 679Conclusion 681

C O D E * Chapter 29. The Event-Driven JavaBean 683

/ _ S P ' _ The Delegation Event Model in a Nutshell 684• Sources and Listeners 684

The Big Bang Scenario 686The EventObject Class and EventListener Interface 688

Smiley Bean Does Events 6 8 9The ActionEvent and ActionListener Classes 690An Event for All Seasons 692The Event-Sawy Smiley 692SmileyPlace: A Hard-Wired Bean Container 694Anonymous Inner Class Adapters 698

Event Adapters 6 9 8Why Adapters? 698Event Adapters: A Taxonomy 699The Smiley Event Adapter 702The CORBA Count Event Adapter 704

More Guidelines for Writing Portable Beans 708Conclusion 709

£ • Chapter 30. The Propertied JavaBean 711i

• Standalone Properties 712' "Lj Simple Properties.., 712

Multi-Valued Indexed Properties 713Active Properties 714

Bound Properties 714The Bound Property Classes and Interfaces 716A Bound Property Scenario 717The Bound-Propertied Smiley 719The Event Adapters 721SmileyPlace: A Container for Bound Beans 722Constrained Properties 725Constrained Properties: Classes and Interfaces 725A Constrained Property Scenario 728The Constrained-Property Smiley 730

Page 17: Programming with Java and CORBA€¦ · CORBA Component Nirvana 25 3-Tier Client/Server, Object-Style 27 From Business Objects to CORBA Beans 28 CORBA 3.0: The Next Generation 30

Client/Server Programming with Java and CORBA

The Event Adapters 733SmileyPlace: A Container for Constrained Beans 734

More Guidelines for Writing Portable Beans 737Conclusion 738

C O D E ® ] Chapter 3 1 . The Persistent JavaBean 739

Persistence 7 4 0The Bean-Related Persistence Interfaces 740The Container-Related Persistence Classes 744A Serialization Scenario. 749A Deserialization Scenario 750The Persistent Smiley 752SmileyPlace: A Container for Persistent Beans 752The Versioning of a Bean's State 756JDK 1.2 Serialization Enhancements 758

In JARs 758A Manifest for JARs 759The JAR Utility 761The Structure of a Manifest 764Creating Your Own Manifest 766Signing a JAR 768JARs and Browsers 771Placing JARs in Your CLASSPATH 772JDK 1.2 JAR Enhancements 772

The Java Security APIs 772The Security Classes and Interfaces 772A Security Signing Scenario 779A Security Signature Verification Scenario 781

JDK 1.2 Security Enhancements 782The New JDK 1.2 Security Model 782The JDK 1.2 Security Enhancements: A Summary 783JDK 1.2 New Security Classes 784

Guidelines for Writing Persistent Beans 786Conclusion 787

C O O IE* Chapter 32. The Introspective and Toolable JavaBean 789

J Which Tool? 790The Introspective JavaBean 791

The Core Reflection Classes 791

Page 18: Programming with Java and CORBA€¦ · CORBA Component Nirvana 25 3-Tier Client/Server, Object-Style 27 From Business Objects to CORBA Beans 28 CORBA 3.0: The Next Generation 30

Contents

JavaBeans Introspection: An Overview 794JavaBeans Introspection: The Metadata Descriptor Classes 795Introspecting with Beanlnfo 801The Introspector and Beanlnfo Interfaces 803

Scenario Time 8 0 6Scenario 1: Discovering a Bean's Events 806Scenario 2: Reading a Property Value "On-the-Fly" 807The Introspective Smiley 809The Bean Analyst 810Tools Discover Smiley 813

Property Editors and Customizers 816Built-in Property Editors 816The Property Editor Interfaces 816A Property Editing Scenario 821The Smile Editor 823

Bean Customizers 827The Customizer Interface 828

Guidelines for Writing Toolable Beans 8 2 9Conclusion 8 3 0

Chapter 33. CORBA Beans 831

CORBA and JavaBeans 8 3 2What CORBA Can Do for JavaBeans 832What JavaBeans Can Do for CORBA 833

The New CORBA Component Model 8 3 4The CORBA/JavaBeans Call for Action 835CORBA Components: JavaBeansH- + 837CORBA Remote Events 840CORBA Containers 842Component Packaging 844How It All Comes Together 845

Conclusion 8 4 6

Chapter 34. Enterprise JavaBeans and C O R B A . . . . 849

EJBs and CORBA Object Transaction Monitors 850So, What Exactly Is an OTM? 851CORBA OTMs 852Enterprise JavaBeans and CORBA OTMs 854The EJB Container Framework 855

Page 19: Programming with Java and CORBA€¦ · CORBA Component Nirvana 25 3-Tier Client/Server, Object-Style 27 From Business Objects to CORBA Beans 28 CORBA 3.0: The Next Generation 30

Client/Server Programming with Java and CORBA

Session and Entity Beans 857The EJB Client/Server Development Process 858The Client's View of an EJB 860The Remote EJB Interfaces 862An EJB Client/Server Scenario 865

The EJB/Container Protocol 8 6 6The Container/Bean Callbacks 866The Container/Bean Interfaces 868

Support For Transactions 872The EJB Transaction Model 872EJB Transaction Usage 873Declarative Transaction Management 874

EJB Packaging 876EJB-JAR and Manifest 877Deployment Descriptor 877Security Descriptor 877The EJB Deployment Classes 877

EJB Design Guidelines 882Conclusion 883

Part 8. Grand Finale: Club Med with CORBA/Java Beans . 885

JCODE*- Chapter 35. The Club Med 3-Tier Client/Server 887

W l . The Club Med Client 8880 1 3 Ten Minutes in the Life of a Club Med Bean 888

The Bargain Hunter Bean 893Club Med Server 8 9 4

The 3-Tier Club Med 895The Club Med Server: What the Client Sees 896The Club Med IDL Contract 896

Club Med Database 898The CreateClubMed Program 899Compile the CreateClubMed Program 903Run the CreateClubMed Program 904

Conclusion 9 0 4

Page 20: Programming with Java and CORBA€¦ · CORBA Component Nirvana 25 3-Tier Client/Server, Object-Style 27 From Business Objects to CORBA Beans 28 CORBA 3.0: The Next Generation 30

pp.

Contents

C O D E * Chapter 36. The Club Med Client Beans 905

' , S j L " The Visual Cafe' Club Med Bean 907--- - ' Developing JavaBeans with Visual Cafe 2.1 907

The Visual Cafe' ClubMedBean 912How Visual Cafe' Does CORBA 913

The JBuilder Club Med Bean 917JBuilder 101 , 917Developing JavaBeans with JBuilder 919JBuilder's CORBA Support 1 921The JBuilder ClubMedBean 922

The VisualAge Bargain Hunter Bean 9 2 3The ClubMedCorbaBean 923VisualAge 101 926Creating the BargainHunterBean with VisualAge 927

Conclusion 9 3 2

C O D E ® Chapter 37. The Club Med CORBA Server 933

®0 ! Club Med Server: The Code Structure 934r:. -r ~o The 3_Tier C|ub Med 934

, The ClubMedDispenser 935Meet the Server Players 936A Club Med Client/Server Scenario 937

The Club Med Server Code 939Compile the Club Med Server 953Running Club Med 953Conclusion / 954

Chapter 38. CORBA/Java: The Good, the Bad, and the Ugly . . . 955s ^jt* So What Djd We Learn? 9 5 6

CORBA ORBs: The Good, the Bad, and the Ugly 956CORBA/Java Clients: The Good, the Bad, and the Ugly 959CORBA/Java Servers: The Good, the Bad, and the Ugly 961

The Object Web Vision and Shippable Places 9 6 3What Is a Shippable Place? 963The Future Web Client 965Portable Component Stores 965Jumping Beans 967

Page 21: Programming with Java and CORBA€¦ · CORBA Component Nirvana 25 3-Tier Client/Server, Object-Style 27 From Business Objects to CORBA Beans 28 CORBA 3.0: The Next Generation 30

Client/Server Programming with Java and CORBA

Back to Reality 968It's Time To Say Good-Bye 970

Where to Go for More Information 973Index 979