Top


定義場所(file name)

jdk/src/share/classes/sun/tools/attach/HotSpotVirtualMachine.java

説明(description)

    /*
     * 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.
     */

名前(function name)

    private void loadAgentLibrary(String agentLibrary, boolean isAbsolute, String options)
        throws AgentLoadException, AgentInitializationException, IOException
    {

本体部(body)

  {- -------------------------------------------
  (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.