01: /**********************************************************************************
02: * $URL: https://source.sakaiproject.org/svn/metaobj/tags/sakai_2-4-1/metaobj-impl/api-impl/src/java/org/sakaiproject/metaobj/utils/Config.java $
03: * $Id: Config.java 14225 2006-09-05 17:39:44Z chmaurer@iupui.edu $
04: ***********************************************************************************
05: *
06: * Copyright (c) 2004, 2005, 2006 The Sakai Foundation.
07: *
08: * Licensed under the Educational Community License, Version 1.0 (the "License");
09: * you may not use this file except in compliance with the License.
10: * You may obtain a copy of the License at
11: *
12: * http://www.opensource.org/licenses/ecl1.php
13: *
14: * Unless required by applicable law or agreed to in writing, software
15: * distributed under the License is distributed on an "AS IS" BASIS,
16: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17: * See the License for the specific language governing permissions and
18: * limitations under the License.
19: *
20: **********************************************************************************/package org.sakaiproject.metaobj.utils;
21:
22: import java.util.Properties;
23:
24: import org.springframework.beans.factory.InitializingBean;
25:
26: /**
27: * Created by IntelliJ IDEA.
28: * User: John Ellis
29: * Date: May 19, 2004
30: * Time: 10:33:49 AM
31: * To change this template use File | Settings | File Templates.
32: */
33: public class Config implements InitializingBean {
34:
35: private static Config instance = null;
36:
37: private Properties properties = null;
38:
39: public static Config getInstance() {
40: return instance;
41: }
42:
43: public Properties getProperties() {
44: return properties;
45: }
46:
47: public void setProperties(Properties properties) {
48: this .properties = properties;
49: }
50:
51: /**
52: * Invoked by a BeanFactory after it has set all bean properties supplied
53: * (and satisfied BeanFactoryAware and ApplicationContextAware).
54: * <p>This method allows the bean instance to perform initialization only
55: * possible when all bean properties have been set and to throw an
56: * exception in the event of misconfiguration.
57: *
58: * @throws Exception in the event of misconfiguration (such
59: * as failure to set an essential property) or if initialization fails.
60: */
61: public void afterPropertiesSet() throws Exception {
62: instance = this;
63: }
64:
65: }
|