@Override public T addingService(ServiceReference<T> serviceReference) { for (Class<?> componentClass : _componentClasses) { _componentContext.enableComponent(componentClass.getName()); } _serviceTracker.close(); return null; }
/** * Enable the FixedCronScheduleComponent service. * * @throws Exception * */ @Tooltip(description = "Enable the FixedCronScheduleComponent component with a fixed 'cron' service property of 1-30/2 * * * * ?, firing every 2 second the first 30 seconds of the minute", deflt = "", type = "") public CancellablePromise<?> fixedSchedule(int id, String cronExpression) throws Exception { assert fsc.get() == null : "This is a singleton, so we can only have one"; if (fsc.get() != null) throw new Exception("Already started"); FixedCronScheduleComponent.id = id; componentContext.enableComponent(FixedCronScheduleComponent.class .getName()); return new Closer<Object>( () -> componentContext .disableComponent(FixedCronScheduleComponent.class .getName())); }
componentContext.enableComponent(BootstrapConfiguration.COMPONENT_NAME); if (!registerLatch.await(30, TimeUnit.SECONDS)) throw new TimeoutException("Timeout for registering BootstrapConfiguration service");