|
1 |
| |
|
2 |
| |
|
3 |
| |
|
4 |
| |
|
5 |
| |
|
6 |
| |
|
7 |
| package org.jconfig.bootstrap; |
|
8 |
| |
|
9 |
| import org.jconfig.*; |
|
10 |
| import org.jconfig.handler.*; |
|
11 |
| import java.util.Vector; |
|
12 |
| |
|
13 |
| |
|
14 |
| |
|
15 |
| |
|
16 |
| |
|
17 |
| |
|
18 |
| |
|
19 |
| |
|
20 |
| |
|
21 |
| |
|
22 |
| public class XMLBootstrapLoader implements BootstrapLoader { |
|
23 |
| |
|
24 |
| |
|
25 |
| |
|
26 |
| |
|
27 |
0
| public XMLBootstrapLoader() {
|
|
28 |
| } |
|
29 |
| |
|
30 |
0
| public LoadedItem[] load() throws ConfigurationManagerException {
|
|
31 |
0
| Vector configs = new Vector();
|
|
32 |
0
| String fileName = "config.xml";
|
|
33 |
0
| InputStreamHandler ish = new InputStreamHandler(fileName);
|
|
34 |
0
| Configuration config = ish.load("default");
|
|
35 |
0
| if ( config != null ) {
|
|
36 |
0
| LoadedItem li = new LoadedItem(config.getConfigName(),config,ish);
|
|
37 |
0
| configs.add(li);
|
|
38 |
| } |
|
39 |
0
| return (LoadedItem[])configs.toArray(new LoadedItem[0]);
|
|
40 |
| } |
|
41 |
| |
|
42 |
| } |