About EJB Server

Enterprise JavaBeans (EJB) Server is a component transaction server. It supports the EJB server-side component model for developing and deploying distributed, enterprise-level applications in a multi-tiered environment. It provides the framework for creating, deploying, and managing middle-tier business logic.

In a three-tier environment, the client provides the user interface logic, the business rules are separated to the middle tier, and the database is the information repository. The client does not access the database directly. Instead, the client makes a call to the EJB Server on the middle tier, which then accesses the database.

The three tiers can reside on different machines or on the same machines. EJB Server is designed to reside on the same machine as the database engines it serves. Because the servers are on the same machine, EJB Server can communicate with the database using Adaptive Server’s high-speed, shared-memory JDBC driver. This approach ensures:

EJB components (or Beans) are reusable modules of code that combine related tasks (methods) into a well-defined interface. EJB components contain the methods that execute business logic and access data sources. You (or the Administrator) install the component’s executable code on EJB Server. Any number of independent Java or EJB applications (clients) can use the EJBs.

There are three types of Enterprise JavaBeans: stateful session Beans, stateless session Beans, and entity Beans. Each type of bean is a set of methods and is responsible for different tasks on behalf of the client.

All session Bean instances are transient. They maintain a one-to-one relationship with the client. They perform tasks, and can store information in the database on the client’s behalf. Stateful session Beans manage complex tasks that require the accumulation of data. Stateless session Beans manage tasks that do not store data between method calls. Entity Bean instances are persistent. They represent underlying objects, typically a particular row in a database. All three bean types work together to process a request and return information to the client.

Figure 1-1shows how the client interacts with the EJB Server and the database.

Figure 1-1: EJB Server environment

The stub and the skeleton allow EJB Server to appear to run locally on the client. Every component instance has its own stub and skeleton created specifically for it. The stub resides on the client machine and is connected over the network to the skeleton, which resides on EJB Server. The stub acts as a surrogate for the client, transmitting requests to the skeleton. The skeleton listens on an IIOP port for requests from the stub.

When the skeleton receives a request, it determines which method is required and then invokes that method. Using the Sybase high-speed JDBC driver, EJB Server sends the request to Adaptive Server. If values are returned, the skeleton sends them to the stub, which returns them to the client application.

EJB Server provides efficient management of client sessions, threads, third-tier database connections, and transaction flow, without requiring specialized knowledge on the part of the component developer. As a consequence, developers can focus on solving business problems instead of programming the application's infrastructure.

Developers use classes and interfaces from the javax.ejb packages of the JavaSoft API to create and deploy components. To implement a component, the developer must define interfaces and classes:

Sybase provides a graphics-based management tool, the Adaptive Server plug-in to Sybase Central, for EJB Server developers and administrators. From this graphical interface, developers can deploy components and administrators can configure the server.

Feature summary

EJB Server features include the following:

The following sections explain these features and describe how EJB Server works.