Package org.graylog2.notifications
Class NotificationSystemEventPublisher
java.lang.Object
com.google.common.util.concurrent.AbstractExecutionThreadService
org.graylog2.notifications.NotificationSystemEventPublisher
- All Implemented Interfaces:
com.google.common.util.concurrent.Service
@Singleton
public class NotificationSystemEventPublisher
extends com.google.common.util.concurrent.AbstractExecutionThreadService
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.google.common.util.concurrent.Service
com.google.common.util.concurrent.Service.Listener, com.google.common.util.concurrent.Service.State
-
Constructor Summary
ConstructorsConstructorDescriptionNotificationSystemEventPublisher
(DBEventDefinitionService dbEventDefinitionService, SystemNotificationRenderService systemNotificationRenderService, EventProcessorEngine eventProcessorEngine, ScheduledExecutorService scheduler, int shutDownTimeoutMs) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
run()
protected void
shutDown()
protected void
startUp()
boolean
submit
(Notification notification) Asynchronously publishes a notification as a system eventprotected void
Methods inherited from class com.google.common.util.concurrent.AbstractExecutionThreadService
addListener, awaitRunning, awaitRunning, awaitRunning, awaitTerminated, awaitTerminated, awaitTerminated, executor, failureCause, isRunning, serviceName, startAsync, state, stopAsync, toString
-
Constructor Details
-
NotificationSystemEventPublisher
@Inject public NotificationSystemEventPublisher(DBEventDefinitionService dbEventDefinitionService, SystemNotificationRenderService systemNotificationRenderService, EventProcessorEngine eventProcessorEngine, @Named("daemonScheduler") ScheduledExecutorService scheduler, @Named("shutdown_timeout") int shutDownTimeoutMs)
-
-
Method Details
-
submit
Asynchronously publishes a notification as a system event- Parameters:
notification
- Notification to publish as a system event. Be aware that this method alters the notification in place.- Returns:
- true if the notification was accepted for publishing, false if not
-
run
- Specified by:
run
in classcom.google.common.util.concurrent.AbstractExecutionThreadService
- Throws:
Exception
-
startUp
- Overrides:
startUp
in classcom.google.common.util.concurrent.AbstractExecutionThreadService
- Throws:
Exception
-
triggerShutdown
protected void triggerShutdown()- Overrides:
triggerShutdown
in classcom.google.common.util.concurrent.AbstractExecutionThreadService
-
shutDown
- Overrides:
shutDown
in classcom.google.common.util.concurrent.AbstractExecutionThreadService
- Throws:
Exception
-