private InputStream executeCommand(String cmd, Object ... args) throws IOException { try { return execute(cmd, args); } catch (AgentLoadException x) { throw new InternalError("Should not get here"); } }
/** * Convenience method for simple commands. */ private InputStream executeCommand(String cmd, Object... args) throws IOException { try { return execute(cmd, args); } catch (AgentLoadException ignore) { throw new InternalError("Should not get here"); } }
private void loadAgentLibrary(String agentLibrary, boolean isAbsolute, String options) throws AgentLoadException, AgentInitializationException, IOException { InputStream in = execute("load", agentLibrary, isAbsolute ? "true" : "false", options); try { int result = readInt(in); if (result != 0) { throw new AgentInitializationException("Agent_OnAttach failed", result); } } finally { in.close(); } }
/** * 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 { InputStream in = execute("load", agentLibrary, isAbsolute ? "true" : "false", options); try { int result = readInt(in); if (result != 0) { throw new AgentInitializationException("Agent_OnAttach failed", result); } } finally { in.close(); } }