Package com.sun.jdi

Examples of com.sun.jdi.VirtualMachine


                        }
                        if (ex instanceof IOException) {
                            throw (IOException)ex;
                        }

                        VirtualMachine vm= runnable.getVirtualMachine();
                        if (vm != null) {
                            DroolsDebugModel.newDebugTarget(launch, vm, renderDebugTarget(config.getClassToLaunch(), port), process, true, false, config.isResumeOnStartup());
                            subMonitor.worked(1);
                            subMonitor.done();
                        }
View Full Code Here


            allowTerminate = configuration.getAttribute(IJavaLaunchConfigurationConstants.ATTR_ALLOW_TERMINATE, false);
        }
        subMonitor.worked(1);
        subMonitor.subTask(LaunchingMessages.SocketAttachConnector_Establishing_connection____2);
        try {
            VirtualMachine vm = connector.attach(map);
            String vmLabel = constructVMLabel(vm, host, portNumberString, configuration);
            IDebugTarget debugTarget= DroolsDebugModel.newDebugTarget(launch, vm, vmLabel, null, allowTerminate, true);
            launch.addDebugTarget(debugTarget);
            subMonitor.worked(1);
            subMonitor.done();
View Full Code Here

                        }
                        if (ex instanceof IOException) {
                            throw (IOException)ex;
                        }

                        VirtualMachine vm= runnable.getVirtualMachine();
                        if (vm != null) {
                            DroolsDebugModel.newDebugTarget(launch, vm, renderDebugTarget(config.getClassToLaunch(), port), process, true, false, config.isResumeOnStartup());
                            subMonitor.worked(1);
                            subMonitor.done();
                        }
View Full Code Here

            return;
        }
        try {
            setSuspended( false );
            resumeThreads();
            VirtualMachine vm = getVM();
            if ( vm != null ) {
                vm.resume();
            }
            if ( fireNotification ) {
                fireResumeEvent( DebugEvent.CLIENT_REQUEST );
            }
        } catch ( VMDisconnectedException e ) {
View Full Code Here

            notSupported( JDIDebugModelMessages.JDIDebugTarget_does_not_support_disconnect );
        }

        try {
            disposeThreadHandler();
            VirtualMachine vm = getVM();
            if ( vm != null ) {
                vm.dispose();
            }
        } catch ( VMDisconnectedException e ) {
            // if the VM disconnects while disconnecting, perform
            // normal disconnect handling
            disconnected();
View Full Code Here

            notSupported( JDIDebugModelMessages.JDIDebugTarget_does_not_support_termination );
        }
        try {
            setTerminating( true );
            disposeThreadHandler();
            VirtualMachine vm = getVM();
            if ( vm != null ) {
                vm.exit( 1 );
            }
            IProcess process = getProcess();
            if ( process != null ) {
                process.terminate();
            }
View Full Code Here

    }

    protected void initializeState() {

        List<ThreadReference> threads = null;
        VirtualMachine vm = getVM();
        if ( vm != null ) {
            try {
                threads = vm.allThreads();
            } catch ( RuntimeException e ) {
                internalError( e );
            }
            if ( threads != null ) {
                Iterator<ThreadReference> initialThreads = threads.iterator();
View Full Code Here

    public void suspend() throws DebugException {
        if ( isSuspended() ) {
            return;
        }
        try {
            VirtualMachine vm = getVM();
            if ( vm != null ) {
                vm.suspend();
            }
            suspendThreads();
            setSuspended( true );
            fireSuspendEvent( DebugEvent.CLIENT_REQUEST );
        } catch ( RuntimeException e ) {
View Full Code Here

    public VirtualMachine connect(int port)
        throws IOException {
      String strPort = Integer.toString(port);
      AttachingConnector connector = getConnector();
      try {
        VirtualMachine vm = connect(connector, strPort);
        return vm;
      } catch (IllegalConnectorArgumentsException e) {
        throw new IllegalStateException(e);
      }
    }
View Full Code Here

  public VMRemoteTarget createJVM() throws IOException, InterruptedException,
      IncompatibleThreadStateException {
    Process process = startSecondJVM(VMLocalTarget.class);
    sleep(90);
    // connect
    VirtualMachine vm = new VMAcquirer().connect(debugPort);

    ClassPrepareRequest createClassPrepareRequest = vm
        .eventRequestManager().createClassPrepareRequest();
    createClassPrepareRequest.addClassFilter(VMLocalTarget.class.getName());
    createClassPrepareRequest.enable();
   
    vm.resume();

    List<ThreadReference> allThreads = vm.allThreads();
    for (ThreadReference threadReference : allThreads) {
      System.out.println(threadReference+" isSuspended: "+threadReference.isSuspended()+" suspendCount: "+threadReference.suspendCount());
    }

    // process events
    EventQueue eventQueue = vm.eventQueue();
    while (true) {
      EventSet eventSet = eventQueue.remove();
      for (Event event : eventSet) {
        if (event instanceof ClassPrepareEvent) {
          event.request().disable();
View Full Code Here

TOP

Related Classes of com.sun.jdi.VirtualMachine

Copyright © 2018 www.massapicom. 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.