Dynamic generation of wrapper classes to implement call-by-value semantics
First Claim
1. A method for supporting method invoking between software objects, comprising:
- receiving a request, from a first software object in a first software module on a virtual machine, to access a second software object in a second software module on the virtual machine, wherein the request contains a method invocation using a parameter object and call-by-value semantics, wherein the parameter object is located in the first software module in the virtual machine;
performing introspection on the second software object to identify one or more interfaces for communicating therewith;
dynamically generating a wrapper object for the second software object on the virtual machine where the first software module and the second software module are collocated, wherein the wrapper object is configured to communicate with the second software object based on the one or more identified interfaces, wherein the dynamically generated wrapper object operates tointercept communication between the first and second software objects, andoptimize the parameter object based on the type thereof, wherein the optimization includesdetermining if the parameter object is immutable, and if it is, passing a reference of the parameter object to the second software object, so that the second software object can access the parameter object in the software module,determining if the parameter object is mutable and can be cloned, and if it is, creating a clone thereof and passing the clone to the second software object, anddetermining if the parameter object is mutable but cannot be cloned, and if it cannot be cloned, serializing the parameter object and passing the serialized object to the second software object; and
providing the first software object with a reference to the wrapper object, instead of a direct reference to the second software object, so that the first software object accesses the second software object using the wrapper object.
2 Assignments
0 Petitions
Accused Products
Abstract
A system and method for dynamically generating proxy classes in order to enforce call-by-value semantics between clients and EJBs collocated with a virtual machine. The virtual machine can be a Java virtual machine (JVM) or some other type of virtual machine. The proxy classes are dynamically generated at runtime using dynamic byte code generation. Generated proxies are then interposed between a client and an EJB. The interposition of the generated proxies allows the proxies to intercept communication between the client and the EJB. The dynamically generated wrapper classes may be used in any system wherein a first entity invokes a second entity, wherein the second entity has an interface that can be retrieved or introspected and utilizes call-by-value semantics.
-
Citations
15 Claims
-
1. A method for supporting method invoking between software objects, comprising:
-
receiving a request, from a first software object in a first software module on a virtual machine, to access a second software object in a second software module on the virtual machine, wherein the request contains a method invocation using a parameter object and call-by-value semantics, wherein the parameter object is located in the first software module in the virtual machine; performing introspection on the second software object to identify one or more interfaces for communicating therewith; dynamically generating a wrapper object for the second software object on the virtual machine where the first software module and the second software module are collocated, wherein the wrapper object is configured to communicate with the second software object based on the one or more identified interfaces, wherein the dynamically generated wrapper object operates to intercept communication between the first and second software objects, and optimize the parameter object based on the type thereof, wherein the optimization includes determining if the parameter object is immutable, and if it is, passing a reference of the parameter object to the second software object, so that the second software object can access the parameter object in the software module, determining if the parameter object is mutable and can be cloned, and if it is, creating a clone thereof and passing the clone to the second software object, and determining if the parameter object is mutable but cannot be cloned, and if it cannot be cloned, serializing the parameter object and passing the serialized object to the second software object; and providing the first software object with a reference to the wrapper object, instead of a direct reference to the second software object, so that the first software object accesses the second software object using the wrapper object. - View Dependent Claims (2, 3, 4, 5)
-
-
6. A non-transitory computer-readable storage medium, storing instructions for supporting communication between objects, the instructions comprising:
-
receiving a request, from a first software object in a first software module on a virtual machine, to access a second software object in a second software module on the virtual machine, wherein the request contains a method invocation using a parameter object and call-by-value semantics, wherein the parameter object is located in the first software module in the virtual machine; performing introspection on the second software object to identify one or more interfaces for communicating therewith; dynamically generating a wrapper object for the second software object on the virtual machine where the first software module and the second software module are collocated, wherein the wrapper object is configured to communicate with the second software object based on the one or more identified interfaces, wherein the dynamically generated wrapper object operates to intercept communication between the first and second software objects, and optimize the parameter object based on the type thereof, wherein the optimization includes determining if the parameter object is immutable, and if it is, passing a reference of the parameter object to the second software object, so that the second software object can access the parameter object in the first software module, determining if the parameter object is mutable and can be cloned, and if it is, creating a clone thereof and passing the clone to the second software object, and determining if the parameter object is mutable but cannot be cloned, and if it cannot be cloned, serializing the parameter object and passing the serialized object to the second software object; and providing the first software object with a reference to the wrapper object, instead of a direct reference to the second software object, so that the first software object accesses the second software object using the wrapper object. - View Dependent Claims (7, 8, 9, 15)
-
-
10. A system to support invoking between software objects, comprising:
-
one or more microprocessors; and a virtual machine running on the one or more microprocessors, wherein a container on the virtual machine is configured to perform a method to; receive request, from a first software object in a first software module on a virtual machine, to access a second software object in a second software module on the virtual machine, wherein the request contains a method invocation using a parameter object and call-by-value semantics, and wherein the parameter object is located in the first software module on the virtual machine, perform introspection on the second software object to identify one or more interfaces for communicating therewith, dynamically generate a wrapper object for the second software object on the virtual machine where the first software module and the second software module are collocated, wherein the wrapper object is configured to communicate with the second software object based on the one or more identified interfaces, wherein the dynamically generated wrapper object operates to intercept communication between the first software object and the second software object, and optimize the parameter object based on the type thereof, wherein the optimization includes determining if the parameter object is immutable, and if it is, passing a reference of the parameter object to the second software object, so that the second software object can access the parameter object in the first software module, determining if the parameter object is mutable and can be cloned, and if it is, creating a clone thereof and passing the clone to the another software object, and determining if the parameter object is mutable but cannot be cloned, and if it cannot be cloned, serializing the parameter object and passing the serialized object to the another software object, and provide the first software object with a reference to the wrapper object, instead of a direct reference to the second software object, so that the first software object accesses the second software object using the wrapper object. - View Dependent Claims (11, 12, 13, 14)
-
Specification