We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 351de8e commit c9f351fCopy full SHA for c9f351f
spring-custom-event/src/main/java/com/hmkcode/beans/LoginTracker.java
@@ -0,0 +1,18 @@
1
+package com.hmkcode.beans;
2
+
3
+import org.springframework.context.ApplicationListener;
4
+import com.hmkcode.event.LoginEvent;
5
6
+public class LoginTracker implements ApplicationListener<LoginEvent> {
7
8
+ @Override
9
+ public void onApplicationEvent(LoginEvent event) {
10
11
12
+ System.out.println("\n"+((Login)event.getSource()).getUsername()+" logged-in @ "+event.getDate()+"\n");
13
14
15
16
+ }
17
18
+}
0 commit comments