Changeset 1643ee7f303706cfc20f3bc5dd4b66ab26e412a1

Show
Ignore:
Timestamp:
11/01/06 11:00:27 (2 years ago)
Author:
Christopher Jung <bktheg@web.de>
git-committer:
Christopher Jung <bktheg@web.de> 1162375227 +0100
git-parent:

[f953ce99dfcf22ed5e2872e0a0bb60051481264c]

git-author:
Christopher Jung <bktheg@web.de> 1162375227 +0100
Message:

Teil 2 boot.xml optional

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/net/driftingsouls/ds2/server/framework/DriftingSouls.java

    rcf73a30 r1643ee7  
    6464                Common.setLocale(Locale.GERMAN); 
    6565                 
    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                                } 
    8486                        } 
    8587                }