private static void addScheduledApp(EclipseScheduledApplication scheduledApp) { if (ScheduledApplication.TIMER_TOPIC.equals(scheduledApp.getTopic())) { synchronized (timerApps) { timerApps.add(scheduledApp); if (timerThread == null) startTimer(); } } scheduledApps.put(scheduledApp.getScheduleId(), scheduledApp); Hashtable serviceProps = new Hashtable(); if (scheduledApp.getTopic() != null) serviceProps.put(EventConstants.EVENT_TOPIC, new String[] {scheduledApp.getTopic()}); if (scheduledApp.getEventFilter() != null) serviceProps.put(EventConstants.EVENT_FILTER, scheduledApp.getEventFilter()); serviceProps.put(ScheduledApplication.SCHEDULE_ID, scheduledApp.getScheduleId()); serviceProps.put(ScheduledApplication.APPLICATION_PID, scheduledApp.getAppPid()); ServiceRegistration sr = context.registerService(new String[] {ScheduledApplication.class.getName(), EVENT_HANDLER}, scheduledApp, serviceProps); scheduledApp.setServiceRegistration(sr); }
private static void addScheduledApp(EclipseScheduledApplication scheduledApp) { if (ScheduledApplication.TIMER_TOPIC.equals(scheduledApp.getTopic())) { synchronized (timerApps) { timerApps.add(scheduledApp); if (timerThread == null) startTimer(); } } scheduledApps.put(scheduledApp.getScheduleId(), scheduledApp); Hashtable serviceProps = new Hashtable(); if (scheduledApp.getTopic() != null) serviceProps.put(EventConstants.EVENT_TOPIC, new String[] {scheduledApp.getTopic()}); if (scheduledApp.getEventFilter() != null) serviceProps.put(EventConstants.EVENT_FILTER, scheduledApp.getEventFilter()); serviceProps.put(ScheduledApplication.SCHEDULE_ID, scheduledApp.getScheduleId()); serviceProps.put(ScheduledApplication.APPLICATION_PID, scheduledApp.getAppPid()); ServiceRegistration sr = context.registerService(new String[] {ScheduledApplication.class.getName(), EVENT_HANDLER}, scheduledApp, serviceProps); scheduledApp.setServiceRegistration(sr); }
private static void addScheduledApp(EclipseScheduledApplication scheduledApp) { if (ScheduledApplication.TIMER_TOPIC.equals(scheduledApp.getTopic())) { synchronized (timerApps) { timerApps.add(scheduledApp); if (timerThread == null) startTimer(); } } scheduledApps.put(scheduledApp.getScheduleId(), scheduledApp); Hashtable serviceProps = new Hashtable(); if (scheduledApp.getTopic() != null) serviceProps.put(EventConstants.EVENT_TOPIC, new String[] {scheduledApp.getTopic()}); if (scheduledApp.getEventFilter() != null) serviceProps.put(EventConstants.EVENT_FILTER, scheduledApp.getEventFilter()); serviceProps.put(ScheduledApplication.SCHEDULE_ID, scheduledApp.getScheduleId()); serviceProps.put(ScheduledApplication.APPLICATION_PID, scheduledApp.getAppPid()); ServiceRegistration sr = context.registerService(new String[] {ScheduledApplication.class.getName(), EVENT_HANDLER}, scheduledApp, serviceProps); scheduledApp.setServiceRegistration(sr); }