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 TypeMethodDescriptionvoidactivate()voidvoiddisposeResourceListener(ProjectContext projectContext) voidinit()booleanisDeactivatedCheckPermitted(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.voidonChange(org.eclipse.core.resources.IProject project, Collection<CheckSettingsChange> changedCheckSettings) This method is called on check settings getDiffWithInstanceSettings.voidonPostResourceLoading(ProjectContext projectContext) Marks that initial resource loading for the project was completed.voidonStorageInitialization(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.voidpermitDeactivatedCheckRequest(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.voidscheduleClearance(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 checksvoidscheduleValidation(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.voidscheduleValidation(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.voidMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.e1c.g5.v8.dt.check.ICheckScheduler
scheduleValidationMethods 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-ICheckRepositoryreference. May not benullbmModelManager-IBmModelManagerreference. May not benullmarkerManager-IMarkerManagerV2reference. May not benullderivedDataManagerProvider-IDerivedDataManagerProviderreference. May not benulldepManager-IDependenciesManagerreference. May not benullresourceManager-IResourceManagerreference. May not benull
-
-
Method Details
-
activate
public void activate()- Specified by:
activatein interfaceIManagedService
-
deactivate
public void deactivate()- Specified by:
deactivatein 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:ICheckSettingsChangeListenerThis method is called on check settings getDiffWithInstanceSettings.- Specified by:
onChangein interfaceICheckSettingsChangeListener- Parameters:
project- project with specific settings ornullfor 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
IMarkerManagerV2and 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:ICheckSchedulerSchedules the clearance of the check results for the given set of checks- Specified by:
scheduleClearancein interfaceICheckScheduler- Parameters:
project- Target project, notnullcheckIds- The set of target check identifeirs. If empty set is applied - all applicable checks will be cleared, notnullprogressMonitor- 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:ICheckSchedulerSchedules 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:
scheduleValidationin interfaceICheckScheduler- Parameters:
project- Target project, notnullcheckIds- The set of target check identifeirs. If empty set is applied - all applicable checks will be scheduled, notnulltopObjectIds- Identifiers of checked objects, all available objects if left empty, notnullisRecursive- iftrueall the dependencies (including modules) of objects provided by topObjectIds are processed. Iffalsethen 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:ICheckSchedulerSchedules 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:
scheduleValidationin interfaceICheckScheduler- Parameters:
project- Target project, notnullcheckIds- The set of target check identifeirs. If empty set is applied - all applicable checks will be scheduled, notnulltopObjectIds- Identifiers of checked objects, all available objects if left empty, notnullprogressMonitor- progress monitor, notnull
-
unlinking
-
permitDeactivatedCheckRequest
public void permitDeactivatedCheckRequest(Object objectId, org.eclipse.core.resources.IProject project) Description copied from interface:ICheckSchedulerPermits 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:
permitDeactivatedCheckRequestin 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:ICheckSchedulerStates 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:
isDeactivatedCheckPermittedin 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
-