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

Sun Microsystems Inc

Object interaction diagrams for a STATELESS session beanEnterprise JavaBeans 2.0, Public Draft Session Bean Component Contract

Accessing resource managers and enterprise beans is disallowed in the session bean methods for which the Container does not have a meaningful transaction context or client security context.

The UserTransaction interface is unavailable to session beans with container-managed transaction demarcation.

6.8.3 Dealing with exceptions

A RuntimeException thrown from any method of the enterprise bean class (including the business methods and the callbacks invoked by the Container) results in the transition to the “does not exist” state. Exception handling is described in detail in Chapter 17.

From the client perspective, the session object continues to exist. The client can continue accessing the session object because the Container can delegate the client’s requests to another instance.

6.9Object interaction diagrams for a STATELESS session bean

This section contains object interaction diagrams that illustrates the interaction of the classes.

6.9.1 Client-invoked create()

The following diagram illustrates the creation of a stateless session object.

Figure 12 OID for creation of a STATELESS session object

container-provided classes

client

EJB

EJB

container session

synchro-

instance transaction

 

Home

Object

context

nization

service

 

 

 

 

 

 

create()

new

79

5/31/00

Sun Microsystems Inc.

Session Bean Component Contract

Enterprise JavaBeans 2.0, Public Draft Object interaction diagrams for a STATELESS

6.9.2 Business method invocation

The following diagram illustrates the invocation of a business method.

Figure 13 OID for invocation of business method on a STATELESS session object

container-provided classes

client

EJB

EJB

container session

synchro-

instance transaction database

 

Home

Object

context

nization

service

 

 

 

 

 

 

business method

business method

read or update some data register resource manager

6.9.3 Client-invoked remove()

The following diagram illustrates the destruction of a stateless session object.

5/31/00

80

Sun Microsystems Inc

Object interaction diagrams for a STATELESS session beanEnterprise JavaBeans 2.0, Public Draft Session Bean Component Contract

Figure 14 OID for removal of a STATELESS session object

container-provided classes

client

EJB

 

EJB

container session

synchro-

instance

 

 

Home

Object

context

nization

 

 

remove()

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

6.9.4 Adding instance to the pool

The following diagram illustrates the sequence for a container adding an instance to the method-ready pool.

Figure 15 OID for Container Adding Instance of a STATELESS session bean to a method-ready pool

container-provided classes

EJB

EJB

container session

synchro-

instance transaction

Home

Object

context

nization

service

 

 

 

 

 

new

new

setSessionContext()

ejbCreate()

81

5/31/00