/** {@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(); } }
/** {@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); }