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

Sun Microsystems Inc.

Support for Distribution and Interoperability

Enterprise JavaBeans 2.0, Public Draft

Interoperability Scenarios

providers (on potentially different operating systems), deploy applications in the J2EE servers, and have the multiple applications interoperate.

To leverage the interoperability work done by standards bodies (including the IETF, W3C and OMG) where possible, so that customers can work with industry standards and use standard protocols to access enterprise beans.

This specification does not address interoperability issues between enterprise beans and non-J2EE components. The J2EE platform specification describes requirements for interoperability with internet clients (using HTTP and XML) and interoperability with enterprise information systems (using the J2EE Connector architecture).

Since the interoperability protocol is based on CORBA/IIOP, CORBA clients written in Java, C++, or other languages can also invoke methods on enterprise beans.

This chapter subsumes the previous EJB1.1-to-CORBA mapping document [ 12 ].

18.3 Interoperability Scenarios

This section presents a number of interoperability scenarios that motivate the interoperability mechanisms described in later sections of this chapter. These scenarios are illustrative, rather than prescriptive. There is no requirement that a J2EE product should support these scenarios in exactly the manner described here.

J2EE applications are multi-tier, web-enabled applications. Each application consists of one or more components, which are deployed in containers. The four types of containers are:

EJB containers, which host enterprise beans.

Web containers, which host JavaServer Pages (JSPs) and Servlet components as well as static documents including HTML pages.

Application client containers, which host standalone applications.

Applet containers, which host applets which may be downloaded from a web site. At this time, there is no requirement for an applet to be able to directly invoke the remote methods of enterprise beans.

The scenarios below describe interactions between components hosted in these various container types.

18.3.1 Interactions between web containers and EJB containers for e-commerce applications

This scenario occurs for business-to-business and business-to-consumer interactions over the Internet.

5/31/00

358

Sun Microsystems Inc

Interoperability Scenarios

Enterprise JavaBeans 2.0, Public Draft

Support for Distribution and Interoperability

Scenario 1: A customer wants to buy a book from an Internet bookstore. The bookstore’s web site consists of a J2EE application containing JSPs which form the presentation layer, and another J2EE application containing enterprise beans which have the business logic and database access code. The JSPs and enterprise beans are deployed in containers from different vendors.

At deployment time: The enterprise beans are deployed, and their EJBHome objects are published in the EJB server’s name service. The deployer links the EJB reference in the JSP’s deployment descriptor to the URL of the enterprise bean’s EJBHome object which can be looked up from the name service. The transaction attribute specified in the enterprise bean’s deployment descriptor is RequiresNew for all business methods. The “checkout” JSP requires secure access to set up payments for purchases, so the bookstore’s administrator configures the “checkout” JSP to require access over HTTPS with only server authentication. Customer authentication is done using form-based login. The “book search” JSP is accessed over normal HTTP. Both JSPs talk with enterprise beans which access the book database. The web and EJB containers use the same customer realm and have a trust relationship with each other. The network between the web and EJB servers is not guaranteed to be secure from attacks.

At runtime: The customer accesses the book search JSP using a browser. The JSP looks up the enterprise bean’s EJBHome object in a name service, and calls findBooks(....) with the search criteria as parameters. The web container establishes a secure session with the EJB container with mutual authentication between the containers, and invokes the enterprise bean. The customer then decides to buy a book, and accesses the “checkout” JSP. The customer enters the necessary information in the login form, which is used by the web server to authenticate the customer. The JSP invokes the enterprise bean to update the book and customer databases. The customer’s principal is propagated to the EJB container and used for authorization checks. The enterprise bean completes the updates and commits the transaction. The JSP sends back a confirmation page to the customer.

18.3.2 Interactions between application client containers and EJB containers within an enterprise’s intranet

Scenario 2.1: An enterprise has an expense accounting application which is used by employees from their desktops. The server-side consists of a J2EE application containing enterprise beans which are deployed on one vendor's J2EE product, which is hosted in a datacenter. The client side consists of another J2EE application containing an application client deployed using another vendor's J2EE infrastructure. The network between the application client and the EJB container is insecure and needs to be protected against spoofing and other attacks.

At deployment time: The enterprise beans are deployed and their EJBHome objects are published in the enterprise’s name service. The application clients are configured with the names of the EJBHome objects. The deployer maps employees to roles which are allowed access to the enterprise beans. The administrator configures the security settings of the application client and EJB container to require client and server authentication and message protection. The administrator also does the necessary cli- ent-side configuration to allow client authentication.

359

5/31/00

Sun Microsystems Inc.

Support for Distribution and Interoperability

Enterprise JavaBeans 2.0, Public Draft

Interoperability Scenarios

At runtime: The employee logs on using username and password. The application client container may interact with the enterprise’s authentication service infrastructure to set up the employee’s credentials. The client application does a remote invocation to the name server to look up the enterprise bean’s EJBHome object, and creates the enterprise beans. The application client container uses a secure protocol to interact with the name server and EJB server which does mutual authentication and also guarantees the confidentiality and integrity of messages. The employee then enters the expense information and submits it. This causes remote business methods of the enterprise beans to be invoked. The EJB container performs authorization checks and, if they succeed, executes the business methods.

Scenario 2.2: This is the same as Scenario 2.1, except that there is no client-side authentication infrastructure set up by the administrator. At run time the client container needs to send the user’s password to the server during the method invocation to authenticate the employee.

18.3.3 Interactions between two EJB containers in an enterprise’s intranet

Scenario 3: An enterprise has an expense accounting application which needs to communicate with a payroll application. The applications use enterprise beans and are deployed on J2EE servers from different vendors. The J2EE servers and naming/authentication services may be in the enterprise's datacenter with a physically secure private network between them, or they may need to communicate across the intranet which may be less secure. The applications need to update accounts and payroll databases. The employee (client) accesses the expense accounting application as described in Scenario 2.

At deployment time: The deployer configures both applications with the appropriate database resources. The accounts application is configured with the name of the EJBHome object of the payroll application. The payroll bean’s deployment descriptor specifies the RequiresNew transaction attribute for all methods. The applications use the same principal-to-role mappings (e.g. the roles may be Employee, PayrollDept, AccountsDept). The deployer of these two applications has administratively set up a trust relationship between the two EJB containers, so that the containers do not need to authenticate principals propagated on calls to enterprise beans from the other container. The administrator also sets up the message protection parameters of the two containers if the network is not physically secure.

At run time: An employee makes a request to the accounts application which requires it to access the payroll application. The accounts application does a lookup of the payroll application’s EJBHome object in the naming/directory service and creates enterprise beans. It updates the accounts database and invokes a remote method of the payroll bean. The accounts bean’s container propagates the employee’s principal on the method call. The payroll bean’s container maps the propagated employee principal to a role, does authorization checks, and sets up the payroll bean’s transaction context. The container starts a new transaction, then the payroll bean updates the payroll database, and the container commits the transaction. The accounts bean receives a status reply from the payroll bean. If an error occurs in the payroll bean, the accounts bean executes code to recover from the error and restore the databases to a consistent state.

5/31/00

360

Sun Microsystems Inc

Interoperability Scenarios

Enterprise JavaBeans 2.0, Public Draft

Support for Distribution and Interoperability

18.3.4 Interactions between web containers and EJB containers for intranet applications

Scenario 4: This is the same as scenario 2.1, except that instead of using a “fat-client” desktop application to access the enterprise’s expense accounting application, employees use a web browser, and connect to a web server in the intranet which hosts JSPs. The JSPs gather input from the user (e.g., through an HTML form), invoke enterprise beans that contain the actual business logic, and format the results returned by the enterprise beans (using HTML).

At deployment time: The enterprise deployer configures its expense accounting JSPs to require access over HTTPS with mutual authentication. The web and EJB containers use the same customer realm and have a trust relationship with each other.

At run-time: The employee logs in to the client desktop, starts the browser, and accesses the expense accounting JSP. The browser establishes an HTTPS session with the web server. Client authentication is performed (for example) using the employee’s credentials which have been established by the operating system at login time (the browser interacts with the operating system to obtain the employee’s credentials). The JSP looks up the enterprise bean’s EJBHome object in a name service. The web container establishes a secure session with the EJB container with mutual authentication and integrity/confidentiality protection between the containers, and invokes methods on the enterprise beans.

18.3.5 Overview of interoperability requirements

The following interoperable mechanisms are used to support the scenarios described above:

1.Remote method invocation on an enterprise bean’s EJBObject and EJBHome object references (scenarios 1,2,3,4), described in section 18.4.

2.Name service lookup of the enterprise bean’s EJBHome object (scenarios 1,2,3,4), described in section 18.6.

3.Integrity and confidentiality protection of messages (scenarios 1,2,3,4), described in section

4.Authentication between an application client and EJB container (described in section 18.7):

4.1Mutual authentication when there is client-side authentication infrastructure such as certificates (scenario 2.1).

4.2Propagation of the user’s authentication data from application client to EJB container to allow the EJB container to authenticate the client when there is no client-side authentication infrastructure (scenario 2.2).

5.Mutual authentication between two EJB containers or between a web and EJB container to establish trust before principals are propagated (scenarios 1,3,4), described in section 18.7.

361

5/31/00