本文整理汇总了Java中com.sun.jdi.request.EventRequestManager.createExceptionRequest方法的典型用法代码示例。如果您正苦于以下问题:Java EventRequestManager.createExceptionRequest方法的具体用法?Java EventRequestManager.createExceptionRequest怎么用?Java EventRequestManager.createExceptionRequest使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sun.jdi.request.EventRequestManager
的用法示例。
在下文中一共展示了EventRequestManager.createExceptionRequest方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setExceptionBreakpoints
import com.sun.jdi.request.EventRequestManager; //导入方法依赖的package包/类
@Override
public void setExceptionBreakpoints(boolean notifyCaught, boolean notifyUncaught) {
EventRequestManager manager = vm.eventRequestManager();
ArrayList<ExceptionRequest> legacy = new ArrayList<>(manager.exceptionRequests());
manager.deleteEventRequests(legacy);
// When no exception breakpoints are requested, no need to create an empty exception request.
if (notifyCaught || notifyUncaught) {
ExceptionRequest request = manager.createExceptionRequest(null, notifyCaught, notifyUncaught);
request.setSuspendPolicy(EventRequest.SUSPEND_EVENT_THREAD);
request.enable();
}
}
示例2: createRequest
import com.sun.jdi.request.EventRequestManager; //导入方法依赖的package包/类
protected void createRequest()
{
final EventRequestManager manager = owner.getEventRequestManager();
if (manager != null)
{
try
{
/**
* NOTE: (@2012-10-11, dlessa): In Juno, the list of exception requests is implemented as
* an UnmodifiableCollection, therefore, we cannot circumvent the processing order of the
* exception handlers any longer... Hopefully, this will not affect the semantics of
* exception handling in Jive.
*/
// Don't filter ExceptionEvents as they are needed to adjust the call stack
if (request != null)
{
removeRequest();
}
request = manager.createExceptionRequest(null, true, true);
request.setSuspendPolicy(EventRequest.SUSPEND_EVENT_THREAD);
request.enable();
owner.addJDIEventListener(this, request);
}
catch (final RuntimeException e)
{
JiveDebugPlugin.log(e);
}
}
}
示例3: setEventRequests
import com.sun.jdi.request.EventRequestManager; //导入方法依赖的package包/类
/**
* Create the desired event requests, and enable
* them so that we will get events.
* @param excludes Class patterns for which we don't want events
* @param watchFields Do we want to watch assignments to fields
*/
void setEventRequests() {
EventRequestManager mgr = vm.eventRequestManager();
ExceptionRequest excReq = mgr.createExceptionRequest(null,true, true);
excReq.setSuspendPolicy(EventRequest.SUSPEND_ALL);
excReq.enable();
MethodEntryRequest menr = mgr.createMethodEntryRequest();
for (int i=0; i<excludes.size(); ++i) {
menr.addClassExclusionFilter(excludes.get(i));
}
menr.setSuspendPolicy(EventRequest.SUSPEND_ALL);
menr.enable();
MethodExitRequest mexr = mgr.createMethodExitRequest();
for (int i=0; i<excludes.size(); ++i) {
mexr.addClassExclusionFilter(excludes.get(i));
}
mexr.setSuspendPolicy(EventRequest.SUSPEND_ALL);
mexr.enable();
ThreadDeathRequest tdr = mgr.createThreadDeathRequest();
tdr.setSuspendPolicy(EventRequest.SUSPEND_ALL);
tdr.enable();
}