Exemple #1
0
  /** {@inheritDoc} */
  public void stop(BundleContext context) {

    SchedulesDirectProgramData pd = getSchedulesDirectProgramData();
    if (pd != null) {
      pd.close();
    }

    Db4oServiceTracker t = getDb4oServiceTracker();
    if (t != null) {
      t.close();
    }

    JobContainer jc = getJobContainer();
    if (jc != null) {
      jc.stop();
    }
  }
Exemple #2
0
  /** {@inheritDoc} */
  public void start() {

    Video v = getVideo();
    if (v != null) {

      try {

        File tmp = File.createTempFile("generate", ".png");
        setImageFile(tmp);
        ThumbnailerJob job = new ThumbnailerJob(v.getPath(), tmp.getPath(), 300);
        job.addJobListener(this);
        JobContainer jc = JobManager.getJobContainer(job);
        jc.start();
        setTerminate(false);

      } catch (IOException ex) {
      }
    }
  }
Exemple #3
0
  /** {@inheritDoc} */
  public void start(BundleContext bc) {

    setBundleContext(bc);

    SchedulesDirectProgramData pd = new SchedulesDirectProgramData();
    setSchedulesDirectProgramData(pd);

    Db4oServiceTracker t = new Db4oServiceTracker(bc, pd);
    setDb4oServiceTracker(t);
    t.open();

    SchedulesDirectProgramDataJob job = new SchedulesDirectProgramDataJob(pd);
    JobContainer jc = JobManager.getJobContainer(job);
    setJobContainer(jc);
    jc.start();

    Hashtable<String, String> dict = new Hashtable<String, String>();
    dict.put(ProgramData.TITLE_PROPERTY, pd.getTitle());

    bc.registerService(ProgramData.class.getName(), pd, dict);
  }