Classloader/instrumentation approach for invoking non-bound libraries
First Claim
1. A computer-implemented method for accessing an application, the method comprising:
- at an agent, receiving a reference to an application object of the application from instrumentation of the application, and identifying a class loader of the application from the reference;
and based on the reference, performing a process which allows the agent to invoke one or more methods of the application object, the performing the process comprising;
determining if byte code of a helper class and byte code of a helper object are in a repository, indexed to the class loader of the application;
if the byte code of the helper class and the byte code of the helper object have previously been created and are present in the repository, indexed to the class loader of the application, retrieving byte code of the helper class and byte code of the helper object from the repository;
if the byte code of the helper class and the byte code of the helper object are not found in the repository, creating a helper class loader and setting a parent class loader of the helper class loader as the class loader of the application, using the helper class loader to obtain and load the byte code of the helper class, using the loaded byte code of the helper class to define the byte code of the helper object, and storing the byte code of the helper class and the byte code of the helper object in the repository, indexed to the class loader of the application;
and invoking the one or more methods of the application object, wherein the agent invokes the one or more methods of the application object by class casting the helper object and invoking the one or more methods of the application object on the helper object casted, without having a direct class loader connection with the application object.
2 Assignments
0 Petitions
Accused Products
Abstract
An agent object can invoke one or more methods of an application object using a helper object. The application object passes a reference to itself to the agent object. The agent object identifies a class loader of the application from the reference. The agent object obtains byte code of a helper class and uses the byte code of the helper class to creating a helper class loader. A parent of the helper class loader is set as the class loader of the application. The helper class loader is used to load the helper class and define an instance of the helper object. Using the helper object, the one or more methods of the application object are invoked by the agent using casting, without having a direct class loader connection with the class loader of the application.
-
Citations
20 Claims
-
1. A computer-implemented method for accessing an application, the method comprising:
-
at an agent, receiving a reference to an application object of the application from instrumentation of the application, and identifying a class loader of the application from the reference; and based on the reference, performing a process which allows the agent to invoke one or more methods of the application object, the performing the process comprising; determining if byte code of a helper class and byte code of a helper object are in a repository, indexed to the class loader of the application; if the byte code of the helper class and the byte code of the helper object have previously been created and are present in the repository, indexed to the class loader of the application, retrieving byte code of the helper class and byte code of the helper object from the repository; if the byte code of the helper class and the byte code of the helper object are not found in the repository, creating a helper class loader and setting a parent class loader of the helper class loader as the class loader of the application, using the helper class loader to obtain and load the byte code of the helper class, using the loaded byte code of the helper class to define the byte code of the helper object, and storing the byte code of the helper class and the byte code of the helper object in the repository, indexed to the class loader of the application; and invoking the one or more methods of the application object, wherein the agent invokes the one or more methods of the application object by class casting the helper object and invoking the one or more methods of the application object on the helper object casted, without having a direct class loader connection with the application object. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15)
-
-
16. A computing device, comprising:
-
a storage device which stores software instructions; and a processor associated with the storage device, the processor is configured to execute the software instructions to; receive, at an agent, a reference to an application object of an application from instrumentation of the application, and identify a class loader of the application from the reference; determine if byte code of a helper class and a helper object are in a repository, indexed to the class loader of the application; if the byte code of the helper class and the helper object are in the repository, indexed to the class loader of the application, retrieve the byte code of the helper class and the helper object from the repository; if the byte code of the helper class and the helper object are not in the repository, create a helper class loader and setting a parent class loader of the helper class loader as the class loader of the application, and use the helper class loader to obtain and load the byte code of the helper class and the helper object from the repository; and invoke one or more methods of the application object, wherein the agent, to invoke the one or more methods of the application object, class casts the helper object and invokes the one or more methods of the application object on the helper object casted. - View Dependent Claims (17, 18, 19)
-
-
20. A computer-implemented method for accessing an application, comprising:
-
at an agent, receiving a reference to an application object of the application from instrumentation of the application, and identifying a class loader of the application from the reference; creating a helper class loader and setting a parent class loader of the helper class loader as the class loader of the application, responsive to the identifying; using the helper class loader to obtain and load byte code of a helper class; using the loaded byte code of the helper class to define a helper object; and using the helper object, invoking the one or more methods of the application object, wherein the helper class loader overrides a findClass method of java.lang.ClassLoader so that the helper class loader uses the loaded byte code of the helper class to define the helper class, and the agent invokes the one or more methods of the application object by class casting the helper object and invoking the one or more methods of the application object on the helper object casted, without having a direct class loader connection with the application object.
-
Specification