public IRedmineSpentTimeManager getSpentTimeManager(ITaskActivityManager taskActivityManager) {
    if (spentTimeManager == null) {
      spentTimeManager = new RedmineSpentTimeManager(taskActivityManager);

      if (context != null) {
        spentTimeManager.start();
      }
    }

    return spentTimeManager;
  }
  /*
   * (non-Javadoc)
   * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
   */
  @Override
  public void start(BundleContext bundleContext) throws Exception {
    super.start(bundleContext);

    RedmineCorePlugin.context = bundleContext;

    if (spentTimeManager != null) {
      spentTimeManager.start();
    }
    plugin = this;
  }
  /*
   * (non-Javadoc)
   * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
   */
  @Override
  public void stop(BundleContext bundleContext) throws Exception {
    if (spentTimeManager != null) {
      spentTimeManager.stop();
    }

    if (connector != null) {
      ((ClientManager) connector.getClientManager()).writeCache();
    }

    RedmineCorePlugin.context = null;
    super.stop(bundleContext);
  }