Field of the Invention
This invention relates generally to the field of data processing systems. More particularly, the invention relates to a system and method for improving the efficiency of remote method invocations (“RMI”) within a multi-tiered enterprise network and for generating and configuring dynamic proxies.
Description of the Related Art
Java 2 Enterprise Edition (“J2EE”) is a specification for building and deploying distributed enterprise applications. Unlike traditional client-server systems, J2EE is based on a multi-tiered architecture in which server side program code is divided into several layers including a “presentation” layer and a “business logic” layer.
As illustrated in
Session beans are objects which represent the high level workflow and business rules implemented by the application server 100. For example, in a customer relationship management (“CRM”) system, session beans define the business operations to be performed on the underlying customer data (e.g., calculate average customer invoice dollars, plot the number of customers over a given timeframe, . . . etc). Session beans typically execute a single task for a single client during a “session.” Two versions of session beans exist: “stateless” session beans and “stateful” session beans. As its name suggests, a stateless session bean interacts with a client without storing the current state of its interaction with the client. By contrast, a stateful session bean stores its state across multiple client interactions.
Entity beans are persistent objects which represent data (e.g., customers, products, orders, . . . etc) stored within a relational database. Typically, each entity bean is mapped to a table in the relational database and each “instance” of the entity bean is typically mapped to a row in the table (referred to generally as an “object-relational mapping”). Two different types of persistence may be defined for entity beans: “bean-managed persistence” and “container-managed persistence.” With bean-managed persistence, the entity bean designer must provide the code to access the underlying database (e.g., SQL Java and/or JDBC commands). By contrast, with container-managed persistence, the EJB container 101 manages the underlying calls to the database.
Each enterprise Java bean (“EJB”) consists of “remote home” and/or “local home” interfaces and “remote component” and/or “local component” interfaces, and one class, the “bean” class. The home interfaces list the methods available for creating, removing and finding EJBs within the EJB container. The home object is the implementation of the home interface and is generated by the EJB container at deploy time. The home object is used by clients to identify particular components and establish a connection to the components' interfaces. The component interfaces provides the underlying business methods offered by the EJB.
Remote clients access session beans and entity beans through the beans' remote interfaces, using a technique known as remote method invocation (“RMI”). Specifically, RMI allows Java objects such as EJBs to invoke methods of the remote interfaces on remote objects. Objects are considered “remote” if they are located within a different Java virtual machine (“JVM”) than the invoking object. The JVM may be located on a different physical machine or on the same machine as the JVM of the invoking object.
When a stub's method is invoked, it initiates a connection with the skeleton 161 on the remote virtual machine 156 and transmits the parameters of the method to the skeleton 161. The skeleton 161 forwards the method call to the actual remote object 151, receives the response, and forwards it back to the stub 160. The stub 160 then returns the results to the local object 150.
A “tie” for a remote object is a server-side entity which is similar to a skeleton, but which communicates with the calling object using the Internet Inter-orb protocol (“IIOP”). Another well known transport protocol used to establish communication between stubs and skeletons is the P4 protocol developed by SAP AG. As used throughout the remainder of this document, the term “skeleton” is meant to include ties and any other objects which perform the same underlying functions as skeletons.
A “deployment descriptor” is an XML file (named “ejb-jar.xml”) that describes how a component is deployed within the J2EE application server 100 (e.g., security, authorization, naming, mapping of EJB's to database objects, etc). Because the deployment descriptor information is declarative, it may be changed without modifying the underlying application source code. At the time of deployment, the J2EE server 100 reads the deployment descriptor and acts on the application and/or component accordingly.
A system and method are described in which skeletons and/or stubs are manipulated based on deployment information. For example, a method according to one embodiment of the invention comprises: compiling source code to generate program code executable on an application server comprised of a plurality of different virtual machines, the program code containing stubs and/or skeletons; analyzing the program code to identify stubs and/or skeletons generated for objects which are located within the same virtual machine and/or the same physical machine; removing the stubs and/or skeletons for those objects which are located in the same virtual machine and/or same physical machine to generate modified program code; and deploying the modified program code.
A better understanding of the present invention can be obtained from the following detailed description in conjunction with the following drawings, in which:
Described below is a system and method for improving the efficiency of remote method invocations (“RMI”) within a multi-tiered enterprise network. Throughout the description, for the purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the present invention. It will be apparent, however, to one skilled in the art that the present invention may be practiced without some of these specific details. In other instances, well-known structures and devices are shown in block diagram form to avoid obscuring the underlying principles of the present invention.
One embodiment of the invention analyzes the relationship between local objects and remote objects to determine whether the stub of the local object can be bound directly to the remote object. For example, if the local object and remote object are located within the same Java virtual machine or the same physical machine, the skeleton may be removed and the stub may directly call methods from the remote object.
A system architecture on which embodiments of the invention may be implemented is illustrated in
The worker/server nodes 212-214 within instance 201 provide the business and/or presentation logic for the network applications supported by the system. Each of the worker nodes 212-214 within a particular instance may be configured with a redundant set of programming logic and associated data, represented as virtual machines 221-223 in
In one embodiment, the worker nodes 212-214 may be Java 2 Enterprise Edition (“J2EE”) worker nodes which support Enterprise Java Bean (“EJB”) components and EJB containers (at the business layer) and Servlets and Java Server Pages (“JSP”) (at the presentation layer). In this embodiment, the virtual machines 221-225 implement the J2EE standard (as well as the additional non-standard features described herein). It should be noted, however, that certain high-level features described herein may be implemented in the context of different software platforms including, by way of example, Microsoft .NET platforms and/or the Advanced Business Application Programming (“ABAP”) platforms developed by SAP AG, the assignee of the present application.
In one embodiment, communication and synchronization between each of the instances 201, 202 is enabled via the central services instance 200. As mentioned above, the central services instance 200 includes a messaging service and a locking service. The message service allows each of the servers within each of the instances to communicate with one another via a message passing protocol. For example, messages from one server may be broadcast to all other servers within the cluster via the messaging service (e.g., such as the cache configuration messages described below). Alternatively, messages may be addressed directly to specific servers within the cluster (i.e., rather than being broadcast to all servers). In one embodiment, the locking service disables access to (i.e., locks) certain specified portions of configuration data and/or program code stored within a central database 245. The locking service locks data on behalf of various system components which need to synchronize access to specific types of data and program code. In one embodiment, the central services instance 200 is the same central services instance as implemented within the Web Application Server version 6.3 and/or 6.4 developed by SAP AG. However, the underlying principles of the invention are not limited to any particular type of central services instance.
In addition, unlike prior systems, one embodiment of the invention shares objects across virtual machines 221-225. Specifically, in one embodiment, objects such as session objects which are identified as “shareable” are stored within a shared memory region 240, 241 and are made accessible to multiple virtual machines 221-225. Creating new object instances from scratch in response to client requests can be a costly process, consuming processing power and network bandwidth. As such, sharing objects between virtual machines as described herein improves the overall response time of the system and reduces server load.
In a shared memory implementation, a shared memory area 240, 241 or “heap” is used to store data objects that can be accessed by multiple virtual machines 221-225. The data objects in a shared memory heap should generally not have any pointers or references into any private heap (e.g., the private memory regions/heaps of the individual virtual machines). This is because if an object in the shared memory heap had a member variable with a reference to a private object in one particular virtual machine, that reference would be invalid for all the other virtual machines that use that shared object.
More formally, this restriction can be thought of as follows: For every shared object, the transitive closure of the objects referenced by the initial object should only contain shared objects at all times. Accordingly, in one implementation of the invention, objects are not put into the shared memory heap by themselves—rather, objects (such as the session objects described herein) are put into the shared memory heap in groups known as “shared closures.” A shared closure is an initial object plus the transitive closure of all the objects referenced by the initial object.
As described above with respect to
One embodiment of a system for addressing the foregoing issues is illustrated in
Unlike prior systems, however, the system shown in
In one embodiment, the deployment analysis module 303 will determine the deployed relationship between the two applications/components by parsing the deployment descriptor 305 for the applications/components. As mentioned above, the deployment descriptor 305 is an XML file which describes how code will actually be deployed within the application server. The end result is deployed code with certain stubs and/or skeletons removed 304.
A method according to one embodiment of the invention is set forth in
In addition to deleting unnecessary stubs and skeletons as described above, one embodiment of the invention analyzes method calls during runtime and dynamically generates client-side and/or server-side proxies to manage the method calls (i.e., in situations where no static stub and/or skeleton was generated prior to runtime). Specifically, referring to
In operation, In response to receiving a method invocation to a remote object (in this case, a call to “method 2”) the dynamic proxy 700 initiates an invocation handler 702 to manage the remote method call. A classloader 701 finds the reference object that corresponds to the called method (i.e., Method 2) and wraps the method in the invocation handler object. The invocation handler 702 then uses the parameters of the method to make the remote method call via the static skeleton or the dynamic skeleton on the remote virtual machine. In addition, in one embodiment, if the method invocation is to a local object, then a “local” invocation handler is used to manage the local method call. Alternatively, the invocation handler may be bypassed altogether and the local method call may be made directly to the local object.
A method for generating dynamic proxies and skeletons according to one embodiment of the invention is set forth in
If, however, the call is to a remote object, then at 804 a determination is made as to whether a static stub exists to handle the remote method invocation (i.e., a stub generated as a result of the RMIC compiler). If so, then at 811, the stub is used to handle the remote method call. If not, then at 805, a dynamic proxy such as that illustrated in
If no static skeleton exists on the remote virtual machine (i.e., if no skeleton was generated by the RMIC compiler), determined at 807, then at 809, a dynamic skeleton is generated to handle the remote method call and at 810 the invocation handler communicates with the dynamic skeleton to process the remote method invocation. If a static skeleton already exists for the remote method, then at 808, the invocation handler communicates with the static skeleton to invoke the remote method. In one embodiment, the invocation handler identifies the particular remote method and passes the dynamic or static skeleton the method parameters. The dynamic or static skeleton then directly invokes the method on the remote object using the method parameters and provides the results back to the invocation handler on the local virtual machine.
Embodiments of the invention may include various steps as set forth above. The steps may be embodied in machine-executable instructions which cause a general-purpose or special-purpose processor to perform certain steps. Alternatively, these steps may be performed by specific hardware components that contain hardwired logic for performing the steps, or by any combination of programmed computer components and custom hardware components.
Elements of the present invention 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 cards, or other type of machine-readable media suitable for storing electronic instructions.
Throughout the foregoing description, for the purposes of explanation, numerous specific details were set forth in order to provide a thorough understanding of the invention. It will be apparent, however, to one skilled in the art that the invention may be practiced without some of these specific details. For example, although many of the embodiments set forth above relate to a Java or J2EE implementation, the underlying principles of the invention may be implemented in virtually any enterprise networking environment. Moreover, although some of the embodiments set forth above are implemented within a shared memory environment, the underlying principles of the invention are equally applicable to a non-shared memory environment. Finally, it should be noted that the terms “client” and “server” are used broadly to refer to any applications, components or objects which interact via remote method invocations.
Accordingly, the scope and spirit of the invention should be judged in terms of the claims which follow.
Number | Name | Date | Kind |
---|---|---|---|
5682534 | Kapoor et al. | Oct 1997 | A |
5684955 | Meyer et al. | Nov 1997 | A |
6061721 | Ismael et al. | May 2000 | A |
6157960 | Kaminsky et al. | Dec 2000 | A |
6253256 | Wollrath et al. | Jun 2001 | B1 |
6279030 | Britton et al. | Aug 2001 | B1 |
6385722 | Connelly et al. | May 2002 | B1 |
6408342 | Moore et al. | Jun 2002 | B1 |
6412010 | Kind | Jun 2002 | B1 |
6496850 | Bowman-Amuah | Dec 2002 | B1 |
6519594 | Li | Feb 2003 | B1 |
6549955 | Guthrie et al. | Apr 2003 | B2 |
6618737 | Aridor et al. | Sep 2003 | B2 |
6637025 | Beadle et al. | Oct 2003 | B1 |
6718550 | Lim et al. | Apr 2004 | B1 |
6728788 | Ainsworth et al. | Apr 2004 | B1 |
6854114 | Sexton et al. | Feb 2005 | B1 |
6931429 | Gouge et al. | Aug 2005 | B2 |
6973487 | Kimura | Dec 2005 | B2 |
7131110 | Brewin | Oct 2006 | B2 |
7231644 | Kieffer | Jun 2007 | B2 |
7266677 | Bromley et al. | Sep 2007 | B1 |
7356562 | Yoon | Apr 2008 | B2 |
7512953 | Sabev | Mar 2009 | B1 |
7533388 | Cavanaugh | May 2009 | B1 |
7574714 | Black et al. | Aug 2009 | B2 |
20020046228 | Scheifler et al. | Apr 2002 | A1 |
20020129078 | Plaxton et al. | Sep 2002 | A1 |
20020174169 | Schmid | Nov 2002 | A1 |
20020184226 | Klicnik et al. | Dec 2002 | A1 |
20020188935 | Hertling et al. | Dec 2002 | A1 |
20030084204 | Wollrath et al. | May 2003 | A1 |
20030221023 | Peddada et al. | Nov 2003 | A1 |
20040019897 | Taylor et al. | Jan 2004 | A1 |
20040261069 | Verbeke et al. | Dec 2004 | A1 |
20050022157 | Brendle et al. | Jan 2005 | A1 |
20050155044 | Broussard et al. | Jul 2005 | A1 |
20060143601 | Concha et al. | Jun 2006 | A1 |
20070027877 | Droshev et al. | Feb 2007 | A1 |
20070027878 | Droshev et al. | Feb 2007 | A1 |
20070168509 | Droshev et al. | Jul 2007 | A1 |
Number | Date | Country |
---|---|---|
2000250758 | Sep 2000 | JP |
Entry |
---|
Baude et al., “Interactive and Descriptor-based Deployment of Object-Oriented Grid Application”, 2002, Proceedings. 11th IEEE International Symposium on High Performance Distributed Computing, 2002. |
Lee et al., “Deployment Time Optimization of Distributed Applications”, Nov. 2005, IBM Research Report, retrieved from: http://domino.research.ibm.com/comm/research—people.nsf/pages/kangwon.pubs.html. |
Schmidt et al. “Object Interconnections Collocation Optimization for CORBA”, Sep. 1999, SIGS C++ Report Magazine. |
Prem et al., “BEA WebLogic Platform 7”, Aug. 2003, Sams, excerpts from Chapters 10, 12, 21, 25, and 27. |
Mountjoy et al. “WebLogic: The Definitive Guide”, Feb. 2004, O'Reilly Media Inc., excerpts from Chapters 10 and 14. |
Synonyms of omit from Thesaurus.com and education.yahoo.com retrieved on Jun. 2, 2009. |
Møller, “Automatic Specialization of Client/Server Interfaces”, Jul. 2000, University of Copenhagean, Department of Computer Science Thesis. |
Peter Delahunty, “Remote vs Local Call Optimization”, Nov. 2000, ejb-interest@java.sun.com mail archive. |
Non-Final Office Action for U.S. Appl. No. 11/323,063, Mailed Dec. 10, 2008, 19 pages. |
Non-Final Office Action for U.S. Appl. No. 11/193,070, Mailed Apr. 30, 2008, 16 pages. |
Final Office Action for U.S. Appl. No. 11/193,070, Mailed Oct. 28, 2008, 18 pages. |
Parker, Daryl, et al., “A P2P Approach to ClassLoading in Java”, Springer-Verlag, Berlin, Germany, Jul. 14, 2004, pp. 144-149. |
“U.S. Appl. No. 11/193,070, Advisory Action mailed Mar. 25, 2009”, 3 pgs. |
“U.S. Appl. No. 11/193,070, Examiner Interview Summary mailed Dec. 22, 2008”, 2 pgs. |
“U.S. Appl. No. 11/193,070, Final Office Action mailed Oct. 28, 2008”, 17 pgs. |
“U.S. Appl. No. 11/193,070, Non Final Office Action mailed Apr. 30, 2008”, 15 pgs. |
“U.S. Appl. No. 11/193,070, Non-Final Office Action mailed Jun. 8, 2009”, 11 pgs. |
“U.S. Appl. No. 11/193,070, Response filed Mar. 2, 2009 to Final Office Action mailed Oct. 28, 2008”, 17 pgs. |
“U.S. Appl. No. 11/193,070, Response filed Mar. 30, 2009 to Advisory Action mailed Mar. 25, 2009”, 17 pgs. |
“U.S. Appl. No. 11/193,070, Response filed Jul. 30, 2008 to Non Final Office Action mailed Apr. 30, 2008”, 11 pgs. |
“U.S. Appl. No. 11/193,070, Response filed Sep. 3, 2009 to Non Final Office Action mailed Jun. 8, 2009”, 12 pgs. |
“U.S. Appl. No. 11/323,063, Advisory Action mailed Sep. 3, 2009”, 3 pgs. |
“U.S. Appl. No. 11/323,063, Final Office Action mailed Jun. 22, 2009”, 19 pgs. |
“U.S. Appl. No. 11/323,063, Non Final Office Action mailed Dec. 10, 2008”, 18 pgs. |
“U.S. Appl. No. 11/323,063, Response filed Mar. 10, 2009 to Non Final Office Action mailed Dec. 10, 2008”, 10 pgs. |
“U.S. Appl. No. 11/323,063, Response filed Aug. 20, 2009 to Final Office Action mailed Jun. 22, 2009”, 10 pgs. |
“U.S. Appl. No. 11/323,063, Response filed Sep. 22, 2009 to Advisory Action mailed Sep. 3, 2009”, 10 pgs. |
“U.S. Appl. No. 11/193,070, Non-Final Office Action mailed Nov. 27, 2009.”, 17 Pgs. |
“U.S. Appl. No. 11/193,070, Response filed Feb. 24, 2010 to Non Final Office Action mailed Nov. 27, 2009”, 14 pgs. |
“U.S. Appl. No. 11/323,063 Final Office Action mailed Dec. 9, 2009”, 11 pgs. |
Delahunty, P., et al., “Remote vs Local Call Optimization”, ejb-interest@java.sun.commail—archive., (Nov. 2000) |
“U.S. Appl. No. 11/323,063 Final Office Action mailed Jun. 11, 2010”, 12 pgs. |
“U.S. Appl. No. 11/193,070, Final Office Action mailed May 26, 2010”, 22. |
Zdun, et al., “Remoting Patterns”, Tutorial, Jax 2004, (May 2004), 157 pages. |
“U.S. Appl. No. 11/193,070, Examiner Interview Summary mailed Feb. 25, 2010”, 4 pgs. |
“U.S. Appl. No. 11/193,070, Examiner Interview Summary mailed Aug. 5 ,2010”, 3 pgs. |
“U.S. Appl. No. 11/193,070, Response filed Aug. 17, 2010 to Final Office Action mailed May 26, 2010”, 16 pgs. |
“U.S. Appl. No. 11/323,063, Examiner Interview Summary mailed Sep. 25, 2009”, 2 pgs. |
“U.S. Appl. No. 11/193,070, Non Final Office Action mailed Feb. 20, 2013”, 16 pgs. |
Ryan, et al., “Application Adaptation Through Transparent and Portable Object Mobility in Java”, CoopIS/DOA/ODBASE 2004, LNCS 3291., (2004), 1262-1284. |
Number | Date | Country | |
---|---|---|---|
20070027878 A1 | Feb 2007 | US |