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

  • EJB 3 Developer Guide
  • Michael Sikora
  • 258字
  • 2021-07-02 11:34:53

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.

主站蜘蛛池模板: 辽阳县| 襄汾县| 台州市| 海阳市| 加查县| 辉南县| 井冈山市| 元谋县| 麦盖提县| 静海县| 同江市| 仙游县| 同江市| 锡林郭勒盟| 怀远县| 广丰县| 卢氏县| 信阳市| 茌平县| 思茅市| 江北区| 陇南市| 梧州市| 岳阳县| 扎鲁特旗| 东明县| 孙吴县| 武鸣县| 巴林左旗| 墨竹工卡县| 桂林市| 辽中县| 凤庆县| 武城县| 奇台县| 新野县| 定西市| 衡阳县| 开化县| 兴海县| 白山市|