A portion of the disclosure of this patent document contains material which is subject to copyright protection. The copyright owner has no objection to the facsimile reproduction by anyone of the patent document or the patent disclosure, as it appears in the Patent and Trademark Office patent file or records, but otherwise reserves all copyright rights whatsoever.
The invention relates generally to application servers and software development systems, and particularly to a system and method for EJB classloading.
The architecture of the traditional EJB classloading scheme is such that any changes to the EJB implementation (impl) class forces the developer to go through a full redeployment (undeploy and redeploy cycle) for the changes to take effect. This results in unnecessary work being done, since much of the EJB deployment code that had to execute has no direct dependency on the EJB impl class. One of the downsides is that it takes longer than necessary to have the new EJB impl changes take effect.
Another problem is that a full redeployment can be very disruptive, since it invalidates all references to the EJB and forces clients to obtain those references again to continue to invoke on the EJB.
The invention provides a system and method for EJB classloading. By changing the EJB classloading scheme so that the EJB impl class is loaded in a child ClassLoader, the system makes it possible to replace the old EJB impl class with a new one without disturbing the rest of the deployment. The key to doing this is to remove all direct references to the EJB impl class from classes loaded in the parent ClassLoaders. Removing this dependency allows the old EJB impl class to be replaced at any time with a new impl class.
The invention provides a system and method for EJB classloading. The EJB classloading scheme is changed so that the EJB impl class* is loaded in a child ClassLoader. This allows us to replace the old EJB impl class with a new one without disturbing the rest of the deployment. (* by referring to EJB implementation class, this means the implementation class and all super classes).
The architecture of the traditional EJB classloading scheme is such that any changes to the EJB implementation (impl) class forces the developer to go through a full redeployment (undeploy and redeploy cycle) for the changes to take effect. This results in unnecessary work being done, since much of the EJB deployment code that had to execute has no direct dependency on the EJB impl class. One of the downsides is that it takes longer than necessary to have the new EJB impl changes take effect.
By changing the EJB classloading scheme so that the EJB impl class is loaded in a child ClassLoader, it is possible to replace the old EJB impl class with a new one without disturbing the rest of the deployment. The key to doing this is to remove all direct references to the EJB impl class from classes loaded in the parent ClassLoaders. Removing this dependency allows the old EJB impl class to be replaced at any time with a new impl class.
Implementing this, however, presents some unique challenges. First, one must ensure the EJB impl class is actually loaded in the child and not from the parent ClassLoader. This is achieved via a custom ClassLoader implementation in which the EJB impl class is specifically disallowed from being loaded in the parent ClassLoader. This is necessary because the parent ClassLoader has access to the EJB impl class along with the rest of the EJB classes since they are all packaged together.
Another challenge is ensuring none of the classes loaded in the parent ClassLoader have direct references to the classes loaded in the child ClassLoader. This is achieved by generating a custom interface for the EJB impl class, declaring all methods that are invoked on the EJB impl by the classes loaded in the parent ClassLoader. The classes in the parent ClassLoader then refer to the bean class interface instead of the bean class, and the direct dependency is removed.
The present invention may be conveniently implemented using a conventional general purpose or a specialized digital computer or microprocessor programmed according to the teachings of the present disclosure. Appropriate software coding can readily be prepared by skilled programmers based on the teachings of the present disclosure, as will be apparent to those skilled in the software art.
In some embodiments, the present invention includes a computer program product which is a storage medium (media) having instructions stored thereon/in which can be used to program a computer to perform any of the processes of the present invention. The storage medium can include, but is not limited to, any type of disk including floppy disks, optical discs, DVD, CD-ROMs, microdrive, and magneto-optical disks, ROMs, RAMs, EPROMs, EEPROMs, DRAMs, VRAMs, flash memory devices, magnetic or optical cards, nanosystems (including molecular memory ICs), or any type of media or device suitable for storing instructions and/or data.
The foregoing description of the present invention has been provided for the purposes of illustration and description. It is not intended to be exhaustive or to limit the invention to the precise forms disclosed. Many modifications and variations will be apparent to the practitioner skilled in the art. Particularly, it will be evident that while the examples described herein illustrate how the invention may be used in a WebLogic environment, other application servers, servers, and computing environments, may use and benefit from the invention. The code examples given are presented for purposes of illustration. It will be evident that the techniques described herein may be applied using other code languages, and with different code.
The embodiments were chosen and described in order to best explain the principles of the invention and its practical application, thereby enabling others skilled in the art to understand the invention for various embodiments and with various modifications that are suited to the particular use contemplated. It is intended that the scope of the invention be defined by the following claims and their equivalence.
This application claims priority to U.S. Provisional Patent Application 60/450,779, filed Feb. 28, 2003, entitled “SYSTEM AND METHOD FOR EJB CLASSLOADING”, and incorporated herein by reference.
Number | Name | Date | Kind |
---|---|---|---|
5805896 | Burgess | Sep 1998 | A |
5815718 | Tock | Sep 1998 | A |
5950008 | van Hoff | Sep 1999 | A |
5970252 | Buxton et al. | Oct 1999 | A |
5974428 | Gerard et al. | Oct 1999 | A |
6081665 | Nilsen et al. | Jun 2000 | A |
6092120 | Swaminathan et al. | Jul 2000 | A |
6237135 | Timbol | May 2001 | B1 |
6330709 | Johnson et al. | Dec 2001 | B1 |
6339841 | Merrick et al. | Jan 2002 | B1 |
6442753 | Gerard et al. | Aug 2002 | B1 |
6530080 | Fresko et al. | Mar 2003 | B1 |
6571388 | Venkatraman et al. | May 2003 | B1 |
6631521 | Curtis | Oct 2003 | B1 |
6658492 | Kawahara et al. | Dec 2003 | B1 |
6675381 | Yamaguchi | Jan 2004 | B1 |
6851111 | McGuire et al. | Feb 2005 | B1 |
6915511 | Susarla et al. | Jul 2005 | B1 |
6973646 | Bordawekar et al. | Dec 2005 | B1 |
6983315 | Crutcher | Jan 2006 | B1 |
Number | Date | Country | |
---|---|---|---|
20040172404 A1 | Sep 2004 | US |
Number | Date | Country | |
---|---|---|---|
60450779 | Feb 2003 | US |