1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package de.smartics.properties.impl.config.cache;
17
18 import de.smartics.properties.api.config.domain.PropertyStoreAccessor;
19 import de.smartics.properties.api.config.domain.SerializableConfigurationProperties;
20 import de.smartics.properties.api.config.domain.SerializableConfigurationPropertiesManagement;
21 import de.smartics.properties.spi.config.support.ConfigurationPropertiesManagementSpi;
22 import de.smartics.properties.spi.config.support.SerializableConfigurationPropertiesManagementSpi;
23 import de.smartics.util.lang.Arg;
24
25
26
27
28 public final class SerializableCacheConfigurationPropertiesManagement extends
29 AbstractCacheConfigurationPropertiesManagement implements
30 SerializableConfigurationPropertiesManagementSpi
31 {
32
33
34
35
36
37
38
39 private static final long serialVersionUID = 1L;
40
41
42
43
44
45
46
47
48 private final SerializableConfigurationPropertiesManagementSpi delegate;
49
50
51
52
53
54
55
56
57
58
59
60 public SerializableCacheConfigurationPropertiesManagement(
61 final SerializableConfigurationPropertiesManagementSpi delegate)
62 throws NullPointerException
63 {
64 this(delegate, new DependencyTrackingCache(delegate.getKey()));
65 }
66
67
68
69
70
71
72
73
74 SerializableCacheConfigurationPropertiesManagement(
75 final SerializableConfigurationPropertiesManagementSpi delegate,
76 final DependencyTrackingCache cache) throws NullPointerException
77 {
78 super(cache);
79
80 this.delegate = Arg.checkNotNull("delegate", delegate);
81 }
82
83
84
85
86
87
88
89
90
91 @Override
92 public boolean isInAdminMode()
93 {
94 return delegate.isInAdminMode();
95 }
96
97 @Override
98 public void setToAdminMode(final boolean newMode)
99 {
100 delegate.setToAdminMode(newMode);
101 }
102
103 @Override
104 protected ConfigurationPropertiesManagementSpi getDelegate()
105 {
106 return delegate;
107 }
108
109 @Override
110 public <T> T getProperties(final Class<T> propertiesInterface,
111 final SerializableConfigurationProperties configuration)
112 {
113 return delegate.getProperties(propertiesInterface, this);
114 }
115
116
117
118 @Override
119 public SerializableConfigurationPropertiesManagement toSerializable()
120 {
121 return this;
122 }
123
124 @Override
125 public PropertyStoreAccessor getPropertyStoreAccessor()
126 {
127 return delegate.getPropertyStoreAccessor();
128 }
129
130
131
132 }