Last active
July 29, 2017 10:08
-
-
Save jeevan-patil/65d01c61fc5755b08b6f0937b4693df6 to your computer and use it in GitHub Desktop.
Project Service Implementation which publishes the event.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Service | |
public class ProjectServiceImpl implements ProjectService { | |
@Autowired | |
private ApplicationEventPublisher applicationEventPublisher; | |
@Override | |
public void createProject(Project project) { | |
// save project entity in the database and publish an event to send mail to project owner | |
publishProjectCreatedEvent(project); | |
} | |
void publishProjectCreatedEvent(final Project project) { | |
EntityCreatedEvent entityCreatedEvent = new EntityCreatedEvent(this, project); | |
applicationEventPublisher.publishEvent(entityCreatedEvent); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment