Examples of loadAgent()


Examples of com.sun.tools.attach.VirtualMachine.loadAgent()

        for (Integer pid : pids) {
          log.log(Level.INFO, "Attaching to remote process " + pid);
          VirtualMachine vm = VirtualMachine.attach("" + pid);
          String options = sb.toString();
          log.log(Level.INFO, "Loading agent with command " + options + " as agent " + agentFile.getCanonicalPath());
          vm.loadAgent(agentFile.getCanonicalPath(), options);
        }
        shell = null;
      }
    } else {
      final Bootstrap bootstrap = new Bootstrap(
View Full Code Here

Examples of com.sun.tools.attach.VirtualMachine.loadAgent()

            }
        }

        agent = f.getCanonicalPath();
        try {
            vm.loadAgent(agent, "com.sun.management.jmxremote");
        } catch (AgentLoadException x) {
            throw new IOException(x.getMessage(), x);
        } catch (AgentInitializationException x) {
            throw new IOException(x.getMessage(), x);
        }
View Full Code Here

Examples of com.sun.tools.attach.VirtualMachine.loadAgent()

        agentArgs.append(" ");
      }
      agentArgs.append(stagerArgs[i]);
    }
    final VirtualMachine vm = VirtualMachine.attach(pid);
    vm.loadAgent(agentPath, agentArgs.toString());
    vm.detach();
    loader.handleAfter(loader.stageHandler.consoleErr, null);
  }

  public static void listVMs(PrintStream out) {
View Full Code Here

Examples of com.sun.tools.attach.VirtualMachine.loadAgent()

            }
        }

        agent = f.getCanonicalPath();
        try {
            vm.loadAgent(agent, "com.sun.management.jmxremote");
        } catch (AgentLoadException x) {
            throw new IOException(x.getMessage(), x);
        } catch (AgentInitializationException x) {
            throw new IOException(x.getMessage(), x);
        }
View Full Code Here

Examples of com.sun.tools.attach.VirtualMachine.loadAgent()

        try {
            vm = VirtualMachine.attach(id);
            String connectorAddr = vm.getAgentProperties().getProperty(PROP_LOCAL_CONNECTOR_ADDRESS);
            if (connectorAddr == null && startAgent) {
                final String agent = Paths.get(vm.getSystemProperties().getProperty(PROP_JAVA_HOME)).resolve(MANAGEMENT_AGENT).toString();
                vm.loadAgent(agent);
                connectorAddr = vm.getAgentProperties().getProperty(PROP_LOCAL_CONNECTOR_ADDRESS);
            }
            final JMXServiceURL url = connectorAddr != null ? new JMXServiceURL(connectorAddr) : null;
            vm.detach();
            return url;
View Full Code Here

Examples of com.sun.tools.attach.VirtualMachine.loadAgent()

            }
        }

        agent = f.getCanonicalPath();
        try {
            vm.loadAgent(agent, "com.sun.management.jmxremote");
        } catch (AgentLoadException x) {
            throw new IOException(x.getMessage(), x);
        } catch (AgentInitializationException x) {
            throw new IOException(x.getMessage(), x);
        }
View Full Code Here

Examples of com.sun.tools.attach.VirtualMachine.loadAgent()

        if (connectorAddress == null) {
            String agent = vm.getSystemProperties().getProperty(
                    "java.home") + File.separator + "lib" + File.separator +
                    "management-agent.jar";
            try {
                vm.loadAgent(agent);
            } catch (Exception e) {
                throw new IllegalStateException("Exception loading agent " + agent);
            }
            connectorAddress = vm.getAgentProperties().getProperty(
                    "com.sun.management.jmxremote.localConnectorAddress");
View Full Code Here

Examples of com.sun.tools.attach.VirtualMachine.loadAgent()

      }
      else {
        vm = VirtualMachine.attach(pid);
      }

      vm.loadAgent(jarFilePath, params);
      vm.detach();
    } catch (Exception e) {
      throw new RuntimeException(e);
    }
  }
View Full Code Here

Examples of com.sun.tools.attach.VirtualMachine.loadAgent()

        }

        try {
            String agent = ApmAgentLauncher.class.getProtectionDomain().getCodeSource().getLocation().getPath();
            System.err.println("Trying to load agent " + agent);
            vm.loadAgent(agent, args);
            System.out.println("Agent successfully loaded");
        } catch (AgentLoadException x) {
            IOException ioe = new IOException(x.getMessage());
            ioe.initCause(x);
            throw ioe;
View Full Code Here

Examples of com.sun.tools.attach.VirtualMachine.loadAgent()

          .getProperty("java.home")
          + File.separator
          + "lib"
          + File.separator
          + "management-agent.jar";
      vm.loadAgent(agent);

      // agent is started, get the connector address
      connectorAddress = vm.getAgentProperties().getProperty(CONNECTOR_ADDRESS);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.