当前位置: 首页>>代码示例>>Java>>正文


Java VMStartException类代码示例

本文整理汇总了Java中com.sun.jdi.connect.VMStartException的典型用法代码示例。如果您正苦于以下问题:Java VMStartException类的具体用法?Java VMStartException怎么用?Java VMStartException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


VMStartException类属于com.sun.jdi.connect包,在下文中一共展示了VMStartException类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: generalGetVM

import com.sun.jdi.connect.VMStartException; //导入依赖的package包/类
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;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:18,代码来源:ChildSession.java

示例2: launch

import com.sun.jdi.connect.VMStartException; //导入依赖的package包/类
public VirtualMachine
    launch(Map<String, ? extends Connector.Argument> arguments)
    throws IOException, IllegalConnectorArgumentsException,
           VMStartException
{
    String command = argument(ARG_COMMAND, arguments).value();
    String address = argument(ARG_ADDRESS, arguments).value();
    String quote = argument(ARG_QUOTE, arguments).value();

    if (quote.length() > 1) {
        throw new IllegalConnectorArgumentsException("Invalid length",
                                                     ARG_QUOTE);
    }

    TransportService.ListenKey listener = transportService.startListening(address);

    try {
        return launch(tokenizeCommand(command, quote.charAt(0)),
                      address, listener, transportService);
    } finally {
        transportService.stopListening(listener);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:24,代码来源:RawCommandLineLauncher.java

示例3: launch

import com.sun.jdi.connect.VMStartException; //导入依赖的package包/类
/**
 * Launch a debuggee in suspend mode.
 * @see {@link #launch(VirtualMachineManager, String, String, String, String, String)}
 */
public static IDebugSession launch(VirtualMachineManager vmManager,
        String mainClass,
        String programArguments,
        String vmArguments,
        List<String> modulePaths,
        List<String> classPaths,
        String cwd,
        String[] envVars)
        throws IOException, IllegalConnectorArgumentsException, VMStartException {
    return DebugUtility.launch(vmManager,
            mainClass,
            programArguments,
            vmArguments,
            String.join(File.pathSeparator, modulePaths),
            String.join(File.pathSeparator, classPaths),
            cwd,
            envVars);
}
 
开发者ID:Microsoft,项目名称:java-debug,代码行数:23,代码来源:DebugUtility.java

示例4: launch

import com.sun.jdi.connect.VMStartException; //导入依赖的package包/类
public VirtualMachine launch(Map<String, ? extends Connector.Argument> arguments) throws
                          IOException,
                          IllegalConnectorArgumentsException,
                          VMStartException {

    /*
     * Get the class name that we are to execute
     */
    String className = ((StringArgumentImpl)arguments.get(ARG_NAME)).value();
    if (className.length() == 0) {
        throw new IllegalConnectorArgumentsException("class name missing", ARG_NAME);
    }

    /*
     * Listen on an emperical port; launch the debuggee; wait for
     * for the debuggee to connect; stop listening;
     */
    TransportService.ListenKey key = ts.startListening();

    String exe = System.getProperty("java.home") + File.separator + "bin" +
        File.separator + "java";
    String cmd = exe + " -Xdebug -Xrunjdwp:transport=dt_socket,timeout=15000,address=" +
        key.address() +
        " -classpath " + System.getProperty("test.classes") +
        " " + className;
    Process process = Runtime.getRuntime().exec(cmd);
    Connection conn = ts.accept(key, 30*1000, 9*1000);
    ts.stopListening(key);

    /*
     * Debugee is connected - return the virtual machine mirror
     */
    return Bootstrap.virtualMachineManager().createVirtualMachine(conn);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:35,代码来源:SimpleLaunchingConnector.java

示例5: launch

import com.sun.jdi.connect.VMStartException; //导入依赖的package包/类
protected VirtualMachine launch(String[] commandArray, String address,
                                TransportService.ListenKey listenKey,
                                TransportService ts)
                                throws IOException, VMStartException {
    Helper helper = new Helper(commandArray, address, listenKey, ts);
    helper.launchAndAccept();

    VirtualMachineManager manager =
        Bootstrap.virtualMachineManager();

    return manager.createVirtualMachine(helper.connection(),
                                        helper.process());
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:14,代码来源:AbstractLauncher.java

示例6: launchAndAccept

import com.sun.jdi.connect.VMStartException; //导入依赖的package包/类
synchronized void launchAndAccept() throws
                        IOException, VMStartException {

    process = Runtime.getRuntime().exec(commandArray);

    Thread acceptingThread = acceptConnection();
    Thread monitoringThread = monitorTarget();
    try {
        while ((connection == null) &&
               (acceptException == null) &&
               !exited) {
            wait();
        }

        if (exited) {
            throw new VMStartException(
                "VM initialization failed for: " + commandString(), process);
        }
        if (acceptException != null) {
            // Rethrow the exception in this thread
            throw acceptException;
        }
    } catch (InterruptedException e) {
        throw new InterruptedIOException("Interrupted during accept");
    } finally {
        acceptingThread.interrupt();
        monitoringThread.interrupt();
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:30,代码来源:AbstractLauncher.java

示例7: spawn

import com.sun.jdi.connect.VMStartException; //导入依赖的package包/类
private VirtualMachine spawn( String vmArgs, String cmdLine ) throws SessionException
{
	VirtualMachine vm;
	
       try
       {
		VirtualMachineManager manager = Bootstrap.virtualMachineManager();

		LaunchingConnector connector = manager.defaultConnector();
		
		Map arguments = connector.defaultArguments();
		DC.log(LEVEL, arguments );
		((Connector.Argument)arguments.get("options")).setValue(vmArgs);
		((Connector.Argument)arguments.get("main")).setValue(cmdLine);
       
           vm = connector.launch( arguments );
           return vm;
       }
       catch (IOException ioe)
       {
       	throw new SessionException( ioe );
       }
       catch (IllegalConnectorArgumentsException icae )
       {
       	throw new SessionException( icae );
       }
       catch (VMStartException vmse )
       {
       	throw new SessionException( vmse );
       }
}
 
开发者ID:robertocapuano,项目名称:jink,代码行数:32,代码来源:Session.java

示例8: launch

import com.sun.jdi.connect.VMStartException; //导入依赖的package包/类
public F3VirtualMachine launch(Map<String, ? extends Argument> args)
        throws IOException, IllegalConnectorArgumentsException, VMStartException {
    return F3Wrapper.wrap(underlying().launch(args));
}
 
开发者ID:unktomi,项目名称:form-follows-function,代码行数:5,代码来源:F3RawLaunchingConnector.java

示例9: launch

import com.sun.jdi.connect.VMStartException; //导入依赖的package包/类
public VirtualMachine launch(Map<String, ? extends Connector.Argument> arguments) throws
                          IOException,
                          IllegalConnectorArgumentsException,
                          VMStartException {

    /*
     * Get the class name that we are to execute
     */
    String className = ((StringArgumentImpl)arguments.get(ARG_NAME)).value();
    if (className.length() == 0) {
        throw new IllegalConnectorArgumentsException("class name missing", ARG_NAME);
    }

    /*
     * Listen on an emperical port; launch the debuggee; wait for
     * for the debuggee to connect; stop listening;
     */
    TransportService.ListenKey key = ts.startListening();

    String exe = System.getProperty("java.home") + File.separator + "bin" +
        File.separator;
    String arch = System.getProperty("os.arch");
    String osname = System.getProperty("os.name");
    if (osname.equals("SunOS") && arch.equals("sparcv9")) {
        exe += "sparcv9/java";
    } else if (osname.equals("SunOS") && arch.equals("amd64")) {
        exe += "amd64/java";
    } else {
        exe += "java";
    }
    String cmd = exe + " -Xdebug -Xrunjdwp:transport=dt_socket,timeout=15000,address=" +
        key.address() +
        " -classpath " + System.getProperty("test.classes") +
        " " + className;
    Process process = Runtime.getRuntime().exec(cmd);
    Connection conn = ts.accept(key, 30*1000, 9*1000);
    ts.stopListening(key);

    /*
     * Debugee is connected - return the virtual machine mirror
     */
    return Bootstrap.virtualMachineManager().createVirtualMachine(conn);
}
 
开发者ID:openjdk,项目名称:jdk7-jdk,代码行数:44,代码来源:SimpleLaunchingConnector.java

示例10: getVirtualMachine

import com.sun.jdi.connect.VMStartException; //导入依赖的package包/类
/**
 * Creates a new instance of VirtualMachine for this DebuggerInfo Cookie.
 *
 * @return a new instance of VirtualMachine for this DebuggerInfo Cookie
 */
public VirtualMachine getVirtualMachine () throws IOException,
IllegalConnectorArgumentsException, VMStartException {
    return launchingConnector.launch (args);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:10,代码来源:LaunchingDICookie.java

示例11: getVirtualMachine

import com.sun.jdi.connect.VMStartException; //导入依赖的package包/类
/**
 * Creates a new instance of VirtualMachine for this DebuggerInfo Cookie.
 *
 * @return a new instance of VirtualMachine for this DebuggerInfo Cookie
 * @throws java.net.ConnectException When a connection is refused
 */
public abstract VirtualMachine getVirtualMachine () throws IOException,
IllegalConnectorArgumentsException, VMStartException;
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:9,代码来源:AbstractDICookie.java


注:本文中的com.sun.jdi.connect.VMStartException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。