jdk/src/share/classes/sun/tools/attach/HotSpotVirtualMachine.java
/*
* Load agent library
* If isAbsolute is true then the agent library is the absolute path
* to the library and thus will not be expanded in the target VM.
* if isAbsolute is false then the agent library is just a library
* name and it will be expended in the target VM.
*/
private void loadAgentLibrary(String agentLibrary, boolean isAbsolute, String options)
throws AgentLoadException, AgentInitializationException, IOException
{
{- -------------------------------------------
(1) execute() (を各サブクラスがオーバーライドしたもの) を呼び出し,
HotSpot に "load" 処理を実行させる
(= agentLibrary 引数で指定されたライブラリを HotSpot にロードさせる)
---------------------------------------- -}
InputStream in = execute("load",
agentLibrary,
isAbsolute ? "true" : "false",
options);
{- -------------------------------------------
(1) HotSpot との通信用 InputStream を閉じる.
また, execute() の結果がエラーだった場合は AgentInitializationException をスローする.
---------------------------------------- -}
try {
int result = readInt(in);
if (result != 0) {
throw new AgentInitializationException("Agent_OnAttach failed", result);
}
} finally {
in.close();
}
}
This document is available under the GNU GENERAL PUBLIC LICENSE Version 2.