This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 200636
Collapse All | Expand All

(-)a/core.startup/apichanges.xml (+16 lines)
Lines 56-61 Link Here
56
<!-- ACTUAL CHANGES BEGIN HERE: -->
56
<!-- ACTUAL CHANGES BEGIN HERE: -->
57
57
58
  <changes>
58
  <changes>
59
     <change id="PARALLEL_MODULE_INSTALL">
60
        <api name="exec-property"/>
61
        <summary>Invoke ModuleInstalls in parallel</summary>
62
        <version major="1" minor="34"/>
63
        <date day="10" month="8" year="2011"/>
64
        <author login="jtulach"/>
65
        <compatibility addition="yes" binary="compatible" semantic="compatible" />
66
        <description>
67
        <p>
68
            New branding key
69
            <a href="architecture-summary.html#property-PARALLEL_MODULE_INSTALL">PARALLEL_MODULE_INSTALL</a> 
70
            is available to run <a href="@org-openide-modules@/org/openide/modules/ModuleInstall.html">
71
            ModuleInstall</a>s in parallel.
72
        </p>
73
        </description>
74
    </change>
59
     <change id="netbeans.bootdelegation">
75
     <change id="netbeans.bootdelegation">
60
        <api name="exec-property"/>
76
        <api name="exec-property"/>
61
        <summary>netbeans.bootdelegation property</summary>
77
        <summary>netbeans.bootdelegation property</summary>
(-)a/core.startup/arch.xml (+17 lines)
Lines 643-648 Link Here
643
          can be accessed. Available since version 1.26.
643
          can be accessed. Available since version 1.26.
644
          </p>
644
          </p>
645
      </api>
645
      </api>
646
      <api name="PARALLEL_MODULE_INSTALL" category="devel" group="property" type="export">
647
          <p>
648
          Applications built on top of NetBeans Platform may request execution
649
          of all <a href="@org-openide-modules@/org/openide/modules/ModuleInstall.html">
650
          ModuleInstall</a> in parallel. This usually speeds up start of the
651
          application on modern multi core computers, however it requires
652
          more robustness and code polishing, as the execution order is more 
653
          or less random.
654
          </p>
655
          <p>
656
          To request parallel execution brand the 
657
          <code>org/netbeans/core/startup/Bundle</code> file and change value
658
          of <code>PARALLEL_MODULE_INSTALL</code> to the number of 
659
          <a href="@org-openide-modules@/org/openide/modules/ModuleInstall.html">
660
          ModuleInstall</a>s that may run concurrently.
661
          </p>
662
      </api>
646
  </p>
663
  </p>
647
 </answer>
664
 </answer>
648
665
(-)a/core.startup/manifest.mf (-1 / +1 lines)
Lines 3-7 Link Here
3
OpenIDE-Module-Localizing-Bundle: org/netbeans/core/startup/Bundle.properties
3
OpenIDE-Module-Localizing-Bundle: org/netbeans/core/startup/Bundle.properties
4
OpenIDE-Module-Layer: org/netbeans/core/startup/layer.xml
4
OpenIDE-Module-Layer: org/netbeans/core/startup/layer.xml
5
OpenIDE-Module-Provides: org.openide.modules.InstalledFileLocator
5
OpenIDE-Module-Provides: org.openide.modules.InstalledFileLocator
6
OpenIDE-Module-Specification-Version: 1.33
6
OpenIDE-Module-Specification-Version: 1.34
7
7
(-)a/core.startup/src/org/netbeans/core/startup/Bundle.properties (+4 lines)
Lines 233-235 Link Here
233
# {3} - line #
233
# {3} - line #
234
EXC_sax_parse_col_line=Parse error in file {1} line {3} column {2} (PUBLIC {0})
234
EXC_sax_parse_col_line=Parse error in file {1} line {3} column {2} (PUBLIC {0})
235
235
236
# Do we want paralelism while installing modules? Zero means no.
237
# NOI18N
238
PARALLEL_MODULE_INSTALL=0
239
(-)a/core.startup/src/org/netbeans/core/startup/NbInstaller.java (-14 / +49 lines)
Lines 92-97 Link Here
92
import org.openide.util.NbCollections;
92
import org.openide.util.NbCollections;
93
import org.openide.util.SharedClassObject;
93
import org.openide.util.SharedClassObject;
94
import org.openide.util.NbBundle;
94
import org.openide.util.NbBundle;
95
import org.openide.util.RequestProcessor;
96
import org.openide.util.RequestProcessor.Task;
95
import org.openide.util.Utilities;
97
import org.openide.util.Utilities;
96
import org.openide.util.lookup.InstanceContent;
98
import org.openide.util.lookup.InstanceContent;
97
import org.xml.sax.SAXException;
99
import org.xml.sax.SAXException;
Lines 361-369 Link Here
361
        Main.initUICustomizations();
363
        Main.initUICustomizations();
362
364
363
        ev.log(Events.PERF_START, "NbInstaller.load - ModuleInstalls"); // NOI18N
365
        ev.log(Events.PERF_START, "NbInstaller.load - ModuleInstalls"); // NOI18N
366
        
367
        RequestProcessor rp = createModuleInstallProcessor();
368
        Set<Task> waitFor = new HashSet<Task>();
364
        for (Module m: modules) {
369
        for (Module m: modules) {
365
            try {
370
            try {
366
                loadCode(m, true);
371
                waitFor.add(loadCode(m, true, rp));
367
            } catch (Exception t) {
372
            } catch (Exception t) {
368
                Util.err.log(Level.SEVERE, null, t);
373
                Util.err.log(Level.SEVERE, null, t);
369
            } catch (LinkageError le) {
374
            } catch (LinkageError le) {
Lines 371-392 Link Here
371
            } catch (AssertionError e) {
376
            } catch (AssertionError e) {
372
                Util.err.log(Level.SEVERE, null, e);
377
                Util.err.log(Level.SEVERE, null, e);
373
            }
378
            }
374
	    ev.log(Events.PERF_TICK, "ModuleInstall for " + m.getCodeName() + " called"); // NOI18N
379
            ev.log(Events.PERF_TICK, "ModuleInstall for " + m.getCodeName() + " called"); // NOI18N
375
        }
380
        }
376
        ev.log(Events.PERF_END, "NbInstaller.load - ModuleInstalls"); // NOI18N
377
381
378
        ev.log(Events.FINISH_LOAD, modules);
379
        
382
        
380
        if (Boolean.getBoolean("netbeans.preresolve.classes")) {
383
        if (Boolean.getBoolean("netbeans.preresolve.classes")) {
381
            preresolveClasses(modules);
384
            preresolveClasses(modules);
382
        }
385
        }
386
        
387
        for (Task t : waitFor) {
388
            if (t != null) {
389
                t.waitFinished();
390
            }
391
        }
392
        ev.log(Events.PERF_END, "NbInstaller.load - ModuleInstalls"); // NOI18N
393
        ev.log(Events.FINISH_LOAD, modules);
383
    }
394
    }
384
    
395
    
396
    @Override
385
    public void unload(List<Module> modules) {
397
    public void unload(List<Module> modules) {
386
        ev.log(Events.START_UNLOAD, modules);
398
        ev.log(Events.START_UNLOAD, modules);
399
        RequestProcessor rp = createModuleInstallProcessor();
400
        Set<Task> waitFor = new HashSet<Task>();
387
        for (Module m: modules) {
401
        for (Module m: modules) {
388
            try {
402
            try {
389
                loadCode(m, false);
403
                waitFor.add(loadCode(m, false, rp));
390
            } catch (Exception t) {
404
            } catch (Exception t) {
391
                Util.err.log(Level.SEVERE, null, t);
405
                Util.err.log(Level.SEVERE, null, t);
392
            } catch (LinkageError le) {
406
            } catch (LinkageError le) {
Lines 412-434 Link Here
412
            }
426
            }
413
        }
427
        }
414
        loadLayers(modules, false);
428
        loadLayers(modules, false);
429
        for (Task t : waitFor) {
430
            if (t != null) {
431
                t.waitFinished();
432
            }
433
        }
415
        ev.log(Events.FINISH_UNLOAD, modules);
434
        ev.log(Events.FINISH_UNLOAD, modules);
416
    }
435
    }
417
    
436
    
418
    /** Load/unload installer code for a module. */
437
    /** Load/unload installer code for a module. */
419
    @SuppressWarnings("deprecation") // old ModuleInstall methods we have to call
438
    @SuppressWarnings("deprecation") // old ModuleInstall methods we have to call
420
    private void loadCode(Module m, boolean load) throws Exception {
439
    private Task loadCode(final Module m, final boolean load, RequestProcessor rp) throws Exception {
421
        Class<? extends ModuleInstall> instClazz = installs.get(m);
440
        final Class<? extends ModuleInstall> instClazz = installs.get(m);
422
        if (instClazz != null) {
441
        if (instClazz != null) {
423
            ModuleInstall inst = SharedClassObject.findObject(instClazz, true);
442
            final Runnable operation = new Runnable() {
424
            if (load) {
443
                @Override
425
                ev.log(Events.RESTORE, m);
444
                public void run() {
426
                inst.restored();
445
                    ModuleInstall inst = SharedClassObject.findObject(instClazz, true);
427
            } else {
446
                    if (load) {
428
                ev.log(Events.UNINSTALL, m);
447
                        ev.log(Events.RESTORE, m);
429
                inst.uninstalled();
448
                        inst.restored();
449
                    } else {
450
                        ev.log(Events.UNINSTALL, m);
451
                        inst.uninstalled();
452
                    }
453
                }
454
            };
455
            if (rp == null) {
456
                operation.run();
457
                return null;
430
            }
458
            }
459
            return rp.post(operation);
431
        }
460
        }
461
        return null;
432
    }
462
    }
433
    
463
    
434
    /** Load/unload all manifest sections for a given module. */
464
    /** Load/unload all manifest sections for a given module. */
Lines 484-489 Link Here
484
    }
514
    }
485
    
515
    
486
    private final InstanceContent.Convertor<ManifestSection,Object> convertor = new Convertor();
516
    private final InstanceContent.Convertor<ManifestSection,Object> convertor = new Convertor();
517
518
    private RequestProcessor createModuleInstallProcessor() {
519
        int throughput = Integer.parseInt(NbBundle.getMessage(NbInstaller.class, "PARALLEL_MODULE_INSTALL"));
520
        return throughput <= 0 ? null : new RequestProcessor("Module Installs", throughput); // NOI18N
521
    }
487
    private final class Convertor implements InstanceContent.Convertor<ManifestSection,Object> { // or <ManifestSection,SharedClassObject>?
522
    private final class Convertor implements InstanceContent.Convertor<ManifestSection,Object> { // or <ManifestSection,SharedClassObject>?
488
        Convertor() {}
523
        Convertor() {}
489
        public Object convert(ManifestSection s) {
524
        public Object convert(ManifestSection s) {
(-)a/ide.branding/core.startup/src/org/netbeans/core/startup/Bundle_nb.properties (+3 lines)
Lines 78-80 Link Here
78
78
79
MSG_warning=NetBeans IDE - Warning
79
MSG_warning=NetBeans IDE - Warning
80
MSG_info=NetBeans IDE - Information
80
MSG_info=NetBeans IDE - Information
81
82
# NOI18N
83
PARALLEL_MODULE_INSTALL=16

Return to bug 200636