Question

I have a Netbeans Platform Application which consist of 6 modules. One of these modules has a class which initiates login mehcanism. This class is a standard Netbeans Installer class, called Installer and extends ModuleInstall.

I can't publish the whole class but it looks like this:

public class Installer extends ModuleInstall {

    private static final String CHECK_DB = "Checking db connection at startup";
    private LoginForm loginForm = new LoginForm();

    private static  Logger logger = LoggerFactory.getLogger(Installer.class);

    public boolean closeApp = false;

    @Override
    public boolean closing() {
        getDBPreferencesService().clearPassoword();

        closeApp = true;
        return closeApp;
    }

    @Override
    public void restored() {
        logger.info(CHECK_DB);
        load();     
    }

    private void load() {
        //stuffs
    }
}

I have the restored() method which overrides restored() in ModuleInstall. The module's manifest.mf file contains the following lines:

OpenIDE-Module: org.app.station
OpenIDE-Module-Install: org/app/station/login/Installer.class
OpenIDE-Module-Localizing-Bundle: org/app/station/Bundle.properties
OpenIDE-Module-Requires: org.openide.windows.WindowManager

Issue: If I run the application after the splash screen the main window appears. restored() method is not being called.

Question: What can be behind of this? How can I get the method called?

No correct solution

OTHER TIPS

Perhaps Geertjan's blog [1] might help you.

For example he use the @OnStart annotation.

[1] https://blogs.oracle.com/geertjan/entry/simple_security_mechanism_for_the

The module with Installer/Activator and all other modules, that depends on that class, must have dependency set on module system API.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top