Class DefaultNotificationManager
- java.lang.Object
-
- com.broadleafcommerce.common.messaging.notification.DefaultNotificationManager
-
- All Implemented Interfaces:
NotificationManager
public class DefaultNotificationManager extends Object implements NotificationManager
- Author:
- Jeff Fischer
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceDefaultNotificationManager.VoidWorkPerform a task without response or exception notification
-
Constructor Summary
Constructors Constructor Description DefaultNotificationManager(List<NotificationHandler> handlers)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidexecutePostTransactionCommitOrNow(DefaultNotificationManager.VoidWork work)Do a unit of work upon successful completion of the current transaction, or, execute the work immediately if transaction synchronization is not currently active.voidhandle(NotificationStateRepository repo, NotificationStateAware notifiable, String messageType)Notify the system in some way about the state change for the notifiable param.voidsetEventPublisher(org.springframework.context.ApplicationEventPublisher eventPublisher)
-
-
-
Constructor Detail
-
DefaultNotificationManager
public DefaultNotificationManager(List<NotificationHandler> handlers)
-
-
Method Detail
-
handle
public void handle(@NonNull NotificationStateRepository repo, @NonNull NotificationStateAware notifiable, @NonNull String messageType)Description copied from interface:NotificationManagerNotify the system in some way about the state change for the notifiable param. Processing is handled through one or moreNotificationHandlerinstances. This will update the given notifiable using repo. Subsequent checks of the latest notification state will require a re-read.- Specified by:
handlein interfaceNotificationManager- Parameters:
repo- The service responsible for making the state change. Usually aRepositoryinstance.notifiable- The object that experienced the state change. Usually a Spring Data entity instance.messageType- The type of message correlating toDefaultNotificationHandler#messageType.
-
executePostTransactionCommitOrNow
protected void executePostTransactionCommitOrNow(DefaultNotificationManager.VoidWork work)
Do a unit of work upon successful completion of the current transaction, or, execute the work immediately if transaction synchronization is not currently active.- Parameters:
work- The work to perform
-
setEventPublisher
@Autowired public void setEventPublisher(@Nullable org.springframework.context.ApplicationEventPublisher eventPublisher)
-
-