StackTraceEntry(Instrumenter instrumenter, EventContext context, byte state) { this.tags = instrumenter.queryTags(context.getInstrumentedNode()); this.sourceSection = context.getInstrumentedSourceSection(); this.instrumentedNode = context.getInstrumentedNode(); this.rootName = extractRootName(instrumentedNode); this.state = state; }
@Override public boolean hasTag(Class<? extends Tag> tag) { return eventContext.hasTag(tag); }
/** * Creates a shallow copy of this node. * * @return the new copy * @since 0.31 */ @Override public Node copy() { ProbeNode pn = (ProbeNode) super.copy(); pn.context = new EventContext(pn, context.getInstrumentedSourceSection()); return pn; }
CancelExecution(EventContext context) { this.node = context.getInstrumentedNode(); }
/** @since 0.12 */ @Override public String toString() { return "EventContext[source=" + getInstrumentedSourceSection() + "]"; }
@SuppressWarnings("unchecked") boolean validEventContext() { Node node = getInstrumentedNode(); if (node instanceof RootNode) { throw new IllegalStateException("Instrumentable node must not be a root node."); } Object object = null; if (node instanceof InstrumentableNode) { object = ((InstrumentableNode) node).getNodeObject(); } else { // legacy support return true; } if (object != null) { assert AccessorInstrumentHandler.interopAccess().isValidNodeObject(object); } boolean foundStandardTag = false; for (Class<?> clazz : StandardTags.ALL_TAGS) { if (hasTag((Class<? extends Tag>) clazz)) { foundStandardTag = true; } } if (foundStandardTag) { RootNode root = probeNode.getRootNode(); if (root != null && root.getSourceSection() != null) { assert sourceSection != null : "All nodes tagged with a standard tag and with a root node that has a source section must also have a source section."; } } return true; }
public ThreadDeath createUnwind(Object info, EventBinding<?> unwindBinding) { return eventContext.createUnwind(info, unwindBinding); }
public boolean isLanguageContextInitialized() { return eventContext.isLanguageContextInitialized(); }
DebuggerNode lookupNode(EventContext context) { if (!isEnabled()) { return null; } else { EventBinding<? extends ExecutionEventNodeFactory> binding = breakpointBinding; if (binding != null) { return (DebuggerNode) context.lookupExecutionEventNode(binding); } return null; } }
/** Instantiated by the instrumentation framework. */ ProbeNode(InstrumentationHandler handler, SourceSection sourceSection) { this.handler = handler; this.context = new EventContext(this, sourceSection); }
@Override public String toString() { return eventContext.toString(); }
assert probe.getContext().validEventContext();
public Node getInstrumentedNode() { return eventContext.getInstrumentedNode(); }
/** @since 0.12 */ @Override public String toString() { return "EventContext[source=" + getInstrumentedSourceSection() + "]"; }
@SuppressWarnings("unchecked") boolean validEventContext() { Node node = getInstrumentedNode(); if (node instanceof RootNode) { throw new IllegalStateException("Instrumentable node must not be a root node."); } Object object = null; if (node instanceof InstrumentableNode) { object = ((InstrumentableNode) node).getNodeObject(); } else { // legacy support return true; } if (object != null) { assert AccessorInstrumentHandler.interopAccess().isValidNodeObject(object); } boolean foundStandardTag = false; for (Class<?> clazz : StandardTags.ALL_TAGS) { if (hasTag((Class<? extends Tag>) clazz)) { foundStandardTag = true; } } if (foundStandardTag) { RootNode root = probeNode.getRootNode(); if (root != null && root.getSourceSection() != null) { assert sourceSection != null : "All nodes tagged with a standard tag and with a root node that has a source section must also have a source section."; } } return true; }
public ThreadDeath createUnwind(Object info, EventBinding<?> unwindBinding) { return eventContext.createUnwind(info, unwindBinding); }
public boolean isLanguageContextInitialized() { return eventContext.isLanguageContextInitialized(); }
DebuggerNode lookupNode(EventContext context) { if (!isEnabled()) { return null; } else { EventBinding<? extends ExecutionEventNodeFactory> binding = breakpointBinding; if (binding != null) { return (DebuggerNode) context.lookupExecutionEventNode(binding); } return null; } }
/** Instantiated by the instrumentation framework. */ ProbeNode(InstrumentationHandler handler, SourceSection sourceSection) { this.handler = handler; this.context = new EventContext(this, sourceSection); }
@Override public String toString() { return eventContext.toString(); }