Java 类com.sun.jdi.event.EventIterator 实例源码

项目:jdivisitor    文件:EventThread.java   
/**
 * Run the event handling thread.
 * 
 * As long as the thread remains connected to the VM, events are removed
 * from the queue and dispatched.
 */
@Override
public void run() {
    EventQueue queue = vm.eventQueue();

    while (connected) {
        try {
            EventSet eventSet = queue.remove();

            EventIterator eventIterator = eventSet.eventIterator();
            while (eventIterator.hasNext()) {
                handleEvent(eventIterator.nextEvent());
            }
            eventSet.resume();
        } catch (InterruptedException ie) {
            vm.dispose();
            break;
        } catch (VMDisconnectedException vmde) {
            handleDisconnectedException();
            break;
        }
    }
}
项目:cn1    文件:Main.java   
private void start() throws Exception {
    eventQueue = debuggee.eventQueue();
    while (true) {
        if (isExit == true) {
            break;
        }
        eventSet = eventQueue.remove();
        EventIterator eventIterator = eventSet.eventIterator();
        while (eventIterator.hasNext()) {
            Event event = (Event) eventIterator.next();
            execute(event);
        }
        if (!isExit) {
            eventSet.resume();
        }
    }
}
项目:freeVM    文件:Main.java   
private void start() throws Exception {
    eventQueue = debuggee.eventQueue();
    while (true) {
        if (isExit == true) {
            break;
        }
        eventSet = eventQueue.remove();
        EventIterator eventIterator = eventSet.eventIterator();
        while (eventIterator.hasNext()) {
            Event event = (Event) eventIterator.next();
            execute(event);
        }
        if (!isExit) {
            eventSet.resume();
        }
    }
}
项目:JavaTracer    文件:EventThread.java   
/***
* A VMDisconnectedException has happened while dealing with
* another event. We need to flush the event queue, dealing only
* with exit events (VMDeath, VMDisconnect) so that we terminate
* correctly.
*/
   synchronized void handleDisconnectedException() {
       EventQueue queue = vm.eventQueue();
       while (connected) {
           try {
               EventSet eventSet = queue.remove();
               EventIterator iter = eventSet.eventIterator();
               while (iter.hasNext()) {
                   Event event = iter.nextEvent();
                   if (event instanceof VMDeathEvent) {
                       vmDeathManager.vmDeathEvent((VMDeathEvent)event,enableProfiling);
                   } else if (event instanceof VMDisconnectEvent) {
                       connected=disconnect.vmDisconnectEvent((VMDisconnectEvent)event);
                   }
               }
               eventSet.resume(); // Resume the VM

           } catch (InterruptedException exc) {
               exc.printStackTrace();
           }
       }
   }
项目:acdebugger    文件:PermissionDebugger.java   
private void loop(BreakpointRequest br, Field contextField) throws Exception {
  int lineNumber = br.location().lineNumber();

  br.setSuspendPolicy(BreakpointRequest.SUSPEND_EVENT_THREAD);
  br.enable();
  EventQueue evtQueue = vm.eventQueue();
  boolean run = true;
  while (run) {
    EventSet evtSet = evtQueue.remove();
    EventIterator evtIter = evtSet.eventIterator();
    while (evtIter.hasNext()) {
      try {
        Event evt = evtIter.next();
        EventRequest evtReq = evt.request();
        if (evtReq instanceof BreakpointRequest
            && ((BreakpointRequest) evtReq).location().lineNumber() == lineNumber) {
          new BreakpointProcessor(missingPerms)
              .processBreakpoint(contextField, (BreakpointEvent) evt);

          // TODO: 12/20/17 Remove when full loop processing is restored
          // run = false;
          System.out.println(missingPerms);
          missingPerms.clear();
        }
      } finally {
        evtSet.resume();
      }
    }
  }

  //    System.out.println(missingPerms);
  //    printPerms(missingPerms);
}
项目:jdivisitor    文件:EventThread.java   
/**
 * A {@link VMDisconnectedException} has happened while dealing with another
 * event. We need to flush the event queue, dealing only with exit events (
 * {@link VMDeatEvent} and {@link VMDisconnectEvent}) so that we terminate
 * correctly.
 */
private void handleDisconnectedException() {
    EventQueue queue = vm.eventQueue();

    while (connected) {
        try {
            EventSet eventSet = queue.remove();

            EventIterator eventIterator = eventSet.eventIterator();
            while (eventIterator.hasNext()) {
                Event event = eventIterator.nextEvent();

                if (event instanceof VMDeathEvent) {
                    handleEvent(event);
                } else if (event instanceof VMDisconnectEvent) {
                    handleEvent(event);
                    connected = false;
                }
            }
            eventSet.resume();
        } catch (InterruptedException ie) {
            vm.dispose();
            break;
        } catch (VMDisconnectedException vmde) {
            break;
        }
    }
}
项目:JavaTracer    文件:EventThread.java   
/**
* Run the event handling thread.
* As long as we are connected, get event sets off
* the queue and dispatch the events within them.
*/

   public void run() {
       EventQueue queue = vm.eventQueue();

       while (connected && !forceExit) {
           try {

                EventSet eventSet = queue.remove();
                EventIterator it = eventSet.eventIterator();
                while (it.hasNext())
                 handleEvent(it.nextEvent());
                eventSet.resume();

           } catch (InterruptedException exc) {
              exc.printStackTrace();
           } catch (VMDisconnectedException discExc) {
            discExc.printStackTrace();
               handleDisconnectedException();
               break;
           }
       }

       if (forceExit){
        vm.exit(-1);
        if (!enableProfiling)
            writer.close();
        tracer.finishedTrace();
       }
   }
项目:openjdk-jdk10    文件:EventSetImpl.java   
public EventIterator eventIterator() {
    return new Itr();
}
项目:form-follows-function    文件:F3EventIterator.java   
public F3EventIterator(F3VirtualMachine f3vm, EventIterator underlying) {
    this.f3vm = f3vm;
    this.underlying = underlying;
}
项目:form-follows-function    文件:F3EventIterator.java   
protected EventIterator underlying() {
    return underlying;
}
项目:form-follows-function    文件:F3EventIterator.java   
public static F3EventIterator wrap(F3VirtualMachine f3vm, EventIterator evtItr) {
    return (evtItr == null)? null : new F3EventIterator(f3vm, evtItr);
}