SYSTEM AND METHOD FOR ENTERPRISE JAVABEANS CONTAINER
A system to implement functionality for running Enterprise JavaBeans. The functionality is provided by a set of components. The components include a life cycle manager, a client views manager, a proxy invocation handler, an invocation chain manager, and an invocation context.
This application claims the priority of U.S. Provisional Patent Application No. 60/926,989, filed Apr. 30, 2007.
BACKGROUND1. Field of Invention
The invention relates generally to enterprise application servers, and, more specifically, to implementing an Enterprise JavaBeans container within an enterprise application server.
2. Background
Application servers are platforms that host and provide services to applications. Application servers manage the life cycles of applications and ensure that the logic implemented in applications is accessible to clients in a centralized fashion. Application servers based on the Java™ Platform, Enterprise Edition 5 (hereinafter “Java EE”) host and provide services to Java enterprise applications (also referred to as “Java EE applications”) and are referred to as Java™ application servers. Java EE applications are written in the Java™ language and conform to a set of specifications so that they can run on a Java™ application server. Application server vendors develop application servers in accordance with the rules and requirements set forth in the Java™ EE 5 specification. A Java™ EE application has application code and configuration information packed into an Enterprise Application Archive (hereinafter “EAR”). The EAR contains one or more modules of a specific type, for example, web modules, web services modules, Enterprise JavaBeans™ (hereinafter “EJB”) modules, and deployment descriptors. Each module is hosted and serviced by a dedicated container on the server. For example, web modules are serviced by a web container, EJB modules are serviced by an EJB container, web services modules are serviced by a web services container, and so on. Each container is implemented according to a dedicated specification part of the Java™ family of enterprise technologies.
Java™ EE 5 provides a number of new features as compared to previous versions of the platform. For example, Java™ EE 5 includes a new version of the EJB specification, that is, EJB 3.0. The EJB 3.0 specification provides new features and sets forth new requirements for EJB containers. However, the specification does not prescribe how such requirements should be implemented by application server vendors. It is up to the application server vendor to decide how to implement all the requirements set forth in the specification so that the application server complies with the specification.
SUMMARY OF THE INVENTIONA system to run Enterprise JavaBeans is described. The system is implemented as a set of components. Each component provides certain functionality to run Enterprise JavaBeans. The components include a life cycle manager, a client views manager, a proxy invocation handler, an invocation chain manager, and an invocation context.
The invention is illustrated by way of example and not by way of limitation in the figures of the accompanying drawings in which like references indicate similar elements. It should be noted that references to “an” or “one” embodiment in this disclosure are not necessarily to the same embodiment, and such references mean at least one.
A system and method to implement an Enterprise JavaBeans™ container and runtime environment is described.
Implementing the EJB container 1000 as a set of independent components has a number of benefits. First, having each component as an independent unit reduces maintenance time and effort. Each component is maintained separately and the maintenance of a single component does not affect the performance of the EJB container 1000. Second, the architecture of the EJB container 1000 facilitates extensibility because new implementations of components can be provided on top of existing ones. Also, new implementations can be switched on transparently, that is, without affecting the work of other components. Third, because components are independent and communicate only through interfaces, it is possible to provide several different implementations of a concrete component. These implementations can co-exist and service requests thus enabling the EJB container 1000 to handle any number of use cases required by clients. For example, the EJB container 1000 can have a number of client view implementations and each client view can serve a distinct task, such as aggregation, caching, performance optimizations, interoperability, isolation, and so on.
The functionality provided by the EJB container 1000 is implemented using interceptors. An interceptor is a class which implements specific functionality and contains source code corresponding to concrete EJB specification requirements. A sequence of concrete instances of interceptors is called an interceptor chain. The invocation chains manager 1300 monitors constructed chains. After an EJB application is initialized, each event that is received at the EJB container 1000 is assigned a chain of interceptors. The invocation chains manager 1300 assigns the chain of interceptors to perform the necessary task and associates the chain with an invocation context, as mentioned above. The invocation context controls the behavior of the interceptor chain. Each interceptor has the knowledge that it participates in a concrete chain and has access to its invocation context. At the time when the chain is executed to service a request or event, an interceptor associated with an invocation context can stop the execution, raise an error, or change the execution arguments. Also, an interceptor can introduce custom values to the invocation context and propagate them to application code or other interceptors. Using interceptors to provide the required functionality for the EJB container 1000 follows good development practices in terms of separating functionality into functional blocks (i.e. interceptors). Consequently, interceptors can be developed independently and the development and maintenance of an interceptor does not influence the work and performance of the EJB container 1000. Also, interceptor chains are not hard coded. This means that interceptor chains can be constructed dynamically to serve a specific scenario. Finally, to add or remove functionality to the EJB container 1000 the container provider simply implements a new interceptor or removes an existing interceptor, thus saving time and effort.
In some embodiments, to implement the required functionality, the EJB container 1000 provides some or all of the following interceptors outlined in the table below:
In an embodiment of the invention, the runtime environment described in
In an embodiment of the invention, the process described in
Elements of embodiments may also be provided as a machine-readable medium for storing the machine-executable instructions. The machine-readable medium may include, but is not limited to, flash memory, optical disks, CD-ROMs, DVD ROMs, RAMs, EPROMs, EEPROMs, magnetic or optical cares, or other type of machine-readable media suitable for storing electronic instructions. Some embodiments of the invention may be downloaded as a computer program which may be transferred from a remote computer (e.g., a server) to a requesting computer (e.g., a client) by way of data signals embodied in a carrier wave or other propagation medium via a communication link (e.g., a modem or network connection).
It should be appreciated that reference throughout this specification to “one embodiment” or “an embodiment” means that a particular feature, structure or characteristic described in connection with the embodiment is included in at least one embodiment of the present invention. Therefore, it is emphasized and should be appreciated that two or more references to “an embodiment” or “one embodiment” or “an alternative embodiment” in various portions of this specification are not necessarily all referring to the same embodiment. Furthermore, the particular features, structures or characteristics may be combined as suitable in one or more embodiments of the invention.
In the foregoing specification, the invention has been described with reference to the specific embodiments thereof. It will, however, be evident that various modifications and changes can be made thereto without departing from the broader spirit and scope of the invention as set forth in the appended claims. The specification and drawings are, accordingly, to be regarded in an illustrative rather than a restrictive sense.
Claims
1. A system to run Enterprise JavaBeans (“EJB”), comprising:
- a life cycle manager to manage the lifecycle of bean instances;
- a client views manager to manage the life cycle of client views provided to bean clients;
- a proxy invocation handler coupled to a client view factory to propagate a client request from a client view to a bean instance;
- an invocation chains manager to execute the client request responsive to receiving the client request from the proxy invocation handler; and
- an invocation context to manage the lifecycle of an interceptor chain responsive to the interceptor chain being executed by the invocation chains manager.
2. The system of claim 1, wherein the client views manager comprises:
- a set of client view factory instances to create and destroy client view instances.
3. The system of claim 1, further comprising:
- a timeout manager to manage timeout invocations.
4. An apparatus to provide a runtime environment for an Enterprise JavaBean (“EJB”), the apparatus comprising:
- an invocation chains manager to invoke an invocation chain responsive to a request;
- an enterprise bean context to maintain a set of resources associated with the EJB;
- an instance life cycle manager coupled to the enterprise bean context to manage an instance of the EJB and resources associated with the instance of the EJB; and
- a component interface manager to manage factory objects associated with the instance of the EJB.
5. The apparatus of claim 4, wherein the factory objects comprise:
- a remote access factory object; and
- a local access factory object.
6. A method to run Enterprise Java Beans (“EJB”) applications, comprising:
- creating a set of interceptors, each interceptor encapsulating logic to service a request for a bean or a bean life cycle event;
- grouping interceptors in interceptor chains;
- requesting an interceptor chain responsive to receiving a request for the bean;
- associating the interceptor chain with an invocation context; and
- executing the interceptor chain to service the request.
7. The method of claim 6, further comprising obtaining a reference to a client view of the bean.
8. The method of claim 6, wherein requesting the interceptor chain comprises:
- invoking a proxy invocation handler to pass the request to an invocation chain manager;
- estimating if the received request is for a business logic operation or a lifecycle operation; and
- identifying an interceptor chain to service the request based on the estimation of the type of the request.
9. A machine readable medium having instructions therein that when executed by the machine, cause the machine to:
- create a set of interceptors, each interceptor encapsulating logic to service a request for a bean or a bean life cycle event;
- group interceptors in interceptor chains;
- request an interceptor chain responsive to receiving a request for the bean; and
- execute the interceptor chain to service the request.
10. The machine readable medium of claim 9, further comprising instructions that cause the machine to obtain a reference to a client view of the bean.
11. The machine readable medium of claim 9, wherein instructions causing the machine to request an interceptor chain, cause the machine to:
- invoke a proxy invocation handler to pass the request to an invocation chain manager;
- estimate if the received request is for a business logic operation or a lifecycle operation; and
- identify an interceptor chain to service the request based on the estimation of the type of the request.
Type: Application
Filed: Apr 28, 2008
Publication Date: Oct 30, 2008
Inventors: Ivo V. Simeonov (Sofia), Hristo K. Sabev (Sofia), Vladimir K. Pavlov (Sofia), Krasimir I. Topchiyski (Sofia), Vesselin P. Mitrov (Sofia)
Application Number: 12/111,127
International Classification: G06F 9/44 (20060101);