Chapter 12. Enterprise Bean Environment

This chapter is for the Enterprise Bean provider; that is, the person in charge of developing the software components on the server side.

12.1. Introduction

The Enterprise Bean environment is a mechanism that allows customization of the Enterprise Bean's business logic during assembly or deployment. The environment is a way for a bean to refer to a value, to a resource, or to another component so that the code will be independent of the actual referred object. The actual value of such environment references (or variables) is set at deployment time, according to what is contained in the deployment descriptor. The Enterprise Bean's environment allows the Enterprise Bean to be customized without the need to access or change the Enterprise Bean's source code.

The Enterprise Bean environment is provided by the container (that is, the JOnAS server) to the bean through the JNDI interface as a JNDI context. The bean code accesses the environment using JNDI with names starting with java:comp/env/.