Method and system for dynamic proxy classes
First Claim
1. A method in a data processing system comprising the steps of:
- specifying, by a first processing entity at runtime, an interface that is not referenced by the first processing entity, the interface having a method;
generating, at runtime, a class that implements the interface;
creating, by the first processing entity, an instance of the class;
receiving by the class instance a request from a second processing entity to process the method of the interface, wherein the second processing entity has a reference to the interface;
dispatching the request to an object to facilitate processing of the method of the interface; and
returning a result of the processed method by the object to the second processing entity.
2 Assignments
0 Petitions
Accused Products
Abstract
In an object-oriented data processing system, methods and systems in accordance with the present invention provide a proxy class dynamically generated at runtime that implements a list of interfaces specified at runtime such that a method invocation through an interface on an instance of the class is encoded and dispatched uniformly to an object that performs the invocation of the requested method. The generation of the proxy class at runtime and the specification at runtime of the list of interfaces implemented by the proxy class allow the interfaces to be used to be chosen at runtime before generation of the proxy class. Since the proxy class does not need to be created before compile time, the interface list implemented by the proxy class does not need to be known at the time the source code is written.
160 Citations
8 Claims
-
1. A method in a data processing system comprising the steps of:
-
specifying, by a first processing entity at runtime, an interface that is not referenced by the first processing entity, the interface having a method;
generating, at runtime, a class that implements the interface;
creating, by the first processing entity, an instance of the class;
receiving by the class instance a request from a second processing entity to process the method of the interface, wherein the second processing entity has a reference to the interface;
dispatching the request to an object to facilitate processing of the method of the interface; and
returning a result of the processed method by the object to the second processing entity. - View Dependent Claims (2, 3)
-
-
4. A computer-readable medium containing instructions for controlling a data processing system to perform a method comprising the steps of:
-
specifying, by a first processing entity at runtime, an interface that is not referenced by the first processing entity, the interface having a method;
generating, at runtime, a class that implements the interface;
creating, by the first processing entity, an instance of the class;
receiving by the class instance a request from a second processing entity to process the method of the interface, wherein the second processing entity has a reference to the interface;
dispatching the request to an object to facilitate processing of the method of the interface; and
returning a result of the processed method by the object to the second processing entity. - View Dependent Claims (5, 6)
-
-
7. A method in a data-processing system having a proxy class implementing interfaces specified at runtime, the interfaces containing methods, the system further having an instance of the proxy class and an invocation handler object for executing the methods contained by the interfaces, the method comprising the steps of:
-
determining, by a processing entity, a first set of interfaces to be implemented by the proxy class, wherein the first set of interfaces are not referenced by the processing entity;
generating at runtime the proxy class implementing the first set of interfaces;
receiving a request by an instance of the proxy class to invoke a method of an interface included in the first set of interfaces implemented by the proxy class;
dispatching the request to the invocation handler object;
returning a value from the invocation handler object to the proxy class instance; and
returning the value from the proxy class instance to the processing entity.
-
-
8. A data-processing system comprising:
-
means for specifying, by a first processing entity at runtime, an interface that is not referenced by the first processing entity, the interface having a method;
means for generating, at runtime, a class that implements the interface;
means for creating, by the first processing entity, an instance of the class;
means for receiving by the class instance a request from a second processing entity to process the method of the interface, wherein the second processing entity has a reference to the interface;
means for dispatching the request to an object to facilitate processing of the method of the interface; and
means for returning a result of the processed method by the object to the second processing entity.
-
Specification