Java 类com.sun.jdi.request.ClassPrepareRequest 实例源码

项目:intellij-ce-playground    文件:CompoundPositionManager.java   
@NotNull
@Override
public List<ClassPrepareRequest> createPrepareRequests(@NotNull final ClassPrepareRequestor requestor, @NotNull final SourcePosition position) {
  return iterate(new Processor<List<ClassPrepareRequest>>() {
    @Override
    public List<ClassPrepareRequest> process(PositionManager positionManager) throws NoDataException {
      if (positionManager instanceof MultiRequestPositionManager) {
        return ((MultiRequestPositionManager)positionManager).createPrepareRequests(requestor, position);
      }
      else {
        ClassPrepareRequest prepareRequest = positionManager.createPrepareRequest(requestor, position);
        if (prepareRequest == null) {
          return Collections.emptyList();
        }
        return Collections.singletonList(prepareRequest);
      }
    }
  }, Collections.<ClassPrepareRequest>emptyList());
}
项目:che    文件:JavaDebugger.java   
private void deferBreakpoint(String className, Breakpoint breakpoint) throws DebuggerException {
  List<Breakpoint> newList = new ArrayList<>();
  List<Breakpoint> list = deferredBreakpoints.putIfAbsent(className, newList);
  if (list == null) {
    list = newList;
  }
  list.add(breakpoint);

  // start listening for the load of the type
  if (!classPrepareRequests.containsKey(className)) {
    ClassPrepareRequest request = getEventManager().createClassPrepareRequest();
    // set class filter in order to reduce the amount of event traffic sent from the target VM to
    // the debugger VM
    request.addClassFilter(className);
    request.enable();
    classPrepareRequests.put(className, request);
  }

  LOG.debug("Deferred breakpoint: {}", breakpoint.getLocation().toString());
}
项目:che    文件:JavaDebugger.java   
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;
}
项目:tools-idea    文件:GroovyPositionManager.java   
public ClassPrepareRequest createPrepareRequest(final ClassPrepareRequestor requestor, final SourcePosition position)
  throws NoDataException {
  String qName = getOuterClassName(position);
  if (qName != null) {
    return myDebugProcess.getRequestsManager().createClassPrepareRequest(requestor, qName);
  }

  qName = findEnclosingName(position);

  if (qName == null) throw new NoDataException();
  ClassPrepareRequestor waitRequestor = new ClassPrepareRequestor() {
    public void processClassPrepare(DebugProcess debuggerProcess, ReferenceType referenceType) {
      final CompoundPositionManager positionManager = ((DebugProcessImpl)debuggerProcess).getPositionManager();
      if (positionManager.locationsOfLine(referenceType, position).size() > 0) {
        requestor.processClassPrepare(debuggerProcess, referenceType);
      }
    }
  };
  return myDebugProcess.getRequestsManager().createClassPrepareRequest(waitRequestor, qName + "$*");
}
项目:jive    文件:EventHandlerFactory.java   
protected void createRequest()
{
  final EventRequestManager manager = owner.getEventRequestManager();
  if (manager != null)
  {
    try
    {
      final ClassPrepareRequest request = manager.createClassPrepareRequest();
      owner.jdiManager().modelFilter().filter(request);
      request.setSuspendPolicy(EventRequest.SUSPEND_EVENT_THREAD);
      request.enable();
      owner.addJDIEventListener(this, request);
    }
    catch (final RuntimeException e)
    {
      JiveDebugPlugin.log(e);
    }
  }
}
项目:OpenJSharp    文件:PatternReferenceTypeSpec.java   
@Override
public ClassPrepareRequest createPrepareRequest() {
    ClassPrepareRequest request =
        Env.vm().eventRequestManager().createClassPrepareRequest();
    request.addClassFilter(classId);
    request.addCountFilter(1);
    return request;
}
项目:MaxSim    文件:FieldMonitor.java   
private static void addClassWatch(VirtualMachine vm) {
  EventRequestManager erm = vm.eventRequestManager();
  ClassPrepareRequest classPrepareRequest = erm
      .createClassPrepareRequest();
  classPrepareRequest.addClassFilter(CLASS_NAME);
  classPrepareRequest.setEnabled(true);
}
项目:jdk8u-jdk    文件:PatternReferenceTypeSpec.java   
@Override
public ClassPrepareRequest createPrepareRequest() {
    ClassPrepareRequest request =
        Env.vm().eventRequestManager().createClassPrepareRequest();
    request.addClassFilter(classId);
    request.addCountFilter(1);
    return request;
}
项目:openjdk-jdk10    文件:GetObjectLockCount.java   
private static void addClassWatch(VirtualMachine vm) {
    EventRequestManager erm = vm.eventRequestManager();
    ClassPrepareRequest classPrepareRequest = erm
            .createClassPrepareRequest();
    classPrepareRequest.addClassFilter(CLASS_NAME);
    classPrepareRequest.setEnabled(true);
}
项目:openjdk-jdk10    文件:FieldMonitor.java   
private static void addClassWatch(VirtualMachine vm) {
  EventRequestManager erm = vm.eventRequestManager();
  ClassPrepareRequest classPrepareRequest = erm
      .createClassPrepareRequest();
  classPrepareRequest.addClassFilter(CLASS_NAME);
  classPrepareRequest.setEnabled(true);
}
项目:openjdk-jdk10    文件:PatternReferenceTypeSpec.java   
@Override
public ClassPrepareRequest createPrepareRequest() {
    ClassPrepareRequest request =
        Env.vm().eventRequestManager().createClassPrepareRequest();
    request.addClassFilter(classId);
    request.addCountFilter(1);
    return request;
}
项目:openjdk9    文件:GetObjectLockCount.java   
private static void addClassWatch(VirtualMachine vm) {
    EventRequestManager erm = vm.eventRequestManager();
    ClassPrepareRequest classPrepareRequest = erm
            .createClassPrepareRequest();
    classPrepareRequest.addClassFilter(CLASS_NAME);
    classPrepareRequest.setEnabled(true);
}
项目:openjdk9    文件:FieldMonitor.java   
private static void addClassWatch(VirtualMachine vm) {
  EventRequestManager erm = vm.eventRequestManager();
  ClassPrepareRequest classPrepareRequest = erm
      .createClassPrepareRequest();
  classPrepareRequest.addClassFilter(CLASS_NAME);
  classPrepareRequest.setEnabled(true);
}
项目:openjdk9    文件:PatternReferenceTypeSpec.java   
@Override
public ClassPrepareRequest createPrepareRequest() {
    ClassPrepareRequest request =
        Env.vm().eventRequestManager().createClassPrepareRequest();
    request.addClassFilter(classId);
    request.addCountFilter(1);
    return request;
}
项目:jdk8u_jdk    文件:PatternReferenceTypeSpec.java   
@Override
public ClassPrepareRequest createPrepareRequest() {
    ClassPrepareRequest request =
        Env.vm().eventRequestManager().createClassPrepareRequest();
    request.addClassFilter(classId);
    request.addCountFilter(1);
    return request;
}
项目:lookaside_java-1.8.0-openjdk    文件:FieldMonitor.java   
private static void addClassWatch(VirtualMachine vm) {
  EventRequestManager erm = vm.eventRequestManager();
  ClassPrepareRequest classPrepareRequest = erm
      .createClassPrepareRequest();
  classPrepareRequest.addClassFilter(CLASS_NAME);
  classPrepareRequest.setEnabled(true);
}
项目:lookaside_java-1.8.0-openjdk    文件:PatternReferenceTypeSpec.java   
@Override
public ClassPrepareRequest createPrepareRequest() {
    ClassPrepareRequest request =
        Env.vm().eventRequestManager().createClassPrepareRequest();
    request.addClassFilter(classId);
    request.addCountFilter(1);
    return request;
}
项目:intellij-ce-playground    文件:JSR45PositionManager.java   
@Override
public ClassPrepareRequest createPrepareRequest(@NotNull final ClassPrepareRequestor requestor, @NotNull final SourcePosition position)
  throws NoDataException {
  checkSourcePositionFileType(position);

  return myDebugProcess.getRequestsManager().createClassPrepareRequest(new ClassPrepareRequestor() {
    @Override
    public void processClassPrepare(DebugProcess debuggerProcess, ReferenceType referenceType) {
      onClassPrepare(debuggerProcess, referenceType, position, requestor);
    }
  }, GENERATED_CLASS_PATTERN);
}
项目:intellij-ce-playground    文件:CompoundPositionManager.java   
@Override
public ClassPrepareRequest createPrepareRequest(@NotNull final ClassPrepareRequestor requestor, @NotNull final SourcePosition position) {
  return iterate(new Processor<ClassPrepareRequest>() {
    @Override
    public ClassPrepareRequest process(PositionManager positionManager) throws NoDataException {
      return positionManager.createPrepareRequest(requestor, position);
    }
  }, null);
}
项目:intellij-ce-playground    文件:GroovyPositionManager.java   
@Override
public ClassPrepareRequest createPrepareRequest(@NotNull final ClassPrepareRequestor requestor, @NotNull final SourcePosition position)
  throws NoDataException {
  if (LOG.isDebugEnabled()) {
    LOG.debug("createPrepareRequest: " + position);
  }
  checkGroovyFile(position);

  String qName = getOuterClassName(position);
  if (qName != null) {
    return myDebugProcess.getRequestsManager().createClassPrepareRequest(requestor, qName);
  }

  qName = findEnclosingName(position);

  if (qName == null) throw NoDataException.INSTANCE;
  ClassPrepareRequestor waitRequestor = new ClassPrepareRequestor() {
    @Override
    public void processClassPrepare(DebugProcess debuggerProcess, ReferenceType referenceType) {
      final CompoundPositionManager positionManager = ((DebugProcessImpl)debuggerProcess).getPositionManager();
      if (!positionManager.locationsOfLine(referenceType, position).isEmpty()) {
        requestor.processClassPrepare(debuggerProcess, referenceType);
      }
    }
  };
  return myDebugProcess.getRequestsManager().createClassPrepareRequest(waitRequestor, qName + "$*");
}
项目:intellij-ce-playground    文件:SpringLoadedPositionManager.java   
@Override
public ClassPrepareRequest createPrepareRequest(@NotNull ClassPrepareRequestor requestor, @NotNull SourcePosition position) throws NoDataException {
  String className = getOuterClassName(position);
  if (className == null) {
    throw NoDataException.INSTANCE;
  }

  return myDebugProcess.getRequestsManager().createClassPrepareRequest(requestor, className + "*");
}
项目:form-follows-function    文件:F3EventRequest.java   
public static List<ClassPrepareRequest> wrapClassPrepareRequests(
        F3VirtualMachine f3vm,  List<ClassPrepareRequest> reqs) {
    if (reqs == null) {
        return null;
    }
    List<ClassPrepareRequest> result = new ArrayList<ClassPrepareRequest>();
    for (ClassPrepareRequest req : reqs) {
        result.add(wrap(f3vm, req));
    }
    return result;
}
项目:form-follows-function    文件:PatternReferenceTypeSpec.java   
public ClassPrepareRequest createPrepareRequest() {
    ClassPrepareRequest request =
        env.vm().eventRequestManager().createClassPrepareRequest();
    request.addClassFilter(classId);
    request.addCountFilter(1);
    return request;
}
项目:form-follows-function    文件:Debugger.java   
public ClassPrepareEvent resumeToPrepareOf(String className) {
    final ClassPrepareRequest request =
            eventRequestManager().createClassPrepareRequest();
    request.addClassFilter(className);
    request.addCountFilter(1);
    request.enable();
    return (ClassPrepareEvent)resumeToEvent(request);
}
项目:infobip-open-jdk-8    文件:FieldMonitor.java   
private static void addClassWatch(VirtualMachine vm) {
  EventRequestManager erm = vm.eventRequestManager();
  ClassPrepareRequest classPrepareRequest = erm
      .createClassPrepareRequest();
  classPrepareRequest.addClassFilter(CLASS_NAME);
  classPrepareRequest.setEnabled(true);
}
项目:infobip-open-jdk-8    文件:PatternReferenceTypeSpec.java   
@Override
public ClassPrepareRequest createPrepareRequest() {
    ClassPrepareRequest request =
        Env.vm().eventRequestManager().createClassPrepareRequest();
    request.addClassFilter(classId);
    request.addCountFilter(1);
    return request;
}
项目:jdk8u-dev-jdk    文件:PatternReferenceTypeSpec.java   
@Override
public ClassPrepareRequest createPrepareRequest() {
    ClassPrepareRequest request =
        Env.vm().eventRequestManager().createClassPrepareRequest();
    request.addClassFilter(classId);
    request.addCountFilter(1);
    return request;
}
项目:jdk7-jdk    文件:PatternReferenceTypeSpec.java   
@Override
public ClassPrepareRequest createPrepareRequest() {
    ClassPrepareRequest request =
        Env.vm().eventRequestManager().createClassPrepareRequest();
    request.addClassFilter(classId);
    request.addCountFilter(1);
    return request;
}
项目:openjdk-source-code-learn    文件:PatternReferenceTypeSpec.java   
@Override
public ClassPrepareRequest createPrepareRequest() {
    ClassPrepareRequest request =
        Env.vm().eventRequestManager().createClassPrepareRequest();
    request.addClassFilter(classId);
    request.addCountFilter(1);
    return request;
}
项目:OLD-OpenJDK8    文件:FieldMonitor.java   
private static void addClassWatch(VirtualMachine vm) {
  EventRequestManager erm = vm.eventRequestManager();
  ClassPrepareRequest classPrepareRequest = erm
      .createClassPrepareRequest();
  classPrepareRequest.addClassFilter(CLASS_NAME);
  classPrepareRequest.setEnabled(true);
}
项目:OLD-OpenJDK8    文件:PatternReferenceTypeSpec.java   
@Override
public ClassPrepareRequest createPrepareRequest() {
    ClassPrepareRequest request =
        Env.vm().eventRequestManager().createClassPrepareRequest();
    request.addClassFilter(classId);
    request.addCountFilter(1);
    return request;
}
项目:cn1    文件:Main.java   
@SuppressWarnings("unchecked")
private void init(String[] args) throws Exception {
    /*
     * TODO As currently jdb just supports "jdb -attach [port]" command, 
     * more work to do to parse the jdb launching command option
     */
    if (args.length >= 2 && args[0].equals("-attach")) {
        SocketAttachingConnectorImpl sac = 
            new SocketAttachingConnectorImpl(
                    (VirtualMachineManagerImpl) Bootstrap.
                    virtualMachineManager());
        Map argMap = sac.defaultArguments();
        Connector.Argument value;
        value = (Connector.Argument) argMap.get("hostname");
        value.setValue("localhost");
        value = (Connector.Argument) argMap.get("port");
        value.setValue(args[1]);
        debuggee = sac.attach(argMap);
        //VMProcess = debuggee.process();
    } else {
        System.out.println("Wrong command option. " +
                "The jdb currently only support jdb -attach [port].");
        System.exit(0);
    }

    eventRequestManager = debuggee.eventRequestManager();

    // Enable class prepare request for all classes
    ClassPrepareRequest classPrepareRequest 
        = eventRequestManager.createClassPrepareRequest();
    classPrepareRequest.addClassFilter("*");
    classPrepareRequest.setSuspendPolicy(EventRequest.SUSPEND_ALL);
    classPrepareRequest.enable();

    // Enable thread start request for all threads
    ThreadStartRequest threadStartRequest 
        = eventRequestManager.createThreadStartRequest();
    threadStartRequest.setSuspendPolicy(EventRequest.SUSPEND_EVENT_THREAD);
    threadStartRequest.enable();
}
项目:tools-idea    文件:JSR45PositionManager.java   
public ClassPrepareRequest createPrepareRequest(final ClassPrepareRequestor requestor, final SourcePosition position)
  throws NoDataException {
  checkSourcePositionFileType(position);

  return myDebugProcess.getRequestsManager().createClassPrepareRequest(new ClassPrepareRequestor() {
    public void processClassPrepare(DebugProcess debuggerProcess, ReferenceType referenceType) {
      onClassPrepare(debuggerProcess, referenceType, position, requestor);
    }
  }, GENERATED_CLASS_PATTERN);
}
项目:tools-idea    文件:CompoundPositionManager.java   
public ClassPrepareRequest createPrepareRequest(ClassPrepareRequestor requestor, SourcePosition position) {
  for (PositionManager positionManager : myPositionManagers) {
    try {
      return positionManager.createPrepareRequest(requestor, position);
    }
    catch (NoDataException ignored) {
    }
  }

  return null;
}
项目:tools-idea    文件:SpringLoadedPositionManager.java   
@Override
public ClassPrepareRequest createPrepareRequest(ClassPrepareRequestor requestor, SourcePosition position) throws NoDataException {
  String className = getOuterClassName(position);
  if (className == null) {
    throw new NoDataException();
  }

  return myDebugProcess.getRequestsManager().createClassPrepareRequest(requestor, className + "*");
}
项目:openjdk-jdk7u-jdk    文件:PatternReferenceTypeSpec.java   
@Override
public ClassPrepareRequest createPrepareRequest() {
    ClassPrepareRequest request =
        Env.vm().eventRequestManager().createClassPrepareRequest();
    request.addClassFilter(classId);
    request.addCountFilter(1);
    return request;
}
项目:freeVM    文件:Main.java   
@SuppressWarnings("unchecked")
private void init(String[] args) throws Exception {
    /*
     * TODO As currently jdb just supports "jdb -attach [port]" command, 
     * more work to do to parse the jdb launching command option
     */
    if (args.length >= 2 && args[0].equals("-attach")) {
        SocketAttachingConnectorImpl sac = 
            new SocketAttachingConnectorImpl(
                    (VirtualMachineManagerImpl) Bootstrap.
                    virtualMachineManager());
        Map argMap = sac.defaultArguments();
        Connector.Argument value;
        value = (Connector.Argument) argMap.get("hostname");
        value.setValue("localhost");
        value = (Connector.Argument) argMap.get("port");
        value.setValue(args[1]);
        debuggee = sac.attach(argMap);
        //VMProcess = debuggee.process();
    } else {
        System.out.println("Wrong command option. " +
                "The jdb currently only support jdb -attach [port].");
        System.exit(0);
    }

    eventRequestManager = debuggee.eventRequestManager();

    // Enable class prepare request for all classes
    ClassPrepareRequest classPrepareRequest 
        = eventRequestManager.createClassPrepareRequest();
    classPrepareRequest.addClassFilter("*");
    classPrepareRequest.setSuspendPolicy(EventRequest.SUSPEND_ALL);
    classPrepareRequest.enable();

    // Enable thread start request for all threads
    ThreadStartRequest threadStartRequest 
        = eventRequestManager.createThreadStartRequest();
    threadStartRequest.setSuspendPolicy(EventRequest.SUSPEND_EVENT_THREAD);
    threadStartRequest.enable();
}
项目:openjdk-icedtea7    文件:FieldMonitor.java   
private static void addClassWatch(VirtualMachine vm) {
  EventRequestManager erm = vm.eventRequestManager();
  ClassPrepareRequest classPrepareRequest = erm
      .createClassPrepareRequest();
  classPrepareRequest.addClassFilter(CLASS_NAME);
  classPrepareRequest.setEnabled(true);
}
项目:openjdk-icedtea7    文件:PatternReferenceTypeSpec.java   
@Override
public ClassPrepareRequest createPrepareRequest() {
    ClassPrepareRequest request =
        Env.vm().eventRequestManager().createClassPrepareRequest();
    request.addClassFilter(classId);
    request.addCountFilter(1);
    return request;
}
项目:openjdk-jdk10    文件:EventRequestManagerImpl.java   
public ClassPrepareRequest createClassPrepareRequest() {
    return new ClassPrepareRequestImpl();
}