Event System
The ServiceLayer provides a framework to send and receive events within SAP Commerce. Events can either be published locally or across cluster nodes.
A common way to communicate between software components is through events. A source publishes an event while any interested party registers a listener that is able to receive these events and then perform logic. SAP Commerce Service Layer uses this concept: Events are published using an event service. Listeners are registered with the event service and can then react to the events.
The SAP Commerce event system is based on the Spring event system, but we have added some intelligence to make it easier to handle SAP Commerce-related logic.
Examples of events:
-
Java Swing button publishes an event when clicked.
-
Item publishes the fact that one of its attributes changes, for example that a description or a thumbnail of a media item has been modified.
-
SAP Commerce publishes the fact that a new session has been created or an order has been submitted.
Events can either be published locally or across cluster nodes.