Software Patent: A method and system for marshalling interface pointers for remote procedure calls.
Table of contents:
Bibliography
|
Title |
A method and system for marshalling interface pointers for remote procedure calls. |
|
Title - german |
|
|
Title - french |
|
|
Granted. Opposition window closed |
|
|
Atkinson, Robert, G. (US); Corbett, Tom (US); Jung, Edward, K. (US); Williams, Antony, S. (US) |
|
|
None |
|
|
WO1993US10965 19931112; US19920975775 19921113 |
|
|
|
|
|
WO9411810-A1, JP2003140898-A, EP669020-B1 |
|
|
ep669020 |
|
|
EP19940901451 19931112 |
Abstract
||<#ffd0d0>[[patent( A computer method and system for passing a pointer to an interface from a server process to a client process. In a preferred embodiment, the server process instantiates an object that has multiple interfaces. The server process identifies an interface to pass to the client process and creates a stub object for receiving a request to invoke a function member of the interface and for invoking the requested function member upon receiving the request. The server process then sends an identifier of the stub to the client process. When the client process receives the identifier of the stub, it instantiates a proxy object for receiving requests to invoke a function member of the interface and for sending the request to the identified stub. The client process can then invoke the function members of the interface by invoking function members of the proxy object. The proxy object sends a request to the identified stub. The identified stub then invokes the corresponding function member of the interface. )]] ||
Description
[[patent( Description of correspondent: <strong>WO9411810</strong><br/> <br/> <br/> Description<br/>
Technical Field<br/>
<br/> Background of the Invention<br/>
<br/>
<br/>
<br/> For example, the overhead of copying a large array may be unacceptable. As discussed in the following, it may also be impractical to make a copy of an object when marshalling the object because the object may be large and include various functions.<br/> <br/>
<br/>
No. 07/682,537, entitled "A Method for Implementing Virtual Functions and<br/> Virtual Bases in a Compiler for an Object Oriented Programming Language," which is hereby incorporated by reference. In the following, an object will be described as an instance of a class as defined by the C+ + programming language.<br/> <br/> One skilled in the art would appreciate that objects can be defined using other programming languages.<br/> <br/>
Moreover, the copying of an object may be intractable because a function member loaded in the server process space may need to access data or other functions in the server process space.<br/> <br/>
<br/>
<br/>
<br/> Moreover, any spreadsheet object, whether implemented before or after the word processing program is compiled, can be embedded.<br/> <br/> class ISpreadSheet<br/>
. <br/> <br/> The developer of a spreadsheet program would need to provide an implementation of the interface to allow the spreadsheet objects to be embedded in a word processing document. When the word processing program embeds a spreadsheet object, the program needs access to the code that implements the interface for the spreadsheet object. To access the code, each implementation is given a unique class identifier. For example, a spreadsheet object developed by<br/> Microsoft Corporation may have a class identifier of "MSSpreadsheet," while a spreadsheet object developed by another corporation may have a class identifier of "LTSSpreadsheet." A persistent registry in each computer system is maintained that maps each class identifier to the code that implements the class.Typically, when a spreadsheet program is installed on a computer system, the persistent registry is updated to reflect the availability of that class of spreadsheet objects.<br/> <br/> So long as a spreadsheet developer implements each function member defined by the interface and the persistent registry is maintained, the word processing program can embed the developer's spreadsheet objects into a word processing document.<br/> <br/>
IBasic may be defined for a spreadsheet object as follows.<br/> <br/> class IDatabase<br/>
. <br/> <br/> Each spreadsheet developer would implement the IBasic interface and, optionally, the IDatabase interface.<br/> <br/>
<br/> Tomake this determination, another interface is defined (that every spreadsheet object implements) with a function member that indicates which interfaces are implemented for the object. This interface is known as IUnknown and is defined by the following.<br/> <br/> class IUnknown<br/>
. . . <br/> <br/> The IUnknown interface defines the function member (method)Querylnterface. <br/> <br/> The methodQueryinterface is passed an interface identifier (e.g., "IDatabase") and returns a pointer to the implementation of the identified interface for the object for which the method is invoked. If the object does not support the interface, then the method returns a false.<br/> <br/>
<br/> class IDatabase :IUnknown<br/>
<br/>
<br/>
The pointer pIBasic is a pointer to the IBasic interface of the object. If the object supports the IDatabase interface, the methodQuerylnterface sets the pointerpIDatabase to point to the IDatabase data structure and returns true as its value.<br/> <br/>
IClassFactory, which is defined in the following.<br/> <br/> class IClassFactory: IUnknown<br/>
The methodCreatefnstance instantiates an object and returns a pointerinterface to the interface of the object designated by argumentiidInterface. <br/> <br/>
<br/> makes to the object.<br/> <br/> Surnmarv of the Invention<br/>
<br/>
<br/>
<br/>
<br/> Brief Description of theDrawings <br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/> Detailed Description of the Invention<br/>
<br/>
<br/> The client then accesses the interface of object 301 through proxy 303.<br/> <br/>
EMI9.1 <br/> <br/> <br/> <tb> <SEP> Table <SEP> 1<br/> <tb> void <SEP> File <SEP> (string <SEP> Name, <SEP> int <SEP> OpenMode, <SEP> int <SEP> Status)<br/> <tb> <SEP> {package <SEP> "File" <SEP> into <SEP> message<br/> <tb> <SEP> package <SEP> Name <SEP> into <SEP> message<br/> <tb> <SEP> package <SEP> OpenMode <SEP> into <SEP> message<br/> <tb> <SEP> send <SEP> message <SEP> to <SEP> stub<br/> <tb> <SEP> wait <SEP> for <SEP> message <SEP> from <SEP> stub<br/> <tb> <SEP> unpackage <SEP> Status <SEP> from <SEP> message<br/> <tb> <SEP> }<br/> <tb> <br/> Stub 302 is an object that implements an interface that receives messages from the client, unmarshals the method name and any in-parameters, invokes the named method of object 301, marshals any out-parameters into a message, and sends the message to the proxy 303.Table 2 lists sample pseudocode for a stub. <br/> EMI10.1 <br/> <br/> <br/> <tb> <SEP> Table <SEP> 2<br/> <tb> void <SEP> Stub<br/> <tb> <SEP> (while <SEP> (true) <SEP> <br/> <tb> <SEP> (wait <SEP> for <SEP> message <SEP> from <SEP> a <SEP> client<br/> <tb> <SEP> unpackage <SEP> method <SEP> name<br/> <tb> <SEP> unpackage <SEP> any <SEP> parameters<br/> <tb> <SEP> invoke <SEP> named <SEP> method <SEP> for <SEP> the <SEP> object<br/> <tb> <SEP> package <SEP> return <SEP> parameters<br/> <tb> <SEP> send <SEP> message <SEP> to <SEP> the <SEP> client<br/> <tb> <SEP> }<br/> <tb> <br/> <br/>
<br/>
The method GetCell retrieves a pointer to the cell object representing the cell specified by the passed row/column designator (RC) and returns a pointer to that cell (pCell). The cell objects 404 and 405 have an implementation of the interface<br/> IData, which is defined by the following.<br/> <br/>
.. <br/> <br/> The method GetFormula returns the formula value of the cell object as a string, and the method SetFormula sets the formula in the cell object to the passed string. <br/> <br/>
<br/> plBasic- > GetCell("Al", pCell);<br/>
The spreadsheet proxy 407 is pointed to by pointer pIBasic 408. The client first invokes the spreadsheet proxy method GetCell. The method GetCell packages the method name "GetCell" and the string "Al" into a message and sends the message to spreadsheet stub 406. The spreadsheet stub 406 unpackages the method name and string. The spreadsheet stub 406 then invokes the GetCell method of the spreadsheet object 403. The method GetCell returns to the spreadsheet stub 406 a pointer to cell object 404. The spreadsheet stub 406 then marshals the cell pointer by creating cell stub 409 for cell object 404, assigning a message address to cell stub 409, packaging the message address and an unmarshal class identifier (described below) into a message, and sending the message to the spreadsheet proxy 407.When the spreadsheet proxy 407 receives the message, method GetCell then unmarshals the pointer to the cell object 404.<br/> <br/>
Microsoft Press. Each dynamic link library for a class contains a functionGetiClassFactory which returns a pointer to an IClassFactory interface for the class. The method GetCell loads the dynamic link library 410 for the retrieved unmarshal class identifier (the unmarshal class) and invokes the function<br/> GetIClassFactory which returns a pointer to the IClassFactory interface 411. The method GetCell then invokes the methodCreatelnstance of the IClassFactory interface 411 to create cell proxy 412. The cell proxy 412 is then initialized with the retrieved message address for cell stub 409. The method GetCell then returns with the pointer to the cell proxy 412. The client can then access the cell object 404 through the cell proxy 412. <br/> <br/>
UnMarshalInterface to unmarshal the interface pointer received in message 505A.<br/> <br/> The method then returns with the pointer pCell pointing to a cell proxy.<br/> <br/>
In step 508, if the method name is "GetCell", then the stub continues at step 509, else the stub continues to determine if the method name corresponds to another method of the IBasic interface (as indicated by the ellipsis). In step 509, the stub invokes function UnMarshal to unmarshal the in-parameter designating the cell location from message 509A. In step 510, the stub invokes the method GetCell for the spreadsheet object passing the cell location. The method GetCell returns a pointer to the cell object for the passed location. In step 511, the stub invokes the function MarshalInterface passing it the pointer to the cell object.In step 512, the stub sends the message 511A to the cell proxy that sent the message received in step 506. The stub then loops to step 506 to wait for the next message.<br/> <br/>
IMarshal interface as appropriate.<br/> <br/>
<br/>
<br/>
This function marshals the designated pointer (pInterface) to an interface for an object into the designated message (pstm). In step 601, the function determines whether the object implements custom marshalling. The function invokes the methodQueryinterface of the interface to retrieve a pointer to an IMarshal interface. If the object implements custom marshalling, then a pointer (pMarshal) to the IMarshal interface for the object is returned and the function continues at step 603, else the function continues at step 602. In step 602, the function invokes the function GetStandardMarshal to retrieve a pointer (pMarshal) to an IMarshal interface with default marshalling methods. In step 603, the function invokes the method IMarshal::GetUnmarshalClass pointed to by the retrieved pointer.The method GetUnmarshalClass returns the class identifier of the class that should be used in the unmarshalling process to instantiate a proxy for the designated interface (iid). In step 604, the function invokes the function Marshal to marshal the unmarshal class identifier to the designated message. In step 605, the function invokes the methodIMarshal::Marshalinterface pointed to by the retrieved pointer (pMarshal). The method MarshalInterface marshals the designated interface pointer (pInterface) to the designated message. The method then returns.<br/> <br/>
<br/>
The method MarshalInterface marshals the designated pointer to an interface (pInterface) to the designated message (pstm). In step 701, the method invokes function MakeStub. The functionMakeStub makes a stub for the designated pointer to the interface and returns the message address of the stub. In step 702, the method invokes the function Marshal to marshal the returned message address in the designated message. The method then returns.<br/> <br/>
<br/>
The function MakeStub makes a stub for the designated pointer (pInterface) to the designated interface (iid) and returns the message address (MessageAddress) of the stub. In step 801, the function loads a copy of the stub code for the designated interface. In step 802, the function stores the designated pointer. to the interface so that it is accessible to the stub code. The storing of the pointer associates the stub code with the object pointed to by the designated pointer. In step 803, the function registers the stub code with the messaging system. The messaging system returns the message address of the stub. In step 804, the function stores the message address to return to the caller. The function<br/> MakeStub then returns.<br/> <br/>
<br/>
The function UnMarshalInterface unmarshals a pointer to an interface that was previously marshalled in the designated message (pstm) and returns a pointer (pInterface) to the designated interface (iid) of the object. In step 901, the function invokes function UnMarshal to unmarshal the unmarshal class identifier from the designated message. In step 902, the function invokes function<br/> GetClassObject to retrieve an IClassFactory interface for the class indicated by the unmarshal class identifier (the unmarshal class). In step 903, the function invokes the methodCreatelnstance of the retrieved IClassFactory interface to create an instance of the proxy and returns a pointer to its IMarshal interface. In step 904, the function invokes method UnMarshalInterface of the proxy. The function UnMarshal then returns.<br/> <br/>
<br/>
The method UnMarshalInterface initializes the newly created proxy and returns a pointer (pInterface) to the designated interface (iid). In step 1001, the method invokes function UnMarshal to unmarshal the stub message address from the designated message. In step 1002, the method stores the stub message address. In step 1003, the method retrieves a pointer to the designated interface. The method<br/> UnMarshalInterface returns.<br/> <br/>
<br/>
The function GetClassObject returns a pointer (pInterface) to the designated interface (iid) of the designated class (cid). In step 1101, the function retrieves the name of the dynamic link library for the designated class from the persistent registry. In step 1102, the function loads the dynamic link library. In step 1103, if the designated interface is the IClassFactory, then the function continues at step 1104, else the function returns. In step 1104, the function invokes the function<br/> GetIClassFactory to get the pointer to the IClassFactory interface. The function<br/> GetIClassFactory is preferably provided by the developer of the object. The function GetClassObject then returns.<br/> <br/>
IMarshal interface to provide custom marshalling and unmarshalling for the object. The IMarshal interface is defined in the following.<br/> <br/> class IMarshal: IUnknown<br/>
) <br/>
<br/> Cell stub 1204 receives the message, unmarshals the parameters, and invokes the appropriate proxy method of cell proxy 1203. The proxy method of cell proxy 1203 marshals the parameters and sends a message to cell stub 1202. Cell stub 1202 receives the message, unmarshals the parameters, and invokes the appropriate method of cell object 1201. When the method returns, cell stub 1202 marshals any out-parameters and sends a message to cell proxy 1203. When cell proxy 1203 receives the message, the proxy method unmarshals the parameters and returns to its caller, cell stub 1204. Cell stub 1204 marshals and out-parameters and sends a message to cell proxy 1205. When cell proxy 1205 receives the message, the proxy method unmarshals the parameters and returns to its caller. Thus, whenever process P3 accesses the cell object 1201, the access is routed through process P2.<br/> <br/>
<br/> void IMarshal::MarshalInterface (pstm, iid, pInterface, DestContext)<br/>
As discussed above, the standard IMarshal::Marshallnterface creates a stub and sends the message address of the stub. However, the custom<br/> IMarshal::MarshalInterface simply sends the message address of the stub to which it communicates. Thus, when the custom IMarshal::MarshalInterface of cell proxy 1203 is invoked, the message address of cell stub 1202 is sent to process P3, along with the unmarshal class identifier (CellProxy). When process P3 initializes cell proxy 1205 using the standard unmarshalling method, it stores the message address of cell stub 1202. Thus, when process P3 access cell object 1201, it bypasses process P2.<br/> <br/>
<br/> The custom methods of the IMarshal interface for a cell object are implemented by the following pseudocode.<br/> <br/> void IMarshal::MarshalInterface (pstm, iid, pInterface, DestContext)<br/> { if (DestContext = = Shared) then<br/>
) void IMarshal::GetUnmarshalClass (iid,pInterface, DestContext, cid)<br/> { if (DestContext = = Shared)<br/>
) <br/> The parameter DestContext of the method IMarshal::Marshallnterface indicates whether the data of the cell object is stored in shared memory. If the data is not stored in shared memory, then the equivalent of the standard marshalling is performed. If, however, the data is stored in shared memory, then the address of the shared data is marshalled into the message. The method<br/> IMarshal::GetUnmarshalClass determines the unmarshal class based on whether the data is in shared memory. If the data is not in shared memory, then theCellProxy class is the unmarshal class. If the data is in shared memory, then the<br/> Cell class is the unmarshal class. The unmarshal class and address of the shared data are sent to process P2. After process P2 instantiates the cell object 1303, the process P2 invokes the custom method IMarshal::UnMarshalInterface, which unmarshals the address of the shared data and initializes the object to point to the data. <br/> <br/>
IMarshal::MarshalInterface creates no stub. When the other process receives the message, the other process creates an object of the class of the immutable object.<br/> <br/> The methodIMarshal::UnMarshallnterface then retrieves the data members from the message and initializes the newly-created object. The other process can then access the immutable object.<br/> <br/>
)]] |
Claims
The claims shown below can differ from the final claims filed EPO. Please read the original
documents, if such a difference is of importance.
[[patent( Claims of correspondent: <strong>WO9411810</strong><br/> <br/> <br/> Claims<br/> <br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
)]] |
Comment
Sources
The data shown above was obtained from:
Espacenet bibliography
v3.espacenet PDF source
l2.espacenet bibliography
EPOline register
Epoline dossier
The data in this page was last updated . Read Legal Disclaimer.