Package org.rssowl.core.util

Examples of org.rssowl.core.util.LoggingSafeRunnable


      final Shell[] shellAr = new Shell[] { shell };
      if (e instanceof AuthenticationRequiredException && shouldProceedReloading(monitor, bookmark)) {

        /* Resolve active Shell if necessary */
        if (shellAr[0] == null || shellAr[0].isDisposed()) {
          SafeRunner.run(new LoggingSafeRunnable() {
            public void run() throws Exception {
              shellAr[0] = OwlUI.getActiveShell();
            }
          });
        }
View Full Code Here


   */
  public void startup() {

    /* Create Relations and Import Default Feeds if required */
    if (!InternalOwl.TESTING) {
      SafeRunner.run(new LoggingSafeRunnable() {
        public void run() throws Exception {

          /* First check wether this action is required */
          IPreference firstStartToken = fPrefsDAO.load(FIRST_START_TOKEN);
          if (firstStartToken != null)
            return;

          onFirstStartup();

          /* Mark this as the first start */
          fPrefsDAO.save(fFactory.createPreference(FIRST_START_TOKEN));
        }
      });
    }

    /* Set hidden News from previous Session to deleted */
    SafeRunner.run(new LoggingSafeRunnable() {
      public void run() throws Exception {
        DynamicDAO.getDAO(INewsDAO.class).setState(EnumSet.of(INews.State.HIDDEN), INews.State.DELETED, false);
      }
    });

View Full Code Here

    /* Backup Subscriptions as OPML if no error */
    else {
      JobRunner.runDelayedInBackgroundThread(new Runnable() {
        public void run() {
          SafeRunner.run(new LoggingSafeRunnable() {
            public void run() throws Exception {
              if (!fShuttingDown)
                backupSubscriptions();
            }
          });
View Full Code Here

  }

  private void fireBookMarkAboutToLoad(final IBookMark bookmark) {
    Object[] listeners = fBookMarkLoadListeners.getListeners();
    for (final Object listener : listeners) {
      SafeRunner.run(new LoggingSafeRunnable() {
        public void run() throws Exception {
          ((BookMarkLoadListener) listener).bookMarkAboutToLoad(bookmark);
        }
      });
    }
View Full Code Here

  }

  private void fireBookMarkDoneLoading(final IBookMark bookmark) {
    Object[] listeners = fBookMarkLoadListeners.getListeners();
    for (final Object listener : listeners) {
      SafeRunner.run(new LoggingSafeRunnable() {
        public void run() throws Exception {
          ((BookMarkLoadListener) listener).bookMarkDoneLoading(bookmark);
        }
      });
    }
View Full Code Here

  @Override
  public void postWindowOpen() {
    final Shell shell = getWindowConfigurer().getWindow().getShell();

    /* System Tray */
    SafeRunner.run(new LoggingSafeRunnable() {
      public void run() throws Exception {
        boolean trayEnabled = false;

        /* Hook TrayItem if supported on OS and 1st Window */
        if (fPreferences.getBoolean(DefaultPreferences.TRAY_ON_MINIMIZE) || fPreferences.getBoolean(DefaultPreferences.TRAY_ON_CLOSE) || fPreferences.getBoolean(DefaultPreferences.TRAY_ON_START))
View Full Code Here

   * @see org.eclipse.ui.application.WorkbenchWindowAdvisor#preWindowShellClose()
   */
  @Override
  public boolean preWindowShellClose() {
    final boolean[] res = new boolean[] { true };
    SafeRunner.run(new LoggingSafeRunnable() {
      public void run() throws Exception {

        /* Check if Prefs tell to move to tray */
        if (ApplicationWorkbenchWindowAdvisor.this.equals(ApplicationWorkbenchAdvisor.fgPrimaryApplicationWorkbenchWindowAdvisor) && fPreferences.getBoolean(DefaultPreferences.TRAY_ON_CLOSE)) {
          fMinimizeFromClose = true;
View Full Code Here

    fServerJob.schedule();
  }

  /* Process Message in Safe-Runnable */
  private void safeProcess(final Socket socket, final String message) {
    SafeRunner.run(new LoggingSafeRunnable() {
      public void run() throws Exception {

        /* This is a Display-Operation */
        if (isDisplayOperation(message))
          processDisplayOperation(socket, message);
View Full Code Here

    fShutdownHook = new Thread() {
      @Override
      public void run() {

        /* Shutdown UI */
        SafeRunner.run(new LoggingSafeRunnable() {
          public void run() throws Exception {
            if (Owl.isStarted() || Controller.isInitialized())
              Controller.getDefault().shutdown(true);
          }
        });

        /* Shutdown Core */
        SafeRunner.run(new LoggingSafeRunnable() {
          public void run() throws Exception {
            Owl.shutdown(true);
          }
        });

        /* Check for Log Message from Core */
        String logMessages = CoreUtils.getAndFlushLogMessages();
        if (logMessages != null && logMessages.length() > 0)
          safeLogError(logMessages, null);

        /* Log Shutdown Info */
        safeLogInfo("RSSOwl Shutting Down (emergency)" + fNl); //$NON-NLS-1$
      }
    };
    fShutdownHook.setPriority(Thread.MAX_PRIORITY);
    Runtime.getRuntime().addShutdownHook(fShutdownHook);

    /* Activate the Core Bundle */
    SafeRunner.run(new LoggingSafeRunnable() {
      public void run() throws Exception {
        startCore();
      }
    });

    /* Propagate startup to Controller */
    SafeRunner.run(new LoggingSafeRunnable() {
      public void run() throws Exception {

        /* Startup Controller */
        if (Owl.isStarted())
          Controller.getDefault().startup();
      }
    });

    /* Propagate post-ui startup to Controller (Eclipse Integration) */
    if (Application.IS_ECLIPSE) {
      SafeRunner.run(new LoggingSafeRunnable() {
        public void run() throws Exception {
          Display.getDefault().asyncExec(new Runnable() {
            public void run() {
              if (Owl.isStarted())
                Controller.getDefault().postWindowOpen();
View Full Code Here

    /* Remove Shutdown Hook first that would run too otherwise */
    Runtime.getRuntime().removeShutdownHook(fShutdownHook);

    /* Propagate shutdown to Controller */
    SafeRunner.run(new LoggingSafeRunnable() {
      public void run() throws Exception {
        if (Owl.isStarted() || Controller.isInitialized())
          Controller.getDefault().shutdown(false);
      }
    });
View Full Code Here

TOP

Related Classes of org.rssowl.core.util.LoggingSafeRunnable

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.