当前位置: 首页>>代码示例>>Java>>正文


Java EventRequest.setSuspendPolicy方法代码示例

本文整理汇总了Java中com.sun.jdi.request.EventRequest.setSuspendPolicy方法的典型用法代码示例。如果您正苦于以下问题:Java EventRequest.setSuspendPolicy方法的具体用法?Java EventRequest.setSuspendPolicy怎么用?Java EventRequest.setSuspendPolicy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.sun.jdi.request.EventRequest的用法示例。


在下文中一共展示了EventRequest.setSuspendPolicy方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createRequest

import com.sun.jdi.request.EventRequest; //导入方法依赖的package包/类
@Override
protected void createRequest()
{
  final EventRequestManager manager = getEventRequestManager();
  if (manager != null)
  {
    try
    {
      final EventRequest request = manager.createThreadDeathRequest();
      request.setSuspendPolicy(EventRequest.SUSPEND_EVENT_THREAD);
      request.enable();
      addJDIEventListener(this, request);
    }
    catch (final RuntimeException e)
    {
      logError(e);
    }
  }
}
 
开发者ID:UBPL,项目名称:jive,代码行数:20,代码来源:JiveDebugTarget.java

示例2: resolveEventRequest

import com.sun.jdi.request.EventRequest; //导入方法依赖的package包/类
/**
 * The 'refType' is known to match, return the EventRequest.
 */
@Override
EventRequest resolveEventRequest(ReferenceType refType)
                                  throws NoSuchFieldException {
    Field field = refType.fieldByName(fieldId);
    EventRequestManager em = refType.virtualMachine().eventRequestManager();
    EventRequest wp = em.createModificationWatchpointRequest(field);
    wp.setSuspendPolicy(suspendPolicy);
    wp.enable();
    return wp;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:14,代码来源:ModificationWatchpointSpec.java

示例3: start

import com.sun.jdi.request.EventRequest; //导入方法依赖的package包/类
@Override
public void start() {
    // request thread events by default
    EventRequest threadStartRequest = vm.eventRequestManager().createThreadStartRequest();
    threadStartRequest.setSuspendPolicy(EventRequest.SUSPEND_NONE);
    threadStartRequest.enable();

    EventRequest threadDeathRequest = vm.eventRequestManager().createThreadDeathRequest();
    threadDeathRequest.setSuspendPolicy(EventRequest.SUSPEND_NONE);
    threadDeathRequest.enable();

    eventHub.start(vm);
}
 
开发者ID:Microsoft,项目名称:java-debug,代码行数:14,代码来源:DebugSession.java

示例4: resolveEventRequest

import com.sun.jdi.request.EventRequest; //导入方法依赖的package包/类
/**
 * The 'refType' is known to match, return the EventRequest.
 */
EventRequest resolveEventRequest(ReferenceType refType)
                                  throws NoSuchFieldException {
    Field field = refType.fieldByName(fieldId);
    EventRequestManager em = refType.virtualMachine().eventRequestManager();
    EventRequest wp = em.createModificationWatchpointRequest(field);
    wp.setSuspendPolicy(suspendPolicy);
    wp.enable();
    return wp;
}
 
开发者ID:unktomi,项目名称:form-follows-function,代码行数:13,代码来源:ModificationWatchpointSpec.java

示例5: VirtualMachineImpl

import com.sun.jdi.request.EventRequest; //导入方法依赖的package包/类
VirtualMachineImpl(VirtualMachineManager manager,
                   Connection connection, Process process,
                   int sequenceNumber) {
    super(null);  // Can't use super(this)
    vm = this;

    this.vmManager = (VirtualMachineManagerImpl)manager;
    this.process = process;
    this.sequenceNumber = sequenceNumber;

    /* Create ThreadGroup to be used by all threads servicing
     * this VM.
     */
    threadGroupForJDI = new ThreadGroup(vmManager.mainGroupForJDI(),
                                        "JDI [" +
                                        this.hashCode() + "]");

    /*
     * Set up a thread to communicate with the target VM over
     * the specified transport.
     */
    target = new TargetVM(this, connection);

    /*
     * Set up a thread to handle events processed internally
     * the JDI implementation.
     */
    EventQueueImpl internalEventQueue = new EventQueueImpl(this, target);
    new InternalEventHandler(this, internalEventQueue);
    /*
     * Initialize client access to event setting and handling
     */
    eventQueue = new EventQueueImpl(this, target);
    eventRequestManager = new EventRequestManagerImpl(this);

    target.start();

    /*
     * Many ids are variably sized, depending on target VM.
     * Find out the sizes right away.
     */
    JDWP.VirtualMachine.IDSizes idSizes;
    try {
        idSizes = JDWP.VirtualMachine.IDSizes.process(vm);
    } catch (JDWPException exc) {
        throw exc.toJDIException();
    }
    sizeofFieldRef  = idSizes.fieldIDSize;
    sizeofMethodRef = idSizes.methodIDSize;
    sizeofObjectRef = idSizes.objectIDSize;
    sizeofClassRef = idSizes.referenceTypeIDSize;
    sizeofFrameRef  = idSizes.frameIDSize;

    /**
     * Set up requests needed by internal event handler.
     * Make sure they are distinguished by creating them with
     * an internal event request manager.
     *
     * Warning: create events only with SUSPEND_NONE policy.
     * In the current implementation other policies will not
     * be handled correctly when the event comes in. (notfiySuspend()
     * will not be properly called, and if the event is combined
     * with external events in the same set, suspend policy is not
     * correctly determined for the internal vs. external event sets)
     */
    internalEventRequestManager = new EventRequestManagerImpl(this);
    EventRequest er = internalEventRequestManager.createClassPrepareRequest();
    er.setSuspendPolicy(EventRequest.SUSPEND_NONE);
    er.enable();
    er = internalEventRequestManager.createClassUnloadRequest();
    er.setSuspendPolicy(EventRequest.SUSPEND_NONE);
    er.enable();

    /*
     * Tell other threads, notably TargetVM, that initialization
     * is complete.
     */
    notifyInitCompletion();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:80,代码来源:VirtualMachineImpl.java

示例6: VirtualMachineImpl

import com.sun.jdi.request.EventRequest; //导入方法依赖的package包/类
VirtualMachineImpl(VirtualMachineManager manager,
                   Connection connection, Process process,
                   int sequenceNumber) {
    super(null);  // Can't use super(this)
    vm = this;

    this.vmManager = (VirtualMachineManagerImpl)manager;
    this.process = process;
    this.sequenceNumber = sequenceNumber;

    /* Create ThreadGroup to be used by all threads servicing
     * this VM.
     */
    threadGroupForJDI = new ThreadGroup(vmManager.mainGroupForJDI(),
                                        "JDI [" +
                                        this.hashCode() + "]");

    /*
     * Set up a thread to communicate with the target VM over
     * the specified transport.
     */
    target = new TargetVM(this, connection);

    /*
     * Set up a thread to handle events processed internally
     * the JDI implementation.
     */
    EventQueueImpl internalEventQueue = new EventQueueImpl(this, target);
    new InternalEventHandler(this, internalEventQueue);
    /*
     * Initialize client access to event setting and handling
     */
    eventQueue = new EventQueueImpl(this, target);
    eventRequestManager = new EventRequestManagerImpl(this);

    target.start();

    /*
     * Many ids are variably sized, depending on target VM.
     * Find out the sizes right away.
     */
    JDWP.VirtualMachine.IDSizes idSizes;
    try {
        idSizes = JDWP.VirtualMachine.IDSizes.process(vm);
    } catch (JDWPException exc) {
        throw exc.toJDIException();
    }
    sizeofFieldRef  = idSizes.fieldIDSize;
    sizeofMethodRef = idSizes.methodIDSize;
    sizeofObjectRef = idSizes.objectIDSize;
    sizeofClassRef = idSizes.referenceTypeIDSize;
    sizeofFrameRef  = idSizes.frameIDSize;
    sizeofModuleRef = idSizes.objectIDSize;

    /**
     * Set up requests needed by internal event handler.
     * Make sure they are distinguished by creating them with
     * an internal event request manager.
     *
     * Warning: create events only with SUSPEND_NONE policy.
     * In the current implementation other policies will not
     * be handled correctly when the event comes in. (notfiySuspend()
     * will not be properly called, and if the event is combined
     * with external events in the same set, suspend policy is not
     * correctly determined for the internal vs. external event sets)
     */
    internalEventRequestManager = new EventRequestManagerImpl(this);
    EventRequest er = internalEventRequestManager.createClassPrepareRequest();
    er.setSuspendPolicy(EventRequest.SUSPEND_NONE);
    er.enable();
    er = internalEventRequestManager.createClassUnloadRequest();
    er.setSuspendPolicy(EventRequest.SUSPEND_NONE);
    er.enable();

    /*
     * Tell other threads, notably TargetVM, that initialization
     * is complete.
     */
    notifyInitCompletion();
}
 
开发者ID:campolake,项目名称:openjdk9,代码行数:81,代码来源:VirtualMachineImpl.java


注:本文中的com.sun.jdi.request.EventRequest.setSuspendPolicy方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。