Class LightClusteringBuilderState
java.lang.Object
org.eclipse.xtext.resource.impl.AbstractResourceDescriptionChangeEventSource
org.eclipse.xtext.builder.builderState.AbstractBuilderState
org.eclipse.xtext.builder.clustering.ClusteringBuilderState
com._1c.g5.modeling.xtext.builder.LightClusteringBuilderState
- All Implemented Interfaces:
IBuilderStateResourceManagement
,org.eclipse.xtext.builder.builderState.IBuilderState
,org.eclipse.xtext.resource.IResourceDescription.Event.Source
,org.eclipse.xtext.resource.IResourceDescriptions
,org.eclipse.xtext.resource.ISelectable
- Direct Known Subclasses:
PersistentClusteringBuilderState
public class LightClusteringBuilderState
extends org.eclipse.xtext.builder.clustering.ClusteringBuilderState
implements IBuilderStateResourceManagement
Lightweight implementation of the
ClusteringBuilderState
class.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Special threads for building EDT filesNested classes/interfaces inherited from interface org.eclipse.xtext.resource.IResourceDescriptions
org.eclipse.xtext.resource.IResourceDescriptions.IContextAware, org.eclipse.xtext.resource.IResourceDescriptions.IResourceSetAware, org.eclipse.xtext.resource.IResourceDescriptions.NullImpl
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Special load option key forResourceSet
(seeResourceSet.getLoadOptions()
) markResourceSet
as created in building operationFields inherited from class org.eclipse.xtext.builder.clustering.ClusteringBuilderState
RESOURCELOADER_CROSS_LINKING, RESOURCELOADER_GLOBAL_INDEX
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected org.eclipse.emf.ecore.resource.Resource
addResource
(org.eclipse.emf.ecore.resource.Resource resource, org.eclipse.emf.ecore.resource.ResourceSet resourceSet) protected void
collectRoughBuildScope
(org.eclipse.core.resources.IProject project, org.eclipse.xtext.resource.impl.ResourceDescriptionsData newData, Set<org.eclipse.emf.common.util.URI> result) Collects rough build scope.protected Collection<org.eclipse.xtext.resource.IResourceDescription.Delta>
doUpdate
(org.eclipse.xtext.builder.impl.BuildData buildData, org.eclipse.xtext.resource.impl.ResourceDescriptionsData newData, org.eclipse.core.runtime.IProgressMonitor monitor) We should override this method for adding logic for clearing resources dataprotected void
void
fillResourceSetOptions
(org.eclipse.emf.ecore.resource.ResourceSet resourceSet) FillResourceSet
load options withBUILDING_OPERATION_OPTION
getExecutorService
(int processors) GetsExecutorService
for paralleling operation.int
Gets number of permitted threads for buildprotected void
installSourceLevelURIs
(org.eclipse.xtext.builder.impl.BuildData buildData) void
load()
void
setPermittedThreads
(int permittedThreads) Sets number of permitted threads for buildprotected Queue<org.eclipse.xtext.resource.IResourceDescription.Delta>
updateNewResourceDescriptions
(Queue<org.eclipse.emf.common.util.URI> allUris, int queueFullSize, org.eclipse.core.resources.IProject currentProject, org.eclipse.emf.ecore.resource.ResourceSet resourceSet, Set<org.eclipse.emf.common.util.URI> toBeDeleted, boolean isIndexingOnly, AtomicInteger[] indexes, org.eclipse.xtext.builder.clustering.CurrentDescriptions newState, org.eclipse.core.runtime.SubMonitor subProgress) protected Queue<org.eclipse.xtext.resource.IResourceDescription.Delta>
updateNewResourceDescriptionsForQueue
(Queue<org.eclipse.emf.common.util.URI> queue, int fullQueueSize, org.eclipse.core.resources.IProject currentProject, org.eclipse.emf.ecore.resource.ResourceSet resourceSet, Set<org.eclipse.emf.common.util.URI> toBeDeleted, boolean isIndexingOnly, AtomicInteger[] indexes, org.eclipse.xtext.builder.clustering.CurrentDescriptions newState, org.eclipse.core.runtime.SubMonitor subProgress) protected void
writeNewResourceDescriptions
(org.eclipse.xtext.builder.impl.BuildData buildData, org.eclipse.xtext.resource.IResourceDescriptions oldState, org.eclipse.xtext.builder.clustering.CurrentDescriptions newState, org.eclipse.core.runtime.IProgressMonitor monitor) We should override this method for additional processing of the resources.Methods inherited from class org.eclipse.xtext.builder.clustering.ClusteringBuilderState
clearResourceSet, getBuiltProject, getResourceDescriptionManager, queueAffectedResources
Methods inherited from class org.eclipse.xtext.builder.builderState.AbstractBuilderState
clean, doClean, doLoad, ensureNotNull, getAllResourceDescriptions, getCopiedResourceDescriptionsData, getExportedObjects, getExportedObjects, getExportedObjectsByObject, getExportedObjectsByType, getResourceDescription, isEmpty, setPersister, setResourceDescriptionsData, update, updateMarkers
Methods inherited from class org.eclipse.xtext.resource.impl.AbstractResourceDescriptionChangeEventSource
addListener, addListeners, notifyListeners, removeListener, removeListeners
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.eclipse.xtext.resource.IResourceDescription.Event.Source
addListener, notifyListeners, removeListener
-
Field Details
-
BUILDING_OPERATION_OPTION
Special load option key forResourceSet
(seeResourceSet.getLoadOptions()
) markResourceSet
as created in building operation- See Also:
-
-
Constructor Details
-
LightClusteringBuilderState
public LightClusteringBuilderState()Constructor
-
-
Method Details
-
load
public void load()- Overrides:
load
in classorg.eclipse.xtext.builder.builderState.AbstractBuilderState
-
getPermittedThreads
public int getPermittedThreads()Description copied from interface:IBuilderStateResourceManagement
Gets number of permitted threads for build- Specified by:
getPermittedThreads
in interfaceIBuilderStateResourceManagement
- Returns:
- number of permitted threads for build
-
setPermittedThreads
public void setPermittedThreads(int permittedThreads) Description copied from interface:IBuilderStateResourceManagement
Sets number of permitted threads for build- Specified by:
setPermittedThreads
in interfaceIBuilderStateResourceManagement
- Parameters:
permittedThreads
- number of permitted threads for build
-
fillResourceSetOptions
public void fillResourceSetOptions(org.eclipse.emf.ecore.resource.ResourceSet resourceSet) FillResourceSet
load options withBUILDING_OPERATION_OPTION
- Parameters:
resourceSet
- fillingResourceSet
,cannot benull
-
getExecutorService
GetsExecutorService
for paralleling operation. CreatingThread
will have name "LCBuilderState" with index adding- Parameters:
processors
- number of allowed independentThread
s- Returns:
ExecutorService
for paralleling operation, cannot benull
-
ensureLoaded
protected void ensureLoaded()- Overrides:
ensureLoaded
in classorg.eclipse.xtext.builder.builderState.AbstractBuilderState
-
installSourceLevelURIs
protected void installSourceLevelURIs(org.eclipse.xtext.builder.impl.BuildData buildData) - Overrides:
installSourceLevelURIs
in classorg.eclipse.xtext.builder.clustering.ClusteringBuilderState
-
addResource
protected org.eclipse.emf.ecore.resource.Resource addResource(org.eclipse.emf.ecore.resource.Resource resource, org.eclipse.emf.ecore.resource.ResourceSet resourceSet) - Overrides:
addResource
in classorg.eclipse.xtext.builder.clustering.ClusteringBuilderState
-
doUpdate
protected Collection<org.eclipse.xtext.resource.IResourceDescription.Delta> doUpdate(org.eclipse.xtext.builder.impl.BuildData buildData, org.eclipse.xtext.resource.impl.ResourceDescriptionsData newData, org.eclipse.core.runtime.IProgressMonitor monitor) We should override this method for adding logic for clearing resources data- Overrides:
doUpdate
in classorg.eclipse.xtext.builder.clustering.ClusteringBuilderState
-
collectRoughBuildScope
protected void collectRoughBuildScope(org.eclipse.core.resources.IProject project, org.eclipse.xtext.resource.impl.ResourceDescriptionsData newData, Set<org.eclipse.emf.common.util.URI> result) Collects rough build scope. Rough means that it may contain URIs of the resources that do not require building.- Parameters:
project
- The project that is being built. May benull
.newData
- The new resource descriptions. May not benull
.result
- The result set the URIs will be added to. May not benull
.
-
updateNewResourceDescriptions
protected Queue<org.eclipse.xtext.resource.IResourceDescription.Delta> updateNewResourceDescriptions(Queue<org.eclipse.emf.common.util.URI> allUris, int queueFullSize, org.eclipse.core.resources.IProject currentProject, org.eclipse.emf.ecore.resource.ResourceSet resourceSet, Set<org.eclipse.emf.common.util.URI> toBeDeleted, boolean isIndexingOnly, AtomicInteger[] indexes, org.eclipse.xtext.builder.clustering.CurrentDescriptions newState, org.eclipse.core.runtime.SubMonitor subProgress) UpdatesIResourceDescription
for concreteQueue
ofURI
s. CreatesIResourceDescription.Delta
with information ofIResourceDescription
updating. This method contains logic for paralleling updating operation forgetPermittedThreads()
threads- Parameters:
allUris
- allURI
s for updateIResourceDescription
, cannot benull
queueFullSize
- initial size of theQueue
ofURI
s for updating, need for right update ofSubMonitor
currentProject
- actual project for updatingIResourceDescription
, cannot benull
resourceSet
- actualResourceSet
for creatingResource
s, cannot benull
toBeDeleted
- set of theURI
s which were deleted from project, cannot benull
isIndexingOnly
-true
if creatingResource
s should be create for only index operationindexes
- special indexes distributed from all threads of updatingIResourceDescription
.- indexes[0] number of
IResourceDescription
updating in this build - indexes[1] number of
IResourceDescription
updating in this step - indexes[2] number of threads updating
IResourceDescription
- indexes[0] number of
newState
-CurrentDescriptions
for gettingIResourceDescription
byURI
, cannot benull
subProgress
-SubMonitor
for show progress of operation, cannot benull
- Returns:
IResourceDescription.Delta
with information ofIResourceDescription
updating, nevernull
-
updateNewResourceDescriptionsForQueue
protected Queue<org.eclipse.xtext.resource.IResourceDescription.Delta> updateNewResourceDescriptionsForQueue(Queue<org.eclipse.emf.common.util.URI> queue, int fullQueueSize, org.eclipse.core.resources.IProject currentProject, org.eclipse.emf.ecore.resource.ResourceSet resourceSet, Set<org.eclipse.emf.common.util.URI> toBeDeleted, boolean isIndexingOnly, AtomicInteger[] indexes, org.eclipse.xtext.builder.clustering.CurrentDescriptions newState, org.eclipse.core.runtime.SubMonitor subProgress) UpdatesIResourceDescription
for concreteQueue
ofURI
s. CreatesIResourceDescription.Delta
with information ofIResourceDescription
updating.- Parameters:
queue
- allURI
s for updateIResourceDescription
, cannot benull
fullQueueSize
- initial size of theQueue
ofURI
s for updating, need for right update ofSubMonitor
currentProject
- actual project for updatingIResourceDescription
, cannot benull
resourceSet
- actualResourceSet
for creatingResource
s, cannot benull
toBeDeleted
- set of theURI
s which were deleted from project, cannot benull
isIndexingOnly
-true
if creatingResource
s should be create for only index operationindexes
- special indexes distributed from all threads of updatingIResourceDescription
.- indexes[0] number of
IResourceDescription
updating in this build - indexes[1] number of
IResourceDescription
updating in this step - indexes[2] number of threads updating
IResourceDescription
- indexes[0] number of
newState
-CurrentDescriptions
for gettingIResourceDescription
byURI
, cannot benull
subProgress
-SubMonitor
for show progress of operation, cannot benull
- Returns:
IResourceDescription.Delta
with information ofIResourceDescription
updating, nevernull
-
writeNewResourceDescriptions
protected void writeNewResourceDescriptions(org.eclipse.xtext.builder.impl.BuildData buildData, org.eclipse.xtext.resource.IResourceDescriptions oldState, org.eclipse.xtext.builder.clustering.CurrentDescriptions newState, org.eclipse.core.runtime.IProgressMonitor monitor) We should override this method for additional processing of the resources. SeeILightClusteringBuilderStateCallbackService
- Overrides:
writeNewResourceDescriptions
in classorg.eclipse.xtext.builder.clustering.ClusteringBuilderState
-