Package com.e1c.g5.v8.dt.internal.check
Class CheckScheduler
java.lang.Object
com.e1c.g5.v8.dt.internal.check.CheckScheduler
- All Implemented Interfaces:
IManagedService
,ICheckScheduler
,ICheckSettingsChangeListener
@LifecycleService(name="CHECK_SCHEDULER")
public class CheckScheduler
extends Object
implements ICheckScheduler, ICheckSettingsChangeListener
Check scheduler implementation. Performs direct schedules as well as reactive (in case of resource changes, etc)
-
Field Summary
Fields inherited from interface com.e1c.g5.v8.dt.check.ICheckScheduler
SERVICE_NAME
-
Constructor Summary
ConstructorsConstructorDescriptionCheckScheduler
(ICheckRepository checkRepo, IBmModelManager bmModelManager, IMarkerManagerV2 markerManager, IDerivedDataManagerProvider derivedDataManagerProvider, IDependenciesManager depManager, IResourceManager resourceManager) Constructs an instance. -
Method Summary
Modifier and TypeMethodDescriptionvoid
activate()
void
void
disposeResourceListener
(ProjectContext projectContext) void
init()
boolean
isDeactivatedCheckPermitted
(Object objectId, org.eclipse.core.resources.IProject project) States if there is an explicit permission was given earlier to perform checks for a provided object.void
onChange
(org.eclipse.core.resources.IProject project, Collection<CheckSettingsChange> changedCheckSettings) This method is called on check settings getDiffWithInstanceSettings.void
onPostResourceLoading
(ProjectContext projectContext) Marks that initial resource loading for the project was completed.void
onStorageInitialization
(ProjectContext projectContext) Checks if there are some language resources are being scheduled during the period of project context unreadiness and schedules the computation if necessary.void
permitDeactivatedCheckRequest
(Object objectId, org.eclipse.core.resources.IProject project) Permits next request to check for a specific object even if massive checks are deactivated for a specified project.void
scheduleClearance
(org.eclipse.core.resources.IProject project, Set<String> checkIds, org.eclipse.core.runtime.IProgressMonitor progressMonitor) Schedules the clearance of the check results for the given set of checksvoid
scheduleValidation
(org.eclipse.core.resources.IProject project, Set<String> checkIds, Collection<Object> topObjectIds, boolean isRecursive, IBmTransaction transaction, org.eclipse.core.runtime.IProgressMonitor progressMonitor) Schedules the model object validation for objects with given object ids by suitable checks with the given check ids.void
scheduleValidation
(org.eclipse.core.resources.IProject project, Set<String> checkIds, Collection<Object> topObjectIds, org.eclipse.core.runtime.IProgressMonitor progressMonitor) Schedules the model object validation for objects with given object ids by suitable checks with the given check ids.void
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.e1c.g5.v8.dt.check.ICheckScheduler
scheduleValidation
Methods inherited from interface com.e1c.g5.v8.dt.check.settings.ICheckSettingsChangeListener
onPreferenceChange
-
Constructor Details
-
CheckScheduler
@Inject public CheckScheduler(ICheckRepository checkRepo, IBmModelManager bmModelManager, IMarkerManagerV2 markerManager, IDerivedDataManagerProvider derivedDataManagerProvider, IDependenciesManager depManager, IResourceManager resourceManager) Constructs an instance. Not intended for a manual instantiation- Parameters:
checkRepo
-ICheckRepository
reference. May not benull
bmModelManager
-IBmModelManager
reference. May not benull
markerManager
-IMarkerManagerV2
reference. May not benull
derivedDataManagerProvider
-IDerivedDataManagerProvider
reference. May not benull
depManager
-IDependenciesManager
reference. May not benull
resourceManager
-IResourceManager
reference. May not benull
-
-
Method Details
-
activate
public void activate()- Specified by:
activate
in interfaceIManagedService
-
deactivate
public void deactivate()- Specified by:
deactivate
in interfaceIManagedService
-
disposeResourceListener
@LifecycleParticipant(phase=STORAGE_CLOSING, dependsOn="BM_MODEL_MANAGER") public void disposeResourceListener(ProjectContext projectContext) -
init
-
onChange
public void onChange(org.eclipse.core.resources.IProject project, Collection<CheckSettingsChange> changedCheckSettings) Description copied from interface:ICheckSettingsChangeListener
This method is called on check settings getDiffWithInstanceSettings.- Specified by:
onChange
in interfaceICheckSettingsChangeListener
- Parameters:
project
- project with specific settings ornull
for instance settings.changedCheckSettings
- the collection of changed settings, notnull
-
onStorageInitialization
@LifecycleParticipant(phase=STORAGE_INITIALIZATION, dependsOn="DerivedDataManager") public void onStorageInitialization(ProjectContext projectContext) Checks if there are some language resources are being scheduled during the period of project context unreadiness and schedules the computation if necessary.- Parameters:
projectContext
- The project context. May not benull
-
onPostResourceLoading
@LifecycleParticipant(phase=POST_RESOURCE_LOADING, dependsOn={"BM_MODEL_MANAGER","MARKER_MANAGER_V2"}) public void onPostResourceLoading(ProjectContext projectContext) Marks that initial resource loading for the project was completed.Also processes a potential crash from
IMarkerManagerV2
and schedules recheck of the affected objects.- Parameters:
projectContext
- The project context. May not benull
-
scheduleClearance
public void scheduleClearance(org.eclipse.core.resources.IProject project, Set<String> checkIds, org.eclipse.core.runtime.IProgressMonitor progressMonitor) Description copied from interface:ICheckScheduler
Schedules the clearance of the check results for the given set of checks- Specified by:
scheduleClearance
in interfaceICheckScheduler
- Parameters:
project
- Target project, notnull
checkIds
- The set of target check identifeirs. If empty set is applied - all applicable checks will be cleared, notnull
progressMonitor
- progress monitor, notnull
-
scheduleValidation
public void scheduleValidation(org.eclipse.core.resources.IProject project, Set<String> checkIds, Collection<Object> topObjectIds, boolean isRecursive, IBmTransaction transaction, org.eclipse.core.runtime.IProgressMonitor progressMonitor) Description copied from interface:ICheckScheduler
Schedules the model object validation for objects with given object ids by suitable checks with the given check ids. It will probably be executed asynchronously. It can be canceled using the progress monitor.- Specified by:
scheduleValidation
in interfaceICheckScheduler
- Parameters:
project
- Target project, notnull
checkIds
- The set of target check identifeirs. If empty set is applied - all applicable checks will be scheduled, notnull
topObjectIds
- Identifiers of checked objects, all available objects if left empty, notnull
isRecursive
- iftrue
all the dependencies (including modules) of objects provided by topObjectIds are processed. Iffalse
then it's supposed that all required objects are passed via topObjectIdstransaction
- The active read-only transaction to perform the scheduling of checks (e.g. context collection)progressMonitor
- progress monitor, notnull
-
scheduleValidation
public void scheduleValidation(org.eclipse.core.resources.IProject project, Set<String> checkIds, Collection<Object> topObjectIds, org.eclipse.core.runtime.IProgressMonitor progressMonitor) Description copied from interface:ICheckScheduler
Schedules the model object validation for objects with given object ids by suitable checks with the given check ids. It will probably be executed asynchronously. It can be canceled using the progress monitor.- Specified by:
scheduleValidation
in interfaceICheckScheduler
- Parameters:
project
- Target project, notnull
checkIds
- The set of target check identifeirs. If empty set is applied - all applicable checks will be scheduled, notnull
topObjectIds
- Identifiers of checked objects, all available objects if left empty, notnull
progressMonitor
- progress monitor, notnull
-
unlinking
-
permitDeactivatedCheckRequest
public void permitDeactivatedCheckRequest(Object objectId, org.eclipse.core.resources.IProject project) Description copied from interface:ICheckScheduler
Permits next request to check for a specific object even if massive checks are deactivated for a specified project. This method allows active editors to perform limited number of checks independenly of the mode- Specified by:
permitDeactivatedCheckRequest
in interfaceICheckScheduler
- Parameters:
objectId
- Target object identifier. Accepts both resource URI's and BM object idsproject
- Target project, notnull
-
isDeactivatedCheckPermitted
public boolean isDeactivatedCheckPermitted(Object objectId, org.eclipse.core.resources.IProject project) Description copied from interface:ICheckScheduler
States if there is an explicit permission was given earlier to perform checks for a provided object. The permission is retracted after a check so it is a single-time permission effectively- Specified by:
isDeactivatedCheckPermitted
in interfaceICheckScheduler
- Parameters:
objectId
- The object to check permission for. Cannot benull
. Must be compliant withICheckScheduler#permitDeactivatedCheckRequest(IProject, Object)
requirementsproject
- Target project, notnull
- Returns:
- True if a permission was given earlier
-