litesoft
Diff Revisions
947
vs
948
for /trunk/GWT_Sandbox/InitFrom/src/org/litesoft/initfrom/server/InitFrom_Configuration.java
|
@@ -1,31 +1,25 @@ |
1 |
1 |
|
package org.litesoft.initfrom.server; |
2 |
2 |
|
|
3 |
|
- |
import java.util.*; |
4 |
|
- |
|
5 |
3 |
|
import org.litesoft.configuration.*; |
6 |
4 |
|
|
7 |
|
- |
public class InitFrom_Configuration |
8 |
|
- |
{ |
|
5 |
+ |
import java.util.*; |
|
6 |
+ |
|
|
7 |
+ |
public class InitFrom_Configuration { |
9 |
8 |
|
private static final String SYSTEM_PROP_CONFIG_FILE = "CONFIG_FILE"; |
10 |
9 |
|
|
11 |
|
- |
private static String makeConfigFileName() |
12 |
|
- |
{ |
|
10 |
+ |
private static String makeConfigFileName() { |
13 |
11 |
|
String zProperty = System.getProperty( SYSTEM_PROP_CONFIG_FILE ); |
14 |
12 |
|
return (zProperty != null) ? zProperty : "InitFrom.properties"; |
15 |
13 |
|
} |
16 |
14 |
|
|
17 |
15 |
|
// Set up the Search Path |
18 |
|
- |
private static List<String> createConfigSearchPath( String... pAdditionalPaths ) |
19 |
|
- |
{ |
|
16 |
+ |
private static List<String> createConfigSearchPath( String... pAdditionalPaths ) { |
20 |
17 |
|
List<String> zSearchPath = new ArrayList<String>(); |
21 |
18 |
|
|
22 |
19 |
|
zSearchPath.add( System.getProperty( "CONFIG_DIR" ) ); |
23 |
|
- |
if ( pAdditionalPaths != null ) |
24 |
|
- |
{ |
25 |
|
- |
for ( String zAdditionalPath : pAdditionalPaths ) |
26 |
|
- |
{ |
27 |
|
- |
if ( zAdditionalPath != null ) |
28 |
|
- |
{ |
|
20 |
+ |
if ( pAdditionalPaths != null ) { |
|
21 |
+ |
for ( String zAdditionalPath : pAdditionalPaths ) { |
|
22 |
+ |
if ( zAdditionalPath != null ) { |
29 |
23 |
|
zSearchPath.add( zAdditionalPath ); |
30 |
24 |
|
} |
31 |
25 |
|
} |
|
@@ -35,18 +29,15 @@ |
35 |
29 |
|
return zSearchPath; |
36 |
30 |
|
} |
37 |
31 |
|
|
38 |
|
- |
public static synchronized void initialize( String... pAdditionalPaths ) |
39 |
|
- |
{ |
40 |
|
- |
if ( !Configuration.isInstantiated() ) |
41 |
|
- |
{ |
|
32 |
+ |
public static synchronized void initialize( String... pAdditionalPaths ) { |
|
33 |
+ |
if ( !Configuration.isInstantiated() ) { |
42 |
34 |
|
new ServerConfiguration( makeConfigAccessorLocator( pAdditionalPaths ) ); // force creation & self registration |
43 |
35 |
|
|
44 |
36 |
|
// LoggerFactory.init( new ConfigurationLoggerLevel(), getLoggerProxy() ); |
45 |
37 |
|
} |
46 |
38 |
|
} |
47 |
39 |
|
|
48 |
|
- |
private static ConfigAccessorLocator makeConfigAccessorLocator( String... pAdditionalPaths ) |
49 |
|
- |
{ |
|
40 |
+ |
private static ConfigAccessorLocator makeConfigAccessorLocator( String... pAdditionalPaths ) { |
50 |
41 |
|
String configFileName = makeConfigFileName(); |
51 |
42 |
|
List<String> zSearchPath = createConfigSearchPath( pAdditionalPaths ); |
52 |
43 |
|
|