Object oriented distributed computing system processing request to other object model with code mapping by object managers located by manager of object managers5475817Abstract An object oriented distributed computing system is provided. Processing means call a location service within automatically generated stubs in response to a request for a service provided by a particular object. The location service is automatically called on behalf of the requester to locate the target object when the request is issued. Multiple Object Managers reflecting multiple Object Models are permitted in the system. Programmers and users do not need to know the Object Model adhered to by an Object Manager. A request to any object in the system is independent of the Object Model of the sought object's Object Manager. A generic interface enables new Object Managers reflecting new Object Models to be easily added to the system. Availability of the target object is independent of association of the target object with a process at the time the request was issued. Deactivation of processes is automatically accomplished in response to the system needing resources. Claims We claim: Description BACKGROUND OF THE INVENTION
______________________________________
return.sub.-- type
Operation.sub.-- Name(
objref.sub.-- t target.sub.-- object,
type Param1,
. . . ,
type ParamN
);
______________________________________
An opaque handle referred to as an objref.sub.-- t is used to identify the object to which the request is to be sent (i.e., target object). In the preferred embodiment, oberf.sub.-- t is a pointer to a system defined structure which is implementation dependent. The internal structure of such handles are not visible or available to users of the system 11. Users of the system 11 create and delete objref.sub.-- t handles through calls to the runtime library 27. Some parameters are conceptually passed by reference; that is, they have the status of output or input-output parameters. The first parameter to all operations is a system defined object references to the target object that is to receive the request. If the method invoked by the call returns a simple value, that value is returned as the return value for the operation. If the method returns multiple values, those values are returned in the parameters to the operation which are capable of returning values. Also, all management apparatus 15 operations are defined to return a status value, which can be used to determine whether the operation succeeded. If the operation fails, the status value indicates the nature of the failure. An interface is a non-empty set of operations that are logically related and form a semantic unit. The management apparatus 15 makes the following requirement regarding interfaces: if an object class supports any operation in an interface, it must support all of the members of the set of operations that constitute that interface. Further, each interface is identified by an interface identifier that is assigned by the implementor who originally designed the interface. A method is the code that implements an operation. For a given operation that code may vary from one object 13 to another because of differences in computer architecture or for other reasons. An operation is used to specify the action that is to be performed on an object 13. A request made of an object 13 is mapped to a method on that object 13. This mapping associates a particular implementation with the operation defined in an interface supported by the object 13. It is the responsibility of the class implementor to ensure that the method associated with the operation request performs the appropriate actions to give the intended semantics to the request. According to the foregoing, in response to an object operation call from a requester, the MOM of the target object's object manager interacts with the object manager to forward the request to the target object 13b. The object manager 23 associated with the target object 13b receiving the operation call also ensures that the target object 13b is capable of receiving the request. The managers of object managers (MOMs) 29 are designed to allow the addition of multiple object managers 23 over the life of the computing system 11. This is accomplished by a common generic interface supported by object managers 23 managed by a common MOM 29, such that the MOM 29 is able to communicate with each object managers 23 without explicit knowledge of the object model on which the object manager is based. The exact way in which the MOM 29 and a particular object manager 23 communicate is the same for any particular implementation of the manager of object managers 29, but may vary from implementation to implementation. The separation of the managers of object managers (MOMs) 29 and the individual object managers 23 allows objects 13 with very different attributes to coexist within the computing system 11 without limiting the ability of those objects 13 to interoperate. The separation also allows the MOMs 29 to know about the communications services used throughout the system 11, while the individual object managers 23 know the particulars of the objects 13 that are associated with them. Moreover, this splitting of knowledge allows the MOMs 29 to receive requests for any type of object 13. In response to receipt of a request, the MOM 29 determines if the target object 13b of the request is one which is managed by one of the object managers 23 associated with that MOM 29. In turn, the individual object manager 23 of the target object 13b ensures that the target object 13b is ready to receive the request. The object manager is able to accomplish this by having or aquiring specific knowledge of the target object 13b being managed. In one case, ensuring that a target object 13b is ready to receive a request requires that the associated object manager 23 activate the target object 13b. This, in turn, requires that the associated object manager 23 know the execution model and persistent storage scheme used by the target object. The net effect of the foregoing separation of responsibility between the managers of object managers (MOMs) 29 and the individual object managers 23 can be restated as follows. The MOM 29 acts as a well known receiving point and a forwarding agent for requests, while the object managers associated with the MOM 29 act as the object model-specific activators and manipulators of objects 13b. To function in the distributed computing system defined by the management apparatus 15, objects 13 support certain operations. In the preferred embodiment, all objects 13 support the following functions.
______________________________________
acl.sub.-- t
get.sub.-- acl(
objref.sub.-- t object,
status.sub.-- t *status
);
______________________________________
The function get.sub.-- acl returns an access control list associated with the object referred to by the parameter "object".
______________________________________
boolean
set.sub.-- acl(
objref.sub.-- t object,
acl.sub.-- t to.sub.-- acl,
status.sub.-- t *status
);
______________________________________
The function set.sub.-- acl associates the access control list referred to by to.sub.-- acl with the object referred to by the parameter "object". The function returns the value "true" if the setting is successful, and "false" otherwise. Note that the access control list currently associated with the parameter "object" must allow the sender of the request the rights to set the access control list for the operation to be successful.
______________________________________
boolean
set.sub.-- class.sub.-- id(
objref.sub.-- t object,
classid.sub.-- t to.sub.-- class,
status.sub.-- t *status
);
______________________________________
The function set.sub.-- class.sub.-- id changes the class identifier associated with the object referred to by the parameter "object" to the value specified in to.sub.-- class. The function returns the value "true" if the setting was successful; otherwise the function returns a value of "false".
______________________________________
boolean
inq-colocation(
objref.sub.-- t of.sub.-- object,
objref.sub.-- t with.sub.-- object,
status.sub.-- t *status
);
______________________________________
The function ing.sub.-- colocation asks of the object referred to by of.sub.-- object if it is colocated with the object referred to by with.sub.-- object. The function returns "true" if the objects are colocated; otherwise the function returns "false". Note that the sematics of colocation are dependent on the persistent storage mechanism and/or object manager associated with the objects. During runtime, calls or operation requests are processed as follows. The runtime library 27 is bound to all objects 13. It serves both as the departure point for sending requests and the final destination for receiving requests. As part of this function, runtime library 27 provides an interface to construct object references, which are basic entities in the Location Services 21. The runtime 27 also provides an interface to the Persistent Storage Manager, which allows objects to manage their persistent state with the aid of the default object manager 25 as discussed later. The sending and receiving of requests is transparent to the user of the system 11 and the writer of objects 13, or more accurately, classes of objects. Request transmission is defined by the internal runtime functionality and by the stubs (i.e., interface code fragments) generated by an interface compiler when it processes the class's operation interfaces. However, three functions are exported from the runtime 27. The first function allows the comparison of two object reference handles to determine if they refer to the same object. The second function allows the creation of an object reference to a class object. The third function allows the destruction of an object reference handle. The first exported runtime function in the preferred embodiment is as follows:
______________________________________
boolean
omf.sub.-- objref.sub.-- equal(
objref.sub.-- t ref1,
objref.sub.-- t ref2,
status.sub.-- t *status
);
______________________________________
The function omf.sub.-- objref.sub.-- equal returns the value "true" if the object reference handles of ref1 and ref2 each refer to the same object; otherwise the function returns the value "false". The second exported runtime function in the preferred embodiment is as follows:
______________________________________
objref.sub.-- t
omf.sub.-- dup.sub.-- objref(
objref.sub.-- t to.sub.-- dup,
status.sub.-- t *status
);
______________________________________
The omf.sub.-- ref.sub.-- objref call creates a duplicate of the object reference supplied by the parameter to.sub.-- dup. The resulting object reference can be given to other objects. The third exported runtime function in the preferred embodiment is:
______________________________________
void
omf.sub.-- free.sub.-- objref(
objref.sub.-- t to.sub.-- free,
status.sub.-- t *status
);
______________________________________
The function omf.sub.-- free.sub.-- objref deletes from storage an object reference handle. Other functions employed in the runtime interface are as follows:
______________________________________
objref.sub.-- t
omf.sub.-- create(
classid.sub.-- t obj.sub.-- class,
objref.sub.-- t group.sub.-- with,
tid.sub.-- t in.sub.-- trans,
status.sub.-- t *status
);
______________________________________
The function omf.sub.-- create informs the object manager that an object exists. In response, the object manager returns an object reference to the new object, which can then be used by this object to identify itself to other objects. The call specifies the class of the new object in obj.sub.-- class. Further, the parameter group.sub.-- with allows the object created to be registered as being in the same group as the object referred to by that parameter. If two objects are in the same group, the object manager can assume that the objects trust each other and can make certain assumptions allowing for optimization. For example, in an implementation which assigns active objects to processes, objects which are in the same group might be placed in the same process. To that end, the object manager 23 treats groups of the objects associated with it as respective equivalence classes. In turn, the object manager 23 effectively only keeps track of the state of the groups of objects associated with it, and not the state of individual objects 13 within a group.
______________________________________
boolean
omf.sub.-- delete(
objref.sub.-- t to.sub.-- delete,
tid.sub.-- t trans.sub.-- id,
status.sub.-- t *status
);
______________________________________
The function omf.sub.-- delete informs the object manager associated with an object that the object referred to by to.sub.-- delete is being deleted. The effective result of the call is removal of all record of the object with the object manager. Note that this call does not free any of the persistent store associated with the object. The function returns a value of "true" if successful; otherwise it returns a value of "false".
______________________________________
boolean
omf.sub.-- change.sub.-- identity(
objref.sub.-- t object,
tid.sub.-- t trans.sub.-- id,
objref.sub.-- t new.sub.-- id,
status.sub.-- t *status
);
______________________________________
The function omf.sub.-- change.sub.-- identity changes the underlying identity of the object referred to by the parameter object to that supplied by new.sub.-- id. This call is basically used only when the object formerly referred to by new.sub.-- id, if any, has been or is about to be deleted. The function returns a value of "true" if successful; otherwise it returns a value of "false". The Persistent Storage Manager (PSM) enables objects to manage their persistent state. The PSM is associated with the default object manager and is accessed through the runtime interface, which is accessible to all objects 13 in the system 11. The set of calls associated with the PSM interface allows an object 13 to obtain objects of type "pointer to file" (as defined in the POSIX standard) from the object identity of the object. The object 13 can then read or write its persistent state using the referenced file in any way it likes. It is noted that an object 13 managed by the default object manager 25 is not required to use the PSM to store its persistent state. However, an object that chooses not to utilize the PSM will be required to do all manipulations of the persistent state of the object 13 without the aid of the default object manager 25. The interface to the PSM consists of the following calls. These calls are not directed to an object 13, but are local calls that are implemented in the system runtime, which is accessible to all objects 13 and which runs in the same process space 39 as the calling object 13. These functions are best thought of as a library which supplies the glue that holds an object 13 and that object's object manager 25 together.
______________________________________
FILE*
psm.sub.-- create(
objref.sub.-- t location,
tid.sub.-- t trans.sub.-- id,
objref.sub.-- t *obj.sub.-- created,
objref.sub.-- t group.sub.-- with,
classid.sub.-- t obj.sub.-- class.sub.-- id,
acl.sub.-- t init.sub.-- acl,
mode.sub.-- t cr.sub.-- mode,
status.sub.-- t *status
);
______________________________________
The function psm.sub.-- create creates a file in the same location as the object referred to by the parameter "location". The object identity of the object created is returned in the parameter obj.sub.-- created. In the preferred embodiment, the object identity encodes an indication of the computer 37 on which the object was created. A pointer to the file created as part of the operation is returned as the return value of the function. The object and the file returned both have the initial access control list (ACL) supplied in init.sub.-- acl, and the file will be created in the mode indicated by cr.sub.-- mode. The object will be registered with the object manager as being of the type indicated by obj.sub.-- class.sub.-- id. It is important to realize that psm.sub.-- create does not create an object, but merely provides persistent storage, an initial object reference, and registers the existence of the object with an object manager. Full object creation may require other activities, such as the initialization of the object's state. This is taken care of by the code which actually creates the object. The psm.sub.-- create call will be made by that code to inform the system of the existence of the new object.
______________________________________
FILE*
psm.sub.-- open(
objref.sub.-- t object,
tid.sub.-- t trans.sub.-- id,
mode.sub.-- t open.sub.-- mode,
status.sub.-- t *status
);
______________________________________
The function psm.sub.-- open returns a pointer to the file associated with the object identified by the object identity in the parameter "object", opened with the mode specified by the parameter open.sub.-- mode. The file must have been created with a call to psm.sub.-- create.
______________________________________
boolean
psm.sub.-- delete(
objref.sub.-- t object,
tid.sub.-- t trans.sub.-- id,
status.sub.-- t *status
);
______________________________________
The function psm.sub.-- delete will delete the file associated with the object identified by the object identity passed in the parameter object, and will also remove any reference to the object in the object manager. The function returns the value "true" if the delete succeeded, otherwise it returns a value of "false".
______________________________________
objref.sub.-- t
psm.sub.-- create.sub.-- link(
objref.sub.-- t to.sub.-- object,
tid.sub.-- t in.sub.-- trans,
oid.sub.-- t class.sub.-- id,
acl.sub.-- t init.sub.-- acl,
status.sub.-- t *status
);
______________________________________
The function psm.sub.-- create.sub.-- link creates an object that is permanently associated with the object referred to by the parameter to.sub.-- object. The object created will have the class specified in class.sub.-- id. If specified, the object will have an access control list of init.sub.-- acl; otherwise the object will have the ACL (access control list) of the object referred to by to.sub.-- object. The newly created object will be associated with the persistent store of to.sub.-- object, doing a subsequent psm.sub.-- open on the object reference returned by this call will return the same value as doing a psm.sub.-- open on to.sub.-- object. The function will also register the object created as being in the same process group as to.sub.-- object.
______________________________________
acl.sub.-- t
psm.sub.-- get.sub.-- acl(
objref.sub.-- t for.sub.-- object,
status.sub.-- t *status
);
______________________________________
The function psm.sub.-- get.sub.-- acl.sub.-- id returns the access control list for the object identified by the parameter for.sub.-- object.
______________________________________
boolean
psm.sub.-- set.sub.-- acl(
objref.sub.-- t for.sub.-- object,
acl.sub.-- t new.sub.-- acl,
status.sub.-- t *status
);
______________________________________
The function psm.sub.-- set.sub.-- acl.sub.-- id sets the ACL for the object identified by the parameter for.sub.-- object to new.sub.-- acl. The functions returns "true" if successful, and "false" otherwise.
______________________________________
boolean
psm.sub.-- change.sub.-- identity(
objref.sub.-- t object,
tid.sub.-- t trans.sub.-- id,
objref.sub.-- t new.sub.-- id,
status.sub.-- t *status
);
______________________________________
The function psm.sub.-- change.sub.-- oid will change the object identity of the object identified by the parameter object to that of the new object identity passed in the parameter new.sub.-- id. This call is used only when the object formerly referred to by new.sub.-- id, if any, has been or is about to be deleted. The function returns a value of true is successful; otherwise it returns a value of false.
______________________________________
boolean
psm.sub.-- inq.sub.-- colocation(
objref.sub.-- t object,
status.sub.-- t *status
);
______________________________________
The function psm.sub.-- ing.sub.-- colocation is used to determine if the object identified by the parameter object is located in the same persistent store as the object making the call. The function returns true if the objects are colocated and false otherwise.
______________________________________
char*
psm.sub.-- get.sub.-- path(
objref.sub.-- t object,
status.sub.-- t *status
);
______________________________________
The function psm.sub.-- get.sub.-- path returns an implementation dependent null-terminated string which corresponds to the pathname, if any, of the file containing the persistent state in the local file system of the object referred to by the parameter object. The string is not interpreted by the management apparatus; the programmer is responsible for understanding the string in the context of the local system and determining what operations are supported on such strings in that local system. If the local system does not support the concept of file pathnames psm.sub.-- get.sub.-- path returns NULL with an error status code. Activation of Objects In most systems, objects (or programs) must be explicitly invoked before use. In the object oriented distributed computing system 11 of the present invention, objects 13 get activated as needed, without requiring an explicit operation to activate them. Mere use of an object 13 through a request will cause an object to be activated, if it is not already in its active state. As used herein, an object that is able to respond to requests is defined as "active". In order for an object 13 to be able to respond to requests, the code for the object's class must be loaded into a process 39, the supported request interfaces must be associated with their implementations in code, and the persistent data of the object 13 must be loaded up. These last two steps are done by a "class initialization" routine and an "object restore" routine, respectively. Loading of class code must be handled in a machine-dependent way. Once these steps are complete, the object 13 is ready and able to respond to any of the requests it supports. The entities involved in object activation in the preferred embodiment are: a program referred to as "Genobj" 55, the default object manager 25, an entity referred to as a class expert 57, and the runtime library 27. Genobj 55 (FIG. 3b ) is a process whose function is to prepare objects 13 to receive requests. An object that is so prepared is considered to be in its active state. Genobj 55 prepares an object 13 by (i) loading the code of the object's class into the address space of Genobj 55 (if necessary), (ii) invoking the "class initialization" function for the object's class, and (iii) invoking the "object restore" function with the objects persistent data. Other programs having a function similar to that of Genobj are suitable. In this context, the default object manager 25 manages a set of objects and a set of processes. The default object manager's 25 objects are more or less permanent but the processes are initiated and terminated as needed. The default object manager knows the class of each of its objects and the location of each object's persistent data. The default object manager 25 also knows whether or not a given object 13 (or group of related objects) is currently associated with one of the processes managed by the default object manager 25. The default object manager 25 considers an object or object group that is associated with a process to be able to receive messages and hence to be "active". The default object manager 25 in the course of "activating" an object 13 will initiate a process 39 that is appropriate to the object's class. If a class does not specify a program 39 to initiate, the default object manager 25 initiates Genobj 55. The class expert 57 (FIG. 3b) is an entity that manages information about an object class (or set of classes). The information includes the operation interfaces that the class supports and the names of certain initialization functions for the class. The class expert 57 also maintains information concerning the implementation (in code) of the object class. The runtime library 27 is described previously. Briefly, the runtime library 27 is resident in every object 13 and hence every process 39. The runtime library 27 that is resident with Genobj 55 additionally interacts with Genobj 55 to coordinate activation and deactivation of objects 13. As used in the following discussion a "user" is a human using the object oriented distributed computing system 11 of the present invention. A "client" is a program or object that makes a request (or method call) on another object in the system 11. The "client" may also be the entity that the user interacts with, typically through a keyboard and/or mouse. The attempted use of an object 13 by a client causes the object 13 to be activated, if the object is not already in its active state. Further, the terms "function", "routine", "handler" and "procedure" are used interchangeably in this discussion. For purposes of illustration and not limitation, suppose a user M wants to know the phone number of another user J. The user M simply asks through her computer application for "phone information" on user J. Typically this involves user M typing user J's name into a menu selection or a form displayed by the computer application. As illustrated in FIG. 2, the computer application then performs the request-side version of the "get phone.sub.-- info" request which is exported by the phone information ("pi") object 13a resident somewhere in the system 11. The request-side version of the request interacts with the runtime library 27 residing in the requesting process 39a. The runtime library 27 first contacts the location services 21 to find the location of the pi object's 13a object manager 25. The runtime library 27 then sends the actual "get phone.sub.-- info" operation request to the manager of object managers (MOM) 29a that manages the object's object manager 25. The runtime library 27 at the MOM 29a (manager of object managers) receives the packet containing the request sent by user M's computer application 39a. The runtime library 27 asks the manager of object managers 29a if it knows where the packet should be directed. More specifically, the runtime library 27 passes down the object identity and the interface identifier found in the packet under respective parameters and expects to receive back an "end point" (i.e., local socket address) to which the packet can be forwarded. In response the manager of object managers 29a asks each of its object managers 23 if the object manager manages the requested object (i.e., the object specified by the object identity passed down by the runtime library 27). The default object manager 25 checks its internal tables 51 (FIG. 3a) to see if it manages the object 13a. If so the default object manager 25 maintains the identifier of the group of objects to which the specified object 13a belongs. (Object groups containing only one object are allowed.) The default object manager 25 then looks up state of the group of objects. A group maybe in any of the following three states: "active"--the group is already associated with a process 39. At least one endpoint for the process is available for use and forwarding packets. "pending"--a process 39 has been initiated for the group but the process has not yet registered its endpoints with the default object manager 25. "inactive"--there is no process 39 associated with the group. If the group is "active", the default object manager 25 returns the endpoints of the process 39 associated with the group. If the group is "pending", the default object manager 25 returns no endpoints since it does not have them yet, but returns an indication that it manages the specified object. If the group is "inactive", the default object manager 25 acquires a process 39 for the group. In the preferred embodiment the default object manager 25 accomplishes process acquisition for a group as follows and illustrated in FIG. 3a. First, the default object manager 25a checks a pool 47 of "available" processes 39c, 39d. An available process is one which has registered one or more endpoints with the default object manager 25 but which is not yet associated with any object group. The default object manager 25 checks each process 39 in the pool 47 to find one that is compatible with the class of the specified object. Some processes (e.g., instances of Genobj) are compatible with many classes but others may be restricted to servicing only objects of a particular class. If default object manager 25 finds a compatible process 39c in pool 47, it marks the group as "active" in the default object manager's internal tables 51. The default object manager 25 also associates the endpoints of the found process 39c and process's operating system identifier with the group. The default manager 25 next returns the newly associated endpoints to the manager of object managers 29a and removes the process 39c from the available process pool 47. If the default object manager 25 cannot find a compatible process in the pool 47 of available processes, the default object manager 25 initiates a compatible process 39f. To do this, the default object manager 25 determines the path of a compatible process 39f by looking at information pertaining to the class of the object. As was mentioned, if a class does not specify a process, the default object manager 25 will initiate Genobj 55. After initiating the process 39f, the default object manager 25 marks in its internal tables 51 that the object's group is "pending activation". The default object manager 25 also puts an entry 39f into a pool 53 of "pending processes". The entry for the process 39f contains the operating system identifier of the process and the identity of the group for which the process 39f is intended. When the process 39f registers its endpoints (via a register.sub.-- endpoints request on the default manager 25), its entry will be removed from the pending process pool 53 and the group it is intended for is marked in the internal tables 51 by the default manager 25 as "active". The default object manager 25 also associates the group with the process's endpoints and process identifier in its internal tables 51. It is noted that when a process that is initiated without a group association registers its endpoints, it gets moved from the pending process pool 53 to the available process pool 47. In the case of Genobj 55 being initiated by the default object manager 25, Genobj performs the following as illustrated in FIG. 3b. Soon after being initiated by the default object manager 25, Genobj 55 asks the runtime library 27 for endpoints. Upon acquiring the endpoints, Genobj 55 performs the "register.sub.-- endpoints" request on the default object manager 25. The parameters to the request include the operating system process identifier of this instance of Genobj 55 and the endpoints acquired from the runtime library 27. In addition to registering endpoints with the default object manager 25, Genobj 55 performs a registration (of a different sort) with the runtime library 27. Genobj 55 registers an "unknown-object" function 61 (a function invoked when the runtime 27 receives a request it does not know how to handle). After performing both registrations, Genobj 55 turns control over to the runtime library 27 which can now start receiving requests (forwarded by the default object manager 25 or possibly sent directly by requesters). When the runtime library 27 receives a request it doesn't know how to handle, the runtime library 27 invokes the unknown-object function 61. Genobj's unknown-object function (or handler) 61 interacts with the default object manager 25 through the get.sub.-- obj.sub.-- info() request to determine the class of the object and the location of the object's persistent data. Using the class identifier just acquired the function 61 locates and contacts the expert 57 for the class. From the class expert 57 the function finds out the names of the class initialization function and the object restore function through the get.sub.-- class.sub.-- info() request as shown in FIG. 3b. The unknown-object function 61 also possibly gets information it needs to load the class's implementation into the function's address space. After loading the class's implementation, the unknown-object function 61 invokes the class initialization function. The primary purpose of the class initialization function is to register the class's operation interfaces and deactivation handler with the runtime library 27. The unknown-object function 61 then invokes the class's object restore function which includes passing in the location of the object's persistent data. After the restore routine completes, the unknown-object function 61 registers the object and class with the runtime library 27. Finally the unknown-object function 61 returns control to the runtime 27. The runtime library now has enough information (received from the request registrations and the object/class registration) to properly process the request (packet). And the object, having been restored, is now ready to receive the request specified by the packet. The runtime library 27 simply calls the stub which the object registered for the request, passing down the data found in the request packet. The stub unmarshalls the data and invokes the appropriate method of the object. When the next request for the object 13 arrives in a packet, the runtime library 27 will be able to invoke the stub directly without recourse to the unknown-object function 61 since the object is at that time "known". The advantage of the foregoing procedure is that it is transparent to the user and to client programs. The client that invoked the request on the object, has no awareness of whether or not the object 13 is active prior to issuance of the request. To that end, all objects appear to be available or active for processing requests even though they are not currently associated with a process. Thus, the present invention provides computer means for implementing operations and data of a target object (and moreover for receiving and servicing requests) for a target object independent of association of the target object with a process at the time the request was issued. Deactivation of Objects The class initialization routine of the object's class is responsible for registering a deactivation handler with the runtime. In the preferred embodiment, object managers 23 provide deactivation of processes in automatic response to the system 11 needing resources. When Genobj 55 receives a process termination request from the default object manager 25, it will ask the runtime library 27 to invoke the deactivation handlers for each registered object 13. The termination request from the default object manager 25 has a "priority" parameter that indicates how important it is to terminate the process 39. There are at least three priority values the parameter can take, ranging from "Please terminate if you aren't busy" to "Terminate or be killed ungracefully." Genobj 55 passes along the priority parameter to the runtime routine "deactivate.sub.-- objects" which calls the deactivation handlers. Before invoking the deactivation handlers, the deactivate.sub.-- objects routine compares the value of the priority parameter to the "unwillingness to terminate" values that are registered by each object 13. If the priority level is greater than each "unwillingness" level, the deactivation handlers are invoked. If not, the "deactivate.sub.-- objects" routine returns to Genobj 55, passing along the current maximum unwillingness level, and Genobj 55, in turn, passes this value back to the default object manager 25. An object 13 is able to change its "unwillingness" level whenever appropriate. For example, an object 13 that has not received any method requests for some time may tell the runtime library 27 that its unwillingness level is low. If this object 13 were to then receive method requests, it might then tell the runtime library 27 that its unwillingness level was high. The runtime library 27 keeps track of the current unwillingness level of each object 13. Objects Activating Other Objects in its Object Group The restore routine of an object may decide (based on its persistent data) that it needs to have other objects in its object group active in Genobj. The restore routine can cause another object to be activated by calling Genobj's unknown-object function (handler) 61, passing in the object identity of the desired object 13. The restore routine may do this for as many objects as it needs. The unknown-object handler 61 checks to see that the desired object is not already active. If the object isn't active, the handler 61 behaves almost the same way as it behaves when called by the runtime library 27 described above. The differences relate to issues of concurrency control rather than to any differences in end effect. Note that calls to the unknown-object handler 61 may be recursive. For example, the handler may be called by the runtime library 27 on a particular object "A" whose restore routine calls the handler on object "B". The restore routine for "B" may, in turn, call the handler on object "C" and so forth. Eventually, all the needed objects 13 will have their classes initialized and their states restored, and control will ultimately return to the runtime library 27. Control of Class Loading and Initialization Any number of objects in an object group may be of the same class. When each object 13 gets activated in Genobj 55, Genobj checks to see whether it has already "loaded" and initialized the class of the object. If so, Genobj 55 refrains from re-loading and reinitializing the class. Genobj 55 does, however, invoke the restore function whether or not the class has been previously loaded. This is done because the restore function serves to restore the state of the object 13 rather than class (and this needs to be done for each object). Equivalents While the invention has been particularly shown and described with reference to a preferred embodiment thereof, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the invention as defined by the appended claims.
|
Same subclass Same class Consider this |
||||||||||
