litesoft
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
package org.litesoft.datt.server;
import java.util.*;
import org.litesoft.configuration.*;
public class DATT_Configuration
{
private static final String SYSTEM_PROP_CONFIG_FILE = "CONFIG_FILE";
private static String makeConfigFileName()
{
String zProperty = System.getProperty( SYSTEM_PROP_CONFIG_FILE );
return (zProperty != null) ? zProperty : "DATT.properties";
}
// Set up the Search Path
private static List<String> createConfigSearchPath( String... pAdditionalPaths )
{
List<String> zSearchPath = new ArrayList<String>();
zSearchPath.add( System.getProperty( "CONFIG_DIR" ) );
if ( pAdditionalPaths != null )
{
for ( String zAdditionalPath : pAdditionalPaths )
{
if ( zAdditionalPath != null )
{
zSearchPath.add( zAdditionalPath );
}
}
}
zSearchPath.add( System.getenv( "CONFIG_DIR" ) );
return zSearchPath;
}
public static synchronized void initialize( String... pAdditionalPaths )
{
if ( !Configuration.isInstantiated() )
{
new ServerConfiguration( makeConfigAccessorLocator( pAdditionalPaths ) ); // force creation & self registration
// LoggerFactory.init( new ConfigurationLoggerLevel(), getLoggerProxy() );
}
}
private static ConfigAccessorLocator makeConfigAccessorLocator( String... pAdditionalPaths )
{
String configFileName = makeConfigFileName();
List<String> zSearchPath = createConfigSearchPath( pAdditionalPaths );
return new ConfigAccessorLocator( configFileName, ConfigAccessorFactoryProperties.INSTANCE, zSearchPath );
}
}
|
Revision |
Author |
Commited |
Message |
430
|
GeorgeS
|
Sat 20 Aug, 2011 19:46:21 +0000 |
|