Package org.rssowl.core.util

Examples of org.rssowl.core.util.LoggingSafeRunnable


    /* Use the LogBridge as Logger */
    System.setProperty("org.apache.commons.logging.Log", "org.rssowl.core.internal.LogBridge"); //$NON-NLS-1$ //$NON-NLS-2$

    /* Load the Proxy Service */
    SafeRunner.run(new LoggingSafeRunnable() {
      public void run() throws Exception {
        fProxyService = loadProxyService();
      }
    });
  }
View Full Code Here


   */
  @Override
  public void stop(BundleContext context) throws Exception {

    /* Stop Internal Owl */
    SafeRunner.run(new LoggingSafeRunnable() {
      public void run() throws Exception {
        Owl.shutdown(false);
      }
    });

View Full Code Here

      /* Return early on cancellation */
      if (monitor.isCanceled() || Owl.isShuttingDown())
        return;

      /* Update state of added news if equivalent news already exists */
      SafeRunner.run(new LoggingSafeRunnable() {
        public void run() throws Exception { //See Bug 1216 (NPE in ModelSearchImpl.getCurrentSearcher)
          updateStateOfUnsavedNewNews(newNewsAdded, monitor);
        }
      });

      /* Return early on cancellation */
      if (monitor.isCanceled() || Owl.isShuttingDown())
        return;

      /* Retention Policy */
      final List<INews> deletedNews = RetentionStrategy.process(bookMark, feed);
      for (INews news : deletedNews)
        mergeResult.addUpdatedObject(news);

      /* Return early on cancellation */
      if (monitor.isCanceled() || Owl.isShuttingDown())
        return;

      /* Set ID to News and handle Description entity */
      IDGenerator generator = Owl.getPersistenceService().getIDGenerator();
      for (INews news : newNewsAdded) {

        /* Return early on cancellation */
        if (monitor.isCanceled() || Owl.isShuttingDown())
          return;

        long id;
        if (generator instanceof DB4OIDGenerator)
          id = ((DB4OIDGenerator) generator).getNext(false);
        else
          id = generator.getNext();

        news.setId(id);

        String description = ((News) news).getTransientDescription();
        if (description != null) {
          mergeResult.addUpdatedObject(new Description(news, description));
        }
      }

      /* Return early on cancellation */
      if (monitor.isCanceled() || Owl.isShuttingDown())
        return;

      /* Run News Filters */
      final AtomicBoolean someNewsFiltered = new AtomicBoolean(false);
      SafeRunner.run(new LoggingSafeRunnable() {
        public void run() throws Exception {
          newNewsAdded.removeAll(deletedNews);
          boolean result = runNewsFilters(newNewsAdded, monitor);
          someNewsFiltered.set(result);
        }
View Full Code Here

    final Map<INews, INews> replacements= new HashMap<INews, INews>();
    Collection<IFilterAction> actions = CoreUtils.getActions(filter); //Need to sort structural actions to end
    for (final IFilterAction action : actions) {
      final INewsAction newsAction = fNewsActions.get(action.getActionId());
      if (newsAction != null) {
        SafeRunner.run(new LoggingSafeRunnable() {
          public void run() throws Exception {
            newsAction.run(news, replacements, action.getData());
          }
        });
      }
View Full Code Here

    super.start(context);
    fContext = context;
    fVersion = (String) fPlugin.getBundle().getHeaders().get("Bundle-Version"); //$NON-NLS-1$

    /* Load the Proxy Service */
    SafeRunner.run(new LoggingSafeRunnable() {
      public void run() throws Exception {
        fProxyService = loadProxyService();
      }
    });

View Full Code Here

   */
  @Override
  public void stop(BundleContext context) throws Exception {

    /* Stop Internal Owl */
    SafeRunner.run(new LoggingSafeRunnable() {
      public void run() throws Exception {
        InternalOwl.getDefault().shutdown();
      }
    });

View Full Code Here

  public void postStartup() {
    super.postStartup();

    /* Run Runnable if provided */
    if (fRunAfterUIStartup != null) {
      SafeRunner.run(new LoggingSafeRunnable() {
        public void run() throws Exception {
          fRunAfterUIStartup.run();
        }
      });
    }
View Full Code Here

  @Override
  public boolean preShutdown() {
    final boolean res[] = new boolean[] { true };

    /* Pre-Shutdown Controller */
    SafeRunner.run(new LoggingSafeRunnable() {
      public void run() throws Exception {
        res[0] = Controller.getDefault().preUIShutdown();
      }
    });

View Full Code Here

  /**
   * @see org.eclipse.ui.application.WorkbenchWindowAdvisor#postWindowOpen()
   */
  @Override
  public void postWindowOpen() {
    SafeRunner.run(new LoggingSafeRunnable() {
      public void run() throws Exception {

        /* Retrieve Preferences */
        fPreferences = Owl.getPreferenceService().getGlobalScope();

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 (fPreferences.getBoolean(DefaultPreferences.TRAY_ON_CLOSE)) {
          fMinimizeFromClose = true;
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.