@Component(value="blCustomerStateRefresher") public class CustomerStateRefresher extends Object implements org.springframework.context.ApplicationListener<CustomerPersistedEvent>
ApplicationListenerresponsible for updating
CustomerStateas well as invalidating the session-based customer, if one existed previously. For instance, when originally browsing the catalog a Customer is created but only stored in session and retrieved from session on subsequent requests. However, once the Customer has been persisted (like when they add something to the cart) then this component is responsible for updating
CustomerStateas well as invalidating the session-based customer.
|Constructor and Description|
|Modifier and Type||Method and Description|
Removes the complete
After a JPA merge occurs, there is a new object created representing the merged changes.
public void onApplicationEvent(CustomerPersistedEvent event)
Customerstored in session and adds a new session variable for just the customer ID. This should occur once the session-based
Customer(all anonymous Customers start out this way) has been persisted.
Copyright © 2019. All rights reserved.