本文整理汇总了Java中com.intellij.debugger.engine.events.SuspendContextCommandImpl类的典型用法代码示例。如果您正苦于以下问题:Java SuspendContextCommandImpl类的具体用法?Java SuspendContextCommandImpl怎么用?Java SuspendContextCommandImpl使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SuspendContextCommandImpl类属于com.intellij.debugger.engine.events包,在下文中一共展示了SuspendContextCommandImpl类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: resume
import com.intellij.debugger.engine.events.SuspendContextCommandImpl; //导入依赖的package包/类
protected void resume(){
assertNotResumed();
if (isEvaluating()) {
LOG.error("Resuming context while evaluating", ThreadDumper.dumpThreadsToString());
}
DebuggerManagerThreadImpl.assertIsManagerThread();
try {
if (!Patches.IBM_JDK_DISABLE_COLLECTION_BUG) {
for (ObjectReference objectReference : myKeptReferences) {
DebuggerUtilsEx.enableCollection(objectReference);
}
myKeptReferences.clear();
}
for(SuspendContextCommandImpl cmd = pollPostponedCommand(); cmd != null; cmd = pollPostponedCommand()) {
cmd.notifyCancelled();
}
resumeImpl();
}
finally {
myIsResumed = true;
}
}
示例2: computeExecutionStacks
import com.intellij.debugger.engine.events.SuspendContextCommandImpl; //导入依赖的package包/类
@Override
public void computeExecutionStacks(final XExecutionStackContainer container) {
myDebugProcess.getManagerThread().schedule(new SuspendContextCommandImpl(this) {
@Override
public void contextAction() throws Exception {
List<JavaExecutionStack> res = new ArrayList<JavaExecutionStack>();
Collection<ThreadReferenceProxyImpl> threads = getDebugProcess().getVirtualMachineProxy().allThreads();
JavaExecutionStack currentStack = null;
for (ThreadReferenceProxyImpl thread : threads) {
boolean current = thread == myThread;
JavaExecutionStack stack = new JavaExecutionStack(thread, myDebugProcess, current);
if (!current) {
res.add(stack);
}
else {
currentStack = stack;
}
}
Collections.sort(res, THREADS_COMPARATOR);
if (currentStack != null) {
res.add(0, currentStack);
}
container.addExecutionStack(res, true);
}
});
}
示例3: startEvaluation
import com.intellij.debugger.engine.events.SuspendContextCommandImpl; //导入依赖的package包/类
@Override
public void startEvaluation(@NotNull final XFullValueEvaluationCallback callback) {
if (callback.isObsolete()) return;
myEvaluationContext.getManagerThread().schedule(new SuspendContextCommandImpl(myEvaluationContext.getSuspendContext()) {
@Override
public Priority getPriority() {
return Priority.NORMAL;
}
@Override
protected void commandCancelled() {
callback.errorOccurred(DebuggerBundle.message("error.context.has.changed"));
}
@Override
public void contextAction() throws Exception {
if (callback.isObsolete()) return;
evaluate(callback);
}
});
}
示例4: scheduleCommand
import com.intellij.debugger.engine.events.SuspendContextCommandImpl; //导入依赖的package包/类
protected static boolean scheduleCommand(EvaluationContextImpl evaluationContext,
@NotNull final XCompositeNode node,
final SuspendContextCommandImpl command) {
evaluationContext.getManagerThread().schedule(new SuspendContextCommandImpl(command.getSuspendContext()) {
@Override
public void contextAction() throws Exception {
command.contextAction();
}
@Override
protected void commandCancelled() {
node.setErrorMessage(DebuggerBundle.message("error.context.has.changed"));
}
});
return true;
}
示例5: invokeCommand
import com.intellij.debugger.engine.events.SuspendContextCommandImpl; //导入依赖的package包/类
public void invokeCommand(final DebuggerCommand command) {
if(command instanceof SuspendContextCommand) {
SuspendContextCommand suspendContextCommand = (SuspendContextCommand)command;
schedule(new SuspendContextCommandImpl((SuspendContextImpl)suspendContextCommand.getSuspendContext()) {
public void contextAction() throws Exception {
command.action();
}
protected void commandCancelled() {
command.commandCancelled();
}
});
}
else {
schedule(new DebuggerCommandImpl() {
protected void action() throws Exception {
command.action();
}
protected void commandCancelled() {
command.commandCancelled();
}
});
}
}
示例6: resume
import com.intellij.debugger.engine.events.SuspendContextCommandImpl; //导入依赖的package包/类
protected void resume(){
assertNotResumed();
DebuggerManagerThreadImpl.assertIsManagerThread();
try {
if (!Patches.IBM_JDK_DISABLE_COLLECTION_BUG) {
for (ObjectReference objectReference : myKeptReferences) {
try {
objectReference.enableCollection();
}
catch (UnsupportedOperationException e) {
// ignore: some J2ME implementations does not provide this operation
}
}
myKeptReferences.clear();
}
for(SuspendContextCommandImpl cmd = pollPostponedCommand(); cmd != null; cmd = pollPostponedCommand()) {
cmd.notifyCancelled();
}
resumeImpl();
}
finally {
myIsResumed = true;
}
}
示例7: actionPerformed
import com.intellij.debugger.engine.events.SuspendContextCommandImpl; //导入依赖的package包/类
public void actionPerformed(final AnActionEvent e) {
DebuggerTreeNodeImpl[] selectedNode = getSelectedNodes(e.getDataContext());
final DebuggerContextImpl debuggerContext = getDebuggerContext(e.getDataContext());
final DebugProcessImpl debugProcess = debuggerContext.getDebugProcess();
//noinspection ConstantConditions
for (final DebuggerTreeNodeImpl debuggerTreeNode : selectedNode) {
final ThreadDescriptorImpl threadDescriptor = ((ThreadDescriptorImpl)debuggerTreeNode.getDescriptor());
if (threadDescriptor.isSuspended()) {
final ThreadReferenceProxyImpl thread = threadDescriptor.getThreadReference();
debugProcess.getManagerThread().schedule(new SuspendContextCommandImpl(debuggerContext.getSuspendContext()) {
public void contextAction() throws Exception {
debugProcess.createResumeThreadCommand(getSuspendContext(), thread).run();
debuggerTreeNode.calcValue();
}
});
}
}
}
示例8: actionPerformed
import com.intellij.debugger.engine.events.SuspendContextCommandImpl; //导入依赖的package包/类
public void actionPerformed(final AnActionEvent e) {
DebuggerTreeNodeImpl[] selectedNode = getSelectedNodes(e.getDataContext());
if (selectedNode == null) {
return;
}
final DebuggerContextImpl debuggerContext = getDebuggerContext(e.getDataContext());
final DebugProcessImpl debugProcess = debuggerContext.getDebugProcess();
for (final DebuggerTreeNodeImpl debuggerTreeNode : selectedNode) {
ThreadDescriptorImpl threadDescriptor = ((ThreadDescriptorImpl)debuggerTreeNode.getDescriptor());
final ThreadReferenceProxyImpl thread = threadDescriptor.getThreadReference();
if (!threadDescriptor.isFrozen()) {
debugProcess.getManagerThread().schedule(new SuspendContextCommandImpl(debuggerContext.getSuspendContext()) {
public void contextAction() throws Exception {
debugProcess.createFreezeThreadCommand(thread).run();
debuggerTreeNode.calcValue();
}
});
}
}
}
示例9: getValue
import com.intellij.debugger.engine.events.SuspendContextCommandImpl; //导入依赖的package包/类
public Value getValue() {
// the following code makes sense only if we do not use ObjectReference.enableCollection() / disableCollection()
// to keep temporary objects
if (Patches.IBM_JDK_DISABLE_COLLECTION_BUG && myStoredEvaluationContext != null && !myStoredEvaluationContext.getSuspendContext().isResumed() &&
myValue instanceof ObjectReference && VirtualMachineProxyImpl.isCollected((ObjectReference)myValue)) {
final Semaphore semaphore = new Semaphore();
semaphore.down();
myStoredEvaluationContext.getDebugProcess().getManagerThread().invoke(new SuspendContextCommandImpl(myStoredEvaluationContext.getSuspendContext()) {
public void contextAction() throws Exception {
// re-setting the context will cause value recalculation
try {
setContext(myStoredEvaluationContext);
}
finally {
semaphore.up();
}
}
});
semaphore.waitFor();
}
return myValue;
}
示例10: handleEvent
import com.intellij.debugger.engine.events.SuspendContextCommandImpl; //导入依赖的package包/类
private void handleEvent(@NotNull SuspendContextCommandImpl action, @NotNull LocatableEvent event)
{
try
{
SuspendContextImpl suspendContext = action.getSuspendContext();
if(suspendContext != null)
{
final MemoryViewDebugProcessData data = suspendContext.getDebugProcess().getUserData(MemoryViewDebugProcessData.KEY);
ObjectReference thisRef = getThisObject(suspendContext, event);
if(thisRef.referenceType().name().equals(myClassName) && data != null)
{
thisRef.disableCollection();
myTrackedObjects.add(thisRef);
data.getTrackedStacks().addStack(thisRef, StackFrameItem.createFrames(suspendContext, false));
}
}
}
catch(EvaluateException ignored)
{
}
if(myTrackedObjects.size() >= TRACKED_INSTANCES_LIMIT)
{
disable();
}
}
示例11: scheduleCommand
import com.intellij.debugger.engine.events.SuspendContextCommandImpl; //导入依赖的package包/类
protected static boolean scheduleCommand(EvaluationContextImpl evaluationContext, @NotNull final XCompositeNode node, final SuspendContextCommandImpl command)
{
if(node.isObsolete())
{
return false;
}
evaluationContext.getManagerThread().schedule(new SuspendContextCommandImpl(command.getSuspendContext())
{
@Override
public void contextAction(@NotNull SuspendContextImpl suspendContext) throws Exception
{
if(node.isObsolete())
{
return;
}
command.contextAction(suspendContext);
}
@Override
protected void commandCancelled()
{
node.setErrorMessage(DebuggerBundle.message("error.context.has.changed"));
}
});
return true;
}
示例12: calcValueIcon
import com.intellij.debugger.engine.events.SuspendContextCommandImpl; //导入依赖的package包/类
@Override
public Icon calcValueIcon(final ValueDescriptor descriptor, final EvaluationContext evaluationContext, final DescriptorLabelListener listener) throws EvaluateException
{
EvaluationContextImpl evalContext = ((EvaluationContextImpl) evaluationContext);
DebugProcessImpl debugProcess = evalContext.getDebugProcess();
if(DebuggerUtilsImpl.isRemote(debugProcess))
{
return null;
}
debugProcess.getManagerThread().schedule(new SuspendContextCommandImpl(evalContext.getSuspendContext())
{
@Override
public void contextAction() throws Exception
{
String getterName = AllIcons.Debugger.Value.getIconHeight() <= 16 ? "iconToBytesPreviewNormal" : "iconToBytesPreviewRetina";
descriptor.setValueIcon(ImageObjectRenderer.getIcon(evaluationContext, descriptor.getValue(), getterName));
listener.labelChanged();
}
});
return null;
}
示例13: computeChildren
import com.intellij.debugger.engine.events.SuspendContextCommandImpl; //导入依赖的package包/类
@Override
public void computeChildren(@NotNull final XCompositeNode node) {
JavaValue.scheduleCommand(myEvaluationContext, node, new SuspendContextCommandImpl(myEvaluationContext.getSuspendContext()) {
@Override
public void contextAction() throws Exception {
final XValueChildrenList children = new XValueChildrenList();
final ReferenceType refType = myStaticDescriptor.getType();
List<Field> fields = refType.allFields();
final ClassRenderer classRenderer = NodeRendererSettings.getInstance().getClassRenderer();
for (Field field : fields) {
if (field.isStatic()) {
boolean isSynthetic = DebuggerUtils.isSynthetic(field);
if (!classRenderer.SHOW_SYNTHETICS && isSynthetic) {
continue;
}
final FieldDescriptorImpl fieldDescriptor = myNodeManager.getFieldDescriptor(myStaticDescriptor, null, field);
children.add(JavaValue.create(fieldDescriptor, myEvaluationContext, myNodeManager));
//final DebuggerTreeNodeImpl node = myNodeManager.createNode(fieldDescriptor, myEvaluationContext);
//myChildren.add(node);
}
}
node.addChildren(children, true);
}
});
}
示例14: computeStackFrames
import com.intellij.debugger.engine.events.SuspendContextCommandImpl; //导入依赖的package包/类
@Override
public void computeStackFrames(final int firstFrameIndex, final XStackFrameContainer container) {
if (container.isObsolete()) return;
myDebugProcess.getManagerThread().schedule(new SuspendContextCommandImpl(myDebugProcess.getDebuggerContext().getSuspendContext()) {
@Override
public Priority getPriority() {
return Priority.NORMAL;
}
@Override
public void contextAction() throws Exception {
if (container.isObsolete()) return;
if (!myThreadProxy.isCollected() && myDebugProcess.getSuspendManager().isSuspended(myThreadProxy)) {
int status = myThreadProxy.status();
if (!(status == ThreadReference.THREAD_STATUS_UNKNOWN) &&
!(status == ThreadReference.THREAD_STATUS_NOT_STARTED) &&
!(status == ThreadReference.THREAD_STATUS_ZOMBIE)) {
try {
int added = 0;
Iterator<StackFrameProxyImpl> iterator = myThreadProxy.frames().iterator();
if (iterator.hasNext() && firstFrameIndex > 0) {
iterator.next();
added++;
}
myDebugProcess.getManagerThread().schedule(new AppendFrameCommand(getSuspendContext(), iterator, container, added, firstFrameIndex));
}
catch (EvaluateException e) {
container.errorOccurred(e.getMessage());
}
}
}
else {
container.errorOccurred(DebuggerBundle.message("frame.panel.frames.not.available"));
}
}
});
}
示例15: invokeCommand
import com.intellij.debugger.engine.events.SuspendContextCommandImpl; //导入依赖的package包/类
@Override
public void invokeCommand(final DebuggerCommand command) {
if(command instanceof SuspendContextCommand) {
SuspendContextCommand suspendContextCommand = (SuspendContextCommand)command;
schedule(new SuspendContextCommandImpl((SuspendContextImpl)suspendContextCommand.getSuspendContext()) {
@Override
public void contextAction() throws Exception {
command.action();
}
@Override
protected void commandCancelled() {
command.commandCancelled();
}
});
}
else {
schedule(new DebuggerCommandImpl() {
@Override
protected void action() throws Exception {
command.action();
}
@Override
protected void commandCancelled() {
command.commandCancelled();
}
});
}
}