| 66 | | LOG.info("Booting Classes..."); |
|---|
| 67 | | |
|---|
| 68 | | Document doc = XMLUtils.readFile(Configuration.getSetting("configdir")+"boot.xml"); |
|---|
| 69 | | NodeList nodes = XMLUtils.getNodesByXPath(doc, "/bootlist/boot"); |
|---|
| 70 | | for( int i=0; i < nodes.getLength(); i++ ) { |
|---|
| 71 | | String className = XMLUtils.getStringByXPath(nodes.item(i), "@class"); |
|---|
| 72 | | String type = XMLUtils.getStringByXPath(nodes.item(i), "@type"); |
|---|
| 73 | | LOG.info("["+type+"] Booting "+className); |
|---|
| 74 | | |
|---|
| 75 | | if( type.equals("static") ) { |
|---|
| 76 | | Class.forName(className); |
|---|
| 77 | | } |
|---|
| 78 | | else if( type.equals("singleton") ) { |
|---|
| 79 | | Class<?> cls = Class.forName(className); |
|---|
| 80 | | cls.getMethod("getInstance").invoke(null); |
|---|
| 81 | | } |
|---|
| 82 | | else { |
|---|
| 83 | | throw new Exception("Kann Klasse '"+className+"' nicht booten: Unbekannter Boot-Typ '"+type+"'"); |
|---|
| | 66 | if( boot ) { |
|---|
| | 67 | LOG.info("Booting Classes..."); |
|---|
| | 68 | |
|---|
| | 69 | Document doc = XMLUtils.readFile(Configuration.getSetting("configdir")+"boot.xml"); |
|---|
| | 70 | NodeList nodes = XMLUtils.getNodesByXPath(doc, "/bootlist/boot"); |
|---|
| | 71 | for( int i=0; i < nodes.getLength(); i++ ) { |
|---|
| | 72 | String className = XMLUtils.getStringByXPath(nodes.item(i), "@class"); |
|---|
| | 73 | String type = XMLUtils.getStringByXPath(nodes.item(i), "@type"); |
|---|
| | 74 | LOG.info("["+type+"] Booting "+className); |
|---|
| | 75 | |
|---|
| | 76 | if( type.equals("static") ) { |
|---|
| | 77 | Class.forName(className); |
|---|
| | 78 | } |
|---|
| | 79 | else if( type.equals("singleton") ) { |
|---|
| | 80 | Class<?> cls = Class.forName(className); |
|---|
| | 81 | cls.getMethod("getInstance").invoke(null); |
|---|
| | 82 | } |
|---|
| | 83 | else { |
|---|
| | 84 | throw new Exception("Kann Klasse '"+className+"' nicht booten: Unbekannter Boot-Typ '"+type+"'"); |
|---|
| | 85 | } |
|---|