本文整理汇总了Java中com.sun.jdi.request.ClassPrepareRequest类的典型用法代码示例。如果您正苦于以下问题:Java ClassPrepareRequest类的具体用法?Java ClassPrepareRequest怎么用?Java ClassPrepareRequest使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ClassPrepareRequest类属于com.sun.jdi.request包,在下文中一共展示了ClassPrepareRequest类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createPrepareRequests
import com.sun.jdi.request.ClassPrepareRequest; //导入依赖的package包/类
@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());
}
示例2: deferBreakpoint
import com.sun.jdi.request.ClassPrepareRequest; //导入依赖的package包/类
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());
}
示例3: processClassPrepareEvent
import com.sun.jdi.request.ClassPrepareRequest; //导入依赖的package包/类
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;
}
示例4: createPrepareRequest
import com.sun.jdi.request.ClassPrepareRequest; //导入依赖的package包/类
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 + "$*");
}
示例5: createRequest
import com.sun.jdi.request.ClassPrepareRequest; //导入依赖的package包/类
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);
}
}
}
示例6: createPrepareRequest
import com.sun.jdi.request.ClassPrepareRequest; //导入依赖的package包/类
@Override
public ClassPrepareRequest createPrepareRequest() {
ClassPrepareRequest request =
Env.vm().eventRequestManager().createClassPrepareRequest();
request.addClassFilter(classId);
request.addCountFilter(1);
return request;
}
示例7: addClassWatch
import com.sun.jdi.request.ClassPrepareRequest; //导入依赖的package包/类
private static void addClassWatch(VirtualMachine vm) {
EventRequestManager erm = vm.eventRequestManager();
ClassPrepareRequest classPrepareRequest = erm
.createClassPrepareRequest();
classPrepareRequest.addClassFilter(CLASS_NAME);
classPrepareRequest.setEnabled(true);
}
示例8: addClassWatch
import com.sun.jdi.request.ClassPrepareRequest; //导入依赖的package包/类
private static void addClassWatch(VirtualMachine vm) {
EventRequestManager erm = vm.eventRequestManager();
ClassPrepareRequest classPrepareRequest = erm
.createClassPrepareRequest();
classPrepareRequest.addClassFilter(CLASS_NAME);
classPrepareRequest.setEnabled(true);
}
示例9: createPrepareRequest
import com.sun.jdi.request.ClassPrepareRequest; //导入依赖的package包/类
@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);
}
示例10: createPrepareRequest
import com.sun.jdi.request.ClassPrepareRequest; //导入依赖的package包/类
@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);
}
示例11: createPrepareRequest
import com.sun.jdi.request.ClassPrepareRequest; //导入依赖的package包/类
@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 + "$*");
}
示例12: createPrepareRequest
import com.sun.jdi.request.ClassPrepareRequest; //导入依赖的package包/类
@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 + "*");
}
示例13: wrapClassPrepareRequests
import com.sun.jdi.request.ClassPrepareRequest; //导入依赖的package包/类
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;
}
示例14: createPrepareRequest
import com.sun.jdi.request.ClassPrepareRequest; //导入依赖的package包/类
public ClassPrepareRequest createPrepareRequest() {
ClassPrepareRequest request =
env.vm().eventRequestManager().createClassPrepareRequest();
request.addClassFilter(classId);
request.addCountFilter(1);
return request;
}
示例15: resumeToPrepareOf
import com.sun.jdi.request.ClassPrepareRequest; //导入依赖的package包/类
public ClassPrepareEvent resumeToPrepareOf(String className) {
final ClassPrepareRequest request =
eventRequestManager().createClassPrepareRequest();
request.addClassFilter(className);
request.addCountFilter(1);
request.enable();
return (ClassPrepareEvent)resumeToEvent(request);
}