ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/cms/source/server/uk/org/iscream/cms/server/core/Core.java
(Generate patch)

Comparing projects/cms/source/server/uk/org/iscream/cms/server/core/Core.java (file contents):
Revision 1.10 by ajm, Thu Nov 16 19:28:03 2000 UTC vs.
Revision 1.13 by tdb, Mon Nov 20 18:44:49 2000 UTC

# Line 91 | Line 91 | class Core {
91              NamingContextExt ncRef = NamingContextExtHelper.narrow(objRef);
92              
93              // start and bind each server in turn
94 <
95 <            // create the logger (either Screen or File)
96 <            ScreenLoggerServant loggerRef = new ScreenLoggerServant(Integer.parseInt(System.getProperty("uk.ac.ukc.iscream.Verbosity")));
97 <            //FileLoggerServant loggerRef = new FileLoggerServant("core.log");
98 <            // and advertise it to the naming context
94 >            
95 >            // work out which logger to use
96 >            String whichLogger = System.getProperty("uk.ac.ukc.iscream.LoggerClass", defaultLogger);
97 >          
98 >            // construct the relevant LoggerImpl
99 >            LoggerImpl loggerImplRef = (LoggerImpl) ClassLoader.getSystemClassLoader().loadClass(whichLogger).newInstance();
100 >            
101 >            // setup and bind the LoggerServant
102 >            LoggerServant loggerRef = new LoggerServant(loggerImplRef);
103              objRef = poa.servant_to_reference(loggerRef);
104              ncRef.bind(ncRef.to_name("iscream.Logger"), objRef);
105              
106 <            // get a ref to the logger servant as a Logger reference
106 >            // get a reference to the servant as a Logger
107              Logger logRef = LoggerHelper.narrow(objRef);
108 <            
108 >
109 >
110 >
111              // create the Configurator
112 <            ConfiguratorServant configuratorRef = new ConfiguratorServant(System.getProperty("uk.ac.ukc.iscream.ConfigurationLocation"), poa, logRef);
112 >            String configLocation = System.getProperty("uk.ac.ukc.iscream.ConfigurationLocation", defaultConfigPath);
113 >            ConfigurationManagerServant configManRef = new ConfigurationManagerServant(poa, logRef);
114              
115              // and advertise it to the naming context
116 <            objRef = poa.servant_to_reference(configuratorRef);
117 <            ncRef.bind(ncRef.to_name("iscream.Configurator"), objRef);
116 >            objRef = poa.servant_to_reference(configManRef);
117 >            ncRef.bind(ncRef.to_name("iscream.ConfigurationManager"), objRef);
118              
119              // start the POA off
120              poa.the_POAManager().activate();
# Line 157 | Line 164 | class Core {
164   //---ACCESSOR/MUTATOR METHODS---
165  
166   //---ATTRIBUTES---
167 <
167 >    
168   //---STATIC ATTRIBUTES---
169 +  
170 +    /**
171 +     * Default logger, to be used when one is not provided
172 +     * in the configuration.
173 +     */
174 +    private static final String defaultLogger = "ScreenLogger";
175 +    
176 +    /**
177 +     * Default configPath, to be used when one is not provided
178 +     * in the configuration.
179 +     */
180 +    private static final String defaultConfigPath = ".";
181  
182   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines