Method and system for transparently executing code using a surrogate process
First Claim
1. A method in a computer system for invoking server code that is stored in a dynamically linkable library, the computer system having a client process that requests invocation of the server code, the method comprising:
- receiving from the client process a request to invoke the server code;
in response to the received request, invoking a surrogate process with a reference to the dynamically linkable library that stores the server code, wherein the surrogate process is an independently executable process for loading server code that is stored in a dynamically linkable library and that can instantiate an object;
loading the referenced dynamically linkable library into the invoked surrogate process;
executing the server code stored in the loaded dynamically linkable library; and
returning to the client process a reference to the executing server code, the returned reference being used by the client process to invoke the server code executing in the surrogate process by executing the same client code that is used to invoke the server code when the server code is executing in the client process.
2 Assignments
0 Petitions
Accused Products
Abstract
A method and system for transparently executing code using a surrogate process is provided. In a preferred embodiment, the underlying system provides a surrogate program that can execute server dynamic-link libraries. When a client program wishes to access an object of a sharable class or a class factory object, the client program requests a service control manager to execute the server code for the sharable class. In response, the service control manager determines from a registration database whether the server code is available in the form of a server executable or a server dynamic-link library. If the server code is implemented as a server dynamic-link library, the service control manager either returns the location of the server dynamic-link library to the client program to be run in the execution context of the client program or the service control manager launches the surrogate program and requests it to load the server dynamic-link library, thereby isolating the server dynamic-link library from the client program execution context. When the surrogate process is launched, the surrogate process loads the requested server dynamic-link library and instantiates class factory objects corresponding to the sharable classes implemented by the server dynamic-link library. In one embodiment, multiple server dynamic-link libraries can be loaded within the same surrogate process. According to this embodiment, when the client program requests access to an object of a sharable class or to a class factory object, the service control manager determines whether the server code that implements the object can be loaded in a surrogate process that is already executing or whether a new surrogate process needs to be launched. Once the server dynamic-link library is loaded in the surrogate process and a reference to a server object returned to the client program, the client program can communicate with the server code in the same manner as if the server code had been loaded into the execution context of the client program.
188 Citations
56 Claims
-
1. A method in a computer system for invoking server code that is stored in a dynamically linkable library, the computer system having a client process that requests invocation of the server code, the method comprising:
-
receiving from the client process a request to invoke the server code; in response to the received request, invoking a surrogate process with a reference to the dynamically linkable library that stores the server code, wherein the surrogate process is an independently executable process for loading server code that is stored in a dynamically linkable library and that can instantiate an object; loading the referenced dynamically linkable library into the invoked surrogate process; executing the server code stored in the loaded dynamically linkable library; and returning to the client process a reference to the executing server code, the returned reference being used by the client process to invoke the server code executing in the surrogate process by executing the same client code that is used to invoke the server code when the server code is executing in the client process. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8)
-
-
9. A method in a computer system for invoking server code that is stored in a dynamically linkable library, the computer system having a client process that requests invocation of the server code, the method comprising:
-
receiving from the client process a request to invoke the server code; in response to the received request, invoking a surrogate process with a reference to the dynamically linkable library that stores the server code, wherein the surrogate process is an independently executable process for loading server code that is stored in a dynamically linkable library and that can instantiate an object; loading the referenced dynamically linkable library into the invoked surrogate process; executing the server code stored in the loaded dynamically linkable library; creating, in the surrogate process, an object instance of a requested type of object implemented by code stored in the referenced dynamically linkable library; and returning to the client process a reference to a requested interface of the created object instance in the surrogate process, the returned reference being used by the client process to access the requested interface of the created object instance in the surrogate process by executing the same client code that is used to access the requested interface when an instance of the requested type of object is created in the client process. - View Dependent Claims (10, 11, 12, 13, 14)
-
-
15. A method in a computer system for invoking server code that is stored in a dynamically linkable library, the method comprising:
-
receiving from a first process a request to invoke the server code; in response to the received request, invoking a surrogate process with a reference to the dynamically linkable library that stores the server code and with a class identifier, the class identifier identifying a class of objects with common behavior and corresponding to a class factory object, the class factory object implemented by the stored server code and having a creation method for creating an object of the class of objects identified by the class identifier, wherein the surrogate process is an independently executable process for loading server code that is stored in a dynamically linkable library and that can instantiate an object; loading the referenced dynamically linkable library into the invoked surrogate process; executing the server code stored in the loaded dynamically linkable library; creating an instance of the class factory object that corresponds to the class identifier within the invoked surrogate process; and registering the created class factory object instance so that other processes can create object instances of the class of objects identified by the class identifier using the creation method without knowledge that the class factory object instance is instantiated in a different process, each created object instance being implemented by code that is stored in the linkable library that is loaded in the surrogate process. - View Dependent Claims (16, 17, 18, 20, 21, 22, 23, 24, 25, 26, 27)
-
-
19. A method in a computer system for invoking a server application having server code, the method comprising the computer-implemented steps of:
-
receiving from a first process a request to invoke the server application; in response to the received request, invoking a surrogate process with a reference to a dynamically linkable library that contains the server code and with a class identifier, the class identifier identifying a class of objects with common behavior and corresponding to a class factory object, the class factory object implemented by the contained server code and containing a creation method for creating an object of the class of objects identified by the class identifier; loading the referenced dynamically linkable library into the surrogate process; executing the server code contained in the loaded dynamically linkable library; creating an instance of the class factory object within the surrogate process corresponding to the class identifier; registering the created class factory object instance so that other processes can create object instances of the class of objects identified by the class identifier using the creation method without knowledge that the class factory object instance is instantiated in a different process, each created object instance being implemented by code in the linkable library loaded in the surrogate process; receiving a request from requesting code to create an object instance of the class of objects identified by the class identifier; and in response to the request, invoking the creation method of the registered class factory object instance within the surrogate process without the requesting code having knowledge that the creation method is being executed within the surrogate process, wherein the first process from which the request to invoke the server application is received is under the control of a first program, the first program belonging to a security identity for determining the access rights of the first program, wherein the requesting code from which the request to create an object instance is received is part of a second program, the second program belonging to a security identity for determining the access rights of the second program, and wherein invoking the creation method of the registered class factory object instance within the surrogate process is performed only when the first and second program belong to the same security identity.
-
-
28. A method in a computer system for invoking server code, the method comprising:
-
receiving a request from a client process to invoke the server code; in response to the received request, determining whether the server code is already executing; when it is determined that the server application is not already executing, determining whether a standalone executable program for the server code exists; when it is determined that no standalone executable program exists, determining whether there exists executable code for the server code that is stored in a linkable library and whether it is desired to execute the server code in a process other than the client process; when it is determined that executable code for the server code exists in a linkable library and it is desired to execute the server application in the process other than the client process, invoking a surrogate process with a reference to the linkable library and a list of class identifiers, each class identifier identifying a class of objects with common behavior and corresponding to a class factory object, each class factory object implemented by code that is stored in the referenced linkable library and having a creation method for creating an object of the class of objects identified by the class identifier, wherein the surrogate process is an independently executable process for loading server code that is stored in a dynamically linkable library and that can instantiate an object; and under control of the invoked surrogate process, loading the referenced linkable library; and for each class identifier in the list of class object identifiers, creating an instance of the corresponding class factory object within the surrogate process; and registering the created class factory object instance so that other processes can create object instances of the class of objects identified by the class identifier using the creation method. - View Dependent Claims (29, 30, 31, 32, 33)
-
-
34. A method in a computer system for invoking a plurality of server applications, each server application implemented by executable server code that is stored in a linkable library, the method comprising:
-
in response to a request to invoke a first server application, invoking a surrogate process with a reference to the linkable library that stores the server code that implements the first server application; and under control of the surrogate process, loading the referenced linkable library that stores the server code that implements the first server application; in response to a request to invoke a second server application, determining whether the linkable library that stores the server code that implements the second server application contains trusted is code; when it is determined that the linkable library that stores the server code that implements the second server application contains trusted code, requesting the already executing surrogate process to load the linkable library that contains trusted code that implements the second server application; and loading the linkable library that contains the trusted code that implements the second server application into the already executing surrogate process. - View Dependent Claims (35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45)
-
-
46. A method in a computer system for unmarshaling a marshalled object, the marshalled object containing a class identifier identifying a class of objects with common behavior and unmarshaling code, the unmarshaling code being implemented by server code that corresponds to the class identifier, the method comprising:
-
determining whether custom unmarshaling is required to unmarshal the marshalled object, wherein custom unmarshaling refers to unmarshaling code that implements an unmarshaling process that is specific to the server code; when it is determined that custom unmarshaling is required, determining the class identifier of the marshalled object; determining whether there exists a linkable library that contains executable server code that corresponds to the determined class identifier; when it is determined that the linkable library exists, invoking a surrogate process with a reference to the linkable library, wherein the surrogate process is an independently executable process for loading server code that is stored in a dynamically linkable library and that can instantiate an object; and under control of the invoked surrogate process, loading the linkable library and executing the custom unmarshaling code in the loaded linkable library to unmarshal the marshalled object in a server code-specific manner. - View Dependent Claims (47, 48, 49)
-
-
50. A method in a computer system for invoking a server application having server code implemented according to a first architectural model from client code implemented according to a second architectural model, the client code executing in a client process, the method comprising the computer-implemented steps of:
-
receiving from the client process a request to invoke the server application; in response to the received request, determining whether the first architectural model of the server code is compatible with the second architectural model of the client code, such that the server code can be executed in the client process; when it is determined that the first architectural model of the server code is not compatible and cannot be executed in the client process, invoking a surrogate process with a reference to a dynamically linkable library that contains the server code implemented according to the first architectural model, the surrogate process providing an emulation of a computer system having an instruction set that implements the first architectural model; loading the referenced dynamically linkable library into the surrogate process; within the surrogate process, executing the server code implemented according to the first architectural model; and returning to the client process a reference to the executing server code, the client process using the returned reference to transparently access the server application as if the server code were executing in the client process. - View Dependent Claims (51)
-
-
52. A computer system for invoking server code that is stored in a dynamically linkable library, the computer system comprising:
-
a surrogate process that is an independently executable process for loading server code that is stored in a dynamically linkable library and that can instantiate an object, and that, in response to being invoked, loads the dynamically linkable library that stores the server code; executes the server code; and returns a reference to a binding handle for the executing server code that can be transparently used by a second process to further invoke the server code without knowledge that the server code is being executed in the surrogate process; and an invocation mechanism that, in response to a request to invoke the server code, invokes the surrogate process with a reference to the dynamically linkable library.
-
-
53. A computer system for invoking server code that is stored in a dynamically linkable library, the computer system comprising:
-
a class factory object identified by class identifier and implemented by server code stored in the linkable library, the class identifier identifying a class of objects with common behavior and containing a creation method for creating an object of the class; a surrogate process that is an independently executable process for loading server code that is stored in a dynamically linkable library and that can instantiate an object, and that in response to being invoked, loads the linkable library that stores the server code; creates an instance of the class factory object within the surrogate process; registers a binding handle for the created class factory object instance so that other processes can create object instances of the class without knowledge that the class factory object and creation method is executing in the surrogate process; and an invocation mechanism that, in response to a request to invoke the server code, invokes the surrogate process with a reference to the linkable library and the class identifier. - View Dependent Claims (54, 55)
-
-
56. A computer system for invoking a plurality of server applications, each server application implemented by executable code contained in a linkable library, the computer system comprising:
-
a surrogate process that, in response to invocation, loads the linkable library containing code implementing a first server application and, in response to a request to load the linkable library implementing a second server application, loads the linkable library containing code implementing the second server application; and an invocation mechanism that, in response to a request to invoke the first server application, invokes the surrogate process with a reference to the linkable library containing code implementing the first server application, in response to a request to invoke the second server application, determines whether the linkable library containing code implementing the second server application contains trusted code, and when the invocation mechanism determines that the linkable library containing code implementing the second server application contains trusted code, requests the invoked surrogate process to load the linkable library containing the trusted code implementing the second server application.
-
Specification