@Override
 public boolean handleClassPrepareEvent(ClassPrepareEvent event, JDXDebugTarget target) {
   try {
     if (isEnabled() && event.referenceType().name().equals(getTypeName())) {
       ThreadReference threadRef = event.thread();
       JDXThread thread = target.findThread(threadRef);
       if (thread == null) {
         return true;
       }
       return handleBreakpointEvent(event, target, thread);
     }
   } catch (CoreException e) {
   }
   return true;
 }
Пример #2
0
  private boolean processClassPrepareEvent(com.sun.jdi.event.ClassPrepareEvent event)
      throws DebuggerException {
    setCurrentThread(event.thread());
    final String className = event.referenceType().name();

    // add deferred breakpoints
    List<Breakpoint> breakpointsToAdd = deferredBreakpoints.get(className);
    if (breakpointsToAdd != null) {

      for (Breakpoint b : breakpointsToAdd) {
        addBreakpoint(b);
      }
      deferredBreakpoints.remove(className);

      // All deferred breakpoints for className have been already added,
      // so no need to listen for an appropriate ClassPrepareRequests any more.
      ClassPrepareRequest request = classPrepareRequests.remove(className);
      if (request != null) {
        getEventManager().deleteEventRequest(request);
      }
    }
    return true;
  }
Пример #3
0
 @Override
 public void classPrepare(ClassPrepareEvent event) {
   final ReferenceType referenceType = event.referenceType();
   if (referenceType == null) {
     LOGGER.warn("No reference type defined in class preparation event: {}", event);
   } else if (referenceType instanceof ClassType) {
     final ClassType classType = (ClassType) referenceType;
     if (isClassEquals(classType, implementorClass)
         && !currentImplementations.contains(classType)) {
       currentImplementations.add(classType);
       implementorCallback.accept(classType);
     }
   }
 }