com.sun.jdi.connect.LaunchingConnector Java Examples

The following examples show how to use com.sun.jdi.connect.LaunchingConnector. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ChildSession.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
static private VirtualMachine generalGetVM(OutputListener diagnostics,
                                           LaunchingConnector connector,
                                           Map<String, Connector.Argument> arguments) {
    VirtualMachine vm = null;
    try {
        diagnostics.putString("Starting child.");
        vm = connector.launch(arguments);
    } catch (IOException ioe) {
        diagnostics.putString("Unable to start child: " + ioe.getMessage());
    } catch (IllegalConnectorArgumentsException icae) {
        diagnostics.putString("Unable to start child: " + icae.getMessage());
    } catch (VMStartException vmse) {
        diagnostics.putString("Unable to start child: " + vmse.getMessage() + '\n');
        dumpFailedLaunchInfo(diagnostics, vmse.process());
    }
    return vm;
}
 
Example #2
Source File: GetObjectLockCount.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Return the launching connector's arguments.
 */
static Map <String,Connector.Argument> connectorArguments(LaunchingConnector connector, String mainArgs) {
    Map<String,Connector.Argument> arguments = connector.defaultArguments();

    Connector.Argument mainArg = (Connector.Argument)arguments.get("main");
    if (mainArg == null) {
        throw new Error("Bad launching connector");
    }
    mainArg.setValue(mainArgs);

    Connector.Argument optionsArg = (Connector.Argument)arguments.get("options");
    if (optionsArg == null) {
        throw new Error("Bad launching connector");
    }
    optionsArg.setValue(ARGUMENTS);
    return arguments;
}
 
Example #3
Source File: ChildSession.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
static private VirtualMachine generalGetVM(OutputListener diagnostics,
                                           LaunchingConnector connector,
                                           Map<String, Connector.Argument> arguments) {
    VirtualMachine vm = null;
    try {
        diagnostics.putString("Starting child.");
        vm = connector.launch(arguments);
    } catch (IOException ioe) {
        diagnostics.putString("Unable to start child: " + ioe.getMessage());
    } catch (IllegalConnectorArgumentsException icae) {
        diagnostics.putString("Unable to start child: " + icae.getMessage());
    } catch (VMStartException vmse) {
        diagnostics.putString("Unable to start child: " + vmse.getMessage() + '\n');
        dumpFailedLaunchInfo(diagnostics, vmse.process());
    }
    return vm;
}
 
Example #4
Source File: FieldMonitor.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
  * Return the launching connector's arguments.
  */
static Map <String,Connector.Argument> connectorArguments(LaunchingConnector connector, String mainArgs) {
     Map<String,Connector.Argument> arguments = connector.defaultArguments();
     for (String key : arguments.keySet()) {
       System.out.println(key);
     }

     Connector.Argument mainArg = (Connector.Argument)arguments.get("main");
     if (mainArg == null) {
         throw new Error("Bad launching connector");
     }
     mainArg.setValue(mainArgs);

     Connector.Argument optionsArg = (Connector.Argument)arguments.get("options");
     if (optionsArg == null) {
       throw new Error("Bad launching connector");
     }
     optionsArg.setValue(ARGUMENTS);
     return arguments;
 }
 
Example #5
Source File: ChildSession.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
static private VirtualMachine generalGetVM(OutputListener diagnostics,
                                           LaunchingConnector connector,
                                           Map<String, Connector.Argument> arguments) {
    VirtualMachine vm = null;
    try {
        diagnostics.putString("Starting child.");
        vm = connector.launch(arguments);
    } catch (IOException ioe) {
        diagnostics.putString("Unable to start child: " + ioe.getMessage());
    } catch (IllegalConnectorArgumentsException icae) {
        diagnostics.putString("Unable to start child: " + icae.getMessage());
    } catch (VMStartException vmse) {
        diagnostics.putString("Unable to start child: " + vmse.getMessage() + '\n');
        dumpFailedLaunchInfo(diagnostics, vmse.process());
    }
    return vm;
}
 
Example #6
Source File: FieldMonitor.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
  * Return the launching connector's arguments.
  */
static Map <String,Connector.Argument> connectorArguments(LaunchingConnector connector, String mainArgs) {
     Map<String,Connector.Argument> arguments = connector.defaultArguments();
     for (String key : arguments.keySet()) {
       System.out.println(key);
     }

     Connector.Argument mainArg = (Connector.Argument)arguments.get("main");
     if (mainArg == null) {
         throw new Error("Bad launching connector");
     }
     mainArg.setValue(mainArgs);

     Connector.Argument optionsArg = (Connector.Argument)arguments.get("options");
     if (optionsArg == null) {
       throw new Error("Bad launching connector");
     }
     optionsArg.setValue(ARGUMENTS);
     return arguments;
 }
 
Example #7
Source File: FieldMonitor.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
  * Return the launching connector's arguments.
  */
static Map <String,Connector.Argument> connectorArguments(LaunchingConnector connector, String mainArgs) {
     Map<String,Connector.Argument> arguments = connector.defaultArguments();
     for (String key : arguments.keySet()) {
       System.out.println(key);
     }

     Connector.Argument mainArg = (Connector.Argument)arguments.get("main");
     if (mainArg == null) {
         throw new Error("Bad launching connector");
     }
     mainArg.setValue(mainArgs);

     Connector.Argument optionsArg = (Connector.Argument)arguments.get("options");
     if (optionsArg == null) {
       throw new Error("Bad launching connector");
     }
     optionsArg.setValue(ARGUMENTS);
     return arguments;
 }
 
Example #8
Source File: ChildSession.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
static private VirtualMachine generalGetVM(OutputListener diagnostics,
                                           LaunchingConnector connector,
                                           Map<String, Connector.Argument> arguments) {
    VirtualMachine vm = null;
    try {
        diagnostics.putString("Starting child.");
        vm = connector.launch(arguments);
    } catch (IOException ioe) {
        diagnostics.putString("Unable to start child: " + ioe.getMessage());
    } catch (IllegalConnectorArgumentsException icae) {
        diagnostics.putString("Unable to start child: " + icae.getMessage());
    } catch (VMStartException vmse) {
        diagnostics.putString("Unable to start child: " + vmse.getMessage() + '\n');
        dumpFailedLaunchInfo(diagnostics, vmse.process());
    }
    return vm;
}
 
Example #9
Source File: ChildSession.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
static private VirtualMachine generalGetVM(OutputListener diagnostics,
                                           LaunchingConnector connector,
                                           Map<String, Connector.Argument> arguments) {
    VirtualMachine vm = null;
    try {
        diagnostics.putString("Starting child.");
        vm = connector.launch(arguments);
    } catch (IOException ioe) {
        diagnostics.putString("Unable to start child: " + ioe.getMessage());
    } catch (IllegalConnectorArgumentsException icae) {
        diagnostics.putString("Unable to start child: " + icae.getMessage());
    } catch (VMStartException vmse) {
        diagnostics.putString("Unable to start child: " + vmse.getMessage() + '\n');
        dumpFailedLaunchInfo(diagnostics, vmse.process());
    }
    return vm;
}
 
Example #10
Source File: ChildSession.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
static private VirtualMachine generalGetVM(OutputListener diagnostics,
                                           LaunchingConnector connector,
                                           Map<String, Connector.Argument> arguments) {
    VirtualMachine vm = null;
    try {
        diagnostics.putString("Starting child.");
        vm = connector.launch(arguments);
    } catch (IOException ioe) {
        diagnostics.putString("Unable to start child: " + ioe.getMessage());
    } catch (IllegalConnectorArgumentsException icae) {
        diagnostics.putString("Unable to start child: " + icae.getMessage());
    } catch (VMStartException vmse) {
        diagnostics.putString("Unable to start child: " + vmse.getMessage() + '\n');
        dumpFailedLaunchInfo(diagnostics, vmse.process());
    }
    return vm;
}
 
Example #11
Source File: FieldMonitor.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
  * Return the launching connector's arguments.
  */
static Map <String,Connector.Argument> connectorArguments(LaunchingConnector connector, String mainArgs) {
     Map<String,Connector.Argument> arguments = connector.defaultArguments();
     for (String key : arguments.keySet()) {
       System.out.println(key);
     }

     Connector.Argument mainArg = (Connector.Argument)arguments.get("main");
     if (mainArg == null) {
         throw new Error("Bad launching connector");
     }
     mainArg.setValue(mainArgs);

     Connector.Argument optionsArg = (Connector.Argument)arguments.get("options");
     if (optionsArg == null) {
       throw new Error("Bad launching connector");
     }
     optionsArg.setValue(ARGUMENTS);
     return arguments;
 }
 
Example #12
Source File: ChildSession.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
static private VirtualMachine generalGetVM(OutputListener diagnostics,
                                           LaunchingConnector connector,
                                           Map<String, Connector.Argument> arguments) {
    VirtualMachine vm = null;
    try {
        diagnostics.putString("Starting child.");
        vm = connector.launch(arguments);
    } catch (IOException ioe) {
        diagnostics.putString("Unable to start child: " + ioe.getMessage());
    } catch (IllegalConnectorArgumentsException icae) {
        diagnostics.putString("Unable to start child: " + icae.getMessage());
    } catch (VMStartException vmse) {
        diagnostics.putString("Unable to start child: " + vmse.getMessage() + '\n');
        dumpFailedLaunchInfo(diagnostics, vmse.process());
    }
    return vm;
}
 
Example #13
Source File: ChildSession.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
static private VirtualMachine generalGetVM(OutputListener diagnostics,
                                           LaunchingConnector connector,
                                           Map<String, Connector.Argument> arguments) {
    VirtualMachine vm = null;
    try {
        diagnostics.putString("Starting child.");
        vm = connector.launch(arguments);
    } catch (IOException ioe) {
        diagnostics.putString("Unable to start child: " + ioe.getMessage());
    } catch (IllegalConnectorArgumentsException icae) {
        diagnostics.putString("Unable to start child: " + icae.getMessage());
    } catch (VMStartException vmse) {
        diagnostics.putString("Unable to start child: " + vmse.getMessage() + '\n');
        dumpFailedLaunchInfo(diagnostics, vmse.process());
    }
    return vm;
}
 
Example #14
Source File: FieldMonitor.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
  * Return the launching connector's arguments.
  */
static Map <String,Connector.Argument> connectorArguments(LaunchingConnector connector, String mainArgs) {
     Map<String,Connector.Argument> arguments = connector.defaultArguments();
     for (String key : arguments.keySet()) {
       System.out.println(key);
     }

     Connector.Argument mainArg = (Connector.Argument)arguments.get("main");
     if (mainArg == null) {
         throw new Error("Bad launching connector");
     }
     mainArg.setValue(mainArgs);

     Connector.Argument optionsArg = (Connector.Argument)arguments.get("options");
     if (optionsArg == null) {
       throw new Error("Bad launching connector");
     }
     optionsArg.setValue(ARGUMENTS);
     return arguments;
 }
 
Example #15
Source File: ChildSession.java    From jdk8u-dev-jdk with GNU General Public License v2.0 6 votes vote down vote up
static private VirtualMachine generalGetVM(OutputListener diagnostics,
                                           LaunchingConnector connector,
                                           Map<String, Connector.Argument> arguments) {
    VirtualMachine vm = null;
    try {
        diagnostics.putString("Starting child.");
        vm = connector.launch(arguments);
    } catch (IOException ioe) {
        diagnostics.putString("Unable to start child: " + ioe.getMessage());
    } catch (IllegalConnectorArgumentsException icae) {
        diagnostics.putString("Unable to start child: " + icae.getMessage());
    } catch (VMStartException vmse) {
        diagnostics.putString("Unable to start child: " + vmse.getMessage() + '\n');
        dumpFailedLaunchInfo(diagnostics, vmse.process());
    }
    return vm;
}
 
Example #16
Source File: ChildSession.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
static private VirtualMachine generalGetVM(OutputListener diagnostics,
                                           LaunchingConnector connector,
                                           Map<String, Connector.Argument> arguments) {
    VirtualMachine vm = null;
    try {
        diagnostics.putString("Starting child.");
        vm = connector.launch(arguments);
    } catch (IOException ioe) {
        diagnostics.putString("Unable to start child: " + ioe.getMessage());
    } catch (IllegalConnectorArgumentsException icae) {
        diagnostics.putString("Unable to start child: " + icae.getMessage());
    } catch (VMStartException vmse) {
        diagnostics.putString("Unable to start child: " + vmse.getMessage() + '\n');
        dumpFailedLaunchInfo(diagnostics, vmse.process());
    }
    return vm;
}
 
Example #17
Source File: FieldMonitor.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
  * Return the launching connector's arguments.
  */
static Map <String,Connector.Argument> connectorArguments(LaunchingConnector connector, String mainArgs) {
     Map<String,Connector.Argument> arguments = connector.defaultArguments();
     for (String key : arguments.keySet()) {
       System.out.println(key);
     }

     Connector.Argument mainArg = (Connector.Argument)arguments.get("main");
     if (mainArg == null) {
         throw new Error("Bad launching connector");
     }
     mainArg.setValue(mainArgs);

     Connector.Argument optionsArg = (Connector.Argument)arguments.get("options");
     if (optionsArg == null) {
       throw new Error("Bad launching connector");
     }
     optionsArg.setValue(ARGUMENTS);
     return arguments;
 }
 
Example #18
Source File: FieldMonitor.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
  * Return the launching connector's arguments.
  */
static Map <String,Connector.Argument> connectorArguments(LaunchingConnector connector, String mainArgs) {
     Map<String,Connector.Argument> arguments = connector.defaultArguments();
     for (String key : arguments.keySet()) {
       System.out.println(key);
     }

     Connector.Argument mainArg = (Connector.Argument)arguments.get("main");
     if (mainArg == null) {
         throw new Error("Bad launching connector");
     }
     mainArg.setValue(mainArgs);

     Connector.Argument optionsArg = (Connector.Argument)arguments.get("options");
     if (optionsArg == null) {
       throw new Error("Bad launching connector");
     }
     optionsArg.setValue(ARGUMENTS);
     return arguments;
 }
 
Example #19
Source File: FieldMonitor.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
  * Return the launching connector's arguments.
  */
static Map <String,Connector.Argument> connectorArguments(LaunchingConnector connector, String mainArgs) {
     Map<String,Connector.Argument> arguments = connector.defaultArguments();
     for (String key : arguments.keySet()) {
       System.out.println(key);
     }

     Connector.Argument mainArg = (Connector.Argument)arguments.get("main");
     if (mainArg == null) {
         throw new Error("Bad launching connector");
     }
     mainArg.setValue(mainArgs);

     Connector.Argument optionsArg = (Connector.Argument)arguments.get("options");
     if (optionsArg == null) {
       throw new Error("Bad launching connector");
     }
     optionsArg.setValue(ARGUMENTS);
     return arguments;
 }
 
Example #20
Source File: ChildSession.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
static private VirtualMachine generalGetVM(OutputListener diagnostics,
                                           LaunchingConnector connector,
                                           Map<String, Connector.Argument> arguments) {
    VirtualMachine vm = null;
    try {
        diagnostics.putString("Starting child.");
        vm = connector.launch(arguments);
    } catch (IOException ioe) {
        diagnostics.putString("Unable to start child: " + ioe.getMessage());
    } catch (IllegalConnectorArgumentsException icae) {
        diagnostics.putString("Unable to start child: " + icae.getMessage());
    } catch (VMStartException vmse) {
        diagnostics.putString("Unable to start child: " + vmse.getMessage() + '\n');
        dumpFailedLaunchInfo(diagnostics, vmse.process());
    }
    return vm;
}
 
Example #21
Source File: ChildSession.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
static private VirtualMachine generalGetVM(OutputListener diagnostics,
                                           LaunchingConnector connector,
                                           Map<String, Connector.Argument> arguments) {
    VirtualMachine vm = null;
    try {
        diagnostics.putString("Starting child.");
        vm = connector.launch(arguments);
    } catch (IOException ioe) {
        diagnostics.putString("Unable to start child: " + ioe.getMessage());
    } catch (IllegalConnectorArgumentsException icae) {
        diagnostics.putString("Unable to start child: " + icae.getMessage());
    } catch (VMStartException vmse) {
        diagnostics.putString("Unable to start child: " + vmse.getMessage() + '\n');
        dumpFailedLaunchInfo(diagnostics, vmse.process());
    }
    return vm;
}
 
Example #22
Source File: ChildSession.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
public ChildSession(ExecutionManager runtime,
                    LaunchingConnector connector,
                    Map<String, Connector.Argument> arguments,
                    InputListener input,
                    OutputListener output,
                    OutputListener error,
                    OutputListener diagnostics) {
    this(runtime, generalGetVM(diagnostics, connector, arguments),
         input, output, error, diagnostics);
}
 
Example #23
Source File: DecisionProcedureGuidanceJDI.java    From jbse with GNU General Public License v3.0 5 votes vote down vote up
private VirtualMachine launchTarget(String mainArgs) throws GuidanceException {
    final LaunchingConnector connector = findLaunchingConnector();
    final Map<String, Connector.Argument> arguments = connectorArguments(connector, mainArgs);
    try {
        return connector.launch(arguments);
    } catch (IOException | IllegalConnectorArgumentsException | VMStartException exc) {
        throw new GuidanceException(exc);
    }
}
 
Example #24
Source File: ChildSession.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
static private VirtualMachine getVM(OutputListener diagnostics,
                                    String userVMArgs,
                                    String cmdLine) {
    VirtualMachineManager manager = Bootstrap.virtualMachineManager();
    LaunchingConnector connector = manager.defaultConnector();
    Map<String, Connector.Argument> arguments = connector.defaultArguments();
    arguments.get("options").setValue(userVMArgs);
    arguments.get("main").setValue(cmdLine);
    return generalGetVM(diagnostics, connector, arguments);
}
 
Example #25
Source File: DecisionProcedureGuidanceJDI.java    From jbse with GNU General Public License v3.0 5 votes vote down vote up
private Map<String, Connector.Argument> connectorArguments(LaunchingConnector connector, String mainArgs) {
    final Map<String, Connector.Argument> arguments = connector.defaultArguments();
    final Connector.Argument mainArg = arguments.get("main");
    if (mainArg == null) {
        throw new Error("Bad launching connector");
    }
    mainArg.setValue(mainArgs);
    return arguments;
}
 
Example #26
Source File: ChildSession.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
static private VirtualMachine getVM(OutputListener diagnostics,
                                    String userVMArgs,
                                    String cmdLine) {
    VirtualMachineManager manager = Bootstrap.virtualMachineManager();
    LaunchingConnector connector = manager.defaultConnector();
    Map<String, Connector.Argument> arguments = connector.defaultArguments();
    arguments.get("options").setValue(userVMArgs);
    arguments.get("main").setValue(cmdLine);
    return generalGetVM(diagnostics, connector, arguments);
}
 
Example #27
Source File: FieldMonitor.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Find a com.sun.jdi.CommandLineLaunch connector
 */
static LaunchingConnector findLaunchingConnector() {
  List <Connector> connectors = Bootstrap.virtualMachineManager().allConnectors();
  Iterator <Connector> iter = connectors.iterator();
  while (iter.hasNext()) {
    Connector connector = iter.next();
    if (connector.name().equals("com.sun.jdi.CommandLineLaunch")) {
      return (LaunchingConnector)connector;
    }
  }
  throw new Error("No launching connector");
}
 
Example #28
Source File: ChildSession.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
static private VirtualMachine getVM(OutputListener diagnostics,
                                    String userVMArgs,
                                    String cmdLine) {
    VirtualMachineManager manager = Bootstrap.virtualMachineManager();
    LaunchingConnector connector = manager.defaultConnector();
    Map<String, Connector.Argument> arguments = connector.defaultArguments();
    arguments.get("options").setValue(userVMArgs);
    arguments.get("main").setValue(cmdLine);
    return generalGetVM(diagnostics, connector, arguments);
}
 
Example #29
Source File: ChildSession.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public ChildSession(ExecutionManager runtime,
                    LaunchingConnector connector,
                    Map<String, Connector.Argument> arguments,
                    InputListener input,
                    OutputListener output,
                    OutputListener error,
                    OutputListener diagnostics) {
    this(runtime, generalGetVM(diagnostics, connector, arguments),
         input, output, error, diagnostics);
}
 
Example #30
Source File: FieldMonitor.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Find a com.sun.jdi.CommandLineLaunch connector
 */
static LaunchingConnector findLaunchingConnector() {
  List <Connector> connectors = Bootstrap.virtualMachineManager().allConnectors();
  Iterator <Connector> iter = connectors.iterator();
  while (iter.hasNext()) {
    Connector connector = iter.next();
    if (connector.name().equals("com.sun.jdi.CommandLineLaunch")) {
      return (LaunchingConnector)connector;
    }
  }
  throw new Error("No launching connector");
}