Package com.sun.jdi.event

Examples of com.sun.jdi.event.EventIterator


      while(true)
        {
        resumir.clear();

        EventSet eventSet = queue.remove();
        EventIterator it = eventSet.eventIterator();
       
        //iniciar transacion
        JPAManager.getJPAManager().startTransaction();
       
        while(it.hasNext())
            {
            Event event=(Event) it.next();
            chrono.setLastNow();
           
            if(!(event instanceof AccessWatchpointEvent || event instanceof ModificationWatchpointEvent))
              System.out.println("*->" + event);
           
View Full Code Here


              tr.resume();
            }
          eventSet = queue.remove(1000);
          }
        System.out.println("suspendPolicy:" + eventSet.suspendPolicy() + ", " +  eventSet);*/
        EventIterator it = eventSet.eventIterator();
       
        JPAManager.getJPAManager().startTransaction();
        Boolean habilitarMethodEvents=null;
        int evento=0;
       
        while(it.hasNext())
            {
         
            Event event=it.next();
            chrono.setLastNow();
            //System.out.println("\t" + ++evento + ", " + event + " request:" +  event.request() + (event.request()!=null ? "suspendPolicy:" + event.request().suspendPolicy() : ""));
           
            if(event instanceof ThreadStartEvent)
              {
View Full Code Here

      try {
        eventSet = eventQueue.remove();
      } catch (InterruptedException e) {
        e.printStackTrace();
      }
      EventIterator eventIterator = eventSet.eventIterator();
      while (eventIterator.hasNext()) {
        Event event = (Event) eventIterator.next();
        if (event instanceof VMStartEvent) {
          handleVMStartEvent((VMStartEvent)event);
        } else if (event instanceof ClassPrepareEvent) {
          handleClassPrepareEvent((ClassPrepareEvent)event);
        } else if (event instanceof BreakpointEvent) {
View Full Code Here

        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();
            }
View Full Code Here

/*     */
/*     */       public void run() {
/* 216 */         EventSet events = null;
/*     */         try {
/* 218 */           events = HotSwapper.this.waitEvent();
/* 219 */           EventIterator iter = events.eventIterator();
/* 220 */           while (iter.hasNext()) {
/* 221 */             Event event = iter.nextEvent();
/* 222 */             if ((event instanceof MethodEntryEvent)) {
/* 223 */               HotSwapper.this.hotswap();
/* 224 */               break;
/*     */             }
/*     */           }
View Full Code Here

  private void dispatch(EventSet eventSet) {
    if (isShutdown()) {
      return;
    }
    if (JDIDebugOptions.DEBUG_JDI_EVENTS) {
      EventIterator eventIter = eventSet.eventIterator();
      StringBuffer buf = new StringBuffer("JDI Event Set: {\n"); //$NON-NLS-1$
      while (eventIter.hasNext()) {
        buf.append(eventIter.next());
        if (eventIter.hasNext()) {
          buf.append(", "); //$NON-NLS-1$
        }
      }
      buf.append("}\n"); //$NON-NLS-1$
      JDIDebugOptions.trace(buf.toString());
    }
    EventIterator iter = eventSet.eventIterator();
    IJDIEventListener[] listeners = new IJDIEventListener[eventSet.size()];
    boolean vote = false;
    boolean resume = true;
    int index = -1;
    List<Event> deferredEvents = null;
    while (iter.hasNext()) {
      index++;
      if (isShutdown()) {
        return;
      }
      Event event = iter.nextEvent();
      if (event == null) {
        continue;
      }
      // Dispatch events to registered listeners, if any
      IJDIEventListener listener = fEventHandlers.get(event.request());
      listeners[index] = listener;
      if (listener != null) {
        if (listener instanceof IJavaLineBreakpoint) {
          // Event dispatch to conditional breakpoints is deferred
          // until after
          // other listeners vote.
          try {
            if (((IJavaLineBreakpoint) listener).isConditionEnabled()) {
              if (deferredEvents == null) {
                deferredEvents = new ArrayList<Event>(5);
              }
              deferredEvents.add(event);
              continue;
            }
          } catch (CoreException exception) {
            JDIDebugPlugin.log(exception);
          }
        }
        vote = true;
        resume = listener.handleEvent(event, fTarget, !resume, eventSet) && resume;
        continue;
      }

      // Dispatch VM start/end events
      if (event instanceof VMDeathEvent) {
        fTarget.handleVMDeath((VMDeathEvent) event);
        shutdown(); // stop listening for events
      } else if (event instanceof VMDisconnectEvent) {
        fTarget.handleVMDisconnect((VMDisconnectEvent) event);
        shutdown(); // stop listening for events
      } else if (event instanceof VMStartEvent) {
        fTarget.handleVMStart((VMStartEvent) event);
      } else {
        // not handled
      }
    }

    // process deferred conditional breakpoint events
    if (deferredEvents != null) {
      Iterator<Event> deferredIter = deferredEvents.iterator();
      while (deferredIter.hasNext()) {
        if (isShutdown()) {
          return;
        }
        Event event = deferredIter.next();
        if (event == null) {
          continue;
        }
        // Dispatch events to registered listeners, if any
        IJDIEventListener listener = fEventHandlers
            .get(event.request());
        if (listener != null) {
          vote = true;
          resume = listener.handleEvent(event, fTarget, !resume, eventSet) && resume;
          continue;
        }
      }
    }

    // notify handlers of the end result
    index = -1;
    iter = eventSet.eventIterator();
    while (iter.hasNext()) {
      index++;
      Event event = iter.nextEvent();
      // notify registered listener, if any
      IJDIEventListener listener = listeners[index];
      if (listener != null) {
        listener.eventSetComplete(event, fTarget, !resume, eventSet);
      }
View Full Code Here

              @Override
              public boolean belongsTo(Object family) {
                if (family instanceof Class) {
                  Class<?> clazz = (Class<?>) family;
                  EventIterator iterator = set.eventIterator();
                  while (iterator.hasNext()) {
                    Event event = iterator.nextEvent();
                    if (clazz.isInstance(event)) {
                      return true;
                    }
                  }
                }
View Full Code Here

    @Override
    public void run() {
        while (this.vmConnected) {
            try {
                EventSet set = vm.eventQueue().remove();
                EventIterator eventIterator = set.eventIterator();
                while (eventIterator.hasNext()) {
                    Event next = eventIterator.next();
                    Throwable t = null;
                    dispatchEvent(vm, next);
                }
            } catch (InterruptedException ex) {
            } catch (VMDisconnectedException ex) {
View Full Code Here

TOP

Related Classes of com.sun.jdi.event.EventIterator

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.