BackgroundScan

Contents

Status

  • The scan runs on background
  • The ClassIndex events works with correct threading.
  • runWhenScanFinished works with partial ordering on "happens-before" relation.
  • Transactions with isolation work on Lucene index (Java, CSL)
  • Transactions partially work on sig file (no isolation yet, except of newly added roots are visible after the root is scanned)

Needs to be done

  • Isolation for changes in sig files
  • Extending ParserResultTask API not to run by default non updated task during the scan (backward semantical compatibility)
  • Scan should be suspended during parse, runUserTask

Compatibility considerations

  • Existing (not adapted) ParserResultTasks will run int he same way and at the same time (after scan finishes) as in 7.1
  • Behaviour of UserTasks not changed - they had to handle erroneous or unresolved elements even in 7.1

Tasks for API Clients - mandatory

These following reviews are required to discover possibly ill-written code or code which was not originally written to handle exceptional cases documented in Parsing / Java APIs. Not that such code is broken already and will eventually break even without background parsing implmented.

  • Clients of ClassIndex events should be prepared that their clients can be initialized before the scan finished and events are delivered.
  • Clients of runUserTask should be defensive and prepared for error types. Nothing has changed even now these clients can be executed on non up to date data, but after change it will be more often.

Tasks for API Clients - optional

The following changes are desirable in order to actually improve perceived performance for the user. They may be implemented piece by piece as time permits or as user feedback to performance suggests:

  • Clients of runWhenScanFinished should verify the validity of the call, should the feature be available during scan?
  • Clients of ParserResultTask should change the task to run during the scan if desirable

Links

Prototypes repository, branch 'background_scan'

Continuous Build

Usages of runWhenScanFinished and parseWhenScanFinished

apisupport/modules/org-netbeans-modules-apisupport-project.jar 1
enterprise/modules/org-netbeans-modules-j2ee-clientproject.jar 1
enterprise/modules/org-netbeans-modules-j2ee-ejbcore.jar 2
enterprise/modules/org-netbeans-modules-web-jsf-editor.jar 1
enterprise/modules/org-netbeans-modules-websvc-core.jar 1
enterprise/modules/org-netbeans-modules-websvc-rest.jar 1
groovy/modules/org-netbeans-modules-groovy-support.jar 1
ide/modules/org-netbeans-modules-csl-api.jar 3
java/modules/org-netbeans-modules-beans.jar 1
java/modules/org-netbeans-modules-debugger-jpda-projects.jar 3
java/modules/org-netbeans-modules-debugger-jpda-ui.jar 2
java/modules/org-netbeans-modules-debugger-jpda.jar 2
java/modules/org-netbeans-modules-j2ee-metadata-model-support.jar 1
java/modules/org-netbeans-modules-j2ee-persistence.jar 1
java/modules/org-netbeans-modules-java-api-common.jar 2
java/modules/org-netbeans-modules-java-editor.jar 4
java/modules/org-netbeans-modules-java-hints.jar 1
java/modules/org-netbeans-modules-java-j2seproject.jar 1
java/modules/org-netbeans-modules-java-source.jar 2
java/modules/org-netbeans-modules-java-sourceui.jar 2
java/modules/org-netbeans-modules-junit.jar 2
java/modules/org-netbeans-modules-refactoring-java.jar 6
java/modules/org-netbeans-modules-spring-beans.jar 1
javafx/modules/org-netbeans-modules-javafx2-editor.jar 1
mobility/modules/org-netbeans-modules-mobility-end2end.jar 1
mobility/modules/org-netbeans-modules-vmd-midp.jar 1
mobility/modules/org-netbeans-modules-vmd-palette.jar 1
php/modules/org-netbeans-modules-php-editor.jar 3
profiler/modules/org-netbeans-modules-profiler-nbimpl.jar 2

Usages of runUserActionTask and parse

apisupport/modules/org-netbeans-modules-apisupport-refactoring.jar 2
cnd/modules/org-netbeans-modules-cnd-script.jar 1
enterprise/modules/org-netbeans-modules-j2ee-api-ejbmodule.jar 1
enterprise/modules/org-netbeans-modules-j2ee-clientproject.jar 1
enterprise/modules/org-netbeans-modules-j2ee-common.jar 1
enterprise/modules/org-netbeans-modules-j2ee-ddloaders.jar 1
enterprise/modules/org-netbeans-modules-j2ee-ejbcore.jar 13
enterprise/modules/org-netbeans-modules-j2ee-ejbrefactoring.jar 1
enterprise/modules/org-netbeans-modules-j2ee-ejbverification.jar 1
enterprise/modules/org-netbeans-modules-maven-j2ee.jar 2
enterprise/modules/org-netbeans-modules-maven-jaxws.jar 8
enterprise/modules/org-netbeans-modules-profiler-j2ee.jar 1
enterprise/modules/org-netbeans-modules-spring-webmvc.jar 2
enterprise/modules/org-netbeans-modules-web-beans.jar 4
enterprise/modules/org-netbeans-modules-web-core-syntax.jar 1
enterprise/modules/org-netbeans-modules-web-core.jar 1
enterprise/modules/org-netbeans-modules-web-el.jar 8
enterprise/modules/org-netbeans-modules-web-jsf-editor.jar 6
enterprise/modules/org-netbeans-modules-web-jsf.jar 10
enterprise/modules/org-netbeans-modules-web-jsfapi.jar 1
enterprise/modules/org-netbeans-modules-web-project.jar 3
enterprise/modules/org-netbeans-modules-web-refactoring.jar 2
enterprise/modules/org-netbeans-modules-web-struts.jar 2
enterprise/modules/org-netbeans-modules-websvc-core.jar 6
enterprise/modules/org-netbeans-modules-websvc-design.jar 2
enterprise/modules/org-netbeans-modules-websvc-editor-hints.jar 2
enterprise/modules/org-netbeans-modules-websvc-owsm.jar 1
enterprise/modules/org-netbeans-modules-websvc-rest.jar 5
enterprise/modules/org-netbeans-modules-websvc-utilities.jar 2
enterprise/modules/org-netbeans-modules-websvc-wsitconf.jar 5
groovy/modules/org-netbeans-modules-groovy-editor.jar 9
groovy/modules/org-netbeans-modules-groovy-refactoring.jar 2
ide/modules/org-netbeans-modules-csl-api.jar 15
ide/modules/org-netbeans-modules-css-editor.jar 3
ide/modules/org-netbeans-modules-html-editor.jar 4
ide/modules/org-netbeans-modules-javascript-editing.jar 2
ide/modules/org-netbeans-modules-javascript-refactoring.jar 6
ide/modules/org-netbeans-modules-parsing-api.jar 1
java/modules/org-netbeans-modules-beans.jar 2
java/modules/org-netbeans-modules-debugger-jpda-projects.jar 2
java/modules/org-netbeans-modules-debugger-jpda.jar 1
java/modules/org-netbeans-modules-form-binding.jar 1
java/modules/org-netbeans-modules-form-j2ee.jar 1
java/modules/org-netbeans-modules-form-nb.jar 1
java/modules/org-netbeans-modules-form-refactoring.jar 2
java/modules/org-netbeans-modules-hibernate.jar 10
java/modules/org-netbeans-modules-i18n.jar 1
java/modules/org-netbeans-modules-j2ee-core-utilities.jar 1
java/modules/org-netbeans-modules-j2ee-jpa-refactoring.jar 3
java/modules/org-netbeans-modules-j2ee-jpa-verification.jar 3
java/modules/org-netbeans-modules-j2ee-metadata-model-support.jar 1
java/modules/org-netbeans-modules-j2ee-persistence.jar 3
java/modules/org-netbeans-modules-java-api-common.jar 2
java/modules/org-netbeans-modules-java-debug.jar 1
java/modules/org-netbeans-modules-java-editor.jar 22
java/modules/org-netbeans-modules-java-hints-declarative.jar 4
java/modules/org-netbeans-modules-java-hints.jar 9
java/modules/org-netbeans-modules-java-navigation.jar 10
java/modules/org-netbeans-modules-java-source-queriesimpl.jar 1
java/modules/org-netbeans-modules-java-source.jar 8
java/modules/org-netbeans-modules-java-sourceui.jar 4
java/modules/org-netbeans-modules-javadoc.jar 2
java/modules/org-netbeans-modules-javawebstart.jar 1
java/modules/org-netbeans-modules-junit.jar 3
java/modules/org-netbeans-modules-maven-refactoring.jar 1
java/modules/org-netbeans-modules-refactoring-java.jar 34
java/modules/org-netbeans-modules-spring-beans.jar 14
java/modules/org-netbeans-modules-websvc-saas-codegen-java.jar 1
javacard/modules/org-netbeans-modules-javacard-project.jar 1
javafx/modules/org-netbeans-modules-javafx2-project.jar 1
mobility/modules/org-netbeans-modules-j2me-cdc-project-execuiimpl.jar 1
mobility/modules/org-netbeans-modules-mobility-j2meunit.jar 3
mobility/modules/org-netbeans-modules-mobility-project-bridge-impl.jar 1
mobility/modules/org-netbeans-modules-vmd-midp-converter.jar 2
mobility/modules/org-netbeans-modules-vmd-midp.jar 4
mobility/modules/org-netbeans-modules-vmd-palette.jar 1
php/modules/org-netbeans-modules-php-editor.jar 10
php/modules/org-netbeans-modules-php-refactoring.jar 3
php/modules/org-netbeans-modules-php-smarty.jar 1
php/modules/org-netbeans-modules-php-symfony.jar 1
php/modules/org-netbeans-modules-php-zend.jar 1
profiler/modules/org-netbeans-modules-profiler-nbimpl.jar 6

Subclasses of ParserResultTask & implementors of CancellableTask

The ParserResultTask or CancellableTask instances can be registered in editor dispatch tread to be executed on editor events.

apisupport/modules/org-netbeans-modules-apisupport-refactoring.jar 2
enterprise/modules/org-netbeans-modules-j2ee-ejbjarproject.jar 1
enterprise/modules/org-netbeans-modules-j2ee-ejbrefactoring.jar 1
enterprise/modules/org-netbeans-modules-j2ee-ejbverification.jar 6
enterprise/modules/org-netbeans-modules-maven-j2ee.jar 1
enterprise/modules/org-netbeans-modules-maven-jaxws.jar 16
enterprise/modules/org-netbeans-modules-profiler-j2ee.jar 1
enterprise/modules/org-netbeans-modules-web-beans.jar 2
enterprise/modules/org-netbeans-modules-web-core-syntax.jar 1
enterprise/modules/org-netbeans-modules-web-el.jar 1
enterprise/modules/org-netbeans-modules-web-jsf-editor.jar 1
enterprise/modules/org-netbeans-modules-web-project.jar 1
enterprise/modules/org-netbeans-modules-web-refactoring.jar 2
enterprise/modules/org-netbeans-modules-websvc-core.jar 29
enterprise/modules/org-netbeans-modules-websvc-design.jar 6
enterprise/modules/org-netbeans-modules-websvc-editor-hints.jar 6
enterprise/modules/org-netbeans-modules-websvc-rest.jar 1
enterprise/modules/org-netbeans-modules-websvc-saas-codegen-j2ee.jar 2
enterprise/modules/org-netbeans-modules-websvc-utilities.jar 2
enterprise/modules/org-netbeans-modules-websvc-wsitconf.jar 3
groovy/modules/org-netbeans-modules-groovy-refactoring.jar 2
ide/modules/org-netbeans-modules-csl-api.jar 13
ide/modules/org-netbeans-modules-css-visual.jar 1
ide/modules/org-netbeans-modules-html-editor.jar 1
ide/modules/org-netbeans-modules-parsing-api.jar 2
java/modules/org-netbeans-modules-beans.jar 2
java/modules/org-netbeans-modules-debugger-jpda-projects.jar 3
java/modules/org-netbeans-modules-debugger-jpda-ui.jar 2
java/modules/org-netbeans-modules-debugger-jpda.jar 2
java/modules/org-netbeans-modules-form-binding.jar 2
java/modules/org-netbeans-modules-form-j2ee.jar 6
java/modules/org-netbeans-modules-form-nb.jar 2
java/modules/org-netbeans-modules-form-refactoring.jar 2
java/modules/org-netbeans-modules-i18n.jar 1
java/modules/org-netbeans-modules-j2ee-jpa-refactoring.jar 6
java/modules/org-netbeans-modules-j2ee-jpa-verification.jar 12
java/modules/org-netbeans-modules-j2ee-metadata-model-support.jar 2
java/modules/org-netbeans-modules-java-api-common.jar 1
java/modules/org-netbeans-modules-java-debug.jar 5
java/modules/org-netbeans-modules-java-editor.jar 2
java/modules/org-netbeans-modules-java-hints-declarative.jar 2
java/modules/org-netbeans-modules-java-hints.jar 3
java/modules/org-netbeans-modules-java-navigation.jar 3
java/modules/org-netbeans-modules-java-source-queriesimpl.jar 1
java/modules/org-netbeans-modules-java-source.jar 4
java/modules/org-netbeans-modules-javadoc.jar 4
java/modules/org-netbeans-modules-javawebstart.jar 1
java/modules/org-netbeans-modules-junit.jar 5
java/modules/org-netbeans-modules-maven-refactoring.jar 1
java/modules/org-netbeans-modules-refactoring-java.jar 45
java/modules/org-netbeans-modules-spellchecker-bindings-java.jar 1
java/modules/org-netbeans-modules-websvc-saas-codegen-java.jar 2
java/modules/org-netbeans-modules-xml-jaxb.jar 1
java/modules/org-netbeans-modules-xml-tools-java.jar 7
javacard/modules/org-netbeans-modules-javacard-project.jar 1
javafx/modules/org-netbeans-modules-javafx2-project.jar 1
mobility/modules/org-netbeans-modules-j2me-cdc-project-execuiimpl.jar 2
mobility/modules/org-netbeans-modules-mobility-end2end.jar 1
mobility/modules/org-netbeans-modules-mobility-j2meunit.jar 3
mobility/modules/org-netbeans-modules-mobility-project-bridge-impl.jar 1
mobility/modules/org-netbeans-modules-vmd-game.jar 1
mobility/modules/org-netbeans-modules-vmd-midp-converter.jar 1
mobility/modules/org-netbeans-modules-vmd-midp.jar 3
mobility/modules/org-netbeans-modules-vmd-midpnb.jar 1
php/modules/org-netbeans-modules-php-twig.jar 1
profiler/modules/org-netbeans-modules-profiler-nbimpl.jar 11

Task conversion

The following table summarizes tasks / actions converted from runWhenScanFinishes to runUserActionTask:

Class name Index / parser usage Comments
EditorContextImpl
JavaCodeTemplateFilter Uses parse trees to manipulate template
JavaCodeTemplateProcessor
JavadocCompletionQuery
MainClassChooser Uses lookup in index updates first with partial results and a warning msg, when scan finishes redrawn with complete data
MethodChooserSupport
MoveMembersPanel Discovers members in the current class
TestCreator Generates code based on this file's information
TestMethodAction Works with the current file only
ToggleBreakpointActionProvider uses trees in the current compilation unit
WatchPanel


The following classes are NOT CONVERTED and there are no current plans to adapt them:

  • MainClassUpdater: NOT converted, searches globally for type. Listener is mainly used after rename refactoring, which itself runs only after scan finishes.
    • handleMainClassMoved replans runUserActionTask into EDT. Bug ?
  • CallHierarchyTasks - NOT converted, performs global queries
    • calls getOverridenMethods
    • could be converted - at the expense of incomplete data before the scan is over; user would have to be warned in the dialog
  • OpenLayerFilesAction - NOT converted; uses global lookup to find originating element. May be reimplemented as two-phase approach:
    • 1st try will be run just through UserTask, trying to locate the element
    • 2nd try wait on scan finish and retry, in the case the relevant element had been never scanned yet

TODO

  • GenerateBeanInfoAction
Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo