Add KeycodeAutoConfiguration for keycode registry initialization and remove Service annotation from KeycodeRegistryImpl
This commit is contained in:
@@ -0,0 +1,15 @@
|
|||||||
|
package de.extio.game_engine.keyboard;
|
||||||
|
|
||||||
|
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||||
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
|
||||||
|
@AutoConfiguration
|
||||||
|
@ConditionalOnProperty(name = "game-engine.keycode-registry.enabled", havingValue = "true", matchIfMissing = true)
|
||||||
|
public class KeycodeAutoConfiguration {
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
KeycodeRegistry keycodeRegistry() {
|
||||||
|
return new KeycodeRegistryImpl();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -6,9 +6,6 @@ import java.util.LinkedHashMap;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
@Service
|
|
||||||
public class KeycodeRegistryImpl implements KeycodeRegistry {
|
public class KeycodeRegistryImpl implements KeycodeRegistry {
|
||||||
|
|
||||||
private volatile Map<String, KeycodeRegistration> registry;
|
private volatile Map<String, KeycodeRegistration> registry;
|
||||||
|
|||||||
Reference in New Issue
Block a user