View Javadoc

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.core.domain.PropertyDescriptorRegistry;
22  import de.smartics.properties.api.core.security.PropertyValueSecurity;
23  import de.smartics.properties.spi.config.domain.key.ConfigurationKeyContextManager;
24  import de.smartics.util.lang.NullArgumentException;
25  
26  /**
27   * Implementation based on {@link java.util.Properties}.
28   * <p>
29   * This implementation is used by the loader of boot properties only.
30   * </p>
31   */
32  @ThreadSafe
33  public final class BootConfigurationProperties extends
34      AbstractInMemoryConfigurationProperties
35  { // NOPMD
36    // ********************************* Fields *********************************
37  
38    // --- constants ------------------------------------------------------------
39  
40    // --- members --------------------------------------------------------------
41  
42    /**
43     * The class version identifier.
44     */
45    private static final long serialVersionUID = 1L;
46  
47    // ****************************** Initializer *******************************
48  
49    // ****************************** Constructors ******************************
50  
51    /**
52     * Default constructor.
53     *
54     * @param registry the registry to resolve property descriptors.
55     * @param decrypter the helper to decrypt secured property values.
56     * @throws NullArgumentException if {@code registry} or {@code decrypter} is
57     *           <code>null</code>.
58     */
59    public BootConfigurationProperties(final PropertyDescriptorRegistry registry,
60        final PropertyValueSecurity decrypter) throws NullArgumentException
61    {
62      super(ConfigurationKeyContextManager.INSTANCE.context()
63          .configurationKeyFactory().createUniqueKey("smartics-boot"), registry,
64          decrypter);
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  }