Platform equivalent of a dynamic library. Load a native agent library by full pathname. ![]() AgentInitializationException.returnValue().IOException - If an I/O error occurs NullPointerException - If agentLibrary is null. AgentInitializationException - If the Agent_OnAttach function returns an error. Statically linked with the VM, or the agent library cannot be Throws: AgentLoadException - If the agent library does not exist, the agent library is not options - The options to provide to the Agent_OnAttachįunction (can be null). Parameters: agentLibrary - The name of the agent library. The return value from the Agent_OnAttach can then be If the Agent_OnAttach function in the agent library returnsĪn error then an AgentInitializationException is Statically linked into the VM then the VM must export a function named LibL.so, and located using the search path specified by the For example, on UNIX systems, the name L might be expanded to Implementation will expand the library name into an operating system specific file In the target virtual machine in an implementation-dependent manner. The agent library provided is the name of the agent library. Or, for a statically linked agent named 'L', the Agent_OnAttach_L functionįunction is invoked even if the agent library was loaded prior to invoking It then causes the target VM to invoke the Agent_OnAttach function VM (if not already loaded or if not statically linked into the VM). This method causes the given agent library to be loaded into the target Alternatively, it may be statically linked into the VM. It is developed in a native language.Ī JVM TI agent is deployed in a platform specific manner but it is typically the IOException - If an I/O error occurs NullPointerException - If id is null.Ĭlient is called an agent. Providers throws AttachNotSupportedException, or AttachNotSupportedException - If the attachVirtualmachine method of all installed Throws: SecurityException - If a security manager has been installed and it deniesĪttachPermission ("attachVirtualMachine"), or another permission Returns: A VirtualMachine representing the target VM. Parameters: id - The abstract identifier that identifies the Java virtual machine. This exception is also thrown ifĪttachProvider.providers() returns an empty list. The identifier provided to this method is invalid, or the identifierĬorresponds to a Java virtual machine that does not exist, or none This means that AttachNotSupportedException is thrown when Then this method also throws AttachNotSupportedException. If the attachVirtualMachine method of all providers throws If a provider successfullyĪttaches then the iteration terminates, and the VirtualMachine createdīy the provider that successfully attached is returned by this method. It then iterates overs the listĪnd invokes each provider's attachVirtualMachine method in turn. This method obtains the list of attach providers by invoking theĪttachProvider.providers() method. Finally, theĪ VirtualMachine is safe for use by multiple concurrent threads. Started in the target process using the supplied arguments. In this example we attach to a Java virtual machine that is identified by VirtualMachine vm = VirtualMachine.attach("2177") The following example demonstrates how VirtualMachine may be used: Used to construct the path to agent that will be loaded into the target VM. This can be useful in some environments where properties such as In addition to loading agents a VirtualMachine provides read access to the LoadAgentPath methods are used to load agents thatĪre deployed either in a dynamic library or statically linked into the VM and for a detailed description on how these agentsĪre loaded and started). The loadAgent method is used to load agents that are written in the Java ![]() Methods are used to load agents into target virtual machine. Once a reference to a virtual machine is obtained, the loadAgent, Implementation-dependent but is typically the process identifier (or pid) inĮnvironments where each Java virtual machine runs in its own operating system process.Īlternatively, a VirtualMachine instance is obtained by invoking theĪttach method with a VirtualMachineDescriptor obtainedįrom the list of virtual machine descriptors returned by the list method. With an identifier that identifies the target virtual machine. Profiler agent to profile the running application.Ī VirtualMachine is obtained by invoking the attach method Written in the Java Language might attach to a running application and load its VirtualMachine to load an agent into the target VM. The Java virtual machine to which it isĪttached is sometimes called the target virtual machine, or target VM.Īn application (typically a tool such as a managemet console or profiler) uses a ![]() A VirtualMachine represents a Java virtual machine to which this
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |