01: /*
02: * $Id: RuntimeProperties.java,v 1.16 2007/09/18 08:45:05 agoubard Exp $
03: *
04: * Copyright 2003-2007 Orange Nederland Breedband B.V.
05: * See the COPYRIGHT file for redistribution and use restrictions.
06: */
07: package org.xins.server;
08:
09: import java.util.ArrayList;
10: import java.util.List;
11:
12: import org.xins.common.collections.InvalidPropertyValueException;
13: import org.xins.common.collections.MissingRequiredPropertyException;
14: import org.xins.common.collections.PropertyReader;
15:
16: /**
17: * Base class to get the runtime properties.
18: *
19: * @version $Revision: 1.16 $ $Date: 2007/09/18 08:45:05 $
20: * @author <a href="mailto:anthony.goubard@japplis.com">Anthony Goubard</a>
21: * @author <a href="mailto:tauseef.rehman@orange-ftgroup.com">Tauseef Rehman</a>
22: *
23: * @since XINS 1.2.0
24: */
25: public class RuntimeProperties {
26:
27: private PropertyReader _runtimeSettings;
28:
29: /**
30: * Initialize the runtime properties. This method should be overwritten
31: * by a generated class if any runtime properties is declared in the
32: * impl.xml file.
33: *
34: * @param runtimeSettings
35: * the runtime properties, not <code>null</code>.
36: *
37: * @throws MissingRequiredPropertyException
38: * if a required property is not given.
39: *
40: * @throws InvalidPropertyValueException
41: * if the value of a certain property is invalid.
42: */
43: protected void init(PropertyReader runtimeSettings)
44: throws MissingRequiredPropertyException,
45: InvalidPropertyValueException {
46: _runtimeSettings = runtimeSettings;
47: }
48:
49: /**
50: * Gets the descriptor list. The list is created by getting all the
51: * properties which are marked as <i>_descriptor</i> in the run time
52: * properties file.
53: *
54: * @return
55: * the list of all descriptors, may not be <code>null</code>.
56: *
57: * @since XINS 1.3.0
58: */
59: protected List descriptors() {
60: return new ArrayList();
61: }
62:
63: /**
64: * Gets all the runtime properties.
65: *
66: * @return
67: * the runtime properties, can be <code>null</code> before the initialization.
68: *
69: * @since XINS 2.1
70: */
71: public PropertyReader properties() {
72: return _runtimeSettings;
73: }
74: }
|