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/autoupdate.pluginimporter/src/org/netbeans/modules/autoupdate/pluginimporter/Installer.java (-10 / +5 lines)
Lines 57-69 Link Here
57
import org.openide.modules.ModuleInstall;
57
import org.openide.modules.ModuleInstall;
58
import org.openide.util.NbPreferences;
58
import org.openide.util.NbPreferences;
59
import org.openide.util.RequestProcessor;
59
import org.openide.util.RequestProcessor;
60
import org.openide.util.lookup.ServiceProvider;
60
import org.openide.windows.WindowManager;
61
import org.openide.windows.WindowManager;
61
62
62
/**
63
/**
63
 * Manages a module's lifecycle. Remember that an installer is optional and
64
 * Manages a module's lifecycle. Remember that an installer is optional and
64
 * often not needed at all.
65
 * often not needed at all.
65
 */
66
 */
66
public class Installer extends ModuleInstall {
67
@ServiceProvider(path="Modules/UIReady", service=Runnable.class)
68
public class Installer implements Runnable {
67
69
68
    public static final String KEY_IMPORT_FROM = "import-from";
70
    public static final String KEY_IMPORT_FROM = "import-from";
69
    public static final String CODE_NAME = "ClusterUpdateProvider";
71
    public static final String CODE_NAME = "ClusterUpdateProvider";
Lines 78-84 Link Here
78
    private static final String IMPORTED = "imported"; // NOI18N
80
    private static final String IMPORTED = "imported"; // NOI18N
79
81
80
    @Override
82
    @Override
81
    public void restored () {
83
    public void run() {
82
        // don't try to invoke at all in these special cases
84
        // don't try to invoke at all in these special cases
83
        if (Boolean.getBoolean("netbeans.full.hack") || Boolean.getBoolean("netbeans.close")) { // NOI18N
85
        if (Boolean.getBoolean("netbeans.full.hack") || Boolean.getBoolean("netbeans.close")) { // NOI18N
84
            return;
86
            return;
Lines 88-101 Link Here
88
        Preferences au_pref = NbPreferences.root ().node ("/org/netbeans/modules/autoupdate"); // NOI18N
90
        Preferences au_pref = NbPreferences.root ().node ("/org/netbeans/modules/autoupdate"); // NOI18N
89
        au_pref.node (Installer.CODE_NAME + Installer.REMOVED).putBoolean (Installer.REMOVED, true);
91
        au_pref.node (Installer.CODE_NAME + Installer.REMOVED).putBoolean (Installer.REMOVED, true);
90
92
91
        // install plugin importer when UI is ready (main window shown)
93
        RequestProcessor.getDefault ().post (doCheck, getImportDelay ()); // XXX: Need to wait until UC downloaded&parsed
92
        WindowManager.getDefault ().invokeWhenUIReady (new Runnable () {
93
94
            @Override
95
            public void run () {
96
                RequestProcessor.getDefault ().post (doCheck, getImportDelay ()); // XXX: Need to wait until UC downloaded&parsed
97
            }
98
        });
99
    }
94
    }
100
95
101
    private Runnable doCheck = new Runnable () {
96
    private Runnable doCheck = new Runnable () {
(-)a/autoupdate.ui/src/org/netbeans/modules/autoupdate/ui/actions/Installer.java (-4 / +4 lines)
Lines 44-61 Link Here
44
44
45
package org.netbeans.modules.autoupdate.ui.actions;
45
package org.netbeans.modules.autoupdate.ui.actions;
46
46
47
import org.openide.modules.ModuleInstall;
48
import org.openide.util.RequestProcessor;
47
import org.openide.util.RequestProcessor;
48
import org.openide.util.lookup.ServiceProvider;
49
49
50
/**
50
/**
51
 * Manages a module's lifecycle. Remember that an installer is optional and
51
 * Manages a module's lifecycle. Remember that an installer is optional and
52
 * often not needed at all.
52
 * often not needed at all.
53
 */
53
 */
54
public class Installer extends ModuleInstall {
54
@ServiceProvider(path="Modules/Start", service=Runnable.class)
55
public class Installer implements Runnable {
55
    public static final RequestProcessor RP = new RequestProcessor("AutoUpdate-UI"); // NOI18N
56
    public static final RequestProcessor RP = new RequestProcessor("AutoUpdate-UI"); // NOI18N
56
    
57
    @Override
57
    @Override
58
    public void restored () {
58
    public void run() {
59
        // don't try to invoke at all in these special cases
59
        // don't try to invoke at all in these special cases
60
        if (Boolean.getBoolean("netbeans.full.hack") || Boolean.getBoolean("netbeans.close")) { // NOI18N
60
        if (Boolean.getBoolean("netbeans.full.hack") || Boolean.getBoolean("netbeans.close")) { // NOI18N
61
            return;
61
            return;
(-)a/db/src/org/netbeans/modules/db/DatabaseModule.java (-3 / +4 lines)
Lines 51-59 Link Here
51
import org.netbeans.modules.db.explorer.DatabaseConnection;
51
import org.netbeans.modules.db.explorer.DatabaseConnection;
52
import org.netbeans.modules.db.runtime.DatabaseRuntimeManager;
52
import org.netbeans.modules.db.runtime.DatabaseRuntimeManager;
53
import org.netbeans.spi.db.explorer.DatabaseRuntime;
53
import org.netbeans.spi.db.explorer.DatabaseRuntime;
54
import org.openide.modules.ModuleInstall;
54
import org.openide.util.lookup.ServiceProvider;
55
55
56
public class DatabaseModule extends ModuleInstall {
56
@ServiceProvider(path="Modules/Stop", service=Runnable.class)
57
public class DatabaseModule implements Runnable {
57
58
58
    public static final String IDENTIFIER_MYSQL = "MySQL"; // NOI18N
59
    public static final String IDENTIFIER_MYSQL = "MySQL"; // NOI18N
59
    public static final String IDENTIFIER_ORACLE = "Oracle"; // NOI18N
60
    public static final String IDENTIFIER_ORACLE = "Oracle"; // NOI18N
Lines 61-67 Link Here
61
    public static final String IDENTIFIER_ORACLE_OCI_DRIVER = "OCI"; // NOI18N
62
    public static final String IDENTIFIER_ORACLE_OCI_DRIVER = "OCI"; // NOI18N
62
    
63
    
63
    @Override
64
    @Override
64
    public void close () {
65
    public void run() {
65
        // XXX this method is called in the event thread and could take long
66
        // XXX this method is called in the event thread and could take long
66
        // to execute
67
        // to execute
67
68
(-)a/editor.completion/src/org/netbeans/modules/editor/completion/CompletionModule.java (-4 / +5 lines)
Lines 44-58 Link Here
44
44
45
package org.netbeans.modules.editor.completion;
45
package org.netbeans.modules.editor.completion;
46
46
47
import org.openide.modules.ModuleInstall;
47
import org.openide.util.lookup.ServiceProvider;
48
48
49
/**
49
/**
50
 *
50
 *
51
 * @author Dusan Balek
51
 * @author Dusan Balek
52
 */
52
 */
53
public class CompletionModule extends ModuleInstall {
53
@ServiceProvider(path="Modules/Start", service=Runnable.class)
54
54
public class CompletionModule implements Runnable {
55
    public void restored() {
55
    @Override
56
    public void run() {
56
        CompletionImpl.get();
57
        CompletionImpl.get();
57
    }
58
    }
58
}
59
}
(-)a/form.j2ee/src/org/netbeans/modules/form/j2ee/Installer.java (-3 / +4 lines)
Lines 45-64 Link Here
45
45
46
import org.netbeans.modules.form.CreationDescriptor;
46
import org.netbeans.modules.form.CreationDescriptor;
47
import org.netbeans.modules.form.CreationFactory;
47
import org.netbeans.modules.form.CreationFactory;
48
import org.openide.modules.ModuleInstall;
48
import org.openide.util.lookup.ServiceProvider;
49
49
50
/**
50
/**
51
 * Management of form/j2ee module's lifecycle.
51
 * Management of form/j2ee module's lifecycle.
52
 *
52
 *
53
 * @author Jan Stola
53
 * @author Jan Stola
54
 */
54
 */
55
public class Installer extends ModuleInstall {
55
@ServiceProvider(path="Modules/Start", service=Runnable.class)
56
public class Installer implements Runnable {
56
    
57
    
57
    /**
58
    /**
58
     * Registers creation descriptors.
59
     * Registers creation descriptors.
59
     */
60
     */
60
    @Override
61
    @Override
61
    public void restored() {
62
    public void run() {
62
        // Install creator for EntityManager
63
        // Install creator for EntityManager
63
        CreationDescriptor cd = new CreationDescriptor() {
64
        CreationDescriptor cd = new CreationDescriptor() {
64
            @Override
65
            @Override
(-)a/glassfish.common/src/org/netbeans/modules/glassfish/common/Installer.java (-6 / +4 lines)
Lines 41-47 Link Here
41
 */
41
 */
42
package org.netbeans.modules.glassfish.common;
42
package org.netbeans.modules.glassfish.common;
43
43
44
import org.openide.modules.ModuleInstall;
44
import org.openide.util.lookup.ServiceProvider;
45
45
46
/**
46
/**
47
 * Manages a module's lifecycle. Remember that an installer is optional and
47
 * Manages a module's lifecycle. Remember that an installer is optional and
Lines 49-60 Link Here
49
 *
49
 *
50
 * @auther Peter Williams
50
 * @auther Peter Williams
51
 */
51
 */
52
public class Installer extends ModuleInstall {
52
@ServiceProvider(path="Modules/Stop", service=Runnable.class)
53
53
public class Installer implements Runnable {
54
    @Override
54
    @Override
55
    public void close() {
55
    public void run() {
56
        super.close();
57
58
        // Send a shutdown message to any V3 server instances we started.
56
        // Send a shutdown message to any V3 server instances we started.
59
        if (GlassfishInstanceProvider.initialized()) {
57
        if (GlassfishInstanceProvider.initialized()) {
60
            for(GlassfishInstanceProvider provider: GlassfishInstanceProvider.getProviders(false)) {
58
            for(GlassfishInstanceProvider provider: GlassfishInstanceProvider.getProviders(false)) {
(-)a/httpserver/src/org/netbeans/modules/httpserver/HttpServerModule.java (-2 / +5 lines)
Lines 66-78 Link Here
66
import org.openide.util.LookupListener;
66
import org.openide.util.LookupListener;
67
import org.openide.util.NbBundle;
67
import org.openide.util.NbBundle;
68
import org.openide.util.RequestProcessor;
68
import org.openide.util.RequestProcessor;
69
import org.openide.util.lookup.ServiceProvider;
69
70
70
/**
71
/**
71
* Module installation class for Http Server
72
* Module installation class for Http Server
72
*
73
*
73
* @author Petr Jiricka
74
* @author Petr Jiricka
74
*/
75
*/
75
public class HttpServerModule extends ModuleInstall implements Externalizable {
76
@ServiceProvider(path="Modules/Stop", service=Runnable.class)
77
public class HttpServerModule implements Runnable {
76
78
77
79
78
    private static ContextManager server;
80
    private static ContextManager server;
Lines 84-90 Link Here
84
    private static boolean inSetRunning = false;
86
    private static boolean inSetRunning = false;
85
87
86
    /** Module is being closed. */
88
    /** Module is being closed. */
87
    public void close () {
89
    @Override
90
    public void run() {
88
        // stop the server, don't set the running status
91
        // stop the server, don't set the running status
89
        synchronized (HttpServerSettings.httpLock ()) {
92
        synchronized (HttpServerSettings.httpLock ()) {
90
            stopHTTPServer();
93
            stopHTTPServer();
(-)a/hudson/src/org/netbeans/modules/hudson/Installer.java (-9 / +13 lines)
Lines 46-71 Link Here
46
46
47
import java.util.prefs.BackingStoreException;
47
import java.util.prefs.BackingStoreException;
48
import org.netbeans.modules.hudson.impl.HudsonManagerImpl;
48
import org.netbeans.modules.hudson.impl.HudsonManagerImpl;
49
import org.openide.modules.ModuleInstall;
50
import org.openide.util.Exceptions;
49
import org.openide.util.Exceptions;
51
import org.openide.util.NbPreferences;
50
import org.openide.util.NbPreferences;
52
import org.openide.windows.WindowManager;
51
import org.openide.util.lookup.ServiceProvider;
53
52
54
public class Installer extends ModuleInstall implements Runnable {
53
@ServiceProvider(path="Modules/UIReady", service=Runnable.class)
54
public class Installer implements Runnable {
55
    
55
    
56
    public @Override void restored() {
56
    public @Override void run() {
57
        if (active()) {
57
        if (active()) {
58
            WindowManager.getDefault().invokeWhenUIReady(this);
58
            init();
59
        }
59
        }
60
    }
60
    }
61
    
61
    
62
    public void run() {
62
    private void init() {
63
        HudsonManagerImpl.getDefault().getInstances();
63
        HudsonManagerImpl.getDefault().getInstances();
64
    }
64
    }
65
65
66
    public @Override void uninstalled() {
66
    @ServiceProvider(path="Modules/Stop", service=Runnable.class)
67
        if (active()) {
67
    public static final class Down implements Runnable {
68
            HudsonManagerImpl.getDefault().terminate();
68
        @Override
69
        public void run() {
70
            if (active()) {
71
                HudsonManagerImpl.getDefault().terminate();
72
            }
69
        }
73
        }
70
    }
74
    }
71
75
(-)a/i18n.form/src/org/netbeans/modules/i18n/form/I18nFormCrossModule.java (-8 / +5 lines)
Lines 47-52 Link Here
47
import org.netbeans.modules.form.FormPropertyEditorManager;
47
import org.netbeans.modules.form.FormPropertyEditorManager;
48
import org.netbeans.modules.i18n.I18nSupport;
48
import org.netbeans.modules.i18n.I18nSupport;
49
import org.openide.modules.ModuleInstall;
49
import org.openide.modules.ModuleInstall;
50
import org.openide.util.lookup.ServiceProvider;
50
51
51
/**
52
/**
52
 * Installation class for i18n to form cross dependency module.
53
 * Installation class for i18n to form cross dependency module.
Lines 54-68 Link Here
54
 *
55
 *
55
 * @author Peter Zavadsky
56
 * @author Peter Zavadsky
56
 */
57
 */
57
public class I18nFormCrossModule extends ModuleInstall {
58
@ServiceProvider(path="Modules/Start", service=Runnable.class)
58
59
public class I18nFormCrossModule implements Runnable {
59
    /** Registers property editor in form module and factory in i18n module. */
60
    /** Registers property editor in form module and factory in i18n module. */
60
    public void restored() {
61
    @Override
61
        registerFormPropertyEditor();
62
    public void run() {
62
    }
63
    
64
    /** Registers <code>FormI18nStringEditor</code> form property editor to form module. */
65
    private void registerFormPropertyEditor() {
66
        Class newEditorClass = FormI18nStringEditor.class;
63
        Class newEditorClass = FormI18nStringEditor.class;
67
        Class newEditorClassInteger = FormI18nIntegerEditor.class;
64
        Class newEditorClassInteger = FormI18nIntegerEditor.class;
68
        Class newEditorClassMnemonic = FormI18nMnemonicEditor.class;
65
        Class newEditorClassMnemonic = FormI18nMnemonicEditor.class;
(-)a/j2eeserver/src/org/netbeans/modules/j2ee/deployment/impl/Install.java (-7 / +4 lines)
Lines 46-63 Link Here
46
46
47
import java.util.Collection;
47
import java.util.Collection;
48
import java.util.Iterator;
48
import java.util.Iterator;
49
import org.openide.util.lookup.ServiceProvider;
49
50
50
51
51
/**
52
/**
52
 * @author  nn136682
53
 * @author  nn136682
53
 */
54
 */
54
public class Install extends org.openide.modules.ModuleInstall {
55
@ServiceProvider(path="Modules/Stop", service=Runnable.class)
55
56
public class Install implements Runnable {
56
    /** Creates a new instance of Install */
57
    @Override public void run() {
57
    public Install() {
58
    }
59
60
    @Override public void close() {
61
        if (ServerRegistry.wasInitialized ()) {
58
        if (ServerRegistry.wasInitialized ()) {
62
            Collection instances = ServerRegistry.getInstance().getInstances();
59
            Collection instances = ServerRegistry.getInstance().getInstances();
63
            for (Iterator i=instances.iterator(); i.hasNext();) {
60
            for (Iterator i=instances.iterator(); i.hasNext();) {
(-)a/java.j2seplatform/src/org/netbeans/modules/java/j2seplatform/J2SEPlatformModule.java (-16 / +10 lines)
Lines 49-80 Link Here
49
import org.openide.cookies.InstanceCookie;
49
import org.openide.cookies.InstanceCookie;
50
import org.openide.filesystems.FileObject;
50
import org.openide.filesystems.FileObject;
51
import org.openide.loaders.DataObject;
51
import org.openide.loaders.DataObject;
52
import org.openide.modules.ModuleInstall;
53
import org.openide.util.Exceptions;
52
import org.openide.util.Exceptions;
54
import org.netbeans.api.project.ProjectManager;
53
import org.netbeans.api.project.ProjectManager;
55
import org.openide.filesystems.FileUtil;
54
import org.openide.filesystems.FileUtil;
55
import org.openide.util.lookup.ServiceProvider;
56
56
57
57
58
public class J2SEPlatformModule extends ModuleInstall {
58
@ServiceProvider(path="Modules/Start", service=Runnable.class)
59
public class J2SEPlatformModule implements Runnable {
59
    
60
    
60
    private static final String DEFAULT_PLATFORM = "Services/Platforms/org-netbeans-api-java-Platform/default_platform.xml";    //NOI18N
61
    private static final String DEFAULT_PLATFORM = "Services/Platforms/org-netbeans-api-java-Platform/default_platform.xml";    //NOI18N
61
62
62
    public void restored() {
63
    @Override
63
        super.restored();
64
    public void run() {
64
        ProjectManager.mutex().postWriteRequest(
65
        if (ProjectManager.mutex().isWriteAccess()) {
65
            new Runnable () {
66
            recoverDefaultPlatform();
66
                public void run () {
67
        } else {
67
                    recoverDefaultPlatform ();
68
            ProjectManager.mutex().postWriteRequest(this);
68
                }
69
        }
69
            }
70
        );
71
72
    }
70
    }
73
71
74
    
75
    
76
    
77
78
    private static void recoverDefaultPlatform () {
72
    private static void recoverDefaultPlatform () {
79
        final FileObject defaultPlatform = FileUtil.getConfigFile(DEFAULT_PLATFORM);
73
        final FileObject defaultPlatform = FileUtil.getConfigFile(DEFAULT_PLATFORM);
80
        if (defaultPlatform != null) {
74
        if (defaultPlatform != null) {
(-)a/java.source/src/org/netbeans/modules/java/source/JBrowseModule.java (-10 / +4 lines)
Lines 45-66 Link Here
45
package org.netbeans.modules.java.source;
45
package org.netbeans.modules.java.source;
46
46
47
import org.netbeans.modules.java.source.usages.ClassIndexManager;
47
import org.netbeans.modules.java.source.usages.ClassIndexManager;
48
import org.openide.modules.ModuleInstall;
48
import org.openide.util.lookup.ServiceProvider;
49
49
50
/**
50
/**
51
 *
51
 *
52
 * @author Petr Hrebejk
52
 * @author Petr Hrebejk
53
 * @author Tomas Zezula
53
 * @author Tomas Zezula
54
 */
54
 */
55
public class JBrowseModule extends ModuleInstall {
55
@ServiceProvider(path="Module/Stop", service=Runnable.class)
56
        
56
public class JBrowseModule implements Runnable {
57
    /** Creates a new instance of JBrowseModule */
57
    public @Override void run() {
58
    public JBrowseModule() {
59
    }
60
    
61
    
62
    public @Override void close () {
63
        super.close();
64
        ClassIndexManager.getDefault().close();
58
        ClassIndexManager.getDefault().close();
65
    }        
59
    }        
66
}
60
}
(-)a/java.sourceui/src/org/netbeans/modules/java/source/ui/JavaSourceUIModule.java (-4 / +4 lines)
Lines 41-57 Link Here
41
 */
41
 */
42
package org.netbeans.modules.java.source.ui;
42
package org.netbeans.modules.java.source.ui;
43
43
44
import org.openide.modules.ModuleInstall;
44
import org.openide.util.lookup.ServiceProvider;
45
45
46
/**
46
/**
47
 * Activates the GPR Listener that prepares 'fast index'
47
 * Activates the GPR Listener that prepares 'fast index'
48
 *
48
 *
49
 * @author sdedic
49
 * @author sdedic
50
 */
50
 */
51
public class JavaSourceUIModule extends ModuleInstall {
51
@ServiceProvider(path="Modules/Start", service=Runnable.class)
52
public class JavaSourceUIModule implements Runnable {
52
    @Override
53
    @Override
53
    public void restored() {
54
    public void run() {
54
        super.restored();
55
        // attach to GPR
55
        // attach to GPR
56
        OpenProjectFastIndex.getDefault();
56
        OpenProjectFastIndex.getDefault();
57
    }
57
    }
(-)a/javadoc/src/org/netbeans/modules/javadoc/JavadocModule.java (-2 / +5 lines)
Lines 50-62 Link Here
50
import java.util.Iterator;
50
import java.util.Iterator;
51
import java.util.LinkedList;
51
import java.util.LinkedList;
52
import org.openide.modules.ModuleInstall;
52
import org.openide.modules.ModuleInstall;
53
import org.openide.util.lookup.ServiceProvider;
53
import org.openide.windows.TopComponent;
54
import org.openide.windows.TopComponent;
54
55
55
/**
56
/**
56
 * Class for initializing Javadoc module on IDE startup.
57
 * Class for initializing Javadoc module on IDE startup.
57
 * @author Petr Hrebejk
58
 * @author Petr Hrebejk
58
 */
59
 */
59
public final class JavadocModule extends ModuleInstall {
60
@ServiceProvider(path="Modules/Stop", service=Runnable.class)
61
public final class JavadocModule implements Runnable {
60
62
61
    private static Collection/*<TopComponent>*/ floatingTopComponents;
63
    private static Collection/*<TopComponent>*/ floatingTopComponents;
62
64
Lines 72-78 Link Here
72
        floatingTopComponents.remove(tc);
74
        floatingTopComponents.remove(tc);
73
    }
75
    }
74
    
76
    
75
    public void uninstalled() {
77
    @Override
78
    public void run() {
76
        Collection c;
79
        Collection c;
77
        synchronized (JavadocModule.class) {
80
        synchronized (JavadocModule.class) {
78
            if (floatingTopComponents != null) {
81
            if (floatingTopComponents != null) {
(-)a/javascript.editing/src/org/netbeans/modules/javascript/editing/Installer.java (-8 / +4 lines)
Lines 43-58 Link Here
43
43
44
import org.netbeans.api.java.classpath.ClassPath;
44
import org.netbeans.api.java.classpath.ClassPath;
45
import org.netbeans.api.java.classpath.GlobalPathRegistry;
45
import org.netbeans.api.java.classpath.GlobalPathRegistry;
46
import org.openide.modules.ModuleInstall;
46
import org.openide.util.lookup.ServiceProvider;
47
47
48
/**
48
@ServiceProvider(path="Modules/Stop", service=Runnable.class)
49
 * Manages a module's lifecycle. Remember that an installer is optional and
49
public class Installer implements Runnable {
50
 * often not needed at all.
51
 */
52
public class Installer extends ModuleInstall {
53
54
    @Override
50
    @Override
55
    public void uninstalled() {
51
    public void run() {
56
        GlobalPathRegistry.getDefault().unregister(JsClassPathProvider.BOOT_CP, new ClassPath[] { JsClassPathProvider.getBootClassPath() });
52
        GlobalPathRegistry.getDefault().unregister(JsClassPathProvider.BOOT_CP, new ClassPath[] { JsClassPathProvider.getBootClassPath() });
57
    }
53
    }
58
54
(-)a/localhistory/src/org/netbeans/modules/localhistory/ModuleLifecycleManager.java (-3 / +5 lines)
Lines 43-56 Link Here
43
 */
43
 */
44
package org.netbeans.modules.localhistory;
44
package org.netbeans.modules.localhistory;
45
45
46
import org.openide.modules.ModuleInstall;
46
import org.openide.util.lookup.ServiceProvider;
47
47
48
/**
48
/**
49
 *
49
 *
50
 * @author Tomas Stupka
50
 * @author Tomas Stupka
51
 */
51
 */
52
public class ModuleLifecycleManager extends ModuleInstall {        
52
@ServiceProvider(path="Modules/Start", service=Runnable.class)
53
    public void restored() {      
53
public class ModuleLifecycleManager implements Runnable {        
54
    @Override
55
    public void run() {      
54
        LocalHistory.getInstance().init();        
56
        LocalHistory.getInstance().init();        
55
    }
57
    }
56
}
58
}
(-)a/masterfs/src/org/netbeans/modules/masterfs/Installer.java (-11 / +10 lines)
Lines 42-64 Link Here
42
package org.netbeans.modules.masterfs;
42
package org.netbeans.modules.masterfs;
43
43
44
import org.netbeans.modules.masterfs.watcher.Watcher;
44
import org.netbeans.modules.masterfs.watcher.Watcher;
45
import org.openide.modules.ModuleInstall;
45
import org.openide.util.lookup.ServiceProvider;
46
46
47
/** Shutdown the watcher system.
47
/** Shutdown the watcher system.
48
 */
48
 */
49
public final class Installer extends ModuleInstall {
49
@ServiceProvider(path="Modules/Start", service=Runnable.class)
50
public final class Installer implements Runnable {
50
    @Override
51
    @Override
51
    public void restored() {
52
    public void run() {
52
        Watcher.isEnabled();
53
        Watcher.isEnabled();
53
    }
54
    }
54
    
55
    
55
    @Override
56
    @ServiceProvider(path="Modules/Stop", service=Runnable.class)
56
    public void uninstalled() {
57
    public static final class Down implements Runnable {
57
        close();
58
        @Override
58
    }
59
        public void run() {
59
60
            Watcher.shutdown();
60
    @Override
61
        }
61
    public void close() {
62
        Watcher.shutdown();
63
    }
62
    }
64
}
63
}
(-)a/maven.indexer/src/org/netbeans/modules/maven/indexer/Installer.java (-3 / +4 lines)
Lines 47-59 Link Here
47
import java.util.logging.Logger;
47
import java.util.logging.Logger;
48
import org.netbeans.modules.maven.indexer.api.RepositoryPreferences;
48
import org.netbeans.modules.maven.indexer.api.RepositoryPreferences;
49
import org.netbeans.modules.maven.indexer.spi.RepositoryIndexerImplementation;
49
import org.netbeans.modules.maven.indexer.spi.RepositoryIndexerImplementation;
50
import org.openide.modules.ModuleInstall;
51
import org.openide.util.Lookup;
50
import org.openide.util.Lookup;
51
import org.openide.util.lookup.ServiceProvider;
52
52
53
public class Installer extends ModuleInstall {
53
@ServiceProvider(path="Modules/Stop", service=Runnable.class)
54
public class Installer implements Runnable {
54
55
55
    @SuppressWarnings("deprecation")
56
    @SuppressWarnings("deprecation")
56
    public @Override void close() {
57
    public @Override void run() {
57
        Logger LOG = Logger.getLogger(Installer.class.getName());
58
        Logger LOG = Logger.getLogger(Installer.class.getName());
58
        if (!Cancellation.cancelAll()) {
59
        if (!Cancellation.cancelAll()) {
59
            // Cf. #188883. Hard to kill HTTP connections.
60
            // Cf. #188883. Hard to kill HTTP connections.
(-)a/mobility.cldcplatform/src/org/netbeans/modules/mobility/cldcplatform/startup/DefaultEmulatorInstall.java (-2 / +5 lines)
Lines 72-77 Link Here
72
import org.openide.modules.InstalledFileLocator;
72
import org.openide.modules.InstalledFileLocator;
73
import org.openide.modules.ModuleInstall;
73
import org.openide.modules.ModuleInstall;
74
import org.openide.util.RequestProcessor;
74
import org.openide.util.RequestProcessor;
75
import org.openide.util.lookup.ServiceProvider;
75
import org.openide.xml.XMLUtil;
76
import org.openide.xml.XMLUtil;
76
import org.w3c.dom.Attr;
77
import org.w3c.dom.Attr;
77
import org.w3c.dom.Document;
78
import org.w3c.dom.Document;
Lines 81-91 Link Here
81
/**
82
/**
82
 * @author David Kaspar
83
 * @author David Kaspar
83
 */
84
 */
84
public class DefaultEmulatorInstall extends ModuleInstall {
85
@ServiceProvider(path="Modules/Start", service=Runnable.class)
86
public class DefaultEmulatorInstall implements Runnable {
85
    static private final String EMU_MARKER="emu_installed.mark";
87
    static private final String EMU_MARKER="emu_installed.mark";
86
    static private final String DSC_MARKER="dsc_installed.mark";
88
    static private final String DSC_MARKER="dsc_installed.mark";
87
    
89
    
88
    public void restored() {
90
    @Override
91
    public void run() {
89
        new LibraryConverter();
92
        new LibraryConverter();
90
        installEmulators();
93
        installEmulators();
91
        installDescriptors();
94
        installDescriptors();
(-)a/openide.text/src/org/netbeans/modules/openide/text/Installer.java (-3 / +4 lines)
Lines 47-53 Link Here
47
import java.util.logging.Level;
47
import java.util.logging.Level;
48
import java.util.logging.LogRecord;
48
import java.util.logging.LogRecord;
49
import java.util.logging.Logger;
49
import java.util.logging.Logger;
50
import org.openide.modules.ModuleInstall;
50
import org.openide.util.lookup.ServiceProvider;
51
51
52
/**
52
/**
53
 * Log number of editors opened during IDE session by mime type.
53
 * Log number of editors opened during IDE session by mime type.
Lines 55-61 Link Here
55
 *
55
 *
56
 * @author Marek Slama
56
 * @author Marek Slama
57
 */
57
 */
58
public class Installer extends ModuleInstall {
58
@ServiceProvider(path="Modules/Stop", service=Runnable.class)
59
public class Installer implements Runnable {
59
    
60
    
60
    private static Map<String,Integer> mimeTypes = new HashMap<String,Integer>();
61
    private static Map<String,Integer> mimeTypes = new HashMap<String,Integer>();
61
62
Lines 71-77 Link Here
71
    }
72
    }
72
    
73
    
73
    @Override
74
    @Override
74
    public void close() {
75
    public void run() {
75
        for (String s : mimeTypes.keySet()) {
76
        for (String s : mimeTypes.keySet()) {
76
            Logger logger = Logger.getLogger("org.netbeans.ui.metrics.editor"); //NOI18N
77
            Logger logger = Logger.getLogger("org.netbeans.ui.metrics.editor"); //NOI18N
77
            LogRecord rec = new LogRecord(Level.INFO, "USG_EDITOR_MIME_TYPE"); //NOI18N
78
            LogRecord rec = new LogRecord(Level.INFO, "USG_EDITOR_MIME_TYPE"); //NOI18N
(-)a/parsing.api/src/org/netbeans/modules/parsing/impl/Installer.java (-20 / +22 lines)
Lines 4-41 Link Here
4
 */
4
 */
5
package org.netbeans.modules.parsing.impl;
5
package org.netbeans.modules.parsing.impl;
6
6
7
import java.awt.EventQueue;
7
import org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater;
8
import org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater;
8
import org.openide.modules.ModuleInstall;
9
import org.openide.util.RequestProcessor;
9
import org.openide.util.RequestProcessor;
10
import org.openide.windows.WindowManager;
10
import org.openide.util.lookup.ServiceProvider;
11
11
12
/**
12
/**
13
 * Manages a module's lifecycle. Remember that an installer is optional and
13
 * Manages a module's lifecycle. Remember that an installer is optional and
14
 * often not needed at all.
14
 * often not needed at all.
15
 */
15
 */
16
public class Installer extends ModuleInstall {
16
@ServiceProvider(path="Modules/Start", service=Runnable.class)
17
public class Installer implements Runnable {
17
18
18
    @Override
19
    @Override
19
    public void restored () {
20
    public void run() {
20
        super.restored();
21
        RepositoryUpdater.getDefault().start(false);
21
        RepositoryUpdater.getDefault().start(false);
22
22
    }
23
        WindowManager.getDefault().invokeWhenUIReady(new Runnable() {
23
    
24
            public void run () {
24
    @ServiceProvider(path="Modules/UIReady", service=Runnable.class)
25
                RequestProcessor.getDefault().post(new Runnable() {
25
    public static class UI implements Runnable {
26
                    public void run() {
26
        @Override
27
                        Schedulers.init();
27
        public void run() {
28
                    }
28
            if (EventQueue.isDispatchThread()) {
29
                });
29
                RequestProcessor.getDefault().post(this);
30
            } else {
31
                Schedulers.init();
30
            }
32
            }
31
        });
33
        }
32
    }
34
    }
33
35
34
    @Override
36
    @ServiceProvider(path="Modules/Stop", service=Runnable.class)
35
    public boolean closing () {
37
    public static class Stop implements Runnable {
36
        final boolean ret = super.closing();
38
        @Override
37
        RepositoryUpdater.getDefault().stop();
39
        public void run() {
38
        return ret;
40
            RepositoryUpdater.getDefault().stop();
41
        }
39
    }
42
    }
40
41
}
43
}
(-)a/profiler.drilldown/src/org/netbeans/modules/profiler/drilldown/Installer.java (-4 / +4 lines)
Lines 41-56 Link Here
41
 */
41
 */
42
package org.netbeans.modules.profiler.drilldown;
42
package org.netbeans.modules.profiler.drilldown;
43
43
44
import org.openide.modules.ModuleInstall;
44
import org.openide.util.lookup.ServiceProvider;
45
45
46
/**
46
/**
47
 * Manages a module's lifecycle. Remember that an installer is optional and
47
 * Manages a module's lifecycle. Remember that an installer is optional and
48
 * often not needed at all.
48
 * often not needed at all.
49
 */
49
 */
50
public class Installer extends ModuleInstall {
50
@ServiceProvider(path="Modules/Stop", service=Runnable.class)
51
51
public class Installer implements Runnable {
52
    @Override
52
    @Override
53
    public void uninstalled() {
53
    public void run() {
54
        DrillDownWindow.closeIfOpened();
54
        DrillDownWindow.closeIfOpened();
55
    }
55
    }
56
}
56
}
(-)a/profiler.ppoints/src/org/netbeans/modules/profiler/ppoints/Installer.java (-3 / +5 lines)
Lines 41-56 Link Here
41
 */
41
 */
42
package org.netbeans.modules.profiler.ppoints;
42
package org.netbeans.modules.profiler.ppoints;
43
43
44
import org.openide.modules.ModuleInstall;
44
import java.util.concurrent.Callable;
45
import org.openide.util.lookup.ServiceProvider;
45
46
46
/**
47
/**
47
 * Manages a module's lifecycle. Remember that an installer is optional and
48
 * Manages a module's lifecycle. Remember that an installer is optional and
48
 * often not needed at all.
49
 * often not needed at all.
49
 */
50
 */
50
public class Installer extends ModuleInstall {
51
@ServiceProvider(path="Modules/Stop", service=Callable.class)
52
public class Installer implements Callable<Boolean> {
51
53
52
    @Override
54
    @Override
53
    public boolean closing() {
55
    public Boolean call() {
54
        ProfilingPointsManager.getDefault().ideClosing(); // TODO: dirty profiling points should be persisted on document save!
56
        ProfilingPointsManager.getDefault().ideClosing(); // TODO: dirty profiling points should be persisted on document save!
55
        return true;
57
        return true;
56
    }
58
    }
(-)a/project.ant/src/org/netbeans/modules/project/ant/AntProjectModule.java (-6 / +4 lines)
Lines 63-70 Link Here
63
import org.openide.DialogDisplayer;
63
import org.openide.DialogDisplayer;
64
import org.openide.LifecycleManager;
64
import org.openide.LifecycleManager;
65
import org.openide.NotifyDescriptor;
65
import org.openide.NotifyDescriptor;
66
import org.openide.modules.ModuleInstall;
67
import org.openide.util.NbBundle;
66
import org.openide.util.NbBundle;
67
import org.openide.util.lookup.ServiceProvider;
68
import org.openide.windows.WindowManager;
68
import org.openide.windows.WindowManager;
69
import org.openide.xml.XMLUtil;
69
import org.openide.xml.XMLUtil;
70
import org.w3c.dom.Document;
70
import org.w3c.dom.Document;
Lines 75-85 Link Here
75
 * @author Jan Lahoda
75
 * @author Jan Lahoda
76
 * @see "issue #70130"
76
 * @see "issue #70130"
77
 */
77
 */
78
public class AntProjectModule extends ModuleInstall {
78
@ServiceProvider(path="Modules/Start", service=Runnable.class)
79
    
79
public class AntProjectModule implements Runnable {
80
    public @Override void restored() {
80
    public @Override void run() {
81
        super.restored();
82
        
83
        if (Boolean.getBoolean("netbeans.do.not.check.xalan")) // NOI18N
81
        if (Boolean.getBoolean("netbeans.do.not.check.xalan")) // NOI18N
84
            return ;
82
            return ;
85
        
83
        
(-)a/project.libraries/src/org/netbeans/modules/project/libraries/LibrariesModule.java (-9 / +4 lines)
Lines 43-51 Link Here
43
 */
43
 */
44
package org.netbeans.modules.project.libraries;
44
package org.netbeans.modules.project.libraries;
45
45
46
import org.openide.modules.ModuleInstall;
47
import org.openide.util.Lookup;
46
import org.openide.util.Lookup;
48
import org.netbeans.spi.project.libraries.LibraryProvider;
47
import org.netbeans.spi.project.libraries.LibraryProvider;
48
import org.openide.util.lookup.ServiceProvider;
49
49
50
/**
50
/**
51
 * Ensures that all {@link LibraryProvider}s are actually loaded.
51
 * Ensures that all {@link LibraryProvider}s are actually loaded.
Lines 54-67 Link Here
54
 * This needs to happen before any Ant build is run.
54
 * This needs to happen before any Ant build is run.
55
 * @author Tomas Zezula
55
 * @author Tomas Zezula
56
 */
56
 */
57
public class LibrariesModule extends ModuleInstall {
57
@ServiceProvider(path="Modules/Start", service=Runnable.class)
58
58
public class LibrariesModule implements Runnable {
59
    @Override public void restored() {
59
    @Override public void run() {
60
        super.restored();
61
        this.initProviders();
62
    }
63
    
64
    private void initProviders () {
65
        for (LibraryProvider lp : Lookup.getDefault().lookupAll(LibraryProvider.class)) {            
60
        for (LibraryProvider lp : Lookup.getDefault().lookupAll(LibraryProvider.class)) {            
66
            lp.getLibraries();
61
            lp.getLibraries();
67
        }
62
        }
(-)a/projectapi/src/org/netbeans/modules/projectapi/Installer.java (-8 / +11 lines)
Lines 44-66 Link Here
44
44
45
package org.netbeans.modules.projectapi;
45
package org.netbeans.modules.projectapi;
46
46
47
import org.openide.modules.ModuleInstall;
47
import org.openide.util.lookup.ServiceProvider;
48
48
49
/**
49
/**
50
 * Manages a module's lifecycle. Remember that an installer is optional and
50
 * Manages a module's lifecycle. Remember that an installer is optional and
51
 * often not needed at all.
51
 * often not needed at all.
52
 */
52
 */
53
public class Installer extends ModuleInstall {
53
@ServiceProvider(path="Modules/Start", service=Runnable.class)
54
54
public class Installer implements Runnable {
55
    @Override
55
    @Override
56
    public void restored() {
56
    public void run() {
57
        //#125582
57
        //#125582
58
        SimpleFileOwnerQueryImplementation.deserialize();
58
        SimpleFileOwnerQueryImplementation.deserialize();
59
    }
59
    }
60
60
61
    @Override
61
    @ServiceProvider(path="Modules/Stop", service=Runnable.class)
62
    public void close() {
62
    public static final class Down implements Runnable {
63
        //#125582
63
        @Override
64
        SimpleFileOwnerQueryImplementation.serialize();
64
        public void run() {
65
            //#125582
66
            SimpleFileOwnerQueryImplementation.serialize();
67
        }
65
    }
68
    }
66
}
69
}
(-)a/projectui/src/org/netbeans/modules/project/ui/ProjectUiModule.java (-11 / +16 lines)
Lines 49-75 Link Here
49
import org.netbeans.api.project.ProjectManager;
49
import org.netbeans.api.project.ProjectManager;
50
import org.openide.ErrorManager;
50
import org.openide.ErrorManager;
51
import org.openide.modules.ModuleInstall;
51
import org.openide.modules.ModuleInstall;
52
import org.openide.util.lookup.ServiceProvider;
52
53
53
/**
54
/**
54
 * Startup and shutdown hooks for projectui module.
55
 * Startup and shutdown hooks for projectui module.
55
 * @author Jesse Glick
56
 * @author Jesse Glick
56
 */
57
 */
57
public class ProjectUiModule extends ModuleInstall {
58
@ServiceProvider(path="Modules/UIReady", service=Runnable.class)
58
59
public class ProjectUiModule implements Runnable {
59
    public void restored() {
60
    @Override
61
    public void run() {
60
        if (!GraphicsEnvironment.isHeadless()) {
62
        if (!GraphicsEnvironment.isHeadless()) {
61
            Hacks.keepCurrentProjectNameUpdated();
63
            Hacks.keepCurrentProjectNameUpdated();
62
        }
64
        }
63
    }
65
    }
64
66
65
    public void close() {
67
    @ServiceProvider(path="Modules/Stop", service=Runnable.class)
66
        OpenProjectList.shutdown();
68
    public static final class Down implements Runnable {
67
        // Just in case something was modified outside the usual customizer dialog:
69
        @Override
68
        try {
70
        public void run() {
69
            ProjectManager.getDefault().saveAllProjects();
71
            OpenProjectList.shutdown();
70
        } catch (IOException e) {
72
            // Just in case something was modified outside the usual customizer dialog:
71
            ErrorManager.getDefault().notify(e);
73
            try {
74
                ProjectManager.getDefault().saveAllProjects();
75
            } catch (IOException e) {
76
                ErrorManager.getDefault().notify(e);
77
            }
72
        }
78
        }
73
    }
79
    }
74
    
75
}
80
}
(-)a/properties.syntax/src/org/netbeans/modules/properties/syntax/RestoreColoring.java (+1 lines)
Lines 56-61 Link Here
56
 *
56
 *
57
 * @author Petr Jiricka, Libor Kramolis, Jesse Glick
57
 * @author Petr Jiricka, Libor Kramolis, Jesse Glick
58
 */
58
 */
59
// XXX: Rewrite LocalizerSupport to obtain the registration via Lookup
59
public class RestoreColoring extends ModuleInstall {
60
public class RestoreColoring extends ModuleInstall {
60
61
61
    /** <code>Localizer</code> passed to editor. */
62
    /** <code>Localizer</code> passed to editor. */
(-)a/spi.debugger.ui/src/org/netbeans/modules/debugger/ui/DebuggerModule.java (-8 / +7 lines)
Lines 44-62 Link Here
44
44
45
package org.netbeans.modules.debugger.ui;
45
package org.netbeans.modules.debugger.ui;
46
46
47
import org.openide.modules.ModuleInstall;
47
import java.util.concurrent.Callable;
48
import org.openide.util.lookup.ServiceProvider;
48
49
49
/**
50
/**
50
 *
51
 *
51
 * @author Martin Entlicher
52
 * @author Martin Entlicher
52
 */
53
 */
53
public class DebuggerModule extends ModuleInstall {
54
@ServiceProvider(path="Modules/Stop", service=Callable.class)
54
    
55
public class DebuggerModule implements Callable<Boolean> {
55
    /** Creates a new instance of DebuggerModule */
56
    /** called on closing */
56
    public DebuggerModule() {
57
    @Override
57
    }
58
    public Boolean call() {
58
59
    public boolean closing() {
60
        DebuggerManagerListener.closeDebuggerUI();
59
        DebuggerManagerListener.closeDebuggerUI();
61
        return true;
60
        return true;
62
    }
61
    }
(-)a/spi.editor.hints/src/org/netbeans/modules/editor/hints/HintsModule.java (-4 / +5 lines)
Lines 44-59 Link Here
44
44
45
package org.netbeans.modules.editor.hints;
45
package org.netbeans.modules.editor.hints;
46
46
47
import org.openide.modules.ModuleInstall;
47
import org.openide.util.lookup.ServiceProvider;
48
48
49
/**
49
/**
50
 * Module installation class for HintsModule.
50
 * Module installation class for HintsModule.
51
 *
51
 *
52
 * @author Jan Lahoda
52
 * @author Jan Lahoda
53
 */
53
 */
54
public final class HintsModule extends ModuleInstall {
54
@ServiceProvider(path="Modules/Start", service=Runnable.class)
55
55
public final class HintsModule implements Runnable {
56
    public void restored () {
56
    @Override
57
    public void run() {
57
        //create HintsUI (which registers some listeners)
58
        //create HintsUI (which registers some listeners)
58
        HintsUI.getDefault();
59
        HintsUI.getDefault();
59
    }
60
    }
(-)a/spi.palette/src/org/netbeans/spi/palette/PaletteModule.java (-17 / +7 lines)
Lines 44-72 Link Here
44
44
45
package org.netbeans.spi.palette;
45
package org.netbeans.spi.palette;
46
46
47
import org.openide.modules.ModuleInstall;
47
import org.openide.util.lookup.ServiceProvider;
48
import org.openide.windows.WindowManager;
49
48
50
/**
49
/**
51
 *
50
 *
52
 * @author S. Aubrecht
51
 * @author S. Aubrecht
53
 * @since 1.10
52
 * @since 1.10
54
 */
53
 */
55
public class PaletteModule extends ModuleInstall {
54
@ServiceProvider(path="Modules/UIReady", service=Runnable.class)
56
    
55
public class PaletteModule implements Runnable {
57
    /** Creates a new instance of ModuleInstall */
58
    public PaletteModule() {
59
    }
60
    
61
    @Override
56
    @Override
62
    public void restored() {
57
    public void run() {
63
        super.restored();
58
        //start listening to activated TopComponents and Nodes 
64
        WindowManager.getDefault().invokeWhenUIReady( new Runnable() {
59
        //to see if palette window should be displayed
65
            public void run() {
60
        PaletteSwitch.getDefault().startListening();
66
                //start listening to activated TopComponents and Nodes 
67
                //to see if palette window should be displayed
68
                PaletteSwitch.getDefault().startListening();
69
            }
70
        });
71
    }
61
    }
72
}
62
}
(-)a/subversion/src/org/netbeans/modules/subversion/ModuleLifecycleManager.java (+1 lines)
Lines 72-77 Link Here
72
 * @author Petr Kuzel
72
 * @author Petr Kuzel
73
 * @author Maros Sandor
73
 * @author Maros Sandor
74
 */
74
 */
75
// XXX: No longer needed, I guess
75
public final class ModuleLifecycleManager extends ModuleInstall implements ErrorHandler, EntityResolver {
76
public final class ModuleLifecycleManager extends ModuleInstall implements ErrorHandler, EntityResolver {
76
77
77
    static final String [] vcsGenericModules = {
78
    static final String [] vcsGenericModules = {
(-)a/timers/src/org/netbeans/modules/timers/Install.java (-3 / +4 lines)
Lines 57-69 Link Here
57
import org.netbeans.api.editor.EditorRegistry;
57
import org.netbeans.api.editor.EditorRegistry;
58
import org.openide.filesystems.FileObject;
58
import org.openide.filesystems.FileObject;
59
import org.openide.loaders.DataObject;
59
import org.openide.loaders.DataObject;
60
import org.openide.modules.ModuleInstall;
60
import org.openide.util.lookup.ServiceProvider;
61
61
62
/**
62
/**
63
 *
63
 *
64
 * @author nenik
64
 * @author nenik
65
 */
65
 */
66
public class Install extends  ModuleInstall {
66
@ServiceProvider(path="Modules/UIReady", service=Runnable.class)
67
public class Install implements Runnable {
67
68
68
    static final boolean ENABLED;
69
    static final boolean ENABLED;
69
70
Lines 80-86 Link Here
80
81
81
    private static String INSTANCES = "Important instances";
82
    private static String INSTANCES = "Important instances";
82
    
83
    
83
    public @Override void restored() {
84
    public @Override void run() {
84
        if (!ENABLED) {
85
        if (!ENABLED) {
85
            return ;
86
            return ;
86
        }
87
        }
(-)a/versioning.system.cvss/src/org/netbeans/modules/versioning/system/cvss/ModuleLifecycleManager.java (+1 lines)
Lines 73-78 Link Here
73
 * @author Petr Kuzel
73
 * @author Petr Kuzel
74
 * @author Maros Sandor
74
 * @author Maros Sandor
75
 */
75
 */
76
// XXX: No longer needed I guess
76
public final class ModuleLifecycleManager extends ModuleInstall implements ErrorHandler, EntityResolver {
77
public final class ModuleLifecycleManager extends ModuleInstall implements ErrorHandler, EntityResolver {
77
78
78
    static final String [] vcsGenericModules = {
79
    static final String [] vcsGenericModules = {
(-)a/webpreview/src/org/netbeans/modules/webpreview/Installer.java (-8 / +11 lines)
Lines 42-64 Link Here
42
package org.netbeans.modules.webpreview;
42
package org.netbeans.modules.webpreview;
43
43
44
import org.netbeans.api.editor.EditorRegistry;
44
import org.netbeans.api.editor.EditorRegistry;
45
import org.openide.modules.ModuleInstall;
45
import org.openide.util.lookup.ServiceProvider;
46
46
47
/**
47
/**
48
 * Web Preview module install
48
 * Web Preview module install
49
 */
49
 */
50
public class Installer extends ModuleInstall {
50
@ServiceProvider(path="Modules/Start", service=Runnable.class)
51
public class Installer implements Runnable {
51
52
52
    @Override
53
    @Override
53
    public void restored() {
54
    public void run() {
54
        EditorRegistry.addPropertyChangeListener(new WebPreviewControler());
55
        EditorRegistry.addPropertyChangeListener(new WebPreviewControler());
55
    }
56
    }
56
57
57
    @Override
58
    @ServiceProvider(path = "Modules/Stop", service = Runnable.class)
58
    public boolean closing() {
59
    public static final class Down implements Runnable {
59
        // we don't want the browser to open on IDE startup
60
        @Override
60
        WebPreviewTopComponent.findInstance().close();
61
        public void run() {
61
        return super.closing();
62
            // we don't want the browser to open on IDE startup
63
            WebPreviewTopComponent.findInstance().close();
64
        }
62
    }
65
    }
63
    
66
    
64
}
67
}
(-)a/websvc.jaxrpc/src/org/netbeans/modules/websvc/jaxrpc/Installer.java (-29 / +31 lines)
Lines 46-51 Link Here
46
46
47
import java.io.File;
47
import java.io.File;
48
import java.io.IOException;
48
import java.io.IOException;
49
import java.util.MissingResourceException;
49
import org.netbeans.api.project.ProjectManager;
50
import org.netbeans.api.project.ProjectManager;
50
import org.netbeans.modules.websvc.api.client.WebServicesClientSupport;
51
import org.netbeans.modules.websvc.api.client.WebServicesClientSupport;
51
import org.netbeans.spi.project.support.ant.EditableProperties;
52
import org.netbeans.spi.project.support.ant.EditableProperties;
Lines 54-95 Link Here
54
import org.openide.ErrorManager;
55
import org.openide.ErrorManager;
55
import org.openide.NotifyDescriptor;
56
import org.openide.NotifyDescriptor;
56
import org.openide.modules.InstalledFileLocator;
57
import org.openide.modules.InstalledFileLocator;
57
import org.openide.modules.ModuleInstall;
58
import org.openide.util.NbBundle;
58
import org.openide.util.NbBundle;
59
import org.openide.util.lookup.ServiceProvider;
59
60
60
/**
61
/**
61
 * @author Peter Williams
62
 * @author Peter Williams
62
 */
63
 */
63
public class Installer extends ModuleInstall {
64
@ServiceProvider(path="Modules/Start", service=Runnable.class)
64
65
public class Installer implements Runnable {
65
    public Installer() {
66
    @Override
66
        super();
67
    public  void run() {
68
        if (ProjectManager.mutex().isWriteAccess()) {
69
            init();
70
        } else {
71
            ProjectManager.mutex().postWriteRequest(this);
72
        }
67
    }
73
    }
68
74
    
69
    public  void restored() {
75
    private void init() throws MissingResourceException {
70
        ProjectManager.mutex().postWriteRequest(new Runnable(){
76
        try {
71
            public  void run() {
77
            EditableProperties ep = PropertyUtils.getGlobalProperties();
72
                try {
78
            boolean changed = false;
73
                    EditableProperties ep = PropertyUtils.getGlobalProperties();
79
            File wsclient_update = InstalledFileLocator.getDefault().locate("ant/extra/wsclientuptodate.jar", null, false);
74
                    boolean changed = false;
80
            if (wsclient_update == null) {
75
                    File wsclient_update = InstalledFileLocator.getDefault().locate("ant/extra/wsclientuptodate.jar", null, false);
81
                String msg = NbBundle.getMessage(Installer.class, "MSG_WSClientUpdateMissing");
76
                    if (wsclient_update == null) {
82
                DialogDisplayer.getDefault().notify(new NotifyDescriptor.Message(msg, NotifyDescriptor.ERROR_MESSAGE));
77
                        String msg = NbBundle.getMessage(Installer.class, "MSG_WSClientUpdateMissing");
83
            } else  {
78
                        DialogDisplayer.getDefault().notify(new NotifyDescriptor.Message(msg, NotifyDescriptor.ERROR_MESSAGE));
84
                String wsclient_update_old = ep.getProperty(WebServicesClientSupport.WSCLIENTUPTODATE_CLASSPATH);
79
                    } else  {
85
                if (wsclient_update_old == null || !wsclient_update_old.equals(wsclient_update.toString())) {
80
                        String wsclient_update_old = ep.getProperty(WebServicesClientSupport.WSCLIENTUPTODATE_CLASSPATH);
86
                    ep.setProperty(WebServicesClientSupport.WSCLIENTUPTODATE_CLASSPATH, wsclient_update.toString());
81
                        if (wsclient_update_old == null || !wsclient_update_old.equals(wsclient_update.toString())) {
87
                    changed = true;
82
                            ep.setProperty(WebServicesClientSupport.WSCLIENTUPTODATE_CLASSPATH, wsclient_update.toString());
83
                            changed = true;
84
                        }
85
                    }
86
                    if (changed) {
87
                        PropertyUtils.putGlobalProperties(ep);
88
                    }
89
                } catch (IOException ioe) {
90
                    ErrorManager.getDefault().notify(ioe);
91
                }
88
                }
92
            }
89
            }
93
        });
90
            if (changed) {
91
                PropertyUtils.putGlobalProperties(ep);
92
            }
93
        } catch (IOException ioe) {
94
            ErrorManager.getDefault().notify(ioe);
95
        }
94
    }
96
    }
95
}
97
}
(-)a/websvc.manager/src/org/netbeans/modules/websvc/manager/WebServiceModuleInstaller.java (-8 / +5 lines)
Lines 45-66 Link Here
45
45
46
package org.netbeans.modules.websvc.manager;
46
package org.netbeans.modules.websvc.manager;
47
47
48
import org.openide.modules.ModuleInstall;
48
import org.openide.util.lookup.ServiceProvider;
49
49
50
// This is here just to persist the snippets
50
// This is here just to persist the snippets
51
51
52
public class WebServiceModuleInstaller extends ModuleInstall {
52
@ServiceProvider(path="Modules/Stop", service=Runnable.class)
53
public class WebServiceModuleInstaller implements Runnable {
53
    
54
    
54
    @Override
55
    @Override
55
    public void close() {
56
    public void run() {
56
        /**
57
        /**
57
         * Persist the Webservice meta data in the user's directory.
58
         * Persist the Webservice meta data in the user's directory.
58
         */
59
         */
59
        WebServicePersistenceManager persistenceManager = new WebServicePersistenceManager();
60
        WebServicePersistenceManager persistenceManager = new WebServicePersistenceManager();
60
        persistenceManager.save();
61
        persistenceManager.save();
61
    }
62
    }
62
        
63
}        
63
    public void uninstalled() {
64
        close();
65
    } 
66
}
(-)a/welcome/src/org/netbeans/modules/welcome/Installer.java (-4 / +5 lines)
Lines 31-37 Link Here
31
package org.netbeans.modules.welcome;
31
package org.netbeans.modules.welcome;
32
32
33
import java.util.Set;
33
import java.util.Set;
34
import org.openide.modules.ModuleInstall;
34
import org.openide.util.lookup.ServiceProvider;
35
import org.openide.windows.Mode;
35
import org.openide.windows.Mode;
36
import org.openide.windows.TopComponent;
36
import org.openide.windows.TopComponent;
37
import org.openide.windows.WindowManager;
37
import org.openide.windows.WindowManager;
Lines 41-50 Link Here
41
/**
41
/**
42
 * Checks the feedback survey.
42
 * Checks the feedback survey.
43
 */
43
 */
44
public class Installer extends ModuleInstall implements Runnable {
44
@ServiceProvider(path="Modules/UIReady", service=Runnable.class)
45
public class Installer implements Runnable {
45
46
46
    @Override public void restored() {
47
    private void initListener() {
47
        WindowManager.getDefault().invokeWhenUIReady(this);
48
        WindowManager.getDefault().addWindowSystemListener( new WindowSystemListener() {
48
        WindowManager.getDefault().addWindowSystemListener( new WindowSystemListener() {
49
49
50
            @Override
50
            @Override
Lines 90-95 Link Here
90
90
91
    @Override
91
    @Override
92
    public void run() {
92
    public void run() {
93
        initListener();
93
        FeedbackSurvey.start();
94
        FeedbackSurvey.start();
94
    }
95
    }
95
}
96
}
(-)a/xml.tax/src/org/netbeans/modules/xml/tax/TAXModuleInstall.java (+2 lines)
Lines 55-60 Link Here
55
 *
55
 *
56
 * @author Libor Kramolis
56
 * @author Libor Kramolis
57
 */
57
 */
58
// XXX: Modifications to bean search path should not run in parallel, otherwise
59
// we risk race condition with others (Form?)
58
public class TAXModuleInstall extends ModuleInstall {
60
public class TAXModuleInstall extends ModuleInstall {
59
61
60
    private static final String BEANINFO_PATH = "org.netbeans.modules.xml.tax.beans.beaninfo"; // NOI18N
62
    private static final String BEANINFO_PATH = "org.netbeans.modules.xml.tax.beans.beaninfo"; // NOI18N
(-)a/xml/src/org/netbeans/modules/xml/CoreModuleInstall.java (-4 / +5 lines)
Lines 45-60 Link Here
45
package org.netbeans.modules.xml;
45
package org.netbeans.modules.xml;
46
46
47
import org.netbeans.modules.xml.actions.InputOutputReporter;
47
import org.netbeans.modules.xml.actions.InputOutputReporter;
48
import org.openide.modules.ModuleInstall;
48
import org.openide.util.lookup.ServiceProvider;
49
49
50
/**
50
/**
51
 * Module installation class for core module.
51
 * Module installation class for core module.
52
 *
52
 *
53
 * @author Libor Kramolis
53
 * @author Libor Kramolis
54
 */
54
 */
55
public class CoreModuleInstall extends ModuleInstall {
55
@ServiceProvider(path="Modules/Stop", service=Runnable.class)
56
56
public class CoreModuleInstall implements Runnable {
57
    public void uninstalled() {
57
    @Override
58
    public void run() {
58
        InputOutputReporter.releaseAllAnnotations();
59
        InputOutputReporter.releaseAllAnnotations();
59
    }
60
    }
60
}
61
}

Return to bug 200636