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


Java Event类代码示例

本文整理汇总了Java中org.apache.harmony.jpda.tests.framework.jdwp.Event的典型用法代码示例。如果您正苦于以下问题:Java Event类的具体用法?Java Event怎么用?Java Event使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Event类属于org.apache.harmony.jpda.tests.framework.jdwp包,在下文中一共展示了Event类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: perform

import org.apache.harmony.jpda.tests.framework.jdwp.Event; //导入依赖的package包/类
@Override
public void perform(JUnit3Wrapper testBase) {
  long threadId = testBase.getDebuggeeState().getThreadId();
  int stepRequestID;
  {
    EventBuilder eventBuilder = Event.builder(EventKind.SINGLE_STEP, SuspendPolicy.ALL);
    eventBuilder.setStep(threadId, stepSize, stepDepth);
    stepFilter.getExcludedClasses().stream().forEach(s -> eventBuilder.setClassExclude(s));
    ReplyPacket replyPacket = testBase.getMirror().setEvent(eventBuilder.build());
    stepRequestID = replyPacket.getNextValueAsInt();
    testBase.assertAllDataRead(replyPacket);
  }
  testBase.events
      .put(stepRequestID, new StepEventHandler(this, stepRequestID, stepFilter, stepUntil));

  // Resume all threads.
  testBase.resume();
}
 
开发者ID:inferjay,项目名称:r8,代码行数:19,代码来源:DebugTestBase.java

示例2: setCountableBreakpoint

import org.apache.harmony.jpda.tests.framework.jdwp.Event; //导入依赖的package包/类
/**
 * Sets breakpoint that triggers only on a certain occurrence to a given
 * location
 * 
 * @param typeTag
 * @param breakpoint
 * @param suspendPolicy
 *            Suspend policy for a breakpoint being created
 * @param count
 *            Limit the requested event to be reported at most once after a
 *            given number of occurrences
 * @return ReplyPacket for corresponding command
 */
public ReplyPacket setCountableBreakpoint(byte typeTag,
        Breakpoint breakpoint, byte suspendPolicy, int count) {
    long typeID = getTypeID(breakpoint.className, typeTag);

    // Get Method reference ID
    long methodID = getMethodID(typeID, breakpoint.methodName);

    byte eventKind = JDWPConstants.EventKind.BREAKPOINT;

    EventMod mod1 = new EventMod();
    mod1.modKind = EventMod.ModKind.LocationOnly;
    mod1.loc = new Location(typeTag, typeID, methodID, breakpoint.index);

    EventMod mod2 = new EventMod();
    mod2.modKind = EventMod.ModKind.Count;
    mod2.count = count;

    EventMod[] mods = new EventMod[] { mod1, mod2 };
    Event event = new Event(eventKind, suspendPolicy, mods);

    // Set breakpoint
    return setEvent(event);
}
 
开发者ID:shannah,项目名称:cn1,代码行数:37,代码来源:VmMirror.java

示例3: setException

import org.apache.harmony.jpda.tests.framework.jdwp.Event; //导入依赖的package包/类
/**
 * Sets exception event request for given exception class ID.
 * 
 * @param exceptionID
 *            exception referenceTypeID.
 * @param caught
 *            is exception caught
 * @param uncaught
 *            is exception uncaught
 * @return ReplyPacket for corresponding command
 */
public ReplyPacket setException(long exceptionID, boolean caught,
        boolean uncaught) {
    // Prepare corresponding event
    byte eventKind = JDWPConstants.EventKind.EXCEPTION;
    byte suspendPolicy = JDWPConstants.SuspendPolicy.ALL;
    EventMod[] mods = new EventMod[1];
    mods[0] = new EventMod();
    mods[0].modKind = EventMod.ModKind.ExceptionOnly;
    mods[0].caught = caught;
    mods[0].uncaught = uncaught;
    mods[0].exceptionOrNull = exceptionID;
    Event event = new Event(eventKind, suspendPolicy, mods);

    return setEvent(event);
}
 
开发者ID:shannah,项目名称:cn1,代码行数:27,代码来源:VmMirror.java

示例4: setCountableException

import org.apache.harmony.jpda.tests.framework.jdwp.Event; //导入依赖的package包/类
/**
 * Sets exception event request for given exception class signature.
 * 
 * @param exceptionSignature
 *            exception signature.
 * @param caught
 *            is exception caught
 * @param uncaught
 *            is exception uncaught
 * @param count
 *            Limit the requested event to be reported at most once after a
 *            given number of occurrences
 * @return ReplyPacket for corresponding command
 */
public ReplyPacket setCountableException(String exceptionSignature,
        boolean caught, boolean uncaught, int count) {
    // Request referenceTypeID for exception
    long exceptionID = getClassID(exceptionSignature);
    byte eventKind = JDWPConstants.EventKind.EXCEPTION;
    byte suspendPolicy = JDWPConstants.SuspendPolicy.ALL;
    EventMod[] mods = new EventMod[2];
    mods[0] = new EventMod();
    mods[0].modKind = EventMod.ModKind.ExceptionOnly;
    mods[0].caught = caught;
    mods[0].uncaught = uncaught;
    mods[0].exceptionOrNull = exceptionID;

    mods[1] = new EventMod();
    mods[1].modKind = EventMod.ModKind.Count;
    mods[1].count = count;
    Event event = new Event(eventKind, suspendPolicy, mods);

    return setEvent(event);
}
 
开发者ID:shannah,项目名称:cn1,代码行数:35,代码来源:VmMirror.java

示例5: setMethodEntry

import org.apache.harmony.jpda.tests.framework.jdwp.Event; //导入依赖的package包/类
/**
 * Sets METHOD_ENTRY event request for specified class name pattern.
 * 
 * @param classRegexp
 *            class name pattern or null for no pattern
 * 
 * @return ReplyPacket for corresponding command
 */
public ReplyPacket setMethodEntry(String classRegexp) {
    // Prepare corresponding event
    byte eventKind = JDWPConstants.EventKind.METHOD_ENTRY;
    byte suspendPolicy = JDWPConstants.SuspendPolicy.ALL;
    EventMod[] mods = null;
    if (classRegexp == null) {
        mods = new EventMod[0];
    } else {
        mods = new EventMod[1];
        mods[0] = new EventMod();
        mods[0].modKind = EventMod.ModKind.ClassMatch;
        mods[0].classPattern = classRegexp;
    }
    Event event = new Event(eventKind, suspendPolicy, mods);

    return setEvent(event);
}
 
开发者ID:shannah,项目名称:cn1,代码行数:26,代码来源:VmMirror.java

示例6: setCountableMethodEntry

import org.apache.harmony.jpda.tests.framework.jdwp.Event; //导入依赖的package包/类
/**
 * Sets METHOD_ENTRY event request for specified class name pattern.
 * 
 * @param classRegexp
 *            class name pattern or null for no pattern
 * @param count
 *            Limit the requested event to be reported at most once after a
 *            given number of occurrences
 * @return ReplyPacket for corresponding command
 */
public ReplyPacket setCountableMethodEntry(String classRegexp, int count) {
    byte eventKind = JDWPConstants.EventKind.METHOD_ENTRY;
    byte suspendPolicy = JDWPConstants.SuspendPolicy.ALL;
    EventMod[] mods = null;
    if (classRegexp == null) {
        mods = new EventMod[] { new EventMod() };
        mods[0].modKind = EventMod.ModKind.Count;
        mods[0].count = count;
    } else {
        mods = new EventMod[2];
        mods[0] = new EventMod();
        mods[0].modKind = EventMod.ModKind.ClassMatch;
        mods[0].classPattern = classRegexp;

        mods[1] = new EventMod();
        mods[1].modKind = EventMod.ModKind.Count;
        mods[1].count = count;
    }
    Event event = new Event(eventKind, suspendPolicy, mods);

    return setEvent(event);
}
 
开发者ID:shannah,项目名称:cn1,代码行数:33,代码来源:VmMirror.java

示例7: setMethodExit

import org.apache.harmony.jpda.tests.framework.jdwp.Event; //导入依赖的package包/类
/**
 * Sets METHOD_EXIT event request for specified class name pattern.
 * 
 * @param classRegexp
 *            class name pattern or null for no pattern
 * 
 * @return ReplyPacket for corresponding command
 */
public ReplyPacket setMethodExit(String classRegexp) {
    // Prepare corresponding event
    byte eventKind = JDWPConstants.EventKind.METHOD_EXIT;
    byte suspendPolicy = JDWPConstants.SuspendPolicy.ALL;
    EventMod[] mods = null;
    if (classRegexp == null) {
        mods = new EventMod[0];
    } else {
        mods = new EventMod[1];
        mods[0] = new EventMod();
        mods[0].modKind = EventMod.ModKind.ClassMatch;
        mods[0].classPattern = classRegexp;
    }
    Event event = new Event(eventKind, suspendPolicy, mods);

    return setEvent(event);
}
 
开发者ID:shannah,项目名称:cn1,代码行数:26,代码来源:VmMirror.java

示例8: setMethodExitWithReturnValue

import org.apache.harmony.jpda.tests.framework.jdwp.Event; //导入依赖的package包/类
/**
 * Sets METHOD_EXIT_WITH_RETURN_VALUE event request for specified class name pattern.
 * 
 * @param classRegexp
 *            class name pattern or null for no pattern
 * 
 * @return ReplyPacket for corresponding command
 */
public ReplyPacket setMethodExitWithReturnValue(String classRegexp) {
    // Prepare corresponding event
    byte eventKind = JDWPConstants.EventKind.METHOD_EXIT_WITH_RETURN_VALUE;
    byte suspendPolicy = JDWPConstants.SuspendPolicy.ALL;
    EventMod[] mods = null;
    if (classRegexp == null) {
        mods = new EventMod[0];
    } else {
        mods = new EventMod[1];
        mods[0] = new EventMod();
        mods[0].modKind = EventMod.ModKind.ClassMatch;
        mods[0].classPattern = classRegexp;
    }
    Event event = new Event(eventKind, suspendPolicy, mods);

    return setEvent(event);
}
 
开发者ID:shannah,项目名称:cn1,代码行数:26,代码来源:VmMirror.java

示例9: setCountableMethodExit

import org.apache.harmony.jpda.tests.framework.jdwp.Event; //导入依赖的package包/类
/**
 * Sets METHOD_EXIT event request for specified class name pattern.
 * 
 * @param classRegexp
 *            classRegexp class name pattern or null for no pattern
 * @param count
 *            Limit the requested event to be reported at most once after a
 *            given number of occurrences
 * @return ReplyPacket for corresponding command
 */
public ReplyPacket setCountableMethodExit(String classRegexp, int count) {
    byte eventKind = JDWPConstants.EventKind.METHOD_EXIT;
    byte suspendPolicy = JDWPConstants.SuspendPolicy.ALL;
    EventMod[] mods = null;
    if (classRegexp == null) {
        mods = new EventMod[] { new EventMod() };
        mods[0].modKind = EventMod.ModKind.Count;
        mods[0].count = count;
    } else {
        mods = new EventMod[2];
        mods[0] = new EventMod();
        mods[0].modKind = EventMod.ModKind.ClassMatch;
        mods[0].classPattern = classRegexp;

        mods[1] = new EventMod();
        mods[1].modKind = EventMod.ModKind.Count;
        mods[1].count = count;
    }
    Event event = new Event(eventKind, suspendPolicy, mods);

    return setEvent(event);

}
 
开发者ID:shannah,项目名称:cn1,代码行数:34,代码来源:VmMirror.java

示例10: setStep

import org.apache.harmony.jpda.tests.framework.jdwp.Event; //导入依赖的package包/类
/**
 * Sets step event request for given thread name.
 * 
 * @param threadName
 *            thread name
 * @param stepSize
 * @param stepDepth
 * @return ReplyPacket for corresponding command
 */
public ReplyPacket setStep(String threadName, int stepSize, int stepDepth) {
    long typeID = -1;

    // Request referenceTypeID for class
    typeID = getThreadID(threadName);

    // Prepare corresponding event
    byte eventKind = JDWPConstants.EventKind.SINGLE_STEP;
    byte suspendPolicy = JDWPConstants.SuspendPolicy.ALL;
    // EventMod[] mods = new EventMod[1];
    EventMod[] mods = new EventMod[] { new EventMod() };
    mods[0].thread = typeID;
    mods[0].modKind = EventMod.ModKind.Step;
    mods[0].size = stepSize;
    mods[0].depth = stepDepth;
    Event event = new Event(eventKind, suspendPolicy, mods);

    // Set event
    return setEvent(event);
}
 
开发者ID:shannah,项目名称:cn1,代码行数:30,代码来源:VmMirror.java

示例11: setBreakpoint

import org.apache.harmony.jpda.tests.framework.jdwp.Event; //导入依赖的package包/类
/**
 * Sets breakpoint to given location
 * 
 * @param location
 *            Location of breakpoint
 * @param suspendPolicy
 *            Suspend policy for a breakpoint being created
 * @return ReplyPacket for corresponding command
 */
public ReplyPacket setBreakpoint(Location location, byte suspendPolicy) {
    // Prepare corresponding event
    byte eventKind = JDWPConstants.EventKind.BREAKPOINT;

    // EventMod[] mods = new EventMod[1];
    EventMod[] mods = new EventMod[] { new EventMod() };

    mods[0].loc = location;
    mods[0].modKind = EventMod.ModKind.LocationOnly;
    Event event = new Event(eventKind, suspendPolicy, mods);

    // Set breakpoint
    return setEvent(event);
}
 
开发者ID:shannah,项目名称:cn1,代码行数:24,代码来源:VmMirror.java

示例12: setClassPrepared

import org.apache.harmony.jpda.tests.framework.jdwp.Event; //导入依赖的package包/类
/**
 * Sets ClassPrepare event request for given class name pattern.
 * 
 * @param classRegexp
 *            Required class pattern. Matches are limited to exact matches
 *            of the given class pattern and matches of patterns that begin
 *            or end with '*'; for example, "*.Foo" or "java.*".
 * @return ReplyPacket for setting request.
 */
public ReplyPacket setClassPrepared(String classRegexp) {
    // Prepare corresponding event
    byte eventKind = JDWPConstants.EventKind.CLASS_PREPARE;
    byte suspendPolicy = JDWPConstants.SuspendPolicy.ALL;
    // EventMod[] mods = new EventMod[1];
    EventMod[] mods = new EventMod[] { new EventMod() };
    mods[0].classPattern = classRegexp;
    mods[0].modKind = EventMod.ModKind.ClassMatch;
    Event event = new Event(eventKind, suspendPolicy, mods);

    // Set event
    return setEvent(event);
}
 
开发者ID:shannah,项目名称:cn1,代码行数:23,代码来源:VmMirror.java

示例13: setClassPreparedForSourceNameMatch

import org.apache.harmony.jpda.tests.framework.jdwp.Event; //导入依赖的package包/类
/**
 * Sets ClassPrepare event request for given source name pattern.
 * 
 * @param sourceNamePattern
 *            Required source name pattern. Matches are limited to exact matches
 *            of the given source name pattern and matches of patterns that begin
 *            or end with '*'; for example, "*.Foo" or "java.*".
 * @return ReplyPacket for setting request.
 */
public ReplyPacket setClassPreparedForSourceNameMatch(String sourceNamePattern) {
    // Prepare corresponding event
    byte eventKind = JDWPConstants.EventKind.CLASS_PREPARE;
    byte suspendPolicy = JDWPConstants.SuspendPolicy.ALL;
    EventMod[] mods = new EventMod[] { new EventMod() };
    mods[0].sourceNamePattern = sourceNamePattern; 
    mods[0].modKind = EventMod.ModKind.SourceNameMatch;
    Event event = new Event(eventKind, suspendPolicy, mods);

    // Set event
    return setEvent(event);
}
 
开发者ID:shannah,项目名称:cn1,代码行数:22,代码来源:VmMirror.java

示例14: setClassUnload

import org.apache.harmony.jpda.tests.framework.jdwp.Event; //导入依赖的package包/类
/**
 * Sets ClassUnload event request for given class name pattern.
 * 
 * @param classSignature
 *            class signature
 * @return ReplyPacket for setting request
 */
public ReplyPacket setClassUnload(String classRegexp) {
    // Prepare corresponding event
    byte eventKind = JDWPConstants.EventKind.CLASS_UNLOAD;
    byte suspendPolicy = JDWPConstants.SuspendPolicy.ALL;
    // EventMod[] mods = new EventMod[1];
    EventMod[] mods = new EventMod[] { new EventMod() };
    mods[0].classPattern = classRegexp;
    mods[0].modKind = EventMod.ModKind.ClassMatch;
    Event event = new Event(eventKind, suspendPolicy, mods);

    // Set event
    return setEvent(event);
}
 
开发者ID:shannah,项目名称:cn1,代码行数:21,代码来源:VmMirror.java

示例15: setClassLoad

import org.apache.harmony.jpda.tests.framework.jdwp.Event; //导入依赖的package包/类
/**
 * Set ClassLoad event request for given class ID.
 * 
 * @param referenceTypeID
 *            class referenceTypeID
 * @return ReplyPacket for setting request
 */
public ReplyPacket setClassLoad(long referenceTypeID) {
    // Prepare corresponding event
    byte eventKind = JDWPConstants.EventKind.CLASS_LOAD;
    byte suspendPolicy = JDWPConstants.SuspendPolicy.ALL;
    EventMod[] mods = new EventMod[] { new EventMod() };
    mods[0].clazz = referenceTypeID;
    mods[0].modKind = EventMod.ModKind.ClassOnly;
    Event event = new Event(eventKind, suspendPolicy, mods);

    // Set event
    return setEvent(event);
}
 
开发者ID:shannah,项目名称:cn1,代码行数:20,代码来源:VmMirror.java


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