本文整理汇总了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;
}
示例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);
}
}
示例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);
}
示例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);
}
示例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());
}
示例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();
}
}
示例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 );
}
}
示例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));
}
示例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);
}
示例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);
}
示例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;