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

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

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

706 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

Transaction Reference

Table F.9 Transaction Attributes

CONSTANT

MEANING

TX_BEAN_MANAGED

Your bean programmatically controls its own transaction

 

boundaries via the JTA.

TX_NOT_SUPPORTED

Your bean cannot be involved in a transaction at all. When a bean

 

method is called, any existing transaction is suspended.

TX_REQUIRED

Your bean must always run in a transaction. If there’s already a

 

transaction running, your bean joins in on that transaction. If there

 

is no transaction running, the EJB container starts one for you.

TX_REQUIRES_NEW

Your bean must always run in a new transaction. Any current

 

transaction is suspended.

TX_SUPPORTS

If a transaction is already underway, your bean will join that

 

transaction. Otherwise, the bean runs with no transaction at all.

TX_MANDATORY

Mandates that a transaction must be already running when your

 

bean method is called, else a javax.ejb.TransactionRequired

 

exception is thrown back to the caller.

 

 

Table F.10 Transaction Isolation Levels

 

 

 

 

 

 

 

 

DIRTY

UN REPEATABLE

PHANTOM

ISOLATION LEVEL

READS?

READS?

READS?

TRANSACTION_READ_UNCOMMITTED

Yes

Yes

Yes

TRANSACTION_READ_COMMITTED

No

Yes

Yes

TRANSACTION_REPEATABLE_READ

No

No

Yes

TRANSACTION_SERIALIZABLE

No

No

No

Table F.11 The javax.transaction.UserTransaction Constants for Transactional Status

CONSTANT

MEANING

STATUS_ACTIVE

A transaction is currently happening and is active.

STATUS_NO_TRANSACTION

There is no transaction currently happening.

 

 

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

 

EJB Quick Reference Guide

 

 

707

 

 

 

CONSTANT

MEANING

 

STATUS_MARKED_ROLLBACK

The current transaction will eventually abort because it’s

 

 

been marked for rollback. This could be because some

 

 

party called setRollbackOnly().

 

STATUS_PREPARING

The current transaction is preparing to be committed

 

 

(during Phase One of the two-phase commit protocol).

 

STATUS_PREPARED

The current transaction has been prepared to be

 

 

committed (Phase One is complete).

 

STATUS_COMMITTING

The current transaction is in the process of being

 

 

committed right now (during Phase Two).

 

STATUS_COMMITTED

The current transaction has been committed (Phase Two is

 

complete).

 

STATUS_ROLLING_BACK

The current transaction is in the process of rolling back.

 

STATUS_ROLLEDBACK

The current transaction has been rolled back.

 

STATUS_UNKNOWN

The status of the current transaction cannot be

 

 

determined.

 

 

 

 

 

 

Table F.12 The javax.transaction.UserTransaction Methods for Transactional Boundary Demarcation

METHOD

DESCRI PTION

 

 

begin()

Begin a new transaction. This transaction becomes associated

 

with the current thread.

commit()

Run the two-phase commit protocol on an existing transaction

 

associated with the current thread. Each resource manager will

 

make its updates durable.

getStatus()

Retrieve the status of the transaction associated with this

 

thread.

rollback()

Force a rollback of the transaction associated with the current

 

thread.

setRollbackOnly()

Call this to force the current transaction to rollback. This will

 

eventually force the transaction to abort. One interesting use

 

of this is to test out what your components will do, without

 

having them perform any permanent resource updates.

setTransactionTimeout(int)

The transaction timeout is the maximum amount of time that

 

a transaction can run before it’s aborted. This is useful to avoid

 

deadlock situations, when precious resources are being held

 

by a transaction that is currently running.

 

 

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

I N D E X

Page references followed by italic t indicate material in tables.

abort, 270–272, 276 access control entries, 80

Access Control Lists (ACLs), 64 activation

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

object adapters, 308 and RMI, 508–509 session beans, 88

stateful session beans, 116–117, 118 Active Directory, 91, 563

LDAP-based, 564 active load-balancer, 676

Active Server Pages, 24, 452 afterBegin(), 300–302, 705t afterCompletion(), 300–302, 705t aggregation, 383

all-or-nothing paradigm, transactions, 269, 271 applets, 10–12

application assembler, 44, 49 application-level exceptions, 106–107 application logic components, 179 application servers, 10, 12, 18

and business solution development, 42–43 delegating transactional logic to, 279

EJB 1.1–based, 635

and Enterprise APIs, 27–28 in-memory data cache, 674 locking into, and portability, 23 multiple users, 266

asynchronous communication, 36–37, 533 EJB 2.0 support, 666

and purchase decision, 678 atomicity, transactions, 268–269 atomic names, 571

atomic operations, 264–265 attribute-based programming, 277 attribute list declaration, 629 attributes

directory objects, 562, 577

transaction, 276–281, 654–655, 706t XML elements, 622, 629

authentication

e-commerce sales model, 345 EJB security, 136, 137 yourself to a resource, 648

authorization, 136, 137–141 availability, and purchase decision, 675

bank accounts, 354–355 bank account tellers, 355 bank applications

bean-managed persistent bean example, 211–234

entity beans, 180–181 network failure, 265 teller component, 52, 54

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

Basic Object Adapter (BOA), 309 bean-independent resources, 189 bean installation tools, 65

bean instance pooling, 98

bean life cycle management, 48, 62 and deployment descriptor, 80

bean-managed persistent entity beans, 58–59, 188–190

bank account example, 211–234 container-managed persistence con-

trasted, 255–258 creation, 195

implementation guidelines, 207, 208–210t and purchase decision, 671

sequence diagram, 690 bean provider, 43, 45–46

deployment description creation, 80 and purchase decision, 678

beans. See Enterprise JavaBeans; entity beans; session beans; terms beginning EJB, such as EJB Objects

bean-specific resources, 189 BEA Systems, Inc., 570

BEA WebLogic. See WebLogic

709

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

710 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

before commit message, 290 beforeCompletion(), 300–302, 705t begin(), 295, 296t, 707t

billing functionality, e-commerce sales model, 346

billing mechanisms, 437 binding, 562, 571

nicknames, 92 BizTalk.org, 632 bootstrapping, 512–514, 569

initial context factories for, 575 and provider URL, 580

RMI over IIOP, 331–332 business components, 42 business interface, 103 business logic layer, 13, 14–15

pushing into data layer, 16–17, 19 business logic vendors, 42 business methods, 89–90

calling, 90, 94

business process logic, 51–52, 56 business rules, 51 business-to-business e-commerce, 614

business-to-consumer e-commerce, 614

callback methods, 90

Catalog servlet (e-commerce sales model), 358, 464–470

CDATA section, XML, 623, 628 chained transactions, 274 channels, 535–537

CICS, 31, 32, 39 class keyword, 9 client API, 566 client code

bank account example, 232–234 count bean, 124–127

Fazuul puzzle game, 160–170

looking up home objects from, 641–642 product line example, 250–251 transaction control from, 298–299 writing for “Hello, World” bean, 111–112

clients API, 566

session bean calling, 90–95

Client/Server Programming with Java and CORBA, 341

client-side operations, 11–12 clustering, 676

coarse-grained entity beans, 500 collections framework, 547 COM+, 24, 311, 334

commit, 270–272, 276 commit(), 295, 296t, 707t

Common Object Request Broker Architecture (CORBA). See CORBA

compatibility, and purchase decision, 669–670

ComponentBroker, 306

component life cycle management, 48, 62 component marketplace, 6

components. See software components CompositeName class, 581t

composite names, 572–574 composite namespace, 573–576 CompoundName class, 581t compound names, 571 concurrency control, 282–283 Concurrency Control Service, 316 connect(), 331

connection pooling, 646 connector marketplace, 40 connector providers, 40 connectors, 191

overview, 31, 39–40 consistency, transactions, 269 consulting services, 679 container-managed fields, 235–236

container-managed persistent entity beans, 59, 190, 652

bean-managed persistence contrasted, 255–258

implementation guidelines, 237–240t primary key class, 236–237

product line example, 241–255 and purchase decision, 671–672 sequence diagram, 691

container provider. See EJB containers containers, for components, 8

content searches, 618 Context interface, 580t contexts, 197, 571–572 context switching, 116 contracts, 72 convenience classes, 39

conversational session beans, 84–85, 115–117 conversational state, 117–118

Fazuul puzzle game, 148 conversations, 84, 116

designing transactional, 299–302 CORBA. See also Java IDL

benefits, 305 defined, 303–304 drawbacks, 305–306

dynamic invocations, 314–315 and EJB, 39, 332–340 implementation, 304 importance, 304–306

Java IDL as specific implementation of, 38 and legacy system integration, 304,

321–322, 672

Object Transaction Service (OTS), 36

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

Index 711

and OMG IDL, 310–315 operation, 306–310

RMI contrasted, 317–326, 505, 556–557, 672 RMI integration, 326–329

and server-side component architecture, 26 services, 315–317

session bean client, 90 static invocations, 313–314

CORBA Components, 26, 316–317 CORBA Concurrency Control Service, 316 CORBA Event Service, 315–316

CORBA Naming Service (COS Naming), 315, 332, 568–569

CORBA object adapters, 308–309

CORBA Object Transaction Service (OTS), 36, 90, 293, 316

The CORBA Reference Guide, 317 CORBA Security Service, 316 COS Naming service provider, 332 CosTransactions interfaces, 293 CosTSPortability interfaces, 293 counter bean, 118–128 CreateException exception, 692

creation, of beans. See initialization credit card

billing mechanisms, 437 verification component, 54

customer entity bean, e-commerce sales model, 362–373

customers, 350

database bridges, 17, 34. See also Java Database Connectivity

databases crashes, 266 drivers for, 594

entity bean instances as view into, 183–184 multi-tier server-side component architec-

tures, 13–23

object databases, 58, 178–179 XML-based, 618

data layer, 13

pushing business logic layer into, 16–17 data mapping, 631–632

DataSource objects, 595–596, 646 deadlock scenario, 284 debugging

and IDEs, 675

problem resolution, 258–259 declarative authorization, 137–139

programmatic contrasted, 140–141 declarative security, 657

adding to an EJB 1.1 system, 661–663 declarative transactions, 275–277

delegating transactional logic to application server, 279

EJB 1.1 changes, 653–655

example, 297–298

transaction attribute values, 278–281 deferred invocations, 533

demarcating transactional boundaries, 275, 707t

deployable components, 10, 43 deployer, 44, 50

deployment, 43 count bean, 124

“Hello, World” example bean, 110–111 servlet role, 451–453

six parties responsible for, 43–50 deployment descriptor, 78–80, 82

bank account example, 230–231 bank teller session bean, 448–449 count bean, 123, 124t

customer entity bean, 370–373 with EJB references, 643, 644 entity beans, 182

Fazuul puzzle game, 153–154, 158, 160 “Hello, World” example bean, 105–107 order entity bean, 398–400

order line item entity bean, 386–387 portable, in EJB 1.1, 635–639

pricer session bean, 436–437 product line example, 252–253

quote line item session bean, 408–410 quote session bean, 427

transaction attributes, 277 uses of, 80

XML, 629–630 deployment tools, 49 deserialization, 516 destruction

EJB objects, 90, 94–95 entity beans, 190, 197 session beans, 89

development components, 10 directories, 563

directory context, 577 directory entries, 562 directory objects, 562–563, 577 directory package (JNDI), 578 Directory Server, 91, 563 directory services, 33, 91, 563

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

problems with, 563–564 dirty read problem, 285–287 Distributed COM, 24

distributed garbage collection, 507–508 using Java RMI, 324, 325, 553–556

distributed logging message queue, 533–553 distributed transaction coordinator, 291 distributed transactions, 48, 265–266, 290–293

and purchase decision, 677 Document Object Model (DOM), 633

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

712 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

document type declaration, 626 document type definitions (DTDs), 625 Domain Name System (DNS), 562, 573 DuplicateKeyException exception, 692 durability, transactions, 270

and two-phase commit protocol, 290–291 Dynamic Invocation Interface (DII), 314–315 dynamic invocations, 314–315

eBusiness Smart Components, 43 e-commerce, 614

inadequacies of existing technologies, 614–617

and purchase decision, 673 XML for, 618–619

e-commerce sales model customer entity bean, 362–373

entity bean implementation, 361–400 final product review, 346–348

Java Servlets, 355–359, 452–495 optimization issues, 496–501 order entity bean, 387–400

order line item entity bean, 373–387 pricer session bean, 401, 403–410

quote line item session bean, 401, 403–410 quote session bean, 401, 403–410

running complete system, 495–496 session bean implementation, 401–449 system functionalities, 345–346 technical requirements, 348–369 teller session bean, 402, 403–410

e-commerce Web Store component, 52 EJB. See Enterprise JavaBeans ejbActivate(), 88, 118, 209t, 239t, 699t, 704t

and entity bean pooling, 187 EJB application assembler, 44, 49 EJB bean provider, 43, 45–46 ejb-client jar file, 665

EJB components, 42

EJB containers, 43, 46–49 as abstract entities, 61 debugging, 258–259

and EJB context objects, 133–134 and EJB servers, 47

interfaces, 72

responsibilities overview, 60–67 session bean lifetime, 83–84 and session beans, 73–83 specialized, 65–67

EJB Context class, 692–693, 693–694t EJB context objects, 133–134

EJB contexts, 134

ejbCreate(), 86–87, 94, 98, 190, 193–194, 208t, 238t, 698t, 704t

EJB deployer, 44, 50

EJB deployment descriptor. See deployment descriptor

EJB Exception class, 694 ejbFind(), 194–197, 208t, 238t, 698t EJB Home class, 694–695, 695t EJB home handles, 664, 702

EJB home objects. See home objects EJB/IIOP, 292

ejb-jar file, 630, 665 count bean, 124 creation, 81–82

“Hello, World” example bean, 108–109, 110 one deployment descriptor per file (EJB

1.1), 636

ejbLoad(), 183–184, 187, 209t, 239t, 498, 699t EJB MetaData interface, 695–696

EJB object handles, 142–143, 664 Fazuul puzzle game, 173–174 EJB objects, 73–77, 99, 696–697t

creation, 90, 94 decoupling, 99 defined, 82 destruction, 90, 94–95 required methods, 75t and RMI, 557–558

ejbPassivate(), 87–88, 118, 210t, 240t, 699t, 704t

and entity bean pooling, 187 ejbPostCreate(), 209t, 239t, 698t EJB references, 643, 644

ejbRemove(), 89, 94, 190, 197, 210t, 240t, 700t, 703, 704t

EJB servers, 43, 46–49 and EJB containers, 47

responsibilities overview, 60–67 EJB 1.0 specification. See Enterprise JavaBeans 1.0 specification

EJB 1.1 specification. See Enterprise JavaBeans 1.1 specification

ejbStore(), 183–184, 187, 210t, 240t, 699t EJB system administrator, 44, 50 electronic commerce. See e-commerce Electronic Data Exchange (EDI), 615–616

XML contrasted, 618–619 element type declaration, 627 e-mail capabilities, 38–39 empty elements, 628

Enterprise APIs, 27–29. See also specific APIs enterprise bean class, 72–73, 697

required methods, 698–700 enterprise bean instance, 72, 82 enterprise beans, 10, 45, 51–60

defined, 71–72

Enterprise JavaBeans (EJB). See also entity beans; session beans; terms beginning EJB, such as EJB Objects

API reference, 692–705

application assembler provider, 44, 49 bean provider, 43, 45–46

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

Index 713

component architecture, 10–12 constituents of, 71–82 container provider, 43, 46–49 CORBA integration, 39, 332–340

cross-platform, cross-vendor nature of, 32 data-driven, 146

deployer provider, 44, 50 design strategies, 53

difficulties getting to work together, 631 entity bean diagrams, 688–691

and JNDI, 601–602 latest news about, 680

motivation for multiple types, 59 overview, 3, 29, 31–32

purchase decision, 669–679

puzzle game Fazuul example, 143–174 quick reference guide, 681–707 resource partitioning, 189

security, 136–141

server provider, 43, 46–49

as server-side components, 12, 25 session bean diagrams, 682–687 and singleton pattern, 604

six parties responsible for deployment, 43–50

specification compliance, 669–670 stages of business solutions, 42–43 system administrator provider, 44, 50 terms defined, 82–83

transaction model support, 274 transaction reference, 706–707 transactions with, 274–281 types of beans, 51–60

XML usage, 629–632

Enterprise JavaBeans (EJB) 1.0 specification compatibility, 670

deployment descriptors, 630 entity bean persistence, 59 entity bean support optional, 639 problems with, 27–28

Enterprise JavaBeans (EJB) 1.1 specification, 28–29

API references, 697, 702

bean reference improvements, 651–653 beyond, 666, 667t

compatibility, 670

deployment descriptors, 630, 635–639 entity bean persistence, 59

entity bean support mandated, 639 isolation, 653–654, 656

and JNDI, 640–650 late updates, 635

other changes, 664–665

portable deployment descriptors, 635–639 RMI-IIOP standardized, 639–640

security updates, 648, 655–663, 666 transactions improvements, 653–655

XML deployment descriptor example, 636–639

XML usage, 40, 630

Enterprise JavaBeans (EJB) 2.0 specification, 666, 667t

and JMS, 37

Enterprise Messaging Product, 37

Enterprise Resource Planning (ERP) Systems, 31, 39

entity bean class, 181 entity bean interface, 697

entity beans, 54–58, 55, 58, 72, 83. See also persistent entity beans

caching, 674 defined, 179–182

design versus session beans, 499–500 developing and using, 192–197 diagrams, 688–691

e-commerce sales model, 361–400 features, 182–192

files included with, 181–182 finding large number, 500–501

fine-grained versus coarse-grained, 500 life cycle, 202–204, 689

modification outside of EJB framework, 191–192

object life cycle client view, 688 overuse of term, 181 persistence, 176–179

pooling, 185–188

and purchase decision, 670–672 relationships between, EJB 2.0 support, 666 session beans contrasted, 56–57 synchronization needs, 498–499

wrapping with session beans, 354, 402 entity context, 134, 197–204, 692, 701

methods, 200–201t environment properties

bank account example, 231 count bean, 124

entity beans, 182

Fazuul puzzle game, 145–146, 155, 160 “Hello, World” example bean, 107–108 looking up, 648–649

setting with JNDI, 579–580

error localization, and N-tier architectures, 22 evaluation copies, 679

Event Service (CORBA), 315–316 exceptions, 106–107 exportObject(), 330

Extensible Linking Language (XLL), 632 Extensible Markup Language (XML). See

also terms beginning with XML, such as XML parsers

basic concepts, 619–629 benefits, 617–618

EDI contrasted, 618–619

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

714 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

and EJB, 40, 629–632 HTML contrasted, 619 needs for, 614–617

as on-the-wire data format, 630–632 overview, 31, 38–39, 617

and performance, 631–632 sample document, 620 SGML contrasted, 619 valid documents, 625

well-formed documents, 623–624 Extensible Stylesheet Language (XSL), 632 external resource security, 648

façade design pattern, 56 Fazuul puzzle game, 143–174 federated namespace, 573–576

File System service provider, 569 finder methods, 664

entity beans, 190–191, 194–197, 500–501 fine-grained entity beans, 500

firewalls, 20

and Java RMI, 322, 531, 532 and purchase decision, 673 tunneling, 452

flat transactions, 270–272 Flip example, 523–528

using JNDI, 605–611 folders, 571–572, 577

garbage collection, distributed, 324, 325, 507–508, 553–556

General Electric Information Services, 615 Generic Collections Library, 547 getCallerIdentity(), 135t, 140, 200t, 693t getEJBHome(), 75t, 696t getEJBMetaData(), 79t, 695t getEJBObject(), 136, 199, 701t, 705t getEnvironment(), 135t, 200t, 693t getHandle(), 75t, 697

getHome(), 135t, 200t, 693t getPrimaryKey(), 75t, 199, 696t, 701t getRollbackOnly(), 135t, 200t, 694t getStatus(), 296t, 707t getUserTransaction(), 135t, 201t, 298, 694t glue-code tools, 65, 74

graphical user interfaces (GUIs) client-side, 673

rendering, 11

handles, 701–702 Harbinger Corporation, 615 headers, manifests, 109

“Hello, World” example bean, 99–113 CORBA client access, 335–337

home handles, 664, 702 home interface, 77–78, 694

bank account example, 211

count bean, 122–123 entity beans, 182

Fazuul puzzle game, 152, 158, 159 “Hello, World” example bean, 104–105 product line example, 242

and RMI, 558–559 home objects, 77–78, 82

acquiring reference via JNDI, 92, 93, 558, 601–602

looking up, 90, 91–94

looking up from client code, 641–642 looking up from within bean, 641, 642–645 required methods, 79t

and RMI, 558–559

HTML (HyperText Markup Language), 616– 617, 619

http, 573

HTTP tunneling, 452, 532

HyperText Markup Language (HTML), 616–617

XML contrasted, 619

IBM Global Information Network, 615 IBM Lotus Notes, 91, 564

IBM VisualAge for Java. See VisualAge for Java

IBM WebSphere. See WebSphere IDL compiler, 313 implementation

downloadable, 508 and RMI, 509–510

session bean versus entity bean, 72 software components, 9

Implementation Repository (CORBA), 310 implicit middleware services, 78–79

IMS, 39

initial context, 574 acquiring, 578–580

for resource look up, 641 InitialContext class, 581t

initial context factories, 574–576 initialization

EJB objects, 90, 94

entity beans, 190, 193–194 session beans, 86–87

initialization parameters, 642 in-memory data cache, 674 Inprise Application Server, 335

as server provider, 43

Inprise JBuilder 2. See JBuilder 2 installation tools, 65 instance-level authorization, 140 instance pooling, 62, 98

Integrated Development Environment (IDE), 7

importance of integration in purchase decision, 675

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

Index 715

intelligent load balancing, 675–676 interactive browser, 582–593 interface, 8–9

and RMI, 509–510 interface-based programming, 9

Interface Definition Language (IDL), 556 OMG, 310–315, 325–326

interface keyword, 9

Interface Repository (CORBA), 310 Internet, 614

XML recommended as standard, 617 Internet Inter-ORB Protocol (IIOP), 307. See

also Java Remote Method InvocationIIOP

with Java RMI, 33, 505

and server-side component architecture, 26 interprocess communication, 29, 32–33 isCallerInRole(), 135t, 139–140, 200t, 657, 694t isIdentical(), 697t

isolation

and EJB 1.1, 653–654, 656 and locking, 284 transactions, 269, 281–289

isolation levels, 283–285, 653–654, 656, 706t

Jad decompiler, 259

Jasmine’s Computer Parts, Inc.. See e-com- merce sales model

Java

built-in garbage collection, 507 component architectures, 8–12 locking in, 284

platform separation, 28–29 JavaBeans. See Enterprise JavaBeans

JavaBeans Activation Framework (JAF), 31 JavaBeans components, 10

JavaBlend, 178

Java Business Expo, 666

Java Collections Framework, 547 Java Database Connectivity (JDBC)

architecture contrasted to JNDI, 567 with JNDI, 593–601

overview, 29, 34–35 testing database work, 233

Java Development Kit (JDK), 27 security model, 64

Java IDL, 329, 556 versus JNDI, 569 overview, 31, 38

java.io.Serializable interface, 117 and enterprise beans, 73

java.lang.Serializable interface, 516, 518, 522 JavaMail, 31, 38–39

Java Messaging Service (JMS), 535 as alternative to threading, 60 overview, 30, 36–37

Java Naming and Directory Interface (JNDI) accessibility of JTA via, 673

architecture, 566–567 basic steps, 578–580 benefits, 565–566

as bridge between naming and directory services, 565, 592–593

core packages, 578 with EJB, 601–602 and EJB 1.1, 640–650

home object location, 91–94 with Java RMI, 602–611 with JDBC, 593–601 overview, 29, 33–34, 561

programming concepts, 570–577 programming details (naming package),

577–593

RMI Registry service provider, 605–611 RMI URLs, 514

service providers, 567–570 setting up software, 577–578 and singleton pattern, 604

Java 2 Platform, Enterprise Edition (J2EE), 3. See also Enterprise JavaBeans; Java Remote Method Invocation; specific J2EE technologies

compatibility issues, 670 finalization of specification, 31 need for, 27–29

real-world application. See e-commerce sales model

and server-side component architecture, 25–26

technologies described, 29–31

Java 2 Platform, Micro Edition (J2ME), 28 Java 2 Platform, Standard Edition (J2SE),

28, 31

Java Programming with CORBA, 341 Java Remote Method Invocation (RMI), 64

advanced examples, 531–556 architecture, 509–512

and bootstrapping, 512–514

CORBA contrasted, 317–326, 505, 556–557, 672

CORBA integration, 326–329 distributed garbage collection, 553–556 distributed logging message queue, 533–

553

EJB contrasted, 557–559 and EJB objects, 76–77 Flip example, 523–528 with JNDI, 602–611 overview, 29, 32–33

parameter passing, 515–516, 519–522 remote exceptions, 528–531

and serialization, 516–519

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

716 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

session bean client, 90–95 tips, 531

Java Remote Method Invocation-IIOP (RMIIIOP), 77, 329–332

EJB object handles, 142–143 EJB server support, 672–673

nonsupport of distributed garbage collection, 554

overview, 29, 32–33

standardized by EJB 1.1, 639–640 java.rmi.Remote, 76, 78, 510, 558 java.rmi.RemoteException, 76, 510

Java RMI remote stubs, 510–511, 520–521 acquiring via JNDI, 602

java.rmi.server.UnicastRemoteObject, 522– 523

java.security.Identity, 657 java.security.Principal, 657 Java Server Pages (JSPs)

as alternative to servlets, 452 overview, 30, 37–38

session bean calling, 90 XML usage, 40

Java Servlets

alternatives to, 452–453 e-commerce sales example, 355–359,

451–496 overview, 30, 37–38

role in deployment, 451–453 session bean calling, 90

java-to-idl compiler, 325–326 Java Transaction API (JTA), 48

accessibility via JNDI, 673 acquiring reference via JNDI, 602 overview, 30, 35–36, 294–296

Java Transaction Service (JTS), 30, 35–36, 294 Java Virtual Machines, 76 javax.ejb.deployment interface, 665 javax.ejb.EJBContext interface, 134, 134t,

693–694t

javax.ejb.EJBHome interface, 78, 79, 694, 695t javax.ejb.EJBMetaData, 695 javax.ejb.EJBObject interface, 74–76, 102,

696–697t

javax.ejb.EnterpriseBean interface, 72–73, 85, 192

javax.ejb.EntityBean interface, 73, 85, 192, 207, 697

javax.ejb.EntityContext interface, 198 javax.ejb package, 692–705 javax.ejb.SessionBean interface, 73, 697, 703

methods, 85–90 javax.ejb.SessionContext interface, 198 javax.ejb.SessionSynchronization interface,

300

javax.Naming.BinaryRefAddr class, 604t javax.naming.directory package, 578

javax.naming package, 578, 580–582 example, 582–593

selected classes, 581–582t selected interfaces, 580–581t

javax.Naming.RefAddr class, 604t javax.naming.Referenceable interface, 603t javax.Naming.Reference class, 604t javax.naming.spi interface, 578 javax.naming.spi.ObjectFactory interface, 604t javax.Naming.StringRefAddr class, 604t javax.rmi.CORBA package, 330

javax.rmi package, 330–331 javax.rmi.PortableRemoteObject package, 330 javax.transaction.UserTransaction interface,

294–295 accessing, 298

constants, 295t, 706–707t looking up, 650 methods, 296t, 707t

JBuilder 2, 368

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

105

JDBC. See Java Database Connectivity JDBC DataSource objects, 595–596

looking up, 646

JDBC DriverManager, 595, 645 JDBC drivers, 34, 226, 594 JDBC Tutorial, 594

J2EE. See Java 2 Platform, Enterprise Edition

J2EE Application Programming Model document, 28

JMS. See Java Messaging Service

JNDI. See Java Naming and Directory Interface JNDIbind(), 605, 608

JNDI references, 596, 603 JNDI Specification, 612 JNDI Tutorial, 612

JSPs. See Java Server Pages JTA. See Java Transaction API

JTA UserTransacation interface. See javax.transaction.UserTransaction interface

JTS (Java Transaction Service), 30, 35–36, 294

layers, multi-tier architectures, 13–14 lazy-loading beans, 498

leases, 553

Least Recently Used (LRU) passivation strategy, 116–117

legacy system integration

and CORBA, 304, 321–322, 672 and EJB, 32

entity beans for, 58, 191 leveraging with connectors, 39 and purchase decision, 678

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