官术网_书友最值得收藏!

Introduction

In object-oriented analysis and design a control class encapsulates business logic for a use case. Session beans are used to implement such control classes. Check credit card details, transfer funds, and book reservation are examples of potential session bean candidates. Session beans are transient and relatively short lived. In particular, session beans are not persistent; they are not stored in a database or other permanent file system. Session beans can create and update entities, which are persistent, as we shall see in the following chapters.

A client interacts with a session bean by invoking one or more methods defined in the bean. This sequence of method calls we call a session, hence the name session beans. The client can be a web-tier client such as a servlet or JSP page, or a standalone Java application program.

Like EJB 2.x, EJB 3 session beans are a component technology. In EJB 3 a session bean component consists of a bean interface and a bean class. The bean interface provides all the bean method definitions, the bean class provides the method implementations. We no longer have to produce a home interface as was required in EJB 2.x.

It is important to stress that the client does not interact directly with a bean. Instead the client interacts with a proxy generated by the EJB container. This proxy intercepts method calls and provides the container services such as transaction management and security.

Session beans come in two flavors: stateless and stateful. We will start with an example of a stateless session bean.

主站蜘蛛池模板: 延边| 兴仁县| 夹江县| 富锦市| 永定县| 政和县| 金山区| 崇文区| 南木林县| 成安县| 巴林左旗| 松阳县| 许昌市| 汾阳市| 赤峰市| 平顶山市| 彭水| 辉县市| 云梦县| 土默特左旗| 天峨县| 讷河市| 湟中县| 禹城市| 靖远县| 宾阳县| 巴里| 中超| 中江县| 宁陵县| 农安县| 元氏县| 南丹县| 甘洛县| 留坝县| 姚安县| 治县。| 手机| 高尔夫| 西乌珠穆沁旗| 方城县|