Feature configure delay time out (#391)
* Create a new property (hawkbit.server.ui.event.push.delay),that the event delay forwarding is configurable. Signed-off-by: SirWayne <dennis.melzer@bosch-si.com> * Add javadoc Signed-off-by: SirWayne <dennis.melzer@bosch-si.com> * Change delay to a long Signed-off-by: SirWayne <dennis.melzer@bosch-si.com>
This commit is contained in:
committed by
Kai Zimmermann
parent
55a21d2633
commit
e6f702c882
@@ -12,6 +12,7 @@ import java.util.concurrent.ScheduledExecutorService;
|
||||
|
||||
import org.eclipse.hawkbit.DistributedResourceBundleMessageSource;
|
||||
import org.eclipse.hawkbit.ui.MgmtUiConfiguration;
|
||||
import org.eclipse.hawkbit.ui.UiProperties;
|
||||
import org.eclipse.hawkbit.ui.push.DelayedEventBusPushStrategy;
|
||||
import org.eclipse.hawkbit.ui.push.EventPushStrategy;
|
||||
import org.eclipse.hawkbit.ui.push.HawkbitEventProvider;
|
||||
@@ -67,17 +68,24 @@ public class UIAutoConfiguration {
|
||||
*
|
||||
* @param applicationContext
|
||||
* the context to add the listener
|
||||
*
|
||||
* @return the provider bean
|
||||
* @param executorService
|
||||
* the general scheduler service
|
||||
* @param eventBus
|
||||
* the ui event bus
|
||||
* @param eventProvider
|
||||
* the event provider
|
||||
* @param uiProperties
|
||||
* the ui properties
|
||||
* @return the push strategy bean
|
||||
*/
|
||||
@Bean
|
||||
@ConditionalOnMissingBean
|
||||
@UIScope
|
||||
public EventPushStrategy eventPushStrategy(final ConfigurableApplicationContext applicationContext,
|
||||
final ScheduledExecutorService executorService, final UIEventBus eventBus,
|
||||
final UIEventProvider eventProvider) {
|
||||
final UIEventProvider eventProvider, final UiProperties uiProperties) {
|
||||
final DelayedEventBusPushStrategy delayedEventBusPushStrategy = new DelayedEventBusPushStrategy(executorService,
|
||||
eventBus, eventProvider);
|
||||
eventBus, eventProvider, uiProperties.getEvent().getPush().getDelay());
|
||||
applicationContext.addApplicationListener(delayedEventBusPushStrategy);
|
||||
return delayedEventBusPushStrategy;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user