Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Enterprise JavaBeans™ Specification, Version 2.0 - Sun Microsystems.pdf
Скачиваний:
14
Добавлен:
24.05.2014
Размер:
2.71 Mб
Скачать

Sun Microsystems Inc

Public Draft

Enterprise JavaBeans 2.0, Public Draft

Revision History

E.9 Public Draft

Removed restrictions on sharing of instances dependent object classes.

Merged EJB Interoperability document into Chapter 18.

Renamed EJB-QL to EJB QL.

Corrected minor inconsistencies in treatment of finder methods.

517

5/31/00

Sun Microsystems Inc.

Revision History

Enterprise JavaBeans 2.0, Public Draft

Public Draft

5/31/00

518

Index

A

activation, 58, 73 All, 54

APIs

runtime, 461, 464, 503, 506 Application Assembler, 32

responsibilities, 470 transaction attributes, 323 transaction role, 322

application assembly, 429–430, 480–481 application exception, 341

application exception See exception

B

Bean Provider, 32 responsibilities, 469 responsibility, 82–85

BeanReference

Interface in package java.beans.enterprise, 473

Interface in package java.ejb, 473

C

cmp-fields element, 427, 479 commit, 158, 235

Container

Interface in package java.ejb, 473 Container Provider, 33

transaction demarcation bean managed, 326

container managed, 328–331 container-transaction element, 323

conversational state, 59 passivation, 59 rollback, 61

CORBA mapping, 46 CreateException, 156, 234

D

Deployer, 32 responsibilities, 470

deployment descriptor application assembly, 426, 478

bean structure, 426, 426–428, 478, 478– 479

DTD, 431–456, 481–496 EJB reference, 386 ejb-link element, 388 ejb-ref element, 386

enterprise-beans element, 426, 478 env-entry element, 382 environment entry, 382

res-auth element, 392 resource-ref element, 392 role, 426, 478 transaction attributes, 323

XML DTD, 431–456, 481–496 distributed objects, 355 DuplicateKeyException, 156, 234

E

EJB Container Provider, 33 requirements, 85–87 responsibilities, 470

519

520

EJB reference, 385 Deployer role, 390 ejb-link element, 388

in deployment descriptor, 386 locate home interface, 386

EJB Role

Application Assembler, 32 Bean Provider, 32 Container Provider, 33 Deployer, 32

EJB Server Provider, 33

System Administrator, 34 EJB Server Provider, 33 ejb-class element, 426, 478 ejb-client JAR file, 458 EJBContext

Interface in package javax.ejb, 472, 473 EJBHome, 49, 173, 245

Interface in package javax.ejb, 473 remove method, 50

ejb-jar file, 43, 428, 457, 480 class files, 458 deployment descriptor, 458 ejb-client JAR file, 458 JAR Manifest, 459

ejb-link element, 388 EJBMetaData, 175, 247 ejb-name element, 426, 478 EJBObject, 47, 51, 174, 246

remove method, 50 ejb-ref element, 386 ejbRemove, 69

enterprise bean component characteristics of, 39

enterprise bean component model, 40 enterprise bean contract

client view, 41

CORBA mapping, 46 home interface, 41 metadata interface, 42 object identity, 42 remote interface, 41

component contract requirements, 42

ejb-jar file, 43

enterprise bean environment

INDEX

JNDI interface, 380 InitialContext, 381

Enterprise Bean Provider, 32 entity bean

allowed method operations, 151, 229 bean provider-implemented methods, 137–??,142–??,222–225

business methods, 165, 242

class requirements, 162, 170, 239 client view of, 93–94

commit, 158, 235 constructor, 138, 142, 222

create method, 97, 163, 171, 240 CreateException, 156, 234 DuplicateKeyException, 156, 234 EJB container, 94

ejbActivate, 139, 144, 224

ejbCreate, 138, 143, 163, 171, 223, 240 ejbFind methods, 241

ejbLoad, 140, 145, 224, 230 ejbPassivate, 139, 144, 224 ejbPostCreate, 139, 143, 164, 171, 223,

241

ejbRemove, 139, 144, 224 ejbStore, 140, 145, 225, 230 exceptions, 155–157, 234–235

find methods, 98, 141, 145, 146, 225, 241 return type, 152–153, 155, 232–233

findByPrimaryKey, 98 FinderException, 157, 235 generated classes, 173, 245 getHandle method, 103 getPrimaryKey method, 101 handle, 103, 174, 246

home interface function of, 96

requirements, 167, 243

home interface handle, 104, 174, 246 isIdentical method, 102

life cycle, 99–101, 136–137, 220–222 locate home interface, 95

methods

container view of, 146–149, ??–149, 226–228, ??–228

modeling business objects, 111, 216 ObjectNotFoundException, 157, 235

INDEX

persistence, 109, 215, 217

container managed, ??–177, 262–267 primary key, 101, 168, 244

reentrancy, 161, 238

remote interface, 102, 166, 243 remove method, 98 RemoveException, 157, 235 setEntityContext, 138, 142, 222 state, 136, 220

state caching, 230 transaction demarcation, 308

container managed, 317 transaction synchronization, 159, 236 unsetEntityContext, 138, 142, 223

entity element, 426, 478 env-entry element, 382 environment entry, 382

Application Assembler role, 385 Deployer role, 385

environment naming context, 381 exception

application, 341

client handling of, 351 data integrity, 342 defined, 342

subclass of, 343 client view, 350

container handling of, 345 container-invoked callbacks, 348

containter-managed transaction, 349 NoSuchObjectException, 353 RemoteException, 350, 351

client handling, 352 system

handling of, 343–344 System Administrator, 353 transaction commit, 349 transaction start, 349

TransactionRequiredException, 352 TransactionRolledbackException, 352

F

findByPrimaryKey, 98 FinderException, 157, 235

521

G

getCallerIdentity, 406 getCallerPrincipal, 407, 421 getEnvironment method, 399 getHandle method, 103 getPrimaryKey method, 55, 101

H

home element, 426, 478 home interface, 41, 48, 75

client functionality, 96 create method, 97 EJB reference to, 385 entity bean, 167, 243 find methods, 98 findByPrimaryKey, 98 handle, 104

locating, 95 remove method, 98

I

Interfaces java.beans.enterprise.BeanReference, 473 java.ejb.BeanReference, 473 java.ejb.Container, 473 javax.ejb.EJBContext, 472, 473 javax.ejb.EJBHome, 473 javax.ejb.SessionSynchronization, 318

isCallerInRole, 406 isCallerinRole, 408 isIdentical method, 54, 102 isolation level

managing in transaction, 309

J

JAR Manifest file, 459

Java RMI, 468, 508

JDBC, 467, 508

JNDI, 466, 508

JNDI interface, 380

InitialContext, 381

JTA, 467, 508

M

Mandatory, 323, 330 metadata interface, 42

522

INDEX

method-permission element, 413

N

narrow method, 55 Never, 323, 330

NoSuchObjectException, 353 NotSupported, 323, 328

O

object identity, 42 ObjectNotFoundException, 157, 235

P

passivation, 58, 73 conversational state, 59 SessionContext interface, 60 UserTransaction interface, 60

persistence, 109, 215 bean managed, 217

entity state caching, 230 container managed, ??–177, 262–267

persistence-type element, 427, 479 portability

programming restrictions, 462–464, 504– 506

primary key, 101, 168, 244 prim-key-class element, 427, 479 principal, 404, 405

delegation, 419

R

remote element, 426, 478 remote interface, 41, 47, 51

entity bean, 102, 166, 243 RemoteException, 350, 351

client handling, 352 RemoveException, 157, 235 Required, 323, 329 RequiresNew, 323, 329 res-auth element, 392 resource

obtaining connection to, 391 res-auth element, 392

resource factory, 390

resource factory reference, 390 resource-ref element, 392

resource-ref element, 392 RMI, 355

role-link element, 416 role-name element, 411 runtime

APIs, 461, 464, 503, 506

S security

audit, 423 bean provider

programming recommendations, 405 client responsibility, 420

current caller, 407

deployment descriptor processing, 419 deployment tools, 420

EJBContext, 406, 421 getCallerPrincipal, 406, 407, 421 isCallerInRole, 406, 408 mechanism, 421

principal, 404, 405 delegation, 419 passing, 421

principal realm, 418, 420 role-link element, 416 runtime enforcement, 422 security-role-ref element, 409

security domain, 418, 420 security role, 404, 410, 411

assigning, 418 linking, 416

method permission, 404, 410, 413 role-name element, 411

security view, 410 security-role element, 411, 418 security-role-ref element, 409 session bean

access to, 47

business method requirements, 84 class requirements, 82

client operations on, 52 client view of, 47 create, 50

ejbCreate requirements, 83 ejbRemove call, 69 exceptions, 69

INDEX

getPrimaryKey method, 55 home interface, 48, 49

home interface requirements, 84 identity, 51

provider responsibility, 82–85 remote interface, 47, 51

remote interface requirements, 84 remove, 50, 74

requirements, 82–85 SessionBean interface, 61 SessionContext interface, 61

SessionSynchronization interface, 62 stateful

conversational state, 59 identity of, 54 isIdentical method, 54 lifecycle, 65 operations in, 67

stateless, 75–82 exceptions, 79 home interface, 75 identity of, 54

isIdentical method, 54 lifecycle, 76 operations, 78

transaction demarcation, 310 use of, 75

transaction context, 64 transaction demarcation, 308, 310

bean managed, 310 container managed, 317

transaction scope, 70 session bean instance

activation, 58, 73 characteristics, 57 creating, 63

diagram of, 71 passivation, 58, 73 serialization of calls, 63

session element, 426, 478 SessionBean interface, 61 SessionContext interface, 61

passivation, 60 SessionSynchronization interface, 62, 318

callbacks, 332

session-type element, 427, 479

523

stateful session bean conversational state, 59 lifecycle, 65 operations in, 67

stateless session bean. See session bean Supports, 323, 329

System Administrator, 34 responsibilities, 470

T transaction

attributes, 300 definition, 322

deployment descriptor, 323 Mandatory, 330

Never, 330 NotSupported, 328 Required, 329 RequiresNew, 329 Supports, 329 values, 322

bean managed, 300, 308–320 container responsibilities, 326

committing, 72

container managed, 300, 308–320 container responsibilities, 328–331 getRollbackOnly method, 319, 332 getUserTransaction method, 332 SessionSynchronization callbacks,

332

setRollbackOnly method, 318, 331 isolation level, 309

JTA, 301

JTS, 301

multiple client access, 335–340 nested, 300

SessionSynchronization interface, 318 starting, 71

synchronizing, 159, 236 unspecified transaction context, 334 UserTransaction interface, 300

transaction context session bean, 64

transaction scope session bean, 70

TransactionRequiredException, 352

524

INDEX

TransactionRolledbackException, 352 transaction-type element, 427, 479 trans-attribute element, 323

type narrowing, 55, 104

U

UserTransaction interface, 300, 310, 400 passivation, 60