# Patent

## Title
Proxy object creation and use

## Abstract

Embodiments are discussed for methods, systems, and computer readable media for creating a proxy object, comprising calling a second functionality in a proxy class, creating a proxy object by the second functionality, calling a third functionality by the second functionality, calling a fourth functionality by the third functionality, creating a reference object by the fourth functionality, returning the reference object to the third functionality, associating the reference object to the proxy object by the third functionality, and returning the associated proxy object by the second functionality to a first functionality.

## Background
CROSS-REFERENCE TO RELATED PATENT APPLICATIONS
This application is a divisional of U.S. application Ser. No. 12/787,957, filed May 26, 2010, (issued as U.S. Pat. No. 8,307,380) which is continuation of U.S. application Ser. No. 10/975,623, filed Oct. 28, 2004, (issued as U.S. Pat. No. 7,774,789) both of which are incorporated herein by reference in their entirety.


BACKGROUND
A problem exists in the current art of effectively and efficiently acquiring an initial remote reference to a remote object.
SUMMARY
In some embodiments, a method for creating a proxy object, comprises a second functionality in a proxy class, creating a proxy object by the second functionality, calling a third functionality by the second functionality, calling a fourth functionality by the third functionality, creating a reference object by the fourth functionality, returning the reference object to the third functionality, associating the reference object to the proxy object by the third functionality, and returning the associated proxy object by the second functionality to a first functionality.
In some embodiments, a method for providing information related to a proxy object to a first functionality comprises receiving a lookup URL by a second functionality, calling a third functionality based on the lookup URL, and returning the information based on the called third functionality.
In some embodiments, a computer readable medium comprises instructions for calling a functionality in a proxy class, creating a proxy object by the functionality, creating a reference object by another functionality, and associating the reference object to the proxy object by a further functionality.
In some embodiments, a computer readable medium comprises instructions for receiving a lookup URL, calling a functionality based on the lookup URL, and returning information related to a proxy object based on the called third functionality.
In some embodiments, a system for creating a proxy object, comprises a client adapted to call a second functionality in a proxy class, create a proxy object by the second functionality, create a reference object by a fourth functionality, return the reference object to a third functionality, associate the reference object to the proxy object by the third functionality, and return the associated proxy object by the second functionality to a first functionality.
In some embodiments, a system for providing information related to a proxy object, comprises a server adapted to receive a lookup URL, and call a functionality based on the lookup URL, and a client adapted to receive information from the server based on the called third functionality.



BRIEF DESCRIPTION OF THE DRAWINGS
FIG. 1 depicts a flow diagram of a client performing a remote invocation in accordance with one or more embodiments.
FIG. 2 depicts a flow diagram of a server responding to the client performing the remote invocation in accordance with one or more embodiments.



DETAILED DESCRIPTION
Some embodiments are related to proxy object, and, more specifically to creating a proxy object and providing information related to a proxy object.
According to some embodiments, an architect console is utilized through which at least one proxy and adapter are provided to a selected source. The architect console analyzes source code, methods within classes that will be exposed and selected, and mapping and various generation options for those methods are provided. The analyzing allows a database of classes, method and fields to be built. Based on a received command, all of the proxies, adapters and streamers that will be needed to perform invocations (or example, remote invocations) are generated in an appropriate source language. For example, if a server associated with JAVA code whose functionality is to be exposed to a C++ client, then JAVA adapters are generated for the server, and C++ source code proxies are generated for the client.
Within the proxy of one or more embodiments, initialization code, at least one proxy method, and at least one lookup method exist. The initialization code registers a type of that proxy within the run time, and registers method streamers used to marshal and unmarshal arguments, and return values passed during remote invocations. The proxy methods have the same signature as the business method of the object that is being exposed. As such, the client “believes” that it is accessing the business object directly but is really invoking the business object through the proxy. The lookup method is called by the client in order to acquire a proxy that is found in a naming service.
Within the adapter of one or more embodiments, initialization code, at least one proxy method, and at least one lookup, at least one bind method, and an invoke method, exist. The bind method can be called to register an adapter in the naming service, while the invoke method, which will be called by the run time, will dispatch the invocation to the appropriate business method. Some embodiments create a proxy object and provide information related to a proxy object.
Some embodiments are related to proxy object, and, more specifically to creating a proxy object and providing information related to a proxy object.
According to some embodiments, an architect console is utilized through which at least one proxy and adapter are provided to a selected source. The architect console analyzes source code, methods within classes that will be exposed and selected, and mapping and various generation options for those methods are provided. The analyzing allows a database of classes, method and fields to be built. Based on a received command, all of the proxies, adapters and streamers that will be needed to perform invocations (or example, remote invocations) are generated in an appropriate source language. For example, if a server associated with JAVA code whose functionality is to be exposed to a C++ client, then JAVA adapters are generated for the server, and C++ source code proxies are generated for the client.
Within the proxy of one or more embodiments, initialization code, at least one proxy method, and at least one lookup method exist. The initialization code registers a type of that proxy within the run time, and registers method streamers used to marshal and unmarshal arguments, and return values passed during remote invocations. The proxy methods have the same signature as the business method of the object that is being exposed. As such, the client “believes” that it is accessing the business object directly but is really invoking the business object through the proxy. The lookup method is called by the client in order to acquire a proxy that is found in a naming service.
Within the adapter of one or more embodiments, initialization code, at least one proxy method, and at least one lookup, at least one bind method, and an invoke method, exist. The bind method can be called to register an adapter in the naming service, while the invoke method, which will be called by the run time, will dispatch the invocation to the appropriate business method. Some embodiments create a proxy object and provide information related to a proxy object.
FIG. 1 depicts a flow diagram 10 of a client 12 performing a remote invocation. A method 14a in a business object 16 is called on the client 12 and the business object 16 performs a remote invocation within the method 14a. A proxy method 14 is called on a proxy 18 passing various arguments. The proxy 18, which is generated by an architect console (not shown), calls a super class invoke method (not shown) which performs an invoke method 20 on a reference holder 22. The reference holder 22 is an object that contains information necessary to perform the remote invocation in terms of having the address of the object, being able to acquire a connection to it and sending the data to a server side (not shown) using that connection.
When a remote reference is acquired, either by performing a lookup (described further below) or as the result of the server returning a remote reference through another invocation, the reference information is encapsulated in data that is passed back to the client. The client then uses the information to create the address information, the reference holder and reference, and proxy, to be able to perform that invocation. Some embodiments include a two-layer design for the reference information in that multiple protocols are supported. The reference holder 22 contains the information that is necessary for performing any kind of remote invocation. Protocol specific references 24, such as IRMP reference, SOAP reference, the JAVA run time, and other, are further supported by one or more embodiments. These references 24 provide the mechanism to perform communication in the appropriate messaging protocol for that type of reference. For example, a SOAP reference takes an invocation consisting of the proxy 18 which is being invoke on, and the arguments. A connection 32 (such a TCP connection) to the server is acquired 30 (via a transport 28) based on the address of the proxy 18 that is being invoked on. The message is then sent 34 in the appropriate protocol via the connection 32 and a response 36 from the connection is received.
The appropriate protocol for a reference is decided upon when a lookup is performed or when a remote invocation returns a remote reference. During such instances, information is received, such as the address information, that is used to create a reference of the appropriate type. In the case of a lookup, part of the information that is passed includes the naming protocol to use. The naming protocol is associated with a messaging protocol.
If a server is returning a remote reference to the client as part of an invocation, and since the remote reference is going to be processed by a SOAP reference or an IRMP reference, for example, the server will already know this fact. In a naming service, when a lookup is performed, information is passed that is in a URL format. For example, in an irmp://host:port/name URL would be passed to perform in a lookup in the IRMP protocol. When a reference (IRMP or SOAP, for example) sends the invocation out across the network, it marshals the arguments in the appropriate protocol format (IRMP or SOAP), and sends any other necessary information to perform the invocation across the network to the server. Using the message streamer registered in the proxy initialization code, the argument types that are being passed can be ascertained and those streamers are able to marshal the argument of that type in the appropriate protocol As such, streamers for native primitive object types (such as integer and string for both IRMP and SOAP) exist and if custom types exist that will be passed back and forth, then streamers for those types would be present as well. When a response is received, any objects that were returned by the server are unmarshaled using the appropriate streamer.
The initialization code for the proxy consists of registering a type within the run time and registering method streamers for every method that the proxy exposes. The type is the unique string that uniquely identifies that type. This allows the distributed system of one or more embodiments to be cross-language and permits the mapping from a generic cross-language type to the appropriate language-specific type.
Referring now to FIG. 2, a flow diagram 40 of a server 42 responding to the client 12 performing the remote invocation is depicted. A request manager 44, which is associated with the connection 32, is adapted to receive incoming invocations via the connection. When the request manager 44 beings to receive an incoming invocation, it inquires as to the ability of each request handler 46 (which is protocol specific and is a counter-part to the client side protocol specific reference 24) to process 48 the incoming invocation. If a request handler 46 is able to process the invocation, the connection is handed off to the appropriate request handler 46. The request handler 46 received the incoming invocation from the connection 32 and reads the request off of the stream. In other words, the request handler 46 is reading the data off the socket and turning it into actual invocation data that is going to be processed. The request handler 46 uses streamers as the client 12 with an exception that where the client is streaming language-specific objects to protocol-specific data, the streaming occurs from protocol-specific to language-specific. In addition, the streamers may have been in a different language to the client side streamers, for example Java instead of C++. The invocation includes information such as the arguments and other information that is necessary to uniquely resolve the object that will be invoked and perform the invocation.
Once this information is received, an adapter 58 for that object is obtained from an ORB server 54 that maintains a mapping between an object ID and the adapter for that object. Based on the foregoing, the adapter that is going to be invoked is determined. The request handler 46 performs an invocation 56 which is received by the adapter 58 which is comprised of code generated from the architect console. The code, based on the operation that is being performed, calls a particular method 60 on the actual business object 62. At this point, the actual business method is called with the arguments and performs a particular operation such as, for example, transferring money from one account to another account. A response 64 is returned to the client 12 via the request handler 46 and the connection 32. The client decodes the response 64 concluding the remote invocation.
In one or more embodiments, a method for a first functionality (such as a client) in a programming language to perform operations within a second functionality (such as a server) in the programming language or in a different programming language comprises creating an adapter object for the second functionality, binding the adapter object within a naming service, looking-up a proxy object for the adapter object, and calling the second functionality through the proxy object by the first functionality. The second functionality can also be called through the adapter by the first functionality. The binding includes associating the adapter object to a URL within the naming service.
The adapter object further includes means to call the second functionality, wherein the second functionality is a business object, and wherein the business object consists of at least one operation. The means to call the second functionality includes at least one of: mapping a required name of the operation to the operation, and calling the operation with optional information to be passed to the operation, wherein the information includes arguments to the operation, and wherein the operation is a business method.
The adapter object and the second functionality are instances of classes, wherein the classes are in the same programming language. Further, the proxy object and the first functionality are instances of classes, wherein the classes are in the same programming language.
In a further embodiment, a computer readable medium comprise instructions for creating an adapter object for a second functionality, binding the adapter object within a naming service, wherein the binding associates the adapter object to a URL, looking-up a proxy object for the adapter object based on the URL, providing the proxy object to a first functionality, and calling the second functionality through the proxy object by the first functionality. The computer readable medium further comprises performing operations by the first functionality in a programming language within a second functionality in the programming language or in a different programming language.
The discussion will now center on how a lookup is performed via the client 12 to resolve the appropriate type of messaging protocol that will be used. Although not depicted, the client 12 can perform the lookup to obtain the proxy within the business object itself or elsewhere and then provide the proxy to the business object. When the proxy's lookup method passes in the URL format (consisting of an optional scheme-specific portion and a required scheme-specific portion), a client side naming service extracts the scheme, looks up a client side naming service using that scheme and then passes the lookup to that client type naming service. Effectively, a naming service interface exists which includes the aforementioned lookup method (as well as other methods) and implementations of the naming service (such as the IRMP naming service and the SOAP naming service, for example) which provide the implementation of that lookup using the messaging protocol associated with that naming service. For example, if an IRMP naming service is being used to perform a lookup, the IRMP naming service performs a remote invocation using the IRMP protocol to obtain the remote reference to that object.
This remote invocation is a static invocation whereby a name space class exists on a server as well as on the client. The name space class contains static methods for naming service operations including, lookup, bind, unbind, and rebind, as well as a registry of naming services. As such, when a lookup is performed, the name space class resolves the appropriate naming service and then hands off the lookup invocation to that naming service. The remote invocation is unique as it provides a simple, single point of entry for all naming service operations. In contrast, systems including an object request broker require a plurality of steps to be taken before naming service type operations can occur. One or more embodiments provide the static methods directly through the name space class. The use of static methods allows a lookup to be performed in as few steps as possible.
Once the server receives the lookup operation (utilizing the name space class), it extracts the scheme and then hands off the invocation to the IRMP naming service. The URL, which is local to this process and includes the scheme which is used by the name space to get the appropriate naming service, is received by a directory which returns the actual proxy back to the client via the previously described mechanism.
The naming service is a combination of a naming and directory service, which is capable of being federated across multiple processes. Using the IRMP naming service as an example, if a lookup is performed on the URL irmp://server/hotels/Dallas/Radisson, the portions of the URL include a scheme (irmp) as well as scheme specific portions including a host (server), a path (hotels/Dallas), and a name (Radisson). Once the host is reached, the rest of the URL is passed to the director which breaks the rest of the URL down into individual components. Let us assume that within the server (the primary server) a directory of hotels exists and that another server, which is running in Dallas, includes a directory called Dallas. When the server in Dallas is initiated, it starts up its directory and binds that directory into the primary server. Therefore, looking at the actual objects on the server, a directory with the name hotels exists with a directory proxy positioned beneath it with the name of Dallas. When the top level hotels directory receives a lookup, it is broken up with the rest of the URL passed off to the directory proxy. Since the Dallas directory is a proxy, it will perform a remote invocation to the server in Dallas which actually includes the Radisson name beneath it. Thus, the proxy is returned from the server to the client via the primary server.
A federated naming service is thus provided where a client only needs to know a URL or a host of the primary server. Service for every city can then be bound into either of those references transparently to the client. Basically, the business object is bound to the bind method which creates an adapter wrapping that business object and binds the adapter into the naming service. Similarly, the server that starts up in Dallas includes an indicator (via, for example, software) that is aware of the primary server. However, the code that binds the Radisson Hotel beneath Dallas only needs to be aware of the directory which it binds itself into regardless of where that directory is actually located. When the server performs a bind to an adapter (such as a bind to server/hotels/Dallas/Radisson), it needs to know the full path but it does not need to know that Dallas is actually being hosted on a server in Dallas.
In some embodiments, with respect to the lookup method, a method for creating a proxy object comprises calling a second functionality (such as a method in a proxy class), creating a proxy object by the second functionality, calling a third functionality (such as a method in a naming service registry class) by the second functionality, calling a fourth functionality (such as a method in a naming service implementation class) by the third functionality, creating a reference object by the fourth functionality, returning the reference object to the third functionality, associating the reference object to the proxy object by the third functionality, and returning the associated proxy object by the second functionality to a first functionality (such as an object of a class).
The method further includes by passing a URL to the second functionality, passing the proxy object and the URL to the third functionality, wherein the URL includes at least one of an optional scheme portion and a required scheme-specific portion, mapping the scheme portion to a naming service implementation, and passing the URL to the fourth functionality by the third functionality, wherein the naming service implementation contains the fourth functionality.
In some embodiments, with respect to the lookup method, a method for providing information related to a proxy object to a first functionality (such as a client) comprises receiving a lookup URL by a second functionality (such as a directory naming service or, for example, an IRMP Naming Service), calling a third functionality based on the lookup URL, and returning the information based on the called third functionality. The information, which includes an address of the object, wherein the address includes an URL and an object ID related to the proxy, is returned to the first functionality which utilizes the URL and the object ID to construct a proxy object.
The lookup URL is at least one of a local lookup URL and a remote lookup URL. The third functionality described above is a local directory if the lookup URL is local, wherein the lookup URL is local if there is a server socket running on the lookup URL that is local to the process. Conversely, the third functionality is a remote directory if the lookup URL is remote, wherein the lookup URL is remote if there is a sever socket running on the lookup URL that is remote to the process.
Calling the third functionality consists of utilizing the lookup URL to obtain the information, or, more specifically, splitting the lookup URL to obtain the information at a path level for the third functionality, wherein the third functionality includes a name related to the path. A directory splits the URL at a path level. Each directory name in the path (hotels/Dallas) is associated with a particular directory and the remainder of the URL is provided to each directory until the directory that is reached that has the actual entry in it. That directory then looks up the entry (Radisson). This occurs whether the URL is local or remote.
Although example embodiments of systems, methods, and computer readable media have been illustrated in the accompanied drawings and described in the foregoing detailed description, it will be understood that embodiments are not limited to those disclosed, but are capable of numerous rearrangements, modifications, and substitutions without departing from the spirit of the embodiments as set forth and defined by the following claims. For example, the capabilities of the client 12 and/or the server 42 can be performed by one or more modules in a distributed architecture and on or via any device able to transfer information between the client and the server. Further, the functionality performed by the elements within the client 12 and/or the server 42 may be performed by one or more of the elements such as the reference holder 22 or the request handler 46.

## Claims

1. A device-implemented method comprising:
associating an address with an adapter for a business object at a first resource;
performing a lookup using the address to determine a proxy object for the adapter; and

communicating the proxy object for receipt at a second resource that is remote from the first resource, the proxy object being configured to enable the second resource to invoke one or more functionalities of the business object via the adapter.

2. The device-implemented method of claim 1, wherein associating the address with the adapter comprises associating a uniform resource locator (URL) and an ID for the business object with the address.

3. The device-implemented method of claim 1, wherein performing the lookup using the address to determine the proxy object for the adapter comprises associating a proxy method with the proxy object.

4. The device-implemented method of claim 1, wherein performing the lookup using the address to determine the proxy object for the adapter comprises determining a messaging protocol associated with the address.

5. The device-implemented method of claim 1, wherein performing the lookup using the address to determine the proxy object for the adapter comprises:
determining a URL associated with the address; and
inspecting the URL to determine a directory location associated with the proxy object.

6. The device-implemented method of claim 1, further comprising:
receiving a request to invoke a method associated with the business object;
processing the request to determine one or more arguments included with the request; and
passing the one or more arguments to the business object for processing.

7. A non-transitory computer-readable medium having instructions stored thereon, the instructions comprising:
instructions to associate an address with an adapter for a business object at a first resource;
instructions to perform a lookup using the address to determine a proxy object for the adapter; and
instructions to communicate the proxy object for receipt at a second resource that is remote from the first resource, the proxy object being configured to enable the second resource to invoke one or more functionalities of the business object via the adapter.

8. The non-transitory computer-readable medium of claim 7, wherein instructions to associate the address with the adapter comprise instructions to associate a uniform resource locator (URL) and an ID for the business object with the address.

9. The non-transitory computer-readable medium of claim 7, wherein instructions to perform the lookup using the address to determine the proxy object for the adapter comprise instructions to associate a proxy method with the proxy object.

10. The non-transitory computer-readable medium of claim 7, wherein instructions to perform the lookup using the address to determine the proxy object for the adapter comprise instructions to determine a messaging protocol associated with the address.

11. The non-transitory computer-readable medium of claim 7, wherein instructions to perform the lookup using the address to determine the proxy object for the adapter comprise:
instructions to determine a URL associated with the address; and
instructions to inspect the URL to determine a directory location associated with the proxy object.

12. The non-transitory tangible computer-readable medium of claim 7, further comprising:
instructions to receive a request to invoke a method associated with the business object;
instructions to process the request to determine one or more arguments included with the request; and

instructions to pass the one or more arguments to the business object for processing.