[BAEL-3348] Moved code to algorithm-4

This commit is contained in:
dupirefr
2019-11-01 00:35:30 +01:00
parent db85c8f275
commit fee1da6091
20514 changed files with 1642355 additions and 0 deletions
@@ -0,0 +1,10 @@
package com.baeldung.events;
import org.springframework.context.ApplicationEvent;
public class FooCreationEvent extends ApplicationEvent {
public FooCreationEvent(Object source) {
super(source);
}
}
@@ -0,0 +1,17 @@
package com.baeldung.events;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;
import java.util.logging.Logger;
@Component
public class FooCreationEventListener implements ApplicationListener<FooCreationEvent> {
private static Logger logger = Logger.getLogger(FooCreationEventListener.class.getName());
@Override
public void onApplicationEvent(FooCreationEvent event) {
logger.info("Created foo instance: " + event.getSource().toString());
}
}