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); }
private static void saveSchedules(File schedulesData) throws IOException { try (ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream(schedulesData))) { out.writeInt(DATA_VERSION); out.writeInt(scheduledApps.size()); for (Iterator apps = scheduledApps.values().iterator(); apps.hasNext();) { EclipseScheduledApplication app = (EclipseScheduledApplication) apps.next(); writeStringOrNull(out, app.getScheduleId()); writeStringOrNull(out, app.getAppPid()); writeStringOrNull(out, app.getTopic()); writeStringOrNull(out, app.getEventFilter()); out.writeBoolean(app.isRecurring()); out.writeObject(app.getArguments()); } } }
private static void saveSchedules(File schedulesData) throws IOException { ObjectOutputStream out = null; try { out = new ObjectOutputStream(new FileOutputStream(schedulesData)); out.writeInt(DATA_VERSION); out.writeInt(scheduledApps.size()); for (Iterator apps = scheduledApps.values().iterator(); apps.hasNext();) { EclipseScheduledApplication app = (EclipseScheduledApplication) apps.next(); writeStringOrNull(out, app.getScheduleId()); writeStringOrNull(out, app.getAppPid()); writeStringOrNull(out, app.getTopic()); writeStringOrNull(out, app.getEventFilter()); out.writeBoolean(app.isRecurring()); out.writeObject(app.getArguments()); } } finally { if (out != null) out.close(); } }
private static void saveSchedules(File schedulesData) throws IOException { ObjectOutputStream out = null; try { out = new ObjectOutputStream(new FileOutputStream(schedulesData)); out.writeInt(DATA_VERSION); out.writeInt(scheduledApps.size()); for (Iterator apps = scheduledApps.values().iterator(); apps.hasNext();) { EclipseScheduledApplication app = (EclipseScheduledApplication) apps.next(); writeStringOrNull(out, app.getScheduleId()); writeStringOrNull(out, app.getAppPid()); writeStringOrNull(out, app.getTopic()); writeStringOrNull(out, app.getEventFilter()); out.writeBoolean(app.isRecurring()); out.writeObject(app.getArguments()); } } finally { if (out != null) out.close(); } }