1 /*
2 * Copyright 2012-2013 smartics, Kronseder & Reiner GmbH
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16 package de.smartics.properties.spi.config.support;
17
18 import javax.annotation.concurrent.ThreadSafe;
19
20 import de.smartics.properties.api.config.domain.SerializableConfigurationPropertiesManagement;
21 import de.smartics.properties.api.config.domain.key.ApplicationId;
22 import de.smartics.properties.api.config.domain.key.ConfigurationKey;
23 import de.smartics.properties.api.config.domain.key.EnvironmentId;
24 import de.smartics.properties.api.core.domain.PropertyDescriptorRegistry;
25 import de.smartics.util.lang.NullArgumentException;
26
27 /**
28 * Implementation based on {@link java.util.Properties}.
29 * <p>
30 * This implementation is used by the loader of boot properties only.
31 * </p>
32 */
33 @ThreadSafe
34 public final class BootConfigurationProperties extends
35 AbstractInMemoryConfigurationProperties
36 { // NOPMD
37 // ********************************* Fields *********************************
38
39 // --- constants ------------------------------------------------------------
40
41 // --- members --------------------------------------------------------------
42
43 /**
44 * The class version identifier.
45 */
46 private static final long serialVersionUID = 1L;
47
48 // ****************************** Initializer *******************************
49
50 // ****************************** Constructors ******************************
51
52 /**
53 * Default constructor.
54 *
55 * @param registry the registry to resolve property descriptors.
56 * @throws NullArgumentException if {@code key} or {@code registry} is
57 * <code>null</code>.
58 */
59 public BootConfigurationProperties(final PropertyDescriptorRegistry registry)
60 throws NullArgumentException
61 {
62 // TODO: Which key should the Boot Configuration use?
63 super(new ConfigurationKey(new EnvironmentId("smartics-boot"),
64 ApplicationId.ANY_APP), registry);
65 }
66
67 // ****************************** Inner Classes *****************************
68
69 // ********************************* Methods ********************************
70
71 // --- init -----------------------------------------------------------------
72
73 @Override
74 public SerializableConfigurationPropertiesManagement toSerializable()
75 {
76 return this;
77 }
78
79 // --- get&set --------------------------------------------------------------
80
81 // --- business -------------------------------------------------------------
82
83 // --- object basics --------------------------------------------------------
84
85 }