US20040148602A1 - Method and apparatus for a servlet server class - Google Patents

Method and apparatus for a servlet server class Download PDF

Info

Publication number
US20040148602A1
US20040148602A1 US10/759,554 US75955404A US2004148602A1 US 20040148602 A1 US20040148602 A1 US 20040148602A1 US 75955404 A US75955404 A US 75955404A US 2004148602 A1 US2004148602 A1 US 2004148602A1
Authority
US
United States
Prior art keywords
virtual machine
computer
available
resource
thread
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Abandoned
Application number
US10/759,554
Inventor
Michael Ottati
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Individual
Original Assignee
Individual
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Individual filed Critical Individual
Priority to US10/759,554 priority Critical patent/US20040148602A1/en
Publication of US20040148602A1 publication Critical patent/US20040148602A1/en
Abandoned legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system

Definitions

  • the present invention relates generally to a servlet interface, and more specifically for providing a scalable, fault tolerant invocation mechanism between a Webserver and Java Objects.
  • Java programming language is an object-oriented programming language. This means that all data and activity in a Java program are organized around the concept of “classes” and “interfaces.”
  • a class contains data and methods that operate on that data.
  • the class defines the methods of the interface.
  • Objects are established by creating instances of classes.
  • Java is a trademark of Sun Microsystems, Inc.
  • Threads are independent pieces of logic within a Java application, or servlet. (In this document, the term application is used for both applications and servlets). Each thread executes in a single Java Virtual Machine (JVM). Although, more than one thread can be active at any one time in a virtual machine, a virtual machine generally is resident on one computer.
  • JVM Java Virtual Machine
  • a servlet executes, one or more threads run in a single process or rather a single JVM.
  • a conventional Java Environment runs multiple threads of the same servlet or of a plurality of servlets in the same process or single JVM. Since one or more servlet threads run in a single JVM, the execution of the servlet threads occur in the same addressable space.
  • Running multiple servlets or threads of a servlet in the same addressable space results in a number of problems. For instance, if the execution of a particular thread corrupts the addressable space of the JVM, then the execution of other threads or servlets may also be corrupted. In a best case scenario, the corruption may halt the operation of the other threads or servlets. In a worst case scenario, the corruption may corrupt the data or output of the other threads. Since data corruption may not be readily apparent to the user, the outcome of such an event may result in long term effects that are extremely detrimental.
  • the present invention overcomes the problems and disadvantages of the prior art by spreading the execution of objects over multiple JVMs, so that the failure of any one object, such as a servlet thread, will not affect an entire system. Since the processing load is distributed between multiple processes and CPU's, implementation of the present invention provides for system scalability.
  • one embodiment comprises receiving a plurality of requests for service from a client; identifying a respective servlet for each of the plurality of requests and a class corresponding to each of the respective servlets; and providing a separate virtual machine for each of the respective servlets, each separate virtual machine executing in a separate addressable space, wherein if a virtual machine is available then reusing the available virtual machine by a single thread by loading the virtual machine to instantiate a thread corresponding to the requested service, and wherein the virtual machine is available if the virtual machine has a matching process identification and thread identification and is not busy, and if no virtual machine is available then spawning and loading a new virtual machine to instantiate the thread corresponding to the requested service, and wherein no virtual machine is available if either the virtual machine does not have the matching process identification and thread identification or is busy.
  • FIG. 1A is a block diagram illustrating an example of a computer system where separate requests invoke two servlets in accordance with a preferred embodiment of the present invention.
  • FIG. 1B is a block diagram illustrating an example of a computer system where two separate requests invoke two servlets in accordance with a preferred embodiment of the present invention.
  • FIG. 2 is a block diagram illustrating details of a web client of the computer system of FIGS. 1A and 1B.
  • FIG. 3 is a block diagram illustrating details of a web server of the computer system of FIGS. 1A and 1B.
  • FIG. 4 is a block diagram illustrating details of a middleware system of the computer system of FIGS. 1A and 1B.
  • FIG. 5 is a flowchart illustrating a method of providing a unique JVM for the execution of each servlet thread in accordance with the present invention.
  • FIG. 6 is a flowchart illustrating details of the FIG. 5 step of determining whether to spawn a new JVM in accordance with the present invention.
  • FIG. 7 is a table illustrating the Service Process Table.
  • the present invention provides an implementation of a Java class called a “servlet server class” (SSC).
  • SSC servlet server class
  • This class is invoked by an application program in the same manner as a conventional servlet. The difference, however, is that each request to execute a servlet results in a servlet thread being run under a new and unique SSC process. Hence a new and unique JVM is provided for each thread being executed.
  • the following paragraphs provide details of the nature and implementation of a preferred embodiment of invoking a separate JVM for each servlet thread.
  • FIG. 1A is a block diagram illustrating an exemplary computer system where separate requests invoke two servlets in accordance with a preferred embodiment of the present invention.
  • a preferred embodiment of the present System 100 comprises a web client 102 coupled directly or indirectly to a web server 106 .
  • Web server 106 is coupled directly or indirectly to a middleware system 112 .
  • Middleware system 112 is coupled directly or indirectly to a Java environment 132 .
  • Web client 102 includes communication engine 104 and a web engine 130 .
  • Communication engine 104 sends message packets such as requests to web server 106 .
  • Web engine 130 sends servlet requests to web server 106 .
  • the requests preferably are in the form of Uniform Resource Locator (URL) requests.
  • a URL included within the request identifies the particular resource to access. For example, the first part of the URL indicates the protocol to use and the second part specifies the IP address or the domain names where the resource is located.
  • web server 106 parses information in the URL to identify the SSC that hosts the requested servlet.
  • Web server 106 includes configuration files 108 and communication engine 110 .
  • Web server 106 uses configuration files 108 to translate the IP address or domain name of the requested URL to a specific SSC that hosts the requested servlet.
  • the SSC is the invocation mechanism that will be based upon the requested service provided by execution of the servlet.
  • the new SSC process is also referred to as an instance of the JVM.
  • Middleware system 112 includes a service process table 114 , a JVM queue 116 , a load balancing and routing engine 118 and a failure detection engine 120 .
  • the service process table 114 determines which service process to invoke.
  • the next thread is then dequeued from JVM queue 116 .
  • Load balancing and routing engine 118 determines based upon resource allocation factors such as available CPUs, and current percentage loads of each CPU, where to instantiate and route the next thread. Regardless of where the next thread is instantiated, a new JVM is provided to execute the new thread.
  • each thread will execute in its own addressable space. Accordingly, if the new thread fails, regardless of the reason for failure, the failure will not affect the other threads. Hence, the focus of failure detection engine 120 is upon the failed thread, and since the threads failure does not affect the other processes, there is no need to monitor its effect upon these other processes. It should be noted that this level of fault tolerance occurs even if the threads are invoked within the same service.
  • An example middleware system 112 is PATHWAY or TUXEDO by Tandem Computers of Cupertino, Calif., and MICROSOFT MESSAGE QUEUES++ by Microsoft Computers of Redmond, Wash.
  • middleware system 112 is PATHWAY or TUXEDO by Tandem Computers of Cupertino, Calif., and MICROSOFT MESSAGE QUEUES++ by Microsoft Computers of Redmond, Wash.
  • Java environment 132 includes servlet server class (SSC) 136 , Java virtual machine 1 138 , Java virtual machine 2 140 , servlet 1 144 and servlet 2 146 .
  • SSC servlet server class
  • Java virtual machine 1 138 Java virtual machine 1 138
  • Java virtual machine 2 140 servlet 1 144
  • servlet 2 146 servlet 2 146
  • Java environment 132 may exist on one or more CPU's and as one or more processes, and that it is the particular implementation of the present invention that determines the outcome of the architecture of the resulting Java environment.
  • the SSC 136 uses information in the URL to identify the particular servlet, i.e., servlet 1 144 or servlet 2 146 .
  • SSC 136 invokes servlet 1 144 by passing the requested objects for the request to servlet 1 144 .
  • the invocation of the new SSC 136 process results in the instantiation of Java virtual machine 1 138 .
  • servlet 2 146 the invocation of this additional process results in the instantiation of Java virtual machine 2 140 .
  • the SSC process replies to middleware system 112 with an output stream from the executing servlet, e.g., servlet 1 144 .
  • middleware system 112 sends the servlet output to web server 106 that returns the output to web client 102 .
  • a servlet finishes servicing the request it returns, allowing SSC 136 to accept a new request for the servlet or for any other servlet of the SSC hosts. It will be appreciated that since a new JVM is invoked for each request, the execution of each request occurs in separate addressable space. Accordingly, it will also be appreciated that this system architecture provides Java environment 132 fault tolerant processing, scalability, and load balancing.
  • FIG. 1B is a block diagram illustrating an exemplary computer system where two separate requests invoke two servlets in accordance with a preferred embodiment of the present invention.
  • Web client 102 sends two requests per each servlet, servlet 1 144 5 and servlet 2 146 .
  • each request is routed to an instantiation of a separate JVM.
  • the two requests that invoke servlet 1 144 instantiate Java Virtual Machine 1 138 and Java Virtual Machine 3 148 .
  • the two requests that invoke servlet 2 146 instantiate Java Virtual Machine 2 140 and Java Virtual Machine 4 150 . Accordingly, the execution of each thread occurs in a separate addressable space so that a failure of one thread does not affect the execution of the remaining threads.
  • FIG. 2 is a block diagram illustrating details of web client computer 102 .
  • Web client 102 includes a Central Processing Unit (CPU) 200 such as a MIPS microprocessor, Motorola Power PCTM microprocessor or an Intel PentiumTM 15 microprocessor.
  • An Input device 204 such as a keyboard and mouse, an output device 210 such as a Cathode Ray Tube (CRT) display, and a computer readable storage medium reader 214 such as a CD ROM drive are coupled via signal bus 206 to CPU 200 .
  • Computer readable storage medium reader 214 reads from a computer readable storage medium 212 such as a CD.
  • a Communications interface 202 , a data storage device 208 such as Read Only Memory (ROM) or a magnetic disk, and Random-Access memory (RAM) are further coupled via signal bus 206 to CPU 200 .
  • ROM Read Only Memory
  • RAM Random-Access memory
  • Internal storage 216 stores communication engine 104 for transferring message packets such as requests to and from web server 106 via communication interface 202 .
  • Internal storage 216 further stores a web engine 130 for sending servlet requests to web server 106 . That is, the web engine 130 sends URL requests to web server 106 .
  • web engine 130 is generally provided by an Internet engine such as a web browser, e.g., the NavigatorTM web browser produced by the Netscape Corporation or the Internet ExplorerTM web browser produced by the Microsoft Corporation.
  • FIG. 3 is a block diagram illustrating details of web server computer 106 .
  • Web server 106 includes a Central Processing Unit (CPU) 300 such as a Tandem Motorola Power PCTM microprocessor or an Intel PentiumTM microprocessor.
  • An Input device 304 such as a keyboard and mouse, an output device 210 such as a Cathode Ray Tube (CRT) display, and a computer readable storage medium reader 314 such as a CD ROM drive are coupled via signal bus 306 to CPU 200 .
  • Computer readable storage medium reader 314 reads from a computer readable storage medium 312 such as a CD.
  • a Communications interface 302 , a data storage device 308 such as Read Only Memory (ROM) or a magnetic disk, and Random-Access memory (RAM) are further coupled via signal bus 306 to CPU 300 .
  • ROM Read Only Memory
  • RAM Random-Access memory
  • Data storage device 308 stores configuration files 108 for translating the IP address or domain name of the requested URL to a specific SSC that hosts the requested servlet.
  • Internal storage 316 stores communication engine 116 for transferring message packets such as requests to and from web client 102 and middleware system 112 via communication interface 302 .
  • FIG. 4 is a block diagram illustrating details of middleware system 112 .
  • Middleware system 112 includes a Central Processing Unit (CPU) 400 such as a Tandem Motorola Power PCTM microprocessor or an Intel PentiumTM microprocessor.
  • An input device 404 such as a keyboard and mouse, an output device 410 such as a Cathode Ray Tube (CRT) display, and a computer readable storage medium reader 414 such as a CD ROM drive are coupled via signal bus 406 to CPU 400 .
  • Computer readable storage medium reader 414 reads from a computer readable storage medium 412 such as a CD.
  • a Communications interface 402 , a data storage device 408 such as Read Only Memory (ROM) or a magnetic disk, and Random-Access memory (RAM) are further coupled via signal bus 406 to CPU 400 .
  • ROM Read Only Memory
  • RAM Random-Access memory
  • Internal storage 416 stores load balancing and routing engine 118 , failure detection engine 120 , JVM Queue 116 and Service Process Table 114 .
  • Load balancing and routing engine 118 is used for instantiating servlets within a service according to the available capacity of processes and CPUs.
  • Failure detection engine 120 is used to identify failed processes.
  • the JVM queue 116 is used for queuing and dequeuing requests to execute particular servlets.
  • Service Process Table 114 is a table for mapping servlet requests to particular JVM processes.
  • FIG. 7 shows an example of Service Process Table 114 .
  • Service Process Table 114 includes a list of processes 700 and a corresponding “In Use” status identifier 702 for each process that indicates whether the process is currently active, or available for use.
  • FIG. 5 is a flowchart illustrating a method of providing a unique JVM for the execution of each servlet thread in accordance with the present invention.
  • Method 500 begins by web client 102 in step 501 using communication engine 104 to create a communications link with web server 106 , and confirming that the user has privileges to access the functionality of web server 106 .
  • Web client 102 using web engine 130 requests service from web server 106 . Each request includes a URL that specifies the address of the web client's requested resource.
  • Web server 106 using communication engine 110 in step 502 receives the request from web client 102 .
  • Web server 106 in step 504 uses configuration files 108 to parse the URL.
  • web server 106 in step 506 uses the information from the URL to identify the SSC that hosts the servlet.
  • Web server 106 in step 508 then uses communication engine 110 to route the request identifying the SSC 136 to middleware system 112 .
  • Middleware system 112 in step 509 enqueues the request onto JVM queue 116 .
  • Middleware system 112 in step 510 then uses service process table 114 to determine whether to spawn a new JVM for the request.
  • Service process table 114 maintains a resource list of all available and active JVMs.
  • FIG. 6 shows in detail the step of determining whether to spawn a new JVM.
  • Middleware system 112 queries Service Process Table 114 in step 602 as to whether there is an existing JVM for the specific service requested. If there is an existing JVM then in step 604 it is determined whether the JVM is busy. If the JVM is busy then step 606 spawns a new JVM. If the JVM is not busy then control returns to FIG. 5 since the existing JVM may be used to fulfill the client request. If in step 602 there is no existing JVM then step 606 spawns a new JVM. After spawning a new JVM, the method returns to FIG. 5.
  • middleware system 112 dequeues and routes the request to SSC 136 of Java environment 132 . If a new JVM was spawned, then in step 512 , Java environment 132 loads the new JVM and executes the requested servlet, e.g., servlet 2 146 . If a new JVM was not spawned then in step 514 the existing JVM loads and executes the requested servlet, e.g., servlet 1 144 . Then in step 516 the JVM sends the servlet output via SSC 136 , middleware system 112 and web server 106 to web client 102 .

Abstract

One embodiment comprises receiving a plurality of requests for service from a client; identifying a respective servlet for each of the plurality of requests and a class corresponding to each of the respective servlets; and providing a separate virtual machine for each of the respective servlets, wherein if a virtual machine is available then reusing the available virtual machine by a single thread by loading the virtual machine to instantiate a thread corresponding to the requested service, and wherein the virtual machine is available if the virtual machine has a matching process identification and thread identification and is not busy, and if no virtual machine is available then spawning and loading a new virtual machine to instantiate the thread corresponding to the requested service, and wherein no virtual machine is available if either the virtual machine does not have the matching process identification and thread identification or is busy.

Description

    CROSS-REFERENCE TO RELATED APPLICATIONS
  • This application is a continuation of copending U.S. utility application entitled, “METHOD AND APPARATUS FOR A SERVLET SERVER CLASS,” having Ser. No. 09/115,402, filed Jul. 14, 1998, now issued as U.S. Pat. No. ______, which is entirely incorporated herein by reference. U.S. Pat. No. ______, entitled “METHOD AND APPARATUS FOR A SERVLET SERVER CLASS,” having application Ser. No. 09/115,402, claimed priority to the U.S. provisional application entitled “Method and Apparatus for a Servlet Server Class,” having serial No. 60/090,082, filed Jun. 18, 1998.[0001]
  • FIELD OF THE INVENTION
  • The present invention relates generally to a servlet interface, and more specifically for providing a scalable, fault tolerant invocation mechanism between a Webserver and Java Objects. [0002]
  • BACKGROUND OF THE INVENTION
  • The Java programming language is an object-oriented programming language. This means that all data and activity in a Java program are organized around the concept of “classes” and “interfaces.” A class contains data and methods that operate on that data. When a class implements an interface, the class defines the methods of the interface. Objects are established by creating instances of classes. Further details of Java, and of object-oriented programs in general, can be found in: “The Java Tutorial: Object Oriented Programming for the Internet” by Mary Campione and Kathy Walrath, which is available in printed form and is also available at http://java.sun.com:80/docs/books/tutorial/index.html; and “The Java Language Specification” by James Gosling, Bill Joy, and Guy Steele, which is available in printed form and is also available at http://java.sun.com:80/docs/books/jls/html/index.html. “Java” is a trademark of Sun Microsystems, Inc. [0003]
  • One class that exists in the Java programming languages is the java.lang.Thread class. Threads are independent pieces of logic within a Java application, or servlet. (In this document, the term application is used for both applications and servlets). Each thread executes in a single Java Virtual Machine (JVM). Although, more than one thread can be active at any one time in a virtual machine, a virtual machine generally is resident on one computer. [0004]
  • When a servlet executes, one or more threads run in a single process or rather a single JVM. A conventional Java Environment runs multiple threads of the same servlet or of a plurality of servlets in the same process or single JVM. Since one or more servlet threads run in a single JVM, the execution of the servlet threads occur in the same addressable space. [0005]
  • Running multiple servlets or threads of a servlet in the same addressable space results in a number of problems. For instance, if the execution of a particular thread corrupts the addressable space of the JVM, then the execution of other threads or servlets may also be corrupted. In a best case scenario, the corruption may halt the operation of the other threads or servlets. In a worst case scenario, the corruption may corrupt the data or output of the other threads. Since data corruption may not be readily apparent to the user, the outcome of such an event may result in long term effects that are extremely detrimental. [0006]
  • For example, if an airline reservation system were implemented in Java, data corruption could in theory affect an airline reservation system without notifying the affected users of the resultant errors. Such a scenario is unacceptable under standards set for today's information systems. However, conventional systems run multiple servlet threads in the same addressable space so that the possibility of such errors occurring currently exists. [0007]
  • SUMMARY OF THE INVENTION
  • The present invention overcomes the problems and disadvantages of the prior art by spreading the execution of objects over multiple JVMs, so that the failure of any one object, such as a servlet thread, will not affect an entire system. Since the processing load is distributed between multiple processes and CPU's, implementation of the present invention provides for system scalability. [0008]
  • More particularly, one embodiment comprises receiving a plurality of requests for service from a client; identifying a respective servlet for each of the plurality of requests and a class corresponding to each of the respective servlets; and providing a separate virtual machine for each of the respective servlets, each separate virtual machine executing in a separate addressable space, wherein if a virtual machine is available then reusing the available virtual machine by a single thread by loading the virtual machine to instantiate a thread corresponding to the requested service, and wherein the virtual machine is available if the virtual machine has a matching process identification and thread identification and is not busy, and if no virtual machine is available then spawning and loading a new virtual machine to instantiate the thread corresponding to the requested service, and wherein no virtual machine is available if either the virtual machine does not have the matching process identification and thread identification or is busy. [0009]
  • Advantages of the invention will be set forth, in part, in the description that follows and, in part, will be understood by those skilled in the art from the description or may be learned by practice of the invention. The advantages of the invention will be realized and attained by means of the elements and combinations particularly pointed out in the appended claims and equivalents.[0010]
  • BRIEF DESCRIPTION OF THE DRAWINGS
  • The accompanying drawings, that are incorporated in and constitute a part of this specification, illustrate several embodiments of the invention and, together with the description, serve to explain the principles of the invention. [0011]
  • FIG. 1A is a block diagram illustrating an example of a computer system where separate requests invoke two servlets in accordance with a preferred embodiment of the present invention. [0012]
  • FIG. 1B is a block diagram illustrating an example of a computer system where two separate requests invoke two servlets in accordance with a preferred embodiment of the present invention. [0013]
  • FIG. 2 is a block diagram illustrating details of a web client of the computer system of FIGS. 1A and 1B. [0014]
  • FIG. 3 is a block diagram illustrating details of a web server of the computer system of FIGS. 1A and 1B. [0015]
  • FIG. 4 is a block diagram illustrating details of a middleware system of the computer system of FIGS. 1A and 1B. [0016]
  • FIG. 5 is a flowchart illustrating a method of providing a unique JVM for the execution of each servlet thread in accordance with the present invention. [0017]
  • FIG. 6 is a flowchart illustrating details of the FIG. 5 step of determining whether to spawn a new JVM in accordance with the present invention. [0018]
  • FIG. 7 is a table illustrating the Service Process Table.[0019]
  • DESCRIPTION OF PREFERRED EMBODIMENTS
  • Reference will now be made in detail to preferred embodiments of the invention, examples of which are illustrated in the accompanying drawings. Wherever possible, the same reference numbers will be used throughout the drawings to refer to the same or like parts. [0020]
  • The present invention provides an implementation of a Java class called a “servlet server class” (SSC). This class is invoked by an application program in the same manner as a conventional servlet. The difference, however, is that each request to execute a servlet results in a servlet thread being run under a new and unique SSC process. Hence a new and unique JVM is provided for each thread being executed. The following paragraphs provide details of the nature and implementation of a preferred embodiment of invoking a separate JVM for each servlet thread. [0021]
  • FIG. 1A is a block diagram illustrating an exemplary computer system where separate requests invoke two servlets in accordance with a preferred embodiment of the present invention. A preferred embodiment of the [0022] present System 100 comprises a web client 102 coupled directly or indirectly to a web server 106. Web server 106 is coupled directly or indirectly to a middleware system 112. Middleware system 112 is coupled directly or indirectly to a Java environment 132.
  • [0023] Web client 102 includes communication engine 104 and a web engine 130. Communication engine 104 sends message packets such as requests to web server 106. Web engine 130 sends servlet requests to web server 106. The requests preferably are in the form of Uniform Resource Locator (URL) requests. A URL included within the request identifies the particular resource to access. For example, the first part of the URL indicates the protocol to use and the second part specifies the IP address or the domain names where the resource is located.
  • In the present invention, [0024] web server 106 parses information in the URL to identify the SSC that hosts the requested servlet. Web server 106 includes configuration files 108 and communication engine 110. Web server 106 uses configuration files 108 to translate the IP address or domain name of the requested URL to a specific SSC that hosts the requested servlet. The SSC is the invocation mechanism that will be based upon the requested service provided by execution of the servlet. The new SSC process is also referred to as an instance of the JVM. Once the particular SSC and servlet are identified, communication engine 110 sends the request to be enqueued at middleware system 112.
  • [0025] Middleware system 112 includes a service process table 114, a JVM queue 116, a load balancing and routing engine 118 and a failure detection engine 120. When middleware system 112 instantiates the next thread on the queue, the service process table 114 determines which service process to invoke. The next thread is then dequeued from JVM queue 116. Load balancing and routing engine 118 then determines based upon resource allocation factors such as available CPUs, and current percentage loads of each CPU, where to instantiate and route the next thread. Regardless of where the next thread is instantiated, a new JVM is provided to execute the new thread.
  • Because a separate JVM is invoked for each new thread, each thread will execute in its own addressable space. Accordingly, if the new thread fails, regardless of the reason for failure, the failure will not affect the other threads. Hence, the focus of [0026] failure detection engine 120 is upon the failed thread, and since the threads failure does not affect the other processes, there is no need to monitor its effect upon these other processes. It should be noted that this level of fault tolerance occurs even if the threads are invoked within the same service.
  • An [0027] example middleware system 112 is PATHWAY or TUXEDO by Tandem Computers of Cupertino, Calif., and MICROSOFT MESSAGE QUEUES++ by Microsoft Computers of Redmond, Wash. One of ordinary skill in the art will understand that these systems are provided only as examples of middleware system 112 and that alternative middleware systems may be included in other embodiments of the present invention.
  • [0028] Java environment 132 includes servlet server class (SSC) 136, Java virtual machine 1 138, Java virtual machine 2 140, servlet 1 144 and servlet 2 146. One of ordinary skill in the art will understand that Java environment 132 may exist on one or more CPU's and as one or more processes, and that it is the particular implementation of the present invention that determines the outcome of the architecture of the resulting Java environment.
  • The [0029] SSC 136 uses information in the URL to identify the particular servlet, i.e., servlet 1 144 or servlet 2 146. For example, SSC 136 invokes servlet 1 144 by passing the requested objects for the request to servlet 1 144. The invocation of the new SSC 136 process results in the instantiation of Java virtual machine 1 138. Similarly for servlet 2 146, the invocation of this additional process results in the instantiation of Java virtual machine 2 140.
  • For either JVM, the SSC process replies to [0030] middleware system 112 with an output stream from the executing servlet, e.g., servlet 1 144. In turn, middleware system 112 sends the servlet output to web server 106 that returns the output to web client 102. When a servlet finishes servicing the request, it returns, allowing SSC 136 to accept a new request for the servlet or for any other servlet of the SSC hosts. It will be appreciated that since a new JVM is invoked for each request, the execution of each request occurs in separate addressable space. Accordingly, it will also be appreciated that this system architecture provides Java environment 132 fault tolerant processing, scalability, and load balancing.
  • FIG. 1B is a block diagram illustrating an exemplary computer system where two separate requests invoke two servlets in accordance with a preferred embodiment of the present invention. With the exception of the number of [0031] web client 102 requests that result in the instantiation of twice the number of JVMs, the elements of FIG. 1B are the same as the elements of FIG. 1A. More particularly, Web client 102 sends two requests per each servlet, servlet 1 144 5 and servlet 2 146. As discussed above, each request is routed to an instantiation of a separate JVM. Hence, the two requests that invoke servlet 1 144 instantiate Java Virtual Machine 1 138 and Java Virtual Machine 3 148. The two requests that invoke servlet 2 146 instantiate Java Virtual Machine 2 140 and Java Virtual Machine 4 150. Accordingly, the execution of each thread occurs in a separate addressable space so that a failure of one thread does not affect the execution of the remaining threads.
  • FIG. 2 is a block diagram illustrating details of [0032] web client computer 102. Web client 102 includes a Central Processing Unit (CPU) 200 such as a MIPS microprocessor, Motorola Power PC™ microprocessor or an Intel Pentium™ 15 microprocessor. An Input device 204 such as a keyboard and mouse, an output device 210 such as a Cathode Ray Tube (CRT) display, and a computer readable storage medium reader 214 such as a CD ROM drive are coupled via signal bus 206 to CPU 200. Computer readable storage medium reader 214 reads from a computer readable storage medium 212 such as a CD. A Communications interface 202, a data storage device 208 such as Read Only Memory (ROM) or a magnetic disk, and Random-Access memory (RAM) are further coupled via signal bus 206 to CPU 200.
  • [0033] Internal storage 216 stores communication engine 104 for transferring message packets such as requests to and from web server 106 via communication interface 202. Internal storage 216 further stores a web engine 130 for sending servlet requests to web server 106. That is, the web engine 130 sends URL requests to web server 106. One of ordinary skill in the art will understand that web engine 130 is generally provided by an Internet engine such as a web browser, e.g., the Navigator™ web browser produced by the Netscape Corporation or the Internet Explorer™ web browser produced by the Microsoft Corporation.
  • FIG. 3 is a block diagram illustrating details of [0034] web server computer 106. Web server 106 includes a Central Processing Unit (CPU) 300 such as a Tandem Motorola Power PC™ microprocessor or an Intel Pentium™ microprocessor. An Input device 304 such as a keyboard and mouse, an output device 210 such as a Cathode Ray Tube (CRT) display, and a computer readable storage medium reader 314 such as a CD ROM drive are coupled via signal bus 306 to CPU 200. Computer readable storage medium reader 314, reads from a computer readable storage medium 312 such as a CD. A Communications interface 302, a data storage device 308 such as Read Only Memory (ROM) or a magnetic disk, and Random-Access memory (RAM) are further coupled via signal bus 306 to CPU 300.
  • [0035] Data storage device 308 stores configuration files 108 for translating the IP address or domain name of the requested URL to a specific SSC that hosts the requested servlet.
  • [0036] Internal storage 316 stores communication engine 116 for transferring message packets such as requests to and from web client 102 and middleware system 112 via communication interface 302.
  • FIG. 4 is a block diagram illustrating details of [0037] middleware system 112. Middleware system 112 includes a Central Processing Unit (CPU) 400 such as a Tandem Motorola Power PC™ microprocessor or an Intel Pentium™ microprocessor. An input device 404 such as a keyboard and mouse, an output device 410 such as a Cathode Ray Tube (CRT) display, and a computer readable storage medium reader 414 such as a CD ROM drive are coupled via signal bus 406 to CPU 400. Computer readable storage medium reader 414, reads from a computer readable storage medium 412 such as a CD. A Communications interface 402, a data storage device 408 such as Read Only Memory (ROM) or a magnetic disk, and Random-Access memory (RAM) are further coupled via signal bus 406 to CPU 400.
  • [0038] Internal storage 416 stores load balancing and routing engine 118, failure detection engine 120, JVM Queue 116 and Service Process Table 114. Load balancing and routing engine 118 is used for instantiating servlets within a service according to the available capacity of processes and CPUs. Failure detection engine 120 is used to identify failed processes. The JVM queue 116 is used for queuing and dequeuing requests to execute particular servlets. Service Process Table 114 is a table for mapping servlet requests to particular JVM processes. FIG. 7 shows an example of Service Process Table 114. Service Process Table 114 includes a list of processes 700 and a corresponding “In Use” status identifier 702 for each process that indicates whether the process is currently active, or available for use.
  • FIG. 5 is a flowchart illustrating a method of providing a unique JVM for the execution of each servlet thread in accordance with the present invention. [0039] Method 500 begins by web client 102 in step 501 using communication engine 104 to create a communications link with web server 106, and confirming that the user has privileges to access the functionality of web server 106. Web client 102 using web engine 130 requests service from web server 106. Each request includes a URL that specifies the address of the web client's requested resource.
  • [0040] Web server 106 using communication engine 110 in step 502 receives the request from web client 102. Web server 106 in step 504 uses configuration files 108 to parse the URL. After parsing the URL, web server 106 in step 506 uses the information from the URL to identify the SSC that hosts the servlet. Web server 106 in step 508 then uses communication engine 110 to route the request identifying the SSC 136 to middleware system 112.
  • [0041] Middleware system 112 in step 509 enqueues the request onto JVM queue 116. Middleware system 112 in step 510 then uses service process table 114 to determine whether to spawn a new JVM for the request. Service process table 114 maintains a resource list of all available and active JVMs.
  • FIG. 6 shows in detail the step of determining whether to spawn a new JVM. [0042] Middleware system 112 queries Service Process Table 114 in step 602 as to whether there is an existing JVM for the specific service requested. If there is an existing JVM then in step 604 it is determined whether the JVM is busy. If the JVM is busy then step 606 spawns a new JVM. If the JVM is not busy then control returns to FIG. 5 since the existing JVM may be used to fulfill the client request. If in step 602 there is no existing JVM then step 606 spawns a new JVM. After spawning a new JVM, the method returns to FIG. 5.
  • Once a separate JVM is secured for the request, in [0043] step 510 middleware system 112 dequeues and routes the request to SSC 136 of Java environment 132. If a new JVM was spawned, then in step 512, Java environment 132 loads the new JVM and executes the requested servlet, e.g., servlet 2 146. If a new JVM was not spawned then in step 514 the existing JVM loads and executes the requested servlet, e.g., servlet 1 144. Then in step 516 the JVM sends the servlet output via SSC 136, middleware system 112 and web server 106 to web client 102.
  • Other embodiments will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. For example, the present invention can be implemented in languages other than the Java language or in languages that are based on or similar to the Java language developed by Sun Microsystems. It is intended that the specification and examples be considered as exemplary only, with a true scope of the invention being indicated by the following claims and equivalents. [0044]

Claims (22)

What is claimed is:
1. A computer data signal embodied in a carrier wave and representing sequences of instructions which, when executed by a processor, causes the processor to provide a separate Java Virtual Machine to instantiate a thread in a data processing system, such that the processor:
receives at least one request for service;
identifies a resource requested and a class corresponding to the resource;
if a virtual machine is available, reuses the available virtual machine by a single thread only by loading the virtual machine to instantiate the thread corresponding to the requested resource, wherein the virtual machine is available if the virtual machine has a matching process identification and thread identification and is not busy; and
if the virtual machine is unavailable, spawns and loads a new virtual machine to instantiate the thread corresponding to the requested resource, wherein the virtual machine is unavailable if either the virtual machine does not have the matching process identification and thread identification or is busy.
2. The computer data signal of claim 1, wherein the processor further receives the request for service by a web client.
3. The computer data signal of claim 1, wherein identifying the resource requested comprises:
parsing a Uniform Resource Locator; and
using the Uniform Resource Locator to identify the class that hosts a program that when executed provides the resource requested.
4. The computer data signal of claim 1, wherein the processor further enqueus the resource request before determining if the virtual machine is available.
5. The computer data signal of claim 1, wherein the processor further:
dequeues the resource request after determining if the virtual machine is available;
routes the resource request to the virtual machine where the virtual machine is available; and
routes the resource request to the new virtual machine where the virtual machine is unavailable.
6. The computer data signal of claim 3, wherein the program is a servlet.
7. The computer data signal of claim 1, wherein the processor sends an output stream to an origin of the resource request.
8. A computer program product comprising:
a computer usable medium having computer readable code embodied therein for causing a unique Java Virtual Machine to instantiate a thread in a data processing system, the computer program product comprising:
a first computer readable program code configured to cause a computer to effect receiving at least one request for service; and
the first computer readable program code configured to cause the computer to effect identifying a resource requested and a class corresponding to the resource;
the first computer readable program code configured to cause the computer to effect if a virtual machine is available, reusing the available virtual machine by a single thread only by loading the virtual machine to instantiate the thread corresponding to the requested resource, wherein the virtual machine is available if the virtual machine has a matching process identification and thread identification and is not busy; and
the first computer readable program code configured to cause the computer to effect if the virtual machine is unavailable, spawning and loading a new virtual machine to instantiate the thread corresponding to the requested resource, wherein the virtual machine is unavailable if either the virtual machine does not have the matching process identification and thread identification or is busy.
9. The computer program of claim 8, wherein the first computer readable program code is configured to cause the computer to effect sending a service request by a web client.
10. The computer program of claim 8, wherein identifying the resource requested comprises:
parsing a Uniform Resource Locator; and
using the Uniform Resource Locator to identify the class that hosts a program that when executed provides the resource requested.
11. The computer program of claim 8, wherein the first computer readable program code is configured to cause the computer to effect enqueuing the resource request before determining if the virtual machine is available.
12. The computer program of claim 8, further comprising:
the first computer readable program code configured to cause the computer to effect dequeuing the resource request after determining if the virtual machine is available;
the first computer readable program code configured to cause the computer to effect routing the resource request to the virtual machine where the virtual machine is available; and
the first computer readable program code configured to cause the computer to effect routing the resource request to the new virtual machine where the virtual machine is unavailable.
13. The computer program of claim 10, wherein the first computer readable program code is a servlet.
14. The computer program of claim 8, wherein the first computer readable program code is configured to cause the computer to effect sending an output stream to an origin of the resource request.
15. A method performed in a data processing system, by at least one processor, comprising:
receiving a plurality of requests for service from a client;
identifying a respective servlet for each of the plurality of requests and a class corresponding to each of the respective servlets; and
providing a separate virtual machine for each of the respective servlets, each separate virtual machine executing in a separate addressable space, wherein if a virtual machine is available then reusing the available virtual machine by a single thread by loading the virtual machine to instantiate a thread corresponding to the requested service, and wherein the virtual machine is available if the virtual machine has a matching process identification and thread identification and is not busy, and
if no virtual machine is available then spawning and loading a new virtual machine to instantiate the thread corresponding to the requested service, and wherein no virtual machine is available if either the virtual machine does not have the matching process identification and thread identification or is busy.
16. The method of claim 15, wherein the receiving further comprises receiving the plurality of requests for service from at least one web client.
17. The method of claim 15, wherein the receiving further comprises identifying a resource requested.
18. The method of claim 15, wherein the receiving the resource requested further comprises the steps of:
parsing a Uniform Resource Locator; and
using the Uniform Resource Locator to identify the class that hosts a program that when executed provides the resource requested.
19. The method of claim 15, further includes the step of:
enqueuing a resource request before determining if the virtual machine is available.
20. The method of claim 15, further includes the step of:
dequeuing a resource request after determining if the virtual machine is available;
routing the resource request to the virtual machine where the virtual machine is available; and
routing the resource request to the new virtual machine where the virtual machine is unavailable.
21. The method of claim 18, wherein the servlet is the program.
22. The method of claim 15, further comprising the step of sending an output stream to an origin of the resource request.
US10/759,554 1998-06-18 2004-01-15 Method and apparatus for a servlet server class Abandoned US20040148602A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US10/759,554 US20040148602A1 (en) 1998-06-18 2004-01-15 Method and apparatus for a servlet server class

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
US9008298P 1998-06-18 1998-06-18
US09/115,402 US6704764B1 (en) 1998-06-18 1998-07-14 Method and apparatus for a servlet server class
US10/759,554 US20040148602A1 (en) 1998-06-18 2004-01-15 Method and apparatus for a servlet server class

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
US09/115,402 Continuation US6704764B1 (en) 1998-06-18 1998-07-14 Method and apparatus for a servlet server class

Publications (1)

Publication Number Publication Date
US20040148602A1 true US20040148602A1 (en) 2004-07-29

Family

ID=31890726

Family Applications (2)

Application Number Title Priority Date Filing Date
US09/115,402 Expired - Lifetime US6704764B1 (en) 1998-06-18 1998-07-14 Method and apparatus for a servlet server class
US10/759,554 Abandoned US20040148602A1 (en) 1998-06-18 2004-01-15 Method and apparatus for a servlet server class

Family Applications Before (1)

Application Number Title Priority Date Filing Date
US09/115,402 Expired - Lifetime US6704764B1 (en) 1998-06-18 1998-07-14 Method and apparatus for a servlet server class

Country Status (1)

Country Link
US (2) US6704764B1 (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020184290A1 (en) * 2001-05-31 2002-12-05 International Business Machines Corporation Run queue optimization with hardware multithreading for affinity
US8261268B1 (en) * 2009-08-05 2012-09-04 Netapp, Inc. System and method for dynamic allocation of virtual machines in a virtual server environment
US9106606B1 (en) 2007-02-05 2015-08-11 F5 Networks, Inc. Method, intermediate device and computer program code for maintaining persistency
CN107341218A (en) * 2017-06-27 2017-11-10 武汉蓝星软件技术有限公司 A kind of information feedback method and system of the core frame platform based on application service
US20190058671A1 (en) * 2006-10-20 2019-02-21 Vmware, Inc. Virtual computing services deployment network

Families Citing this family (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6704764B1 (en) * 1998-06-18 2004-03-09 Hewlett-Packard Development Company, L.P. Method and apparatus for a servlet server class
US6728748B1 (en) * 1998-12-01 2004-04-27 Network Appliance, Inc. Method and apparatus for policy based class of service and adaptive service level management within the context of an internet and intranet
EP1323057A4 (en) * 2000-10-02 2008-04-16 Learning Tree Internat Method and system for hands-on e-learning
US7177934B2 (en) * 2001-03-19 2007-02-13 Sun Microsystems, Inc. Method and apparatus for providing application specific strategies to a JAVA platform including start and stop policies
US7165108B2 (en) * 2001-03-19 2007-01-16 Sun Microsystems, Inc. Method and apparatus for providing application specific strategies to a JAVA platform including load balancing policies
US7313793B2 (en) * 2002-07-11 2007-12-25 Microsoft Corporation Method for forking or migrating a virtual machine
US7478387B2 (en) * 2002-09-25 2009-01-13 International Business Machines Corporation System and method for creating a restartable non-native language routine execution environment
CA2525578A1 (en) * 2003-05-15 2004-12-02 Applianz Technologies, Inc. Systems and methods of creating and accessing software simulated computers
CN1577251B (en) * 2003-07-28 2012-07-18 国际商业机器公司 Long-distance cooperating method and system for small server program
US7246174B2 (en) * 2003-10-28 2007-07-17 Nacon Consulting, Llc Method and system for accessing and managing virtual machines
US20050198303A1 (en) * 2004-01-02 2005-09-08 Robert Knauerhase Dynamic virtual machine service provider allocation
US7840963B2 (en) * 2004-10-15 2010-11-23 Microsoft Corporation Marking and utilizing portions of memory state information during a switch between virtual machines to minimize software service interruption
US20060085784A1 (en) * 2004-10-15 2006-04-20 Microsoft Corporation Systems and methods for authoring and accessing computer-based materials using virtual machines
US20060184935A1 (en) * 2005-02-11 2006-08-17 Timothy Abels System and method using virtual machines for decoupling software from users and services
US8607009B2 (en) 2006-07-13 2013-12-10 Microsoft Corporation Concurrent virtual machine snapshots and restore
US10013268B2 (en) * 2006-08-29 2018-07-03 Prometric Inc. Performance-based testing system and method employing emulation and virtualization
US9176763B2 (en) * 2011-11-28 2015-11-03 Ravello Systems Ltd. Apparatus and method thereof for efficient execution of a guest in a virtualized environment

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5201049A (en) * 1988-09-29 1993-04-06 International Business Machines Corporation System for executing applications program concurrently/serially on different virtual machines
US5692193A (en) * 1994-03-31 1997-11-25 Nec Research Institute, Inc. Software architecture for control of highly parallel computer systems
US5870550A (en) * 1996-02-26 1999-02-09 Network Engineering Software Web server employing multi-homed, moldular framework
US5946487A (en) * 1996-06-10 1999-08-31 Lsi Logic Corporation Object-oriented multi-media architecture
US6182108B1 (en) * 1995-01-31 2001-01-30 Microsoft Corporation Method and system for multi-threaded processing
US6240440B1 (en) * 1997-06-30 2001-05-29 Sun Microsystems Incorporated Method and apparatus for implementing virtual threads
US6256637B1 (en) * 1998-05-05 2001-07-03 Gemstone Systems, Inc. Transactional virtual machine architecture
US6269391B1 (en) * 1997-02-24 2001-07-31 Novell, Inc. Multi-processor scheduling kernel
US6374286B1 (en) * 1998-04-06 2002-04-16 Rockwell Collins, Inc. Real time processor capable of concurrently running multiple independent JAVA machines
US6704764B1 (en) * 1998-06-18 2004-03-09 Hewlett-Packard Development Company, L.P. Method and apparatus for a servlet server class

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5201049A (en) * 1988-09-29 1993-04-06 International Business Machines Corporation System for executing applications program concurrently/serially on different virtual machines
US5692193A (en) * 1994-03-31 1997-11-25 Nec Research Institute, Inc. Software architecture for control of highly parallel computer systems
US6182108B1 (en) * 1995-01-31 2001-01-30 Microsoft Corporation Method and system for multi-threaded processing
US5870550A (en) * 1996-02-26 1999-02-09 Network Engineering Software Web server employing multi-homed, moldular framework
US5946487A (en) * 1996-06-10 1999-08-31 Lsi Logic Corporation Object-oriented multi-media architecture
US6269391B1 (en) * 1997-02-24 2001-07-31 Novell, Inc. Multi-processor scheduling kernel
US6240440B1 (en) * 1997-06-30 2001-05-29 Sun Microsystems Incorporated Method and apparatus for implementing virtual threads
US6374286B1 (en) * 1998-04-06 2002-04-16 Rockwell Collins, Inc. Real time processor capable of concurrently running multiple independent JAVA machines
US6256637B1 (en) * 1998-05-05 2001-07-03 Gemstone Systems, Inc. Transactional virtual machine architecture
US6704764B1 (en) * 1998-06-18 2004-03-09 Hewlett-Packard Development Company, L.P. Method and apparatus for a servlet server class

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020184290A1 (en) * 2001-05-31 2002-12-05 International Business Machines Corporation Run queue optimization with hardware multithreading for affinity
US20190058671A1 (en) * 2006-10-20 2019-02-21 Vmware, Inc. Virtual computing services deployment network
US10897430B2 (en) * 2006-10-20 2021-01-19 Vmware, Inc. Virtual computing services deployment network
US11671380B2 (en) 2006-10-20 2023-06-06 Vmware, Inc. Virtual computing services deployment network
US9106606B1 (en) 2007-02-05 2015-08-11 F5 Networks, Inc. Method, intermediate device and computer program code for maintaining persistency
US9967331B1 (en) 2007-02-05 2018-05-08 F5 Networks, Inc. Method, intermediate device and computer program code for maintaining persistency
US8261268B1 (en) * 2009-08-05 2012-09-04 Netapp, Inc. System and method for dynamic allocation of virtual machines in a virtual server environment
CN107341218A (en) * 2017-06-27 2017-11-10 武汉蓝星软件技术有限公司 A kind of information feedback method and system of the core frame platform based on application service

Also Published As

Publication number Publication date
US6704764B1 (en) 2004-03-09

Similar Documents

Publication Publication Date Title
US6704764B1 (en) Method and apparatus for a servlet server class
US7480679B2 (en) Duplicated naming service in a distributed processing system
US8069447B2 (en) Smart stub or enterprise java bean in a distributed processing system
US7334232B2 (en) Clustered enterprise Java™ in a secure distributed processing system
EP1212680B1 (en) Graceful distribution in application server load balancing
US6385643B1 (en) Clustered enterprise Java™ having a message passing kernel in a distributed processing system
US7484218B2 (en) Method and apparatus for dynamically brokering object messages among object models
US6209018B1 (en) Service framework for a distributed object network system
US8103779B2 (en) Mechanism for enabling session information to be shared across multiple processes
JP3853592B2 (en) Distributed web application server
EP0913769B1 (en) Method and apparatus for pre-processing and packaging class files
EP0817022A2 (en) Method and apparatus for marshalling and unmarshalling argument object references
EP0695992A2 (en) Shared memory subcontract
JP2001522114A (en) Method and system for facilitating distributed software development in a distribution-aware manner
JPH10149296A (en) Method and device for discriminating server computer collective topology
EP0767428B1 (en) Method and apparatus for dynamically loading method call exception code
WO2000010084A2 (en) Object load balancing
EP0807884B1 (en) Method and apparatus for disposing of objects in a multi-threaded environment
JP2000515279A (en) Method and apparatus for performing distributed object invocation using proxy and memory allocation
US20190278639A1 (en) Service for enabling legacy mainframe applications to invoke java classes in a service address space
US6035419A (en) Logical execution sequence error recovery method and system

Legal Events

Date Code Title Description
STCB Information on status: application discontinuation

Free format text: ABANDONED -- FAILURE TO RESPOND TO AN OFFICE ACTION