PluginEnabler () { if (!LoadingState.COMPONENTS_LOADED.isOccurred()) { return HEADLESS; } Application application = ApplicationManager.getApplication(); if (application == null || application.isDisposed()) { return HEADLESS; } return application.getService(PluginEnabler.class); }