User: starksm 
  Date: 01/09/11 11:34:59

  Modified:    src/main/org/jboss/deployment AutoDeployer.java
                        DeployerMBeanSupport.java Installer.java
                        J2eeDeployer.java ServiceDeployer.java
  Log:
  Convert all logging to org.jboss.logging.Logger which is a subclass of
  org.apache.log4j.Category.
  
  Revision  Changes    Path
  1.4       +1 -6      jboss/src/main/org/jboss/deployment/AutoDeployer.java
  
  Index: AutoDeployer.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/deployment/AutoDeployer.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- AutoDeployer.java 2001/09/11 02:45:45     1.3
  +++ AutoDeployer.java 2001/09/11 18:34:59     1.4
  @@ -28,7 +28,6 @@
   import javax.management.NotificationListener;
   import javax.management.Notification;
   import javax.management.MBeanServerNotification;
  -import org.jboss.logging.log4j.JBossCategory;
   
   import org.jboss.system.ServiceMBeanSupport;
   
  @@ -54,7 +53,7 @@
    * @author <a href="mailto:[EMAIL PROTECTED]";>Rickard �berg</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>Toby Allsopp</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>David Maplesden</a>
  - * @version $Revision: 1.3 $
  + * @version $Revision: 1.4 $
    */
   public class AutoDeployer
          extends ServiceMBeanSupport
  @@ -62,10 +61,6 @@
   {
      // Constants -----------------------------------------------------
      // Attributes ----------------------------------------------------
  -
  -   /** Instance logger. */
  -   private JBossCategory log = (JBossCategory)
  -      JBossCategory.getInstance(this.getClass());
      
      /**
       * Callback to the JMX agent.
  
  
  
  1.6       +3 -3      jboss/src/main/org/jboss/deployment/DeployerMBeanSupport.java
  
  Index: DeployerMBeanSupport.java
  ===================================================================
  RCS file: 
/cvsroot/jboss/jboss/src/main/org/jboss/deployment/DeployerMBeanSupport.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- DeployerMBeanSupport.java 2001/08/29 22:53:00     1.5
  +++ DeployerMBeanSupport.java 2001/09/11 18:34:59     1.6
  @@ -19,7 +19,7 @@
    * An abstract base class for deployer service implementations.
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Toby Allsopp</a>
  - * @version $Revision: 1.5 $
  + * @version $Revision: 1.6 $
    *
    * <p><b>Revisions:</b>
    *
  @@ -60,7 +60,7 @@
               }
               catch (Throwable t)
               {
  -               log.exception(t);
  +               log.error("undeploy failed", t);
                  if (t instanceof Exception)
                  {
                     if (t instanceof IOException) throw (IOException) t;
  @@ -78,7 +78,7 @@
            }
            catch (Throwable t)
            {
  -            log.exception(t);
  +            log.error("deploy failed", t);
               if (t instanceof Exception)
               {
                  if (t instanceof IOException) throw (IOException) t;
  
  
  
  1.14      +1 -2      jboss/src/main/org/jboss/deployment/Installer.java
  
  Index: Installer.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/deployment/Installer.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- Installer.java    2001/09/06 18:48:28     1.13
  +++ Installer.java    2001/09/11 18:34:59     1.14
  @@ -39,7 +39,6 @@
   import javax.management.JMException;
   import javax.management.ObjectName;
   
  -import org.jboss.logging.Log;
   import org.jboss.util.MBeanProxy;
   import org.jboss.system.ServiceMBeanSupport;
   
  @@ -57,7 +56,7 @@
    *
    *   @see <related>
    *   @author <a href="mailto:[EMAIL PROTECTED]";>Daniel Schulze</a>
  - *   @version $Revision: 1.13 $
  + *   @version $Revision: 1.14 $
    */
   public class Installer
   {
  
  
  
  1.41      +34 -35    jboss/src/main/org/jboss/deployment/J2eeDeployer.java
  
  Index: J2eeDeployer.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/deployment/J2eeDeployer.java,v
  retrieving revision 1.40
  retrieving revision 1.41
  diff -u -r1.40 -r1.41
  --- J2eeDeployer.java 2001/08/29 22:53:00     1.40
  +++ J2eeDeployer.java 2001/09/11 18:34:59     1.41
  @@ -41,9 +41,10 @@
   import javax.management.RuntimeMBeanException;
   import javax.management.RuntimeErrorException;
   
  -import org.jboss.logging.Log;
  -import org.jboss.util.MBeanProxy;
  +
  +import org.jboss.logging.Logger;
   import org.jboss.system.ServiceMBeanSupport;
  +import org.jboss.util.MBeanProxy;
   
   import org.jboss.ejb.DeploymentException;
   import org.jboss.ejb.ContainerFactoryMBean;
  @@ -66,11 +67,11 @@
   *   @author <a href="mailto:[EMAIL PROTECTED]";>Daniel Schulze</a>
   *   @author <a href="mailto:[EMAIL PROTECTED]";>Toby Allsopp</a>
   *   @author <a href="mailto:[EMAIL PROTECTED]";>Scott Stark</a>.
  -*   @version $Revision: 1.40 $
  +*   @version $Revision: 1.41 $
   */
   public class J2eeDeployer 
  -extends ServiceMBeanSupport
  -implements J2eeDeployerMBean
  +   extends ServiceMBeanSupport
  +   implements J2eeDeployerMBean
   {
        // Constants -----------------------------------------------------
        public File DEPLOYMENT_DIR = null;//"/home/deployment"; // default? MUST BE 
ABSOLUTE PATH!!!
  @@ -122,8 +123,7 @@
        
        public void setDeployerName(String name)
        {
  -             this.log = Log.createLog(this.getClass().getName() + "#" + name);
  -             
  +             this.log = Logger.create(this.getClass().getName() + "#" + name);
                // what is this for?
                name = name.equals("") ? "" : " "+name;
                this.name = name;
  @@ -199,7 +199,7 @@
                {}
                
                // now try to deploy
  -             log.log ("Deploy J2EE application: " + _url);
  +             log.info ("Deploy J2EE application: " + _url);
                
                Deployment d = installApplication (url);
                
  @@ -207,7 +207,7 @@
                {
                        // <comment author="cgjung"> factored out for subclass access
                        startApplication (d);
  -                     log.log ("J2EE application: " + _url + " is deployed.");
  +                     log.info ("J2EE application: " + _url + " is deployed.");
                } 
                catch (Exception _e)
                {
  @@ -237,7 +237,7 @@
                        }
                        else
                        {
  -                             log.exception(_e);
  +                             log.error("fatal error:", _e);
                                throw new J2eeDeploymentException ("fatal error: "+_e);
                        }
                }
  @@ -270,7 +270,7 @@
                                new String[] { "java.lang.String" }
                        );
                } catch(Exception e) {
  -                     log.log("Report of undeployment of J2EE application: " + _url 
+ " could not be reported.");
  +                     log.info("Report of undeployment of J2EE application: " + _url 
+ " could not be reported.");
                }       
        }
        
  @@ -356,7 +356,7 @@
                        !dir.mkdirs ())
                throw new IOException ("Temporary directory \""+dir.getCanonicalPath 
()+"\" does not exist!");
                
  -             installer = new InstallerFactory(dir, category);
  +             installer = new InstallerFactory(dir, log);
                
                // Save JMX name of the deployers
                jarDeployer = new ObjectName(jarDeployerName);
  @@ -368,11 +368,11 @@
        throws Exception
        {
                if (!warDeployerAvailable ())
  -                     log.log ("No web container found - only EJB deployment 
available...");
  +                     log.info ("No web container found - only EJB deployment 
available...");
                
                // clean up the deployment directory since on some Windowz the file 
removement
                // during runtime doesnt work...
  -             log.log("Cleaning up deployment directory");
  +             log.info("Cleaning up deployment directory");
                installer.unclutter();
        }
        
  @@ -380,7 +380,7 @@
        /** undeploys all deployments */
        protected void stopService()
        {
  -             log.log ("Undeploying all applications.");
  +             log.info ("Undeploying all applications.");
                
                Deployment[] deps = installer.getDeployments();
                int count = 0;
  @@ -393,18 +393,21 @@
                        catch (J2eeDeploymentException _e)
                        {
                                //throw _e;               
  -                             log.exception(_e);
  +                             log.error("Failed to stop app", _e);
                        }
                        finally 
                        {
                                try {
                                        uninstallApplication (deps[i]);
  -                             } catch (IOException _ioe)
  -                             {log.exception(_ioe);}
  +                             }
  +                                catch (IOException _ioe)
  +                             {
  +                                    log.error("Failed to unistall app", _ioe);
  +                                }
                        }
                        ++count;
                }
  -             log.log ("Undeployed "+count+" applications.");
  +             log.info ("Undeployed "+count+" applications.");
        }
        
        // Private -------------------------------------------------------
  @@ -439,9 +442,9 @@
        
        protected void uninstallApplication (Deployment _d) throws IOException
        {
  -             log.log ("Destroying application " + _d.name);
  +             log.info ("Destroying application " + _d.name);
                installer.uninstall(_d);
  -             log.log ("Destroyed");
  +             log.info ("Destroyed");
        }
        
        
  @@ -501,7 +504,7 @@
                        while( it.hasNext() ) {
                                m = (Deployment.Module)it.next();
                                moduleName = m.name;
  -                             log.log("Starting module " + moduleName);
  +                             log.info("Starting module " + moduleName);
                                
                                // Call the TomcatDeployer that is loaded in the JMX 
server
                                server.invoke(warDeployer, "deploy",
  @@ -512,23 +515,19 @@
                        }
                }
                catch (MBeanException e) {
  -                     log.error("Starting "+moduleName+" failed!");
  -                     log.exception(e.getTargetException());
  +                     log.error("Starting "+moduleName+" failed!", e);
                        throw new J2eeDeploymentException("Error while starting 
"+moduleName+": " + e.getTargetException().getMessage(), e.getTargetException());
                }
                catch (RuntimeErrorException e) {
  -                     log.error("Starting "+moduleName+" failed!");
  -                     log.exception(e.getTargetError());
  +                     log.error("Starting "+moduleName+" failed!", e);
                        throw new J2eeDeploymentException("Error while starting 
"+moduleName+": " + e.getTargetError().getMessage(), e.getTargetError());
                }
                catch (RuntimeMBeanException e) {
  -                     log.error("Starting "+moduleName+" failed!");
  -                     log.exception(e.getTargetException());
  +                     log.error("Starting "+moduleName+" failed!", e);
                        throw new J2eeDeploymentException("Error while starting 
"+moduleName+": " + e.getTargetException().getMessage(), e.getTargetException());
                }
                catch (JMException e) {
  -                     log.error("Starting failed!");
  -                     log.exception(e);
  +                     log.error("Starting failed!", e);
                        throw new J2eeDeploymentException("Fatal error while 
interacting with deployer MBeans... " + e.getMessage());
                }
                finally {
  @@ -563,7 +562,7 @@
                {
                        // in case we are not running with tomcat
                        // should only happen for tomcat (i=1)
  -                     log.warning("Cannot find web container");
  +                     log.warn("Cannot find web container");
                }
                
                // stop the jar modules (the ContainerFactory is responsible for 
undeploying
  @@ -586,12 +585,12 @@
                                new Object[] { moduleUrl }, new String[] { 
"java.lang.String" });
                        if (((Boolean)result).booleanValue ())
                        {
  -                             log.log ("Stopping module " + moduleName);
  +                             log.info ("Stopping module " + moduleName);
                                server.invoke(container, "undeploy",
                                        new Object[] { moduleUrl }, new String[] { 
"java.lang.String" });
                        }
                        else
  -                             log.log ("Module " + moduleName + " is not running");
  +                             log.info ("Module " + moduleName + " is not running");
                }
                catch (MBeanException _mbe)
                {
  @@ -645,7 +644,7 @@
                else
                {
                        // in case we are not running with tomcat
  -                     log.warning("Cannot find web container");
  +                     log.warn("Cannot find web container");
                }
                
                if (others > 0)
  @@ -662,7 +661,7 @@
        {
                try
                {
  -                     log.log ("Checking module " + moduleName);
  +                     log.info ("Checking module " + moduleName);
                        // Call the ContainerFactory/EmbededTomcat that is loaded in 
the JMX server
                        return server.invoke(container, "isDeployed",
                                new Object[] { moduleUrl }, new String[] { 
"java.lang.String" });
  
  
  
  1.7       +1 -7      jboss/src/main/org/jboss/deployment/ServiceDeployer.java
  
  Index: ServiceDeployer.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/deployment/ServiceDeployer.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- ServiceDeployer.java      2001/09/11 02:46:13     1.6
  +++ ServiceDeployer.java      2001/09/11 18:34:59     1.7
  @@ -41,7 +41,6 @@
   import javax.xml.parsers.DocumentBuilderFactory;
   import javax.xml.parsers.ParserConfigurationException;
   
  -import org.jboss.logging.log4j.JBossCategory;
   import org.jboss.system.MBeanClassLoader;
   
   import org.jboss.system.Service;
  @@ -62,7 +61,7 @@
    * @author    <a href="mailto:[EMAIL PROTECTED]";>Marc Fleury</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>David Maplesden</a>
    * @author    <a href="[EMAIL PROTECTED]">David Jencks</a>
  - * @version   $Revision: 1.6 $ <p>
  + * @version   $Revision: 1.7 $ <p>
    *
    *      <b>20010830 marc fleury:</b>
    *      <ul>initial import
  @@ -96,11 +95,6 @@
   {
   
      // Attributes --------------------------------------------------------
  -   /**
  -    * Instance logger.
  -    */
  -   private JBossCategory log = (JBossCategory)
  -         JBossCategory.getInstance(this.getClass());
   
      // each url can spawn a series of MLet classloaders that are specific to it and 
cycled
      private Map urlToClassLoadersSetMap;
  
  
  

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to