org.eclipse.ocl.examples.debug.vm.launching
Class InternalDebuggableExecutor

java.lang.Object
  extended by org.eclipse.ocl.examples.debug.vm.launching.InternalDebuggableExecutor
Direct Known Subclasses:
OCLInternalDebuggableExecutor

public abstract class InternalDebuggableExecutor
extends java.lang.Object

Internal transformation executor

Since:
3.0

Field Summary
protected  org.eclipse.emf.common.util.URI debuggableURI
           
protected  IVMEnvironmentFactory envFactory
           
 
Constructor Summary
InternalDebuggableExecutor(IVMEnvironmentFactory envFactory, org.eclipse.emf.common.util.URI debuggableURI)
          Constructs the executor for the given transformation URI.
 
Method Summary
 void cleanup()
           
protected abstract  IVMEvaluator createEvaluator()
           
 ExecutionDiagnostic execute(VMStartRequest startRequest, EvaluationContext evaluationContext)
          Executes the transformation referred by this executor using the given model parameters and execution context.
 NamedElement getDebuggable()
           
 IVMEnvironmentFactory getEnvFactory()
           
 IVMEvaluator getEvaluator()
           
 org.eclipse.emf.ecore.resource.ResourceSet getResourceSet()
           
 CompiledUnit getUnit()
          Retrieves compiled unit if the referencing URI gets successfully resolved
 org.eclipse.emf.common.util.URI getURI()
           
 org.eclipse.emf.common.util.Diagnostic loadDebuggable()
          Attempts to load the transformation referred by this executor and checks if it is valid for execution.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

envFactory

@NonNull
protected final IVMEnvironmentFactory envFactory

debuggableURI

@NonNull
protected final org.eclipse.emf.common.util.URI debuggableURI
Constructor Detail

InternalDebuggableExecutor

public InternalDebuggableExecutor(@NonNull
                                  IVMEnvironmentFactory envFactory,
                                  @NonNull
                                  org.eclipse.emf.common.util.URI debuggableURI)
Constructs the executor for the given transformation URI.

No attempt to resolve and load the transformation is done at this step

Parameters:
uri - the URI of an existing transformation
Method Detail

cleanup

public void cleanup()

createEvaluator

@NonNull
protected abstract IVMEvaluator createEvaluator()
                                         throws java.io.IOException
Throws:
java.io.IOException

execute

public ExecutionDiagnostic execute(@NonNull
                                   VMStartRequest startRequest,
                                   @NonNull
                                   EvaluationContext evaluationContext)
Executes the transformation referred by this executor using the given model parameters and execution context.

Parameters:
executionContext - the context object keeping the execution environment details
modelParameters - the actual model arguments to the transformation
Returns:
the diagnostic object indicating the execution result status, also keeping the details of possible problems
Throws:
java.lang.IllegalArgumentException - if the context or any of the model parameters is null

getDebuggable

@Nullable
public NamedElement getDebuggable()

getEnvFactory

@NonNull
public IVMEnvironmentFactory getEnvFactory()

getEvaluator

public IVMEvaluator getEvaluator()

getResourceSet

public org.eclipse.emf.ecore.resource.ResourceSet getResourceSet()

getURI

@NonNull
public org.eclipse.emf.common.util.URI getURI()

getUnit

@Nullable
public CompiledUnit getUnit()
Retrieves compiled unit if the referencing URI gets successfully resolved

Remark: This method invocation causes the referenced transformation to load if not already done before by direct call to #loadTransformation() or

Returns:
compiled unit or null if it failed to be obtained

loadDebuggable

public org.eclipse.emf.common.util.Diagnostic loadDebuggable()
Attempts to load the transformation referred by this executor and checks if it is valid for execution.

Remark:
Only the first performs the actual transformation loading, subsequent calls to this method will return the existing diagnostic.

Returns:
the diagnostic indicating possible problems of the load action

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object