public final class ApplicationEventsNotifier extends Object implements Notifier, OngoingNotification
GlobalNotificationContext and on the
ThreadLocalNotificationContext will be notified.NotificationContext.notifyListeners(AbstractNotificationEvent)| Modifier and Type | Method and Description |
|---|---|
static Notifier |
notifyEvent(NotifiableTaskMetadata taskMetadata)
Entry point to create a notification using DSL.
|
void |
outOf(BigDecimal total) |
void |
outOf(int total) |
void |
progressUndetermined()
Notifies about a task progress which is undetermined
|
OngoingNotification |
stepsCompleted(BigDecimal completed)
Notifies about a certain amount of steps completed:
notifyEvent().stepsCompleted(new BigDecimal("2").outOf(10);
|
OngoingNotification |
stepsCompleted(int completed)
Notifies about a certain amount of steps completed:
notifyEvent().stepsCompleted(2).outOf(10);
|
void |
taskCompleted(long executionTime)
Notifies about a completed task
|
void |
taskFailed(Exception e)
Notifies about a failed task
|
void |
taskStarted()
Notifies about a started task
|
public static Notifier notifyEvent(NotifiableTaskMetadata taskMetadata)
Examples:
NotifiableTaskMetadata taskMetadata = ...
notifyEvent(taskMetadata).stepsCompleted(2).outOf(10);
notifyEvent(taskMetadata).taskCompleted();
public void taskFailed(Exception e)
NotifiertaskFailed in interface Notifiere - failure exceptionpublic void taskCompleted(long executionTime)
NotifiertaskCompleted in interface NotifierexecutionTime - number of millis for the task to completepublic void taskStarted()
NotifiertaskStarted in interface Notifierpublic void progressUndetermined()
NotifierprogressUndetermined in interface Notifierpublic OngoingNotification stepsCompleted(int completed)
Notifier
notifyEvent().stepsCompleted(2).outOf(10);
stepsCompleted in interface Notifiercompleted - number of steps completedOngoingNotification to perform the notificationpublic OngoingNotification stepsCompleted(BigDecimal completed)
Notifier
notifyEvent().stepsCompleted(new BigDecimal("2").outOf(10);
stepsCompleted in interface Notifiercompleted - number of steps completedOngoingNotification to perform the notificationpublic void outOf(int total)
outOf in interface OngoingNotificationtotal - the total number of stepspublic void outOf(BigDecimal total)
outOf in interface OngoingNotificationtotal - the total number of stepsCopyright © 2015. All Rights Reserved.