1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package de.smartics.properties.resource.maven.repository;
17
18 import de.smartics.properties.api.config.app.ConfigurationPropertiesFactory;
19 import de.smartics.properties.api.config.app.ConfigurationPropertiesFactoryFactory;
20 import de.smartics.properties.api.config.domain.ConfigurationPropertiesManagement;
21 import de.smartics.properties.api.config.domain.key.ConfigurationKey;
22 import de.smartics.properties.impl.config.properties.PropertiesConfigurationPropertiesFactory;
23 import de.smartics.properties.spi.config.domain.key.ConfigurationKeyContextManager;
24
25
26
27
28 final class ResourceRepositoryPropertiesSingleton
29 {
30
31
32
33
34
35
36
37 private static ResourceRepositoryProperties INSTANCE;
38
39
40
41
42
43 private static void initialize()
44 {
45 final ConfigurationPropertiesFactory factory =
46 ConfigurationPropertiesFactoryFactory
47 .createFactory(PropertiesConfigurationPropertiesFactory.class);
48
49 final ConfigurationKey<?> key =
50 ConfigurationKeyContextManager.INSTANCE.context()
51 .configurationKeyFactory().createDefaultKey();
52 final ConfigurationPropertiesManagement propertiesConfiguration =
53 factory.createManagement(key);
54 INSTANCE =
55 propertiesConfiguration
56 .getProperties(ResourceRepositoryProperties.class);
57 }
58
59
60
61 private ResourceRepositoryPropertiesSingleton()
62 {
63 }
64
65
66
67
68
69
70
71
72
73
74
75 public static ResourceRepositoryProperties instance()
76 {
77 if (INSTANCE == null)
78 {
79 initialize();
80 }
81 return INSTANCE;
82 }
83
84
85
86 }