Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:

Mastering Enterprise JavaBeans™ and the Java 2 Platform, Enterprise Edition - Roman E

..pdf
Скачиваний:
41
Добавлен:
24.05.2014
Размер:
6.28 Mб
Скачать

Index 717

Lightweight Directory Access Protocol (LDAP), 33, 563–565, 567–568

downloading, 577–578 LinkRef class, 582t list(), 592 listBindings(), 592

listener components, 535 load balancing, 675–676

local/remote transparency, 510 location transparency, 49, 65, 76–77, 91

and CORBA, 308 locks, 283, 284, 316 logging, 258

logging components, 535

Login servlet (e-commerce sales model), 358, 454–461

lookup(), 514 lost updates, 282 Lotus Notes, 91

LDAP-based, 564

Lucias (Fazuul puzzle game), 143

machine failure, 265–266 magazine article reviews, 680

management callback methods, 83–84 manifests, 109

count bean, 124

Fazuul puzzle game, 170 lack of in EJB 1.1, 636

marker interface, 73 marketplace

component, 6 connector, 40 marshalling, 506

and serialization, 519

Message-Oriented Middleware (MOM) systems, 37, 39, 534

message queue, for distributed logging, 533–553

message queueing, 534 messaging service, 36–37 metadata, 563

encapsulation, 695 meta-markup language

SGML as, 616 XML as, 617, 624

method calling, 90, 94 in CORBA, 313–315

Microsoft

Java environment, 509 N-tier vision, 24–25

Microsoft Active Directory. See Active Directory

Microsoft Internet Information Server, 24 Microsoft Management Console, 24 Microsoft Message Queue (MSMQ), 24 Microsoft SQL Server, 24

Microsoft Transaction Server (MTS), 24 Microsoft Windows Distributed interNet

Applications Architecture (DNA), 24–25 Microsoft Windows NT, 24, 25

Microsoft Wolfpack, 24 middleware, 31

and CORBA, 304–305

mission-critical enterprise applications, 266 multiclient support, 48, 266

multi-tier server-side component architectures, 13–23

and purchase decision, 673–674

NameClassPair class, 581t Name interface, 580t name objects, 593

NameParser interface, 581t names, 571–572 namespaces, 572–576

NamingEnumeration interface, 581t naming.lookup(), 331–332

naming package (JNDI). See javax.naming package

naming services, 33, 91, 562–563

JNDI as bridge with directory service, 565, 592–593

problems with, 563–564 naming systems, 572–576 narrow(), 331

narrowing, 324, 325

nested transactions, 270, 272–274 NetDynamics, server provider, 43

Network Information Service (NIS), 564, 568 networks, 505

failure, 265–266

remote method invocations, 506–509 nicknames, 92

nonconversational session beans, 84, 97–98 nonpersistent objects, 83

nonvalidating XML parsers, 626 NoSuchEntity exception, 702

Novell Directory Services (NDS), 33, 564– 565, 568

N-tier server-side component architectures, 14, 18–21

object database management systems (ODBMS), 178

object databases, 58, 178–179 object factories, 602

and JNDI references, 603

Object Management Group (OMG), 26, 38.

See also CORBA Home Page, 341

IDL, 310–315, 325–326

Java-to-IDL Mapping specification, 324–325 Objects-by-Value specification, 323–324

Go back to the first page for a quick link to buy this book online!

718 M A S T E R I N G E N T E R P R I S E J A V A B E A N S

Object Naming Service, 568–569 ObjectNotFound exception, 702–703 object query language (OQL), 178 object references, 309 object-relational mapping, 58, 176–178

Object Request Brokers (ORBs), 306–307 choosing, 329

Objects-by-Value specification, 323–324 object serialization, 63, 511, 516

and container-managed fields, 235–236 and conversational state, 117–118

and persistence, 176 rules for, 517–518 session beans, 73, 85 uses, 519

which variable to mark transient, 518–519 Object Transaction Service (OTS), 36, 90,

293, 316

online auction houses, 614

online catalog, e-commerce sales model, 345 Online Catalog servlet (e-commerce sales

model), 358, 464–470 online white papers, 680

Open Database Connectivity (ODBC) standard, 34, 594. See also Java Database Connectivity

Oracle 8i, 674

as server provider, 43 specialized services, 679

OrbixWeb, 306

order entity bean, e-commerce sales model, 387–400

order-entry component, 54

order generation, e-commerce sales model, 346

order line item entity bean, e-commerce sales model, 373–387

orders, 353

parameter passing conventions, 506–507 and CORBA, 323–324

pass-by-reference, 506–507 RMI simulation, 519–522

pass-by-value, 506–507, 515–516 passivation

EJB 1.1 improvements, 651–652 entity beans, 187, 188

session beans, 87–88

stateful session beans, 116–117, 118 persistence, 48, 64

and deployment descriptor, 80 EJB 1.1 improvements, 652–653 entity beans, 176–179

persistent data components, 179–180 persistent entity beans, 55, 58, 83, 188–190.

See also bean-managed persistent entity

beans; container-managed persistent entity beans

and purchase decision, 671–672 sequence diagrams, 690–691

persistent fields, 188 persistent objects, 83, 175 phantom problem, 288–289 pinging, 553

plug-and-play features, 32 pooling

connection, 646 entity beans, 185–188 instance, 62, 98

N-tier architectures, 20–21 stateful session beans, 115–117 stateless session beans, 84, 98–99

portability, 3

application servers and, 23 and EJB 1.0, 27

and EJB 1.1, 28

security context propagation, 141–142 portable messaging service, 37

Portable Object Adapter (POA), 309 PortableRemoteObject.narrow(), 639–640, 641 PowerTier, as server provider, 43

prepare to commit message, 291 presentation layer, 13, 14–15 pricers, 352–353

pricer session bean, e-commerce sales model, 345, 401, 403–410

pricing component, 4–7, 56 pricing rules, 4

primary key class

container-managed persistent beans, 236–237

deferring creation until runtime, 665 e-commerce sales model, 496–498 entity beans, 182, 194

Product Base servlet (e-commerce sales model), 458, 469, 470–473

Product Detail servlet (e-commerce sales model), 358, 473–476

product line example, 241–255 products, 350

programmatic authorization, 139–140 declarative contrasted, 140–141

programmatic security, 657

adding to an EJB 1.1 system, 657–661 programmatic transactions, 275–277, 293–

296, 653 example, 297–298

transaction attribute values, 278–281

Programming with VisiBroker, 341 prolog, XML documents, 620

protocol issues, and purchase decision, 673 provider URL, 580

Go back to the first page for a quick link to buy this book online!

Index 719

purchase decision, 669–679 Purchasing servlet (e-commerce sales

model), 359, 486–492 puzzle game Fazuul, 143–174

quote line items, 352

quote line item session bean, e-commerce sales model, 401, 403–410

quotes, 347–348, 351–352

quote session bean, e-commerce sales model, 401, 403–410

Quote Viewing servlet (e-commerce sales model), 358, 476–486

readers/writers problem, 540 read locks, 284 readObject(), 516

real-time deployment, 677 recovery process, 266

Rectors (Fazuul puzzle game), 143 referenceable objects, 602

interface and classes used for storing, 603–604t

reference implementation, 28, 29 reliability, and EJB, 3

remote accessibility, 48, 64–65 remote exceptions, 76, 106

and Java RMI, 528–531 remote interface, 74–76, 82

bank account example, 211 count bean, 119, 120–121 entity beans, 181–182

Fazuul puzzle game, 147–148, 154 “Hello, World” example bean, 100–101 product line example, 242

reasons not to implement, 102 and RMI, 557–558

remote method invocation, 32, 506–509. See also Java Remote Method Invocation

remote objects, 601, 639–640 activation, 509

exporting, 522–523 looking up, 513–514

remote procedure calls, 506 remote references, 508

removal, of beans. See destruction remove(), 75t, 79t, 695t, 696t Remove exception, 703 repositories, 309–310

content searches, 618 requests, 355

resource factories, 645 connecting to via JNDI, 602 looking up, 641, 645–648

resource management, 48, 62 resource managers, 268

resource partitioning, 189

resource pooling, N-tier architectures, 20–21 resources, 268

responses, 355 reusability

and EJB, 3

enterprise beans, 45–46 N-tier architectures, 20–21

stateless session beans, 84, 98–99 reusable components, 5–7, 12, 45

and business solution development, 42–43 revisions

locked-down, 29

as moving target, 28

RMI. See Java Remote Method Invocation RMI compiler, 514–515

RMI/IDL, 325

RMI-IIOP. See Java Remote Method Invocation-IIOP

RMI/JDBC, 556 RMI/JNI, 556

RMI Registry, 569, 602–603

and bootstrapping, 332, 512–514 minimizing number of objects, 531

RMI URLs, 512–514 rollback, 270–272 rollback(), 295, 296t, 707t root, of directory, 563

root element, XML elements, 622–623 root-level transaction, 273 round-robin load balancing, 676 routers, 532

runAsIdentity attribute, 141, 656 runAsMode attribute, 141, 656

sagas, 274 scalability

and asynchronous messaging, 36–37 and EJB, 3

multi-tier architectures, 16–17 and purchase decision, 674

schema, directories, 563 sections, manifests, 109 security, 48, 64

and deployment descriptor, 80 EJB 1.1 updates, 648, 655–663, 666 Enterprise JavaBeans, 136–141 Fazuul puzzle game, 174

and RMI, 508 security context, 141

security context propagation, 655–656 portability, 141–142, 322

security identity, 136, 141 security policy, 657

security policy descriptor, 661 security propagation, 141–142

Go back to the first page for a quick link to buy this book online!

720 M A S T E R I N G E N T E R P R I S E J A V A B E A N S

security-role-refs, 661 security roles, 138 serializability, 284

serialization. See object serialization server provider. See EJB servers server-side component architectures. See

also Java 2 Platform, Enterprise Edition and CORBA standard, 26

and Distributed interNet Applications Architecture (DNA), 24–25

and EJB, 3 Java for, 8–12

and J2EE, 25–26 multi-tier, 13–23 need for, 4–23 N-tier, 14, 18–21

and purchase decision, 673–674 solutions, 23–26

three-tier, 14, 18 two-tier, 14–18

server-side components, 12

Service Location Protocol (SLP), 568 Service Provider Interface (SPI) package

(JNDI), 566, 578

service providers, 567–570, 578 mail protocols, 39

servlet engines, 10, 357 servlets, 10–12, 37–38 session bean classes, 703

required methods, 704 writing, 85–90

session beans, 72. See also Enterprise JavaBeans; stateful session beans; stateless session beans

basic concepts, 83–85 bean-specific properties, 81, 82 calling, 90–95

conversational and nonconversational, 84–85

defined, 51–52

design versus entity beans, 499–500 diagrams, 682–687

e-commerce sales model, 401–449 entity beans contrasted, 56–57 entity beans wrapping, 354, 402 life cycle, 683, 685

lifetime, 83–84

object life cycle client view, 682, 685 serialization, 73, 85

single-threaded versus multithreaded, 60 writing, 85–90

session context, 86, 134–136, 650, 692 session context classes, 704, 705t session synchronization

life cycle with, 686 transactions, 300–302

session synchronization classes, 705, 705t session synchronization protocols, 269 setEntityContext(), 190, 202, 208t, 237t, 698t setRollbackOnly(), 135t, 200t, 296t, 694t, 707t setSessionContext(SessionContext ctx), 86,

136, 704t setTransactionTimeout(int), 296t, 707t shutdown, and purchase decision, 677 Simple API for XML (SAX), 633 skeletons, 313, 327, 511, 514

Snarfs (Fazuul puzzle game), 143 software components, 4–7

architectures, 7–12

and business solution development, 42–43 and entity beans, 179–180 implementation, 9

interface, 8–9 JAVA for, 8–12 tools for, 7–8

specialized containers, 65–67

specialized services, and purchase decision, 678–679

stand-alone documents, 620

Standard Generalized Markup Language (SGML), 616

XML contrasted, 619 stateful session beans

characteristics, 115–118 conversations, 84–85 death, 129

defined, 52–53 diagrams, 685–687

example counter bean, 118–128 life cycle, 685–686

sequence diagram, 687 stateful transparent fail-over, 676 stateless session beans

characteristics, 97–99 conversations, 84 defined, 53–54 diagrams, 683–684

“Hello, World” example bean, 99–113 myths and facts, 128–130

object life cycle, 683 sequence diagram, 684

stateless transparent fail-over, 676 state management, 62–63

static invocations, 313–314 STATUS_ACTIVE constant, 295t, 706t STATUS_COMMITTED constant, 296t, 707t STATUS_COMMITTING constant, 296t, 707t STATUS_MARKED_ROLLBACK constant,

295t, 707t STATUS_NO_TRANSACTION constant, 295t,

706t

STATUS_PREPARED constant, 296t, 707t

Go back to the first page for a quick link to buy this book online!

Index 721

STATUS_PREPARING constant, 295t, 707t STATUS_ROLLEDBACK constant, 296t, 707t STATUS_ROLLING_BACK constant, 296t, 707t STATUS_UNKNOWN constant, 296t, 707t Sterling Commerce, Inc., 615

stock portfolio manager component, 54 stored procedures, 16–17

stubs, 313, 327, 510–511, 520–521 Subberts (Fazuul puzzle game), 143, 144 subcontexts, 572

subfolders, 572, 577 subtransactions, 273

Sun Microsystems. See also Java 2 Platform, Enterprise Edition

enterprise API efforts, 27–28 on isolation, 656

Java Platforms, 28–29 JDK efforts, 27

N-tier vision, 25–26

roadmap for EJB future, 666, 667t Web site, 680

Sun Microsystem’s RMI-IIOP package, 341 swapping out, 116

Symantec Visual Cafe. See Visual Cafe synchronization protocols, 269 synchronous communications, 533 system administrator, 44, 50 system-level exceptions, 106

technical support, 679

teller session bean, e-commerce sales model, 402, 403–410

test suite, 28, 29, 670

The Theory Center, 43, 678 thin-client resources, 453 third party Web sites, 680 threads, 60, 85

and entity bean instances, 184 and transactions, 541

three-tier server-side component architectures, 14, 18

top-level transaction, 273 TOPLink, 59, 178 toStub(), 331

training services, 679

transactional boundary demarcation methods, 275, 707t

transactional communication protocol, 291 transactional components, 268 transactional isolation, 281–289 transactional isolation levels, 283–285, 653–

654, 656, 706t transactional models, 270–274 transactional objects, 268

transactional status constants, 706–707t transaction attributes, 276–281, 654–655, 706t

transaction context, 291–293 transaction context propagation, 292 transaction managers, 268

TRANSACTION_READ_COMMITTED mode, 284, 287, 289t, 706t

TRANSACTION_READ_UNCOMMITTED mode, 284, 286–287, 289t, 706t

TRANSACTION_REPEATABLE_READ mode, 285, 288, 289t, 706t

transactions, 35, 58, 63–64. See also declarative transactions; distributed transactions; programmatic transactions

ACID properties, 268–270 benefits, 266–270 chained, 274

conversation design, 299–302 and deployment descriptor, 80 with EJB, 274–281

EJB 1.1 improvements, 653–655 entity bean instances, 185

as exception handling, 531 flat, 270–272

motivation, 264–266 nested, 270, 272–274 reference tables, 706–707 and threads, 541

TRANSACTION_SERIALIZABILITY mode, 285, 288–289, 289t, 706t

transaction service, 48 transient object references, 309 transparent fail-over, 106, 676 trip-planning problem, 273 Tuxedo, 39

two-phase commit protocol (2PC), 290–291, 677

two-tier server-side component architectures, 14–18

TX_BEAN_MANAGED attribute, 278–279, 706t

TX_MANDATORY attribute, 281, 706t TX_NOT_SUPPORTED attribute, 279, 706t TX_REQUIRED attribute, 280, 706t TX_REQUIRES_NEW attribute, 280–281, 706t TX_SUPPORTS attribute, 281, 706t

unexportObject(), 330–331 UnicastRemoteObject, 522–523 Unicode, XML use of, 618

Uniform Resource Locators (URLs) provider URL, 580

RMI URLs, 512–514 XML support, 618

unmarshalling, 506

and serialization, 519 unrepeatable read problem, 287–288

unsetEntityContext(), 190, 202, 210t, 240t, 700t

Go back to the first page for a quick link to buy this book online!

722 M A S T E R I N G E N T E R P R I S E J A V A B E A N S

URLs. See Uniform Resource Locators; Uniform Resource Locators (URLs)

URL scheme-id namespace, 573

validating XML parsers, 625–626 valid XML documents, 625

value-added networks (VANs), 615–616 Version Control Systems, 284

virtual memory, 116 VisiBroker, 306 VisualAge for Java

for component development, 7, 675 deployment descriptor generation wizard,

105 Visual Cafe

for component development, 7, 675 deployment descriptor generation wizard,

105

Vrommells (Fazuul puzzle game), 143

Web browsers

interactive browser, 582–593 Java enabled, 10, 11, 12, 37–38 session bean calling, 90

WebLogic, 27, 640 authentication, 137 DDCreator tool, 630 debugging with, 259

declarative authorization, 138–139 deployment descriptor generation wizard,

105

home object look up, 641 naming service, 570 object-relational mapping, 59 pooling in, 226

resource factory look up, 645 security roles, 138

as server provider, 43 specialized services, 679 transactional isolation levels, 283

transaction attribute setting, 277–278 Web servers, 10, 11, 37–38

session bean calling, 90 WebSphere, 674

as server provider, 43

specialized services, 679

Web Storefront servlet (e-commerce sales model), 358, 461–464

weighted round-robin, 676 well-formed XML documents, 623–624 white papers, 680

Windows Distributed interNet Applications Architecture (DNA), 24–25

Windows NT, 24, 25 workflow solutions, 5, 51

World Wide Web. See also e-commerce sales model; Web browsers; Web servers

e-commerce on, 614

EJB news and information sites, 680 HTML as predominant standard, 616

John Wiley & Sons site (for this book), 635 Object Management Group Home Page,

341

Sun Home Page, 680 write locks, 284 writeObject(), 516, 517

Xenosys, 678

XLinks, 632

XML. See Extensible Markup Language XML-based databases, 618

XML browsers, 618

XML deployment descriptor, 636–639 XML document type definitions (DTDs),

624–629 XML/EDI, 619

XML elements, 621–623 XML entities, 623

XML file utilities, 618 XML4J, 626

XML JavaBean toolkits, 618 XML nonvalidating parsers, 626 XML.org, 632

XML parsers, 618, 623, 624 nonvalidating, 626 validating, 625–626

XML search engines, 618

XML validating parsers, 625–626 XML viewers, 618

XPointers, 632

Go back to the first page for a quick link to buy this book online!

CUSTOMER NOTE: IF THIS BOOK IS ACCOMPANIED BY SOFTWARE, PLEASE READ THE FOLLOWING BEFORE OPENING THE PACKAGE.

This software contains files to help you utilize the models described in the accompanying book. By opening the package, you are agreeing to be bound by the following agreement:

This software product is protected by copyright and all rights are reserved by the author, John Wiley & Sons, Inc., or their licensors. You are licensed to use this software as described in the software and the accompanying book. Copying the software for any other purpose may be a violation of the U.S. Copyright Law.

This software product is sold as is without warranty of any kind, either express or implied, including but not limited to the implied warranty of merchantability and fitness for a particular purpose. Neither Wiley nor its dealers or distributors assumes any liability for any alleged or actual damages arising from the use of or the inability to use this software. (Some states do not allow the exclusion of implied warranties, so the exclusion may not apply to you.)

Using the CD-ROM

Your system must meet the following requirements.

Platform/Processor/Operating System

Windows NT (recommended), Windows 95/98, or UNIX

RAM

64 MB

Hard Drive Space

400 MB

Peripherals

Internet connection for downloading necessary packages, and for source code updates

Installation Notes

Insert the CD-ROM into your computer. Then refer to the README file on the CD-ROM’s root directory.

TO ENSURE SUCCESS, YOU MUST FOLLOW THE README INSTRUCTIONS EXACTLY.

Special Benefits to readers of

Mastering Enterprise JavaBeans:

Free EJB/J2EE news, design strategies, and more.

We’ve been hard at work building a web site where developers can share EJB/J2EE design strategies, application server comparisons, and hear the latest news in the middleware industry.

Best of all, it’s free. Visit us at http://www.TheServerSide.com.

Special 10% off training or consulting

At The Middleware Company, our top experts specialize in building well-designed, scalable, and maintainable EJB and J2EE systems. We reduce project risk levels and accelerate time-to- market by:

Training developers on EJB, JSP, Servlets, JNDI, JMS, XML, and RMI-IIOP.

Architecting a re-usable J2EE object model using UML with your staff.

Advice on the right application server for your business problem.

Jumpstarting your project by developing a prototype system with you, including a build process, a testing process, and code reviews.

Rearchitecting existing deployments for scalability, maintainability, and reliability

For complete information, visit our web site at:

http://www.middleware-company.com

Or contact us at: info@middleware-company.com

Mention promotion code M101 for the discount.