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.1 by ajm, Wed Nov 8 21:24:33 2000 UTC vs.
Revision 1.5 by tdb, Mon Nov 13 18:21:15 2000 UTC

# Line 1 | Line 1
1   //---PACKAGE DECLARATION---
2  
3   //---IMPORTS---
4 < import core.*;
4 > import uk.ac.ukc.iscream.core.*;
5   import org.omg.CORBA.*;
6   import org.omg.CosNaming.*;
7   import org.omg.PortableServer.*;
# Line 36 | Line 36 | class Core {
36       * @param args the command line arguments
37       */
38      public static void main(String[] args) {
39 <        System.out.println("I-Scream CORE:" + REVISION + " - coming up.");
39 >        System.out.println("--- I-Scream ---");
40 >        
41 >        // can't have a real toString() :)
42 >        String toString = "CORE(" + REVISION.substring(11, REVISION.length() - 2) + ")";
43 >        
44 >        System.out.println(toString + ": coming up");
45 >        
46          try {
47              // start the ORB
48              ORB orb = ORB.init(args, null);
# Line 49 | Line 55 | class Core {
55              objRef = orb.resolve_initial_references("NameService");
56              NamingContextExt ncRef = NamingContextExtHelper.narrow(objRef);
57              
58 <            // get a ref to our servers
59 <            // first the Configurator
60 <            ConfiguratorServant configuratorRef = new ConfiguratorServant(poa);
58 >            // start and bind each server in turn
59 >
60 >            // create the logger (either Screen or File)
61 >            ScreenLoggerServant loggerRef = new ScreenLoggerServant();
62 >            //FileLoggerServant loggerRef = new FileLoggerServant("core.log");
63 >            // and advertise it to the naming context
64 >            objRef = poa.servant_to_reference(loggerRef);
65 >            ncRef.bind(ncRef.to_name("iscream.Logger"), objRef);
66              
67 <            // then the logger
68 <            // **** PUT THE LOGGER HERE TIM ****
67 >            // get a ref to the logger servant as a Logger reference
68 >            Logger logRef = LoggerHelper.narrow(objRef);
69              
70 <            // advertise them to the naming context
71 <            // Configurator
70 >            // create the Configurator
71 >            ConfiguratorServant configuratorRef = new ConfiguratorServant(poa, logRef);
72 >            // and advertise it to the naming context
73              objRef = poa.servant_to_reference(configuratorRef);
74              ncRef.bind(ncRef.to_name("iscream.Configurator"), objRef);
75              
64            // Logger
65            // **** REGISTER THE LOGGER WITH THE NAME SERVICE TIM ****
66            
76              // start the POA off
77 <            poa.the_POAManager().activate();            
78 <            
79 <            
71 <            System.out.println("I-Scream CORE:" + REVISION + " - started.");
77 >            poa.the_POAManager().activate();
78 >                        
79 >            logRef.write(toString, "started");
80              
81              // now we are running, we just need to serve
82              // so we ask the orb to block for us until it has finished
# Line 102 | Line 110 | class Core {
110  
111   //---STATIC ATTRIBUTES---
112  
113 < }
113 > }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines