Browse Prior Art Database

Provision of a generic Enterprise JavaBean Home caching service

IP.com Disclosure Number: IPCOM000014821D
Original Publication Date: 2001-Apr-16
Included in the Prior Art Database: 2003-Jun-20
Document File: 2 page(s) / 42K

Publishing Venue

IBM

Abstract

The Enterprise JavaBeans* (EJB) architecture prescribes the use of EJB Homes as a factory for the creation and location of EJB instances. An application program must lookup a naming service using Java Naming and Directory Interface (JNDI), to obtain a reference to a specific EJB Home. Once the EJB Home is obtained, the application can then invoke the lifecycle management services provided by the EJB Home to create retrieve delete an EJB.

This text was extracted from a PDF file.
This is the abbreviated version, containing approximately 52% of the total text.

Page 1 of 2

Provision of a generic Enterprise JavaBean Home caching service

The Enterprise JavaBeans* (EJB) architecture prescribes the use of EJB Homes as a factory for the creation and location of EJB instances. An application program must lookup a naming service using Java Naming and Directory Interface (JNDI), to obtain a reference to a specific EJB Home. Once the EJB Home is obtained, the application can then invoke the lifecycle management services provided by the EJB Home to create / retrieve / delete an EJB.

     The lookup of the EJB Home is a significant overhead, therefore the need to maintain a reference to the EJB Home, and reuse it as necessary, is crucial to the design of high-performance EJB-based systems. Web Application Servers do not provide such a service, leaving it to the application programmer to do this themselves. The application programmer will typically store a reference to the specific EJB Home, and retrieve it as required. The cached EJB Home reference, however, can become 'stale' - this occurs when the EJB Container has suffered a crash, causing an error to be thrown when an application program tries to use the now stale EJB Home reference. An application programmer needs to code appropriate error-handling logic to handle such a situation arising.

     The invention provides a generic EJB Home caching service, which has a cache refresh mechanism in the event of an EJB Home becoming stale. The application programmer is provided with a simple interface to the caching service; a method returns an EJBHome reference giving the JNDI name of the EJB required. The application programmer codes a catch block for the exception 'javax.rmi.MarshalException', and in that block calls another method which signals to the caching service that a refresh of the cache is necessary.

     The invention consists of a Java class that implements the Singleton pattern, 'EjbHomeCacheHelper'. This class mediates client requests to the EJB...