Skip to content

Commit

Permalink
Fixed Application started event
Browse files Browse the repository at this point in the history
  • Loading branch information
alex9849 committed Feb 9, 2022
1 parent cf86b76 commit c922c64
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,20 @@
import net.alex9849.cocktailmaker.model.eventaction.EventTrigger;
import net.alex9849.cocktailmaker.service.EventService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.context.annotation.Lazy;
import org.springframework.context.event.ContextStartedEvent;
import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Component;

@Lazy(false)
@Component
public class EventListener {
public class SpringListener {
@Autowired
private EventService eventService;

@org.springframework.context.event.EventListener
public void handleContextStart(ContextStartedEvent cse) {
eventService.triggerActions(EventTrigger.COCKTAIL_PRODUCTION_STARTED);
@EventListener
public void handleContextStart(ApplicationReadyEvent event) {
eventService.triggerActions(EventTrigger.APPLICATION_STARTUP);
}
}

0 comments on commit c922c64

Please sign in to comment.