@Component(value="blCartStateRefresher") public class CartStateRefresher extends Object implements org.springframework.context.ApplicationListener<OrderPersistedEvent>
ApplicationListenerresponsible for updating
CartStatewith a new version that was persisted.
|Constructor and Description|
|Modifier and Type||Method and Description|
public void onApplicationEvent(OrderPersistedEvent event)
CartState with the newly persisted Order. If
CartState was empty, this will only update it if
Order that has been persisted is the
Order for the active
Customer (as determined by
CartState was not empty,
then it will be replaced only if this newly persisted
Order has the same id.
This ensures that whatever is returned from
CartState.getCart() will always be the most up-to-date
database version (meaning, safe to write to the DB).
Copyright © 2019. All rights reserved.