mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-05-19 11:25:58 +00:00
Java 11 migrate c-d (remaining) (#1111)
* Moves converter pattern to Java 11 * Moves cqrs pattern to Java 11 * Moves dao pattern to Java 11 * Moves data-bus pattern to Java 11 * Moves data-locality pattern to Java 11 * Moves data-mapper pattern to Java 11 * Moves data-transfer-object pattern to Java 11 * Moves decorator pattern to Java 11 * Moves delegation pattern to Java 11 * Moves dependency-injection to Java 11 * Moves dirty-flag to Java 11 * Moves double-buffer to Java 11 * Moves double-checked-locking to Java 11 * Moves double-dispatch to Java 11 * Corrects with changes thats breaking test cases
This commit is contained in:
committed by
Ilkka Seppälä
parent
5681684157
commit
ea57934db6
@@ -23,9 +23,7 @@
|
||||
|
||||
package com.iluwatar.dirtyflag;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@@ -61,18 +59,15 @@ public class App {
|
||||
* Program execution point.
|
||||
*/
|
||||
public void run() {
|
||||
|
||||
final ScheduledExecutorService executorService = Executors.newSingleThreadScheduledExecutor();
|
||||
final var executorService = Executors.newSingleThreadScheduledExecutor();
|
||||
executorService.scheduleAtFixedRate(new Runnable() {
|
||||
final World world = new World();
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
List<String> countries = world.fetch();
|
||||
var countries = world.fetch();
|
||||
LOGGER.info("Our world currently has the following countries:-");
|
||||
for (String country : countries) {
|
||||
LOGGER.info("\t" + country);
|
||||
}
|
||||
countries.stream().map(country -> "\t" + country).forEach(LOGGER::info);
|
||||
}
|
||||
}, 0, 15, TimeUnit.SECONDS); // Run at every 15 seconds.
|
||||
}
|
||||
@@ -83,8 +78,7 @@ public class App {
|
||||
* @param args command line args
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
App app = new App();
|
||||
|
||||
var app = new App();
|
||||
app.run();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user