Class AsyncConverter

java.lang.Object
com.e1c.langtool.internal.converter.AsyncConverter

public class AsyncConverter extends Object
Asynchronous converter for coordinating the conversion process between language projects.

The AsyncConverter class provides a mechanism for scheduling and performing asynchronous language project conversions using a specified IConverterService and IConverterEngine.

Usage example:


 // Create an instance of IConverterService and IConverterEngine
 IConverterEngine engine = ...; // Implement or obtain the instance through dependency injection

 // Create an instance of AsyncConverter
 AsyncConverter asyncConverter = new AsyncConverter(engine);

 // Schedule asynchronous conversion
 asyncConverter.scheduleCompute();

 // Add projects to the conversion queue
 IProject translatedProject = ...; // Specify the translated project
 IProject sourceLangProject = ...; // Specify the source language project
 IProject targetLangProject = ...; // Specify the target language project
 asyncConverter.addToConvert(translatedProject, sourceLangProject, targetLangProject);

 // Clean the conversion queue for a specific project
 IProject projectToClean = ...; // Specify the project to clean the queue
 asyncConverter.cleanQueue(projectToClean);
 

Note: All projects used in this class are assumed to be non-null.

See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new instance of AsyncConverter with the specified IConverterEngine.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addToConvert(org.eclipse.core.resources.IProject project, org.eclipse.core.resources.IProject sourceLangProject, org.eclipse.core.resources.IProject targetLangProject)
    Adds a language project conversion task to the queue for asynchronous processing.
    void
    cleanQueue(org.eclipse.core.resources.IProject project)
    Cleans the conversion queue for the specified project.
    void
    Schedules the asynchronous conversion job.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • AsyncConverter

      public AsyncConverter(IConverterEngine engine)
      Creates a new instance of AsyncConverter with the specified IConverterEngine.
      Parameters:
      engine - the converter engine to use, cannot be null.
  • Method Details

    • scheduleCompute

      public void scheduleCompute()
      Schedules the asynchronous conversion job.
    • addToConvert

      public void addToConvert(org.eclipse.core.resources.IProject project, org.eclipse.core.resources.IProject sourceLangProject, org.eclipse.core.resources.IProject targetLangProject)
      Adds a language project conversion task to the queue for asynchronous processing.
      Parameters:
      project - the translated project, cannot be null.
      sourceLangProject - the source language project, cannot be null.
      targetLangProject - the target language project, cannot be null.
    • cleanQueue

      public void cleanQueue(org.eclipse.core.resources.IProject project)
      Cleans the conversion queue for the specified project.
      Parameters:
      project - the project for which to clean the conversion queue, cannot be null.