Last active
December 17, 2015 11:26
-
-
Save abhirockzz/def697b68e719a06a1c6 to your computer and use it in GitHub Desktop.
Example of a simple CDI event with a static qualifier
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
//firing a (statically) qualified event | |
@Inject | |
@Approved | |
private Event<RequestOutcome> outcomeEvent; | |
public void notify(){ | |
outcomeEvent.fire(outcomeEvent.getOutcome()); | |
} | |
//observers | |
public void handleApprovedRequest(@Observes @Approved RequestOutcome approvedOutcome){ | |
//logic... | |
} | |
public void handleRejectedRequest(@Observes @Rejected RequestOutcome rejectedOutcome){ | |
//logic... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment