本文整理汇总了Java中com.sun.jdi.request.EventRequest.enable方法的典型用法代码示例。如果您正苦于以下问题:Java EventRequest.enable方法的具体用法?Java EventRequest.enable怎么用?Java EventRequest.enable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sun.jdi.request.EventRequest
的用法示例。
在下文中一共展示了EventRequest.enable方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
}
}
示例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;
}
示例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);
}
示例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;
}
示例5: setRequest
import com.sun.jdi.request.EventRequest; //导入方法依赖的package包/类
void setRequest(EventRequest request) {
this.request = request;
request.putProperty(specPropertyKey, this);
request.enable();
}
示例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;
/**
* 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();
}
示例7: 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();
}