User: norbert 
  Date: 00/05/31 18:23:09

  Modified:    src/java/org/spydermq/server Main.java
  Log:
  Verosity level changes
  
  Revision  Changes    Path
  1.2       +13 -17    spyderMQ/src/java/org/spydermq/server/Main.java
  
  Index: Main.java
  ===================================================================
  RCS file: /products/cvs/ejboss/spyderMQ/src/java/org/spydermq/server/Main.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Main.java 2000/05/31 18:10:21     1.1
  +++ Main.java 2000/06/01 01:23:09     1.2
  @@ -15,6 +15,7 @@
   import org.spydermq.distributed.JMSServerFactory;
   import org.spydermq.distributed.SpyTopicConnectionFactory;
   import org.spydermq.distributed.SpyQueueConnectionFactory;
  +import org.spydermq.Log;
   
   import javax.jms.TopicConnectionFactory;
   import javax.jms.QueueConnectionFactory;
  @@ -36,7 +37,7 @@
    *   @author Norbert Lataille ([EMAIL PROTECTED])
    *   @author Rich Johns ([EMAIL PROTECTED])
    *
  - *   @version $Revision: 1.1 $
  + *   @version $Revision: 1.2 $
    */
   public class Main implements Runnable
   {
  @@ -55,7 +56,7 @@
        //bind the TopicConnectionFactory object
        public void startJMSServer()
        {
  -             System.out.println("SpyderMQ [v0.3]");
  +             Log.log("SpyderMQ [v0.3]");
                
                try { 
                        
  @@ -71,7 +72,7 @@
                        if( (noStartJNDI == null) || (noStartJNDI.length() == 0) )
                        {
                                //Start the JNDI server
  -                             System.out.println( "Starting JNDI Server (JNP)" );
  +                             Log.log( "Starting JNDI Server (JNP)" );
                                new org.jnp.server.Main().start();
                        }
                        else
  @@ -79,8 +80,8 @@
                                // Need to warn user because if they fail to start
                                // a JNDI server prior to starting spyder, they
                                // will be confused by the resulting error.
  -                             System.out.println("[Warning]: SpyderMQ.properties 
specifys NOT to start a JNDI Server.");
  -                             System.out.println("           If a JNDI Server is not 
running SpyderMQ will not start.");
  +                             Log.notice("[Warning]: SpyderMQ.properties specifys 
NOT to start a JNDI Server.");
  +                             Log.notice("           If a JNDI Server is not running 
SpyderMQ will not start.");
                        }
   
                        //Get an InitialContext
  @@ -121,7 +122,7 @@
                                        subcontext.rebind(name,t);
                                }
                                
  -                     } else System.out.println("Warning: no known Topics !"); 
  +                     } else Log.notice("Warning: no known Topics !"); 
                        
                        //Get the queue properties
                        String 
queueConnectionFactoryCN=(String)cfg.get("DistributedQueueConnectionFactoryClassName");
  @@ -150,7 +151,7 @@
                                        subcontext.rebind(name,q);
                                }
                                
  -                     } else System.out.println("Warning: no known Queues !"); 
  +                     } else Log.notice("Warning: no known Queues !"); 
   
                        //Set the known Ids
                        String ids=(String)cfg.get("knownIds");
  @@ -168,24 +169,24 @@
                                        pos=passwd.indexOf(':');
                                                                                
                                        if (pos==-1) {
  -                                             System.out.println("[JMSServer] new 
user : Login = "+name+", Id = [none]");                                                
     
  +                                             Log.log("[JMSServer] new user : Login 
= "+name+", Id = [none]");                                                        
                                                
securityManager.addUser(name,passwd,null);
                                        } else {
                                                String ID=passwd.substring(pos+1);
  -                                             System.out.println("[JMSServer] new 
user : Login = "+name+", Id = "+ID);                                                   
     
  +                                             Log.log("[JMSServer] new user : Login 
= "+name+", Id = "+ID);                                                   
                                                
securityManager.addUser(name,passwd.substring(0,pos),ID);
                                        }
                                        
                                }
                                
  -                     } else System.out.println("Warning: no known Ids !"); 
  +                     } else Log.notice("Warning: no known Ids !"); 
                        
                        //(re)bind the connection factories in the JNDI namespace
                        ctx.rebind("TopicConnectionFactory",topicConnectionFactory);
                        ctx.rebind("QueueConnectionFactory",queueConnectionFactory);
   
                } catch (Exception e) { 
  -                     System.out.println("Cannot start the JMS server ! 
"+e.getMessage()); 
  +                     Log.error("Cannot start the JMS server ! "+e.getMessage()); 
                        e.printStackTrace(); 
                } 
                
  @@ -193,12 +194,7 @@
        
        public void run()
        {
  -             try {
  -                     startJMSServer();
  -             } catch (Exception e) {
  -                     System.out.println("I cannot start the server");
  -                     e.printStackTrace(System.err);                  
  -             }
  +             startJMSServer();
        }
        
        public static void main(String[] args) throws Exception
  
  
  

Reply via email to