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.impl.config.jndi; 17 18 import de.smartics.properties.api.config.domain.PropertyStoreMessageBean; 19 import de.smartics.properties.api.config.domain.key.ConfigurationKey; 20 21 /** 22 * Provides context information for problems dealing with JNDI property stores. 23 */ 24 public class JndiPropertyStoreMessageBean extends PropertyStoreMessageBean 25 { 26 // ********************************* Fields ********************************* 27 28 // --- constants ------------------------------------------------------------ 29 30 /** 31 * The class version identifier. 32 * <p> 33 * The value of this constant is {@value}. 34 * </p> 35 */ 36 private static final long serialVersionUID = 1L; 37 38 // --- members -------------------------------------------------------------- 39 40 // ****************************** Initializer ******************************* 41 42 // ****************************** Constructors ****************************** 43 44 /** 45 * Constructor without cause. 46 * 47 * @param code the error or exception code of the exception. 48 * @param configurationKey the key to the configuration where problems arise 49 * accessing the property store. 50 * @param propertyName the name of the property that cannot be accessed in the 51 * store. 52 */ 53 public JndiPropertyStoreMessageBean(final JndiPropertyStoreCode code, 54 final ConfigurationKey<?> configurationKey, final String propertyName) 55 { 56 super(code, configurationKey, propertyName); 57 } 58 59 /** 60 * Default constructor. 61 * 62 * @param code the error or exception code of the exception. 63 * @param cause the cause to the problem. 64 * @param configurationKey the key to the configuration where problems arise 65 * accessing the property store. 66 * @param propertyName the name of the property that cannot be accessed in the 67 * store. 68 */ 69 public JndiPropertyStoreMessageBean(final JndiPropertyStoreCode code, 70 final Throwable cause, final ConfigurationKey<?> configurationKey, 71 final String propertyName) 72 { 73 super(code, cause, configurationKey, propertyName); 74 } 75 76 // ****************************** Inner Classes ***************************** 77 78 // ********************************* Methods ******************************** 79 80 // --- init ----------------------------------------------------------------- 81 82 // --- factory -------------------------------------------------------------- 83 84 /** 85 * Creates a message bean for 86 * {@link JndiPropertyStoreCode#CANNOT_GET_PROPERTY_COLLECTION}. 87 * 88 * @param cause the cause to the problem. 89 * @param configurationKey the key to the configuration where problems arise 90 * accessing the property store. 91 * @return the requested message instance. 92 */ 93 public static PropertyStoreMessageBean collection(final Throwable cause, 94 final ConfigurationKey<?> configurationKey) 95 { 96 return new JndiPropertyStoreMessageBean( 97 JndiPropertyStoreCode.CANNOT_GET_PROPERTY_COLLECTION, cause, 98 configurationKey, null); 99 } 100 101 // --- get&set -------------------------------------------------------------- 102 103 // --- business ------------------------------------------------------------- 104 105 // --- object basics -------------------------------------------------------- 106 107 }