SessionListener

public abstract class SessionListener

Provides callbacks to monitor the state of the verification.

Constructors

SessionListener

public SessionListener(APIClient client)

SessionListener

protected SessionListener(APIClient client, long objectId)

Internal constructor

Methods

codeGenerationFinished

public abstract void codeGenerationFinished(io.cocotec.coco.platform.coco.ide.Project project, boolean failed, String statusMessage)

Called when code generation has finished on the given project.

codeGenerationStarted

public abstract void codeGenerationStarted(io.cocotec.coco.platform.coco.ide.Project project)

Called when code generation has been started on the given project.

createSimulatorFinished

public abstract void createSimulatorFinished(io.cocotec.coco.platform.coco.ide.Project project, io.cocotec.coco.platform.coco.ide.ProjectTreeNode target, io.cocotec.coco.platform.coco.Simulator simulator)

Called when a simulator has been created for the project.

Parameters:
  • project – The Project the simulator was created for
  • target – The ProjectTreeNode that the simulator was created for.
  • simulator – The simulator that was created, or nullptr if none was created. If there is more than one listener, then the first listener that gets the simulator gets to keep it.

createSimulatorFinished

public abstract void createSimulatorFinished(io.cocotec.coco.platform.coco.ide.Project project, io.cocotec.coco.platform.coco.Counterexample counterexample, io.cocotec.coco.platform.coco.BehaviouralInstance behaviouralInstance, io.cocotec.coco.platform.coco.Simulator simulator)

Called when a simulator is being created for the counterexample.

createSimulatorStarted

public abstract void createSimulatorStarted(io.cocotec.coco.platform.coco.ide.Project project, io.cocotec.coco.platform.coco.ide.ProjectTreeNode target)

Called when a simulator is being created for the project.

createSimulatorStarted

public abstract void createSimulatorStarted(io.cocotec.coco.platform.coco.ide.Project project, io.cocotec.coco.platform.coco.Counterexample counterexample, io.cocotec.coco.platform.coco.BehaviouralInstance behaviouralInstance)

Called when a simulator is being created for the counterexample.

finalize

protected void finalize()

getObjectId

public long getObjectId()

Internal method

getOrCreate

public static SessionListener getOrCreate(APIClient client, long objectId)

Internal method

handleDiagnostic

public abstract void handleDiagnostic(io.cocotec.coco.platform.coco.ide.Project project, java.util.ArrayList<io.cocotec.coco.platform.coco.Diagnostic> diagnostics, boolean isLoad)

Called when a diagnostic is discovered on the given project. This could either be found whilst reloading the project, or when performing code generation or verification on the project. This is indicated by is_load.

licenseServerStateChanged

public abstract void licenseServerStateChanged(boolean running, String description)

licenseStateChanged

public abstract void licenseStateChanged(io.cocotec.coco.platform.coco.LicenseState licenseState)

Called whenever the session detects a change in the licensed status of the user. The user is assumed to start off unlicensed, so a callback will normally be received promptly as soon as the first command is executed.

loadFinished

public abstract void loadFinished(io.cocotec.coco.platform.coco.ide.Project project, boolean loadingError)

Called whenever a reload finishes on the given project.

loadStarted

public abstract void loadStarted(io.cocotec.coco.platform.coco.ide.Project project)

Called whenever a reload is started on the given project. Note the next event might not be load_finished – it might be reload_scheduled instead if another reload will be required.

reloadProgress

public abstract void reloadProgress(io.cocotec.coco.platform.coco.ide.Project project, int completed, int total)

Called to indicate the progress of reloading.

Parameters:
  • project – The project that is being reloaded.
  • completed – The number of loads that have been completed so far.
  • total – The number of loads that will need to be done.

reloadScheduled

public abstract void reloadScheduled(io.cocotec.coco.platform.coco.ide.Project project)

Called as soon as it is detected a reload will be required on the given project. The reload may not happen immediately, if we are waiting for filesystem activity to finish. load_started will be emitted as soon as the reload starts.

shutdownFinished

public abstract void shutdownFinished()

Called when a shutdown has completed.

shutdownRequested

public abstract void shutdownRequested()

Called when a shutdown was requested by a user thread.

treeUpdated

public abstract void treeUpdated(java.util.ArrayList<io.cocotec.coco.platform.coco.ide.ProjectTreeNode> createdNodes, java.util.ArrayList<io.cocotec.coco.platform.coco.ide.ProjectTreeNode> deletedNodes, java.util.ArrayList<io.cocotec.coco.platform.coco.ide.ProjectTreeNode> modifiedNodes)

Called whenever the module tree for a project is updated.

Parameters:
  • createdNodes – A list of new nodes that are being inserted into the tree.
  • deletedNodes – A list of nodes that are being deleted from the tree. These pointers will be deleted after this call returns.
  • modifiedNodes – A list of nodes whose properties have changed (specifically their display_name, tooltip, or status).

verificationBackendStateChanged

public abstract void verificationBackendStateChanged(String backendName, io.cocotec.coco.platform.VerificationBackendState state)

Called whenever the verification backend’s state changes.

verificationFinished

public abstract void verificationFinished(io.cocotec.coco.platform.coco.ide.Project project, boolean failed, boolean wasCancelled, String statusMessage)

Called whenever a verification job finishes on the given project.

verificationProgress

public abstract void verificationProgress(io.cocotec.coco.platform.coco.ide.Project project, int completed, int total)

Called to indicate the progress of verification.

Parameters:
  • project – The project that is being verified.
  • completed – The number of loads that have been completed so far.
  • total – The number of loads that will need to be done.

verificationStarted

public abstract void verificationStarted(io.cocotec.coco.platform.coco.ide.Project project)

Called whenever a verification job starts on the given project.