public final class JavaSolverRunner extends java.lang.Object implements ISolverRunner
ISolverRunner
implementation for Java language.Modifier and Type | Field and Description |
---|---|
private org.eclipse.debug.core.ILaunch |
launch
Delegate
ILaunch instance which correspond to our solver execution. |
private org.eclipse.core.runtime.IProgressMonitor |
monitor
Monitor instance used for Java execution.
|
private ProblemSolver |
solver
Target problem solver this submission will work on.
|
Constructor and Description |
---|
JavaSolverRunner(ProblemSolver solver,
org.eclipse.core.runtime.IProgressMonitor monitor)
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
private java.util.Map<java.lang.String,java.lang.String> |
createAttributesMap(java.lang.String arguments,
java.lang.String output)
Creates a
Map of attributes used for the generated launch configuration. |
private static org.eclipse.debug.core.ILaunchConfigurationWorkingCopy |
getLaunchConfiguration(java.lang.String name)
Creates a working copy of
ILaunchConfiguration for the given name. |
boolean |
isTerminated()
Indicates if this solver running step is terminated or not.
|
void |
run(java.lang.String arguments,
java.lang.String output)
Starts the solver running step, using the given
arguments as execution input
(provided through command line arguments).
|
private final ProblemSolver solver
private final org.eclipse.core.runtime.IProgressMonitor monitor
private org.eclipse.debug.core.ILaunch launch
ILaunch
instance which correspond to our solver execution.public JavaSolverRunner(ProblemSolver solver, org.eclipse.core.runtime.IProgressMonitor monitor)
solver
- Solver which aims to be ran.monitor
- Monitor instance used for Java execution.public boolean isTerminated()
isTerminated
in interface ISolverRunner
public void run(java.lang.String arguments, java.lang.String output) throws org.eclipse.core.runtime.CoreException
run
in interface ISolverRunner
arguments
- Command line arguments to provide to the runner.output
- Path of the output file on which solver output should be redirected.org.eclipse.core.runtime.CoreException
- If any error occurs during execution.private java.util.Map<java.lang.String,java.lang.String> createAttributesMap(java.lang.String arguments, java.lang.String output)
Map
of attributes used for the generated launch configuration.arguments
- Command line argument to be used.output
- Target output file path.private static org.eclipse.debug.core.ILaunchConfigurationWorkingCopy getLaunchConfiguration(java.lang.String name) throws org.eclipse.core.runtime.CoreException
ILaunchConfiguration
for the given name.
If such configuration already exist, they are removed first.name
- Name of the launch configuration to create.org.eclipse.core.runtime.CoreException
- If any error occurs while creating launch configuration.