Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*******************************************************************************
* Copyright (c) 2017 Microsoft Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Microsoft Corporation - initial API and implementation
*******************************************************************************/

package com.microsoft.java.debug.core.adapter;

import com.sun.jdi.Value;

/**
* Evaluation results are reported to evaluation listeners on the completion of
* an evaluation. The evaluation may fail but an exception will be supplied
* indicating the problems.
* <p>
* Clients may implement this interface to handle the result or exception.
* </p>
*
* @since 4.0
*/
public interface IEvaluationListener {

/**
* Notifies this listener that an evaluation has completed, with the given
* result.
*
* @param result
* The result from the evaluation
* @param exception
* The exception raised during evaluation
* @see IEvaluationResult
*/
public void evaluationComplete(Value result, Exception exception);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*******************************************************************************
* Copyright (c) 2017 Microsoft Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Microsoft Corporation - initial API and implementation
*******************************************************************************/

package com.microsoft.java.debug.core.adapter;

import com.sun.jdi.ThreadReference;

/**
* An evaluation engine performs an evaluation of a code snippet or expression
* in a specified thread of a debug target. An evaluation engine is associated
* with a specific debug target and Java project on creation.
*
* @see IEvaluationListener
* @since 4.0
*/
public interface IEvaluationProvider extends IProvider {
/**
* This method provides the event hub the ability to exclude the breakpoint event raised during evaluation.
* @param thread the thread to be checked against evaluation work.
* @return whether or not the thread is performing evaluation
*/
boolean isInEvaluation(ThreadReference thread);

/**
* Evaluate the expression at the given project and thread and stack frame depth, the listener is to be notified when
* the evaluation finishes.
*
* @param projectName The java project which provides resolve class used in the expression
* @param expression The expression to be evaluated
* @param thread The thread evaluation task is performed inside
* @param depth The stack frame depth of the evaluation task
* @param listener the listener is to be notified when the evaluation finishes.
*/
void eval(String projectName, String expression, ThreadReference thread, int depth, IEvaluationListener listener);
}