You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pluto-dev@portals.apache.org by bl...@apache.org on 2004/02/17 15:23:58 UTC

cvs commit: jakarta-pluto/portal/src/java/org/apache/pluto/portalImpl/services/pageregistry PageRegistryServiceFileImpl.java

blumm       2004/02/17 06:23:57

  Modified:    portal/src/java/org/apache/pluto/portalImpl/services
                        Service.java ServiceManager.java
               portal/src/java/org/apache/pluto/portalImpl/om/page/impl
                        FragmentImpl.java
               portal/src/java/org/apache/pluto/portalImpl/services/portletdefinitionregistry
                        PortletDefinitionRegistryServiceFileImpl.java
               portal/src/java/org/apache/pluto/portalImpl/services/log
                        Log.java LogService.java LogServiceImpl.java
               portal/src/java/org/apache/pluto/portalImpl/services/portletentityregistry
                        PortletEntityRegistryServiceFileImpl.java
               container/src/java/org/apache/pluto/services/log
                        LogService.java
               portal/src/java/org/apache/pluto/portalImpl/aggregation
                        PortletFragment.java
               portal/src/java/org/apache/pluto/portalImpl/om/common/impl
                        PreferenceSetImpl.java
               container/src/java/org/apache/pluto
                        PortletContainerImpl.java
               container/src/java/org/apache/pluto/invoker/impl
                        PortletInvokerImpl.java
               portal/src/webapp/WEB-INF/config services.properties
               portal/src/java/org/apache/pluto/portalImpl Servlet.java
               portal/src/java/org/apache/pluto/portalImpl/om/servlet/impl
                        WebApplicationDefinitionImpl.java
                        ServletDefinitionImpl.java
               portal/src/java/org/apache/pluto/portalImpl/services/pageregistry
                        PageRegistryServiceFileImpl.java
  Added:       portal/src/java/org/apache/pluto/portalImpl/services/log
                        StandardOutLogger.java StandardOutLogService.java
                        LoggerImpl.java
               container/src/java/org/apache/pluto/services/log Logger.java
  Log:
  Submitted by:	David H. DeWolf/david@daviddewolf.com
  
  Container Changes:
  ------------------------------------
  LogService interface has changed in the following ways in order for the LogService to act as a factory for logging implementations :
  1) All isXXXEnabled() methods have been removed
  2) All logging methods have been removed
  3) getLogger(String) and getLogger(Class) have been added.
  
  Logger interface has been added.  It includes:
  1) All isXXXEnabled() methods
  2) All logging methods removed from LogService
  
  Finally, All pluto classes which log now lookup a Logger using the LogService implementation provided by the container's environment.  Because of this, the static Log class can and should be removed.
  
  Portal Driver changes:
  ---------------------------------
  The LogServiceImpl has been modified to implement the new version of pluto's LogService interface.   It returns Loggers of type LoggerImpl
  
  LoggerImpl has been created.  It utilizes commons logging for all logging functions.
  
  Where possible (and where it makes sense), all driver classes that utilize significant logging grab their own instance of Logger and use it for logging.  Each instance access the LogService directly from the driver's ServiceManager (instead of looking it up through the containers abstractions -- which would eventually bring it back to the ServiceManager anyways.
  
  The driver's Log class has been modified so that all static invocations utilize a single Logger (org.apache.pluto.portalImpl) and it is not looked up each time.  Because of this, the 'aComponent' argument is no longer available to within static logging methods.
  
  All classes have been modified to utilize the above portal changes.
  
  Revision  Changes    Path
  1.2       +1 -16     jakarta-pluto/portal/src/java/org/apache/pluto/portalImpl/services/Service.java
  
  Index: Service.java
  ===================================================================
  RCS file: /home/cvs/jakarta-pluto/portal/src/java/org/apache/pluto/portalImpl/services/Service.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Service.java	7 Jan 2004 20:37:20 -0000	1.1
  +++ Service.java	17 Feb 2004 14:23:56 -0000	1.2
  @@ -61,9 +61,6 @@
   import javax.servlet.ServletContext;
   
   import org.apache.pluto.portalImpl.util.Properties;
  -import org.apache.pluto.util.StringUtils;
  -
  -import org.apache.pluto.portalImpl.services.log.*;
   
   /**
    ** This is the base class for all services of the system. It prototypes
  @@ -85,23 +82,11 @@
   public abstract class Service
   {
   
  -
  -    protected final boolean IS_DEBUG_ENABLED;
  -
       /**
        ** Constructs the service.
        **/
  +    protected Service () {
   
  -    protected Service ()
  -    {
  -        if (ServiceManager.getService (LogService.class) != null)
  -        {
  -            IS_DEBUG_ENABLED = Log.isDebugEnabled (StringUtils.packageOf (getClass ()));
  -        }
  -        else
  -        {
  -            IS_DEBUG_ENABLED = true;
  -        }
       }
   
       /**
  
  
  
  1.2       +5 -4      jakarta-pluto/portal/src/java/org/apache/pluto/portalImpl/services/ServiceManager.java
  
  Index: ServiceManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-pluto/portal/src/java/org/apache/pluto/portalImpl/services/ServiceManager.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ServiceManager.java	7 Jan 2004 20:37:20 -0000	1.1
  +++ ServiceManager.java	17 Feb 2004 14:23:56 -0000	1.2
  @@ -68,7 +68,7 @@
   
   /**
    * Manages the life-time of services registered during servlet startup.
  - * A service has to derive from {@link ContainerService} and implement the
  + * A service has to derive from {@link org.apache.pluto.services.ContainerService} and implement the
    * <CODE>init()</CODE> and <CODE>destroy()</CODE> methods as appropriate.
    * 
    * <P>
  @@ -77,7 +77,7 @@
    * available to the portal engine. The format of the file is simple:
    * 
    * <PRE>
  - *   org.apache.pluto.portalImpl.services.log.LogService = org.apache.pluto.portalImpl.services.log.LogServicesImpl
  + *   org.apache.pluto.portalImpl.services.log.Logger = org.apache.pluto.portalImpl.services.log.LogServicesImpl
    * </PRE>
    * 
    * Each entry represents one service. The left-hand side is the abstract
  @@ -89,7 +89,8 @@
    * <CODE>/config/services</CODE>. It has to have the name of either
    * implementation or abstract class of the service, without the
    * leading package name. For example, the service manager looks
  - * for <CODE>LogServiceImpl.properties</CODE>. This allows a special
  + * for <CODE>LoggerImpl
  +.properties</CODE>. This allows a special
    * implementation to provide different configuration than the
    * general (abstract) service requires.
    * 
  @@ -99,7 +100,7 @@
    * object. Not providing a service configuration file is okay too,
    * in that case the properties are empty.
    * 
  - * @see ContainerService
  + * @see org.apache.pluto.services.ContainerService
    */
   public class ServiceManager
   {
  
  
  
  1.2       +8 -16     jakarta-pluto/portal/src/java/org/apache/pluto/portalImpl/om/page/impl/FragmentImpl.java
  
  Index: FragmentImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-pluto/portal/src/java/org/apache/pluto/portalImpl/om/page/impl/FragmentImpl.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- FragmentImpl.java	7 Jan 2004 20:37:20 -0000	1.1
  +++ FragmentImpl.java	17 Feb 2004 14:23:56 -0000	1.2
  @@ -160,8 +160,7 @@
           org.apache.pluto.portalImpl.aggregation.Fragment fragment = null;
           if (classname == null) {
               if (type == null) {
  -                Log.error("org.apache.pluto.portalImpl",
  -                          "No type defined in pageregistry.xml");
  +                Log.error("No type defined in pageregistry.xml");
                   return null;
               }
               if (type.equalsIgnoreCase("page")) {
  @@ -189,8 +188,7 @@
                                                                                          this,
                                                                                          nav);
               } else {
  -                Log.error("org.apache.pluto.portalImpl",
  -                          "Unknown type "+type+" defined in pageregistry.xml");
  +                Log.error("Unknown type "+type+" defined in pageregistry.xml");
                   return null;
               }
           } else {
  @@ -206,12 +204,10 @@
               try {
                   constructor = Class.forName(classname).getConstructor(parameterClasses);
               } catch (NoSuchMethodException e) {
  -                Log.error("org.apache.pluto.portalImpl",
  -                          "Invalid class or classname defined in pageregistry.xml",e);
  +                Log.error("Invalid class or classname defined in pageregistry.xml",e);
                   return null;
               } catch (ClassNotFoundException e) {
  -                Log.error("org.apache.pluto.portalImpl",
  -                          "Invalid class or classname defined in pageregistry.xml",e);
  +                Log.error("Invalid class or classname defined in pageregistry.xml",e);
                   return null;
               }
               Object[] parameters = {
  @@ -224,22 +220,18 @@
               try {
                   Object _fragment = constructor.newInstance(parameters);
                   if (!(_fragment instanceof org.apache.pluto.portalImpl.aggregation.Fragment)) {
  -                    Log.error("org.apache.pluto.portalImpl",
  -                              "Invalid class or classname defined in pageregistry.xml");
  +                    Log.error("Invalid class or classname defined in pageregistry.xml");
                       return null;
                   }
                   fragment = (org.apache.pluto.portalImpl.aggregation.Fragment)_fragment;
               } catch (InstantiationException e) {
  -                Log.error("org.apache.pluto.portalImpl",
  -                          "Invalid class or classname defined in pageregistry.xml",e);
  +                Log.error("Invalid class or classname defined in pageregistry.xml",e);
                   return null;
               } catch (IllegalAccessException e) {
  -                Log.error("org.apache.pluto.portalImpl",
  -                          "Invalid class or classname defined in pageregistry.xml",e);
  +                Log.error("Invalid class or classname defined in pageregistry.xml",e);
                   return null;
               } catch (InvocationTargetException e) {
  -                Log.error("org.apache.pluto.portalImpl",
  -                          "Invalid class or classname defined in pageregistry.xml",e);
  +                Log.error("Invalid class or classname defined in pageregistry.xml",e);
                   return null;
               }
           }        
  
  
  
  1.2       +18 -21    jakarta-pluto/portal/src/java/org/apache/pluto/portalImpl/services/portletdefinitionregistry/PortletDefinitionRegistryServiceFileImpl.java
  
  Index: PortletDefinitionRegistryServiceFileImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-pluto/portal/src/java/org/apache/pluto/portalImpl/services/portletdefinitionregistry/PortletDefinitionRegistryServiceFileImpl.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- PortletDefinitionRegistryServiceFileImpl.java	7 Jan 2004 20:37:24 -0000	1.1
  +++ PortletDefinitionRegistryServiceFileImpl.java	17 Feb 2004 14:23:56 -0000	1.2
  @@ -77,6 +77,7 @@
   import org.apache.pluto.portalImpl.services.log.Log;
   import org.apache.pluto.portalImpl.util.Properties;
   import org.apache.pluto.portalImpl.xml.XmlParser;
  +import org.apache.pluto.services.log.Logger;
   import org.exolab.castor.mapping.Mapping;
   import org.exolab.castor.xml.Unmarshaller;
   import org.xml.sax.InputSource;
  @@ -106,6 +107,7 @@
       private ServletContext servletContext = null;
       // Base Dir where all web modules are located
       private String baseWMDir = null;
  +    private Logger log = null;
   
       // Helper lists and hashtables to access the data as fast as possible
       // List containing all portlet applications available in the system
  @@ -115,6 +117,7 @@
   
       public void init (ServletConfig config, Properties properties) throws Exception
       {
  +        log = Log.getService().getLogger(getClass());
           servletContext = config.getServletContext();
   
           if (properties.getBoolean("non-servlet")==Boolean.TRUE)
  @@ -123,7 +126,8 @@
               baseWMDir = root + fileSeparator + 
   		"WEB-INF" + fileSeparator + 
   		"portletapps" + fileSeparator; //org.apache.pluto.portalImpl.services.deploy.DeployServiceFileImpl.DEFAULT_PROTECTED;
  -            Log.debug("org.apache.pluto.portalImpl.services.Portletregistry", "baseWMDir = " + baseWMDir + " fileSeparator = " + fileSeparator);
  +            if(log.isDebugEnabled())
  +                log.debug("baseWMDir = " + baseWMDir + " fileSeparator = " + fileSeparator);
           }
           else
           {
  @@ -143,8 +147,7 @@
           }
           catch (Exception e)
           {
  -            Log.error("org.apache.pluto.portalImpl.services", 
  -                      "Failed to load mapping file "+_mapping,e);
  +            log.error("Failed to load mapping file "+_mapping,e);
               throw e;
           }
           // get web xml mapping file
  @@ -158,8 +161,7 @@
           }
           catch (Exception e)
           {
  -            Log.error("org.apache.pluto.portalImpl.services", 
  -                      "Failed to load mapping file "+_mapping,e);
  +            log.error("Failed to load mapping file "+_mapping,e);
               throw e;
           }
   
  @@ -203,10 +205,9 @@
           // portlet application web module
           if (portletXml.exists()) // && (webXml.exists()))
           {
  -            if (Log.isDebugEnabled("org.apache.pluto.portalImpl.services"))
  +            if (log.isDebugEnabled())
               {
  -                Log.debug("org.apache.pluto.portalImpl.services", 
  -                          "Loading the following Portlet Applications XML files..."+portletXml+", "+webXml);
  +                log.debug("Loading the following Portlet Applications XML files..."+portletXml+", "+webXml);
               }
   
               InputSource source = new InputSource(new FileInputStream(portletXml));
  @@ -240,16 +241,16 @@
   
                   webApp.postBuild(structure);
   
  -                if (Log.isDebugEnabled("org.apache.pluto.portalImpl.services"))
  +                if (log.isDebugEnabled())
                   {
  -                    Log.debug("org.apache.pluto.portalImpl.services", webApp.toString());
  +                    log.debug(webApp.toString());
                   }
               }
               else
               {
  -                if (Log.isDebugEnabled("org.apache.pluto.portalImpl.services"))
  +                if (log.isDebugEnabled())
                   {
  -                    Log.debug("org.apache.pluto.portalImpl.services", "no web.xml...");
  +                    log.debug("no web.xml...");
                   }
                   Vector structure = new Vector();
                   structure.add("/" + webModule);
  @@ -265,19 +266,15 @@
   
               registry.add( portletApp );
   
  -            if (Log.isDebugEnabled("org.apache.pluto.portalImpl.services"))
  +            if (log.isDebugEnabled())
               {
                   if (webApp!=null)
                   {
  -                    Log.debug("org.apache.pluto.portalImpl.services", 
  -                              "Dumping content of web.xml...");
  -                    Log.debug("org.apache.pluto.portalImpl.services", 
  -                              webApp.toString());
  +                    log.debug("Dumping content of web.xml...");
  +                    log.debug(webApp.toString());
                   }
  -                Log.debug("org.apache.pluto.portalImpl.services", 
  -                          "Dumping content of portlet.xml...");
  -                Log.debug("org.apache.pluto.portalImpl.services", 
  -                          portletApp.toString());
  +                log.debug("Dumping content of portlet.xml...");
  +                log.debug(portletApp.toString());
               }
           }
   
  
  
  
  1.2       +43 -39    jakarta-pluto/portal/src/java/org/apache/pluto/portalImpl/services/log/Log.java
  
  Index: Log.java
  ===================================================================
  RCS file: /home/cvs/jakarta-pluto/portal/src/java/org/apache/pluto/portalImpl/services/log/Log.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Log.java	7 Jan 2004 20:37:22 -0000	1.1
  +++ Log.java	17 Feb 2004 14:23:56 -0000	1.2
  @@ -58,76 +58,80 @@
   package org.apache.pluto.portalImpl.services.log;
   
   import org.apache.pluto.portalImpl.services.ServiceManager;
  +import org.apache.pluto.services.log.Logger;
   
   /**
  - ** This is the static accessor for the <code>LogService</code>.
  + ** This is the static accessor for the <code>Logger</code>.
  + ** All log messages logged using this classes static log
  + ** methods log to the org.apache.pluto.portalImpl category.
    **
  - ** @see   LogService
  + ** @see   org.apache.pluto.services.log.Logger
    **/
   
   public class Log
   {
   
  +    private static Logger log =
  +        getService().getLogger("org.apache.pluto.portalImpl");
   
  -    public static boolean isDebugEnabled (String aComponent)
  -    {
  -        return (cService.isDebugEnabled (aComponent));
  +    public static boolean isDebugEnabled() {
  +        return log.isDebugEnabled();
       }
   
  -    public static boolean isInfoEnabled (String aComponent)
  -    {
  -        return (cService.isInfoEnabled (aComponent));
  +    public static boolean isInfoEnabled() {
  +        return log.isInfoEnabled();
       }
   
  -    public static boolean isWarnEnabled (String aComponent)
  -    {
  -        return (cService.isWarnEnabled (aComponent));
  +    public static boolean isWarnEnabled() {
  +        return log.isWarnEnabled();
       }
   
  -    public static boolean isErrorEnabled (String aComponent)
  -    {
  -        return (cService.isErrorEnabled (aComponent));
  +    public static boolean isErrorEnabled() {
  +        return log.isErrorEnabled();
       }
   
  -    public static void debug (String aComponent, String aMessage)
  -    {
  -        cService.debug (aComponent, aMessage);
  +    public static void debug(String aMessage) {
  +        log.debug(aMessage);
       }
   
  -    public static void debug (String aComponent, String aMessage, Throwable aThrowable)
  -    {
  -        cService.debug (aComponent, aMessage, aThrowable);
  +    public static void debug(String aMessage, Throwable aThrowable) {
  +        log.debug(aMessage, aThrowable);
       }
   
  -    public static void info (String aComponent, String aMessage)
  -    {
  -        cService.info (aComponent, aMessage);
  +    public static void info(String aMessage) {
  +        log.info(aMessage);
       }
   
  -    public static void warn (String aComponent, String aMessage)
  -    {
  -        cService.warn (aComponent, aMessage);
  +    public static void warn(String aMessage) {
  +        log.warn(aMessage);
       }
   
  -    public static void error (String aComponent, String aMessage)
  -    {
  -        cService.error (aComponent, aMessage, null);
  +    public static void error(String aMessage) {
  +        log.error(aMessage);
       }
   
  -    public static void error (String aComponent, String aMessage, Throwable aThrowable)
  -    {
  -        cService.error (aComponent, aMessage, aThrowable);
  +    public static void error(String aMessage, Throwable aThrowable) {
  +        log.error(aMessage, aThrowable);
       }
   
  -    public static void error (String aComponent, Throwable aThrowable)
  -    {
  -        cService.error (aComponent, aThrowable);
  +    public static void error(Throwable aThrowable) {
  +        log.error(aThrowable);
       }
   
  -    public static LogService getService()
  -    {
  -        return cService;
  +    /** Returns the LogService which has been registered
  +     *  with the ServiceManager. If one does not yet exist,
  +     *  the StandardOutLogService (LogServiceImpl) is
  +     *  and returned.  This must take place since the
  +     *  Deployer (which does not register services) requires
  +     *  a valid log.
  +     * @return
  +     */
  +    public static LogService getService() {
  +        LogService ls = (LogService)
  +                ServiceManager.getService(LogService.class);
  +        if(ls==null)
  +            ls = StandardOutLogService.getInstance();
  +        return ls;
       }
   
  -    private final static LogService cService = (LogService) ServiceManager.getService (LogService.class);
   }
  
  
  
  1.2       +4 -24     jakarta-pluto/portal/src/java/org/apache/pluto/portalImpl/services/log/LogService.java
  
  Index: LogService.java
  ===================================================================
  RCS file: /home/cvs/jakarta-pluto/portal/src/java/org/apache/pluto/portalImpl/services/log/LogService.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- LogService.java	7 Jan 2004 20:37:22 -0000	1.1
  +++ LogService.java	17 Feb 2004 14:23:56 -0000	1.2
  @@ -59,30 +59,10 @@
   
   import org.apache.pluto.portalImpl.services.Service;
   
  +/** Defines the PortalDrivers LogService implementation
  + *  for pluto.
  + */
   public abstract class LogService extends Service
  -implements org.apache.pluto.services.log.LogService
  -{
  -
  -    // org.apache.pluto.services.log.LogService implementation.
  -    public abstract boolean isDebugEnabled (String aComponent);
  -    
  -    public abstract boolean isInfoEnabled (String aComponent);
  -    
  -    public abstract boolean isWarnEnabled (String aComponent);
  -
  -    public abstract boolean isErrorEnabled (String aComponent);
  -
  -
  -    public abstract void debug (String aComponent, String aMessage);
  -
  -    public abstract void debug (String aComponent, String aMessage, Throwable aThrowable);
  -
  -    public abstract void info (String aComponent, String aMessage);
  -
  -    public abstract void warn (String aComponent, String aMessage);
  -
  -    public abstract void error (String aComponent, String aMessage, Throwable aThrowable);
  -
  -    public abstract void error (String aComponent, Throwable aThrowable);
  +implements org.apache.pluto.services.log.LogService {
   
   }
  
  
  
  1.2       +26 -79    jakarta-pluto/portal/src/java/org/apache/pluto/portalImpl/services/log/LogServiceImpl.java
  
  Index: LogServiceImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-pluto/portal/src/java/org/apache/pluto/portalImpl/services/log/LogServiceImpl.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- LogServiceImpl.java	7 Jan 2004 20:37:22 -0000	1.1
  +++ LogServiceImpl.java	17 Feb 2004 14:23:56 -0000	1.2
  @@ -58,88 +58,35 @@
   package org.apache.pluto.portalImpl.services.log;
   
   import org.apache.pluto.portalImpl.util.Properties;
  +import org.apache.pluto.portalImpl.services.Service;
  +import org.apache.pluto.services.log.*;
  +import org.apache.pluto.services.log.Logger;
  +import org.apache.commons.logging.LogFactory;
  +
  +/** LogService implementation which uses Commons Logging.
  + *  The use of commons logging provides us with a simple yet
  + *  effective way to abstract the logging implementation.  Commons
  + *  Logging will be initialized in it's default manner according
  + *  to: http://jakarta.apache.org/commons/logging/userguide.html.
  + *
  + *  If no configuraiton is found, Commons Logging will use it's
  + *  SimpleLog configuration, which will log everything to standard
  + *  error.
  + */
  +public class LogServiceImpl
  +    extends LogService {
  +
  +    public Logger getLogger(String component) {
  +        return new LoggerImpl(
  +            LogFactory.getLog(component)
  +        );
   
  -public class LogServiceImpl extends LogService
  -{
  -
  -    public void init (Properties aProperties)
  -    {
  -        iIsDebugEnabled = aProperties.getBoolean ("debug.enable", Boolean.FALSE).booleanValue ();
  -        iIsInfoEnabled  = aProperties.getBoolean ("info.enable", Boolean.FALSE).booleanValue ();
  -        iIsWarnEnabled  = aProperties.getBoolean ("warn.enable", Boolean.FALSE).booleanValue ();
  -        iIsErrorEnabled = aProperties.getBoolean ("error.enable", Boolean.FALSE).booleanValue ();
  -    }
  -
  -    public boolean isDebugEnabled (String aComponent)
  -    {
  -        return (iIsDebugEnabled);
  -    }
  -
  -    public boolean isInfoEnabled (String aComponent)
  -    {
  -        return (iIsInfoEnabled);
  -    }
  -
  -    public boolean isWarnEnabled (String aComponent)
  -    {
  -        return (iIsWarnEnabled);
  -    }
  -
  -    public boolean isErrorEnabled (String aComponent)
  -    {
  -        return (iIsErrorEnabled);
  -    }
  -
  -    public void debug (String aComponent, String aMessage)
  -    {
  -        if (iIsDebugEnabled)
  -        {
  -            System.out.println ("DEBUG  " + aComponent + "   " + aMessage);
  -        }
  -    }
  -
  -    public void debug (String aComponent, String aMessage, Throwable aThrowable)
  -    {
  -        if (iIsDebugEnabled)
  -        {
  -            System.out.println ("DEBUG  " + aComponent + "   " + aMessage);
  -        }
  -    }
  -
  -    public void info (String aComponent, String aMessage)
  -    {
  -        if (iIsInfoEnabled)
  -        {
  -            System.out.println ("INFO   " + aComponent + "   " + aMessage);
  -        }
  -    }
  -
  -    public void warn (String aComponent, String aMessage)
  -    {
  -        if (iIsWarnEnabled)
  -        {
  -            System.out.println ("WARN   " + aComponent + "   " + aMessage);
  -        }
  -    }
  -
  -    public void error (String aComponent, String aMessage, Throwable aThrowable)
  -    {
  -        if (iIsErrorEnabled)
  -        {
  -            System.out.println ("ERROR  " + aComponent + "   " + aMessage);
  -
  -            if (aThrowable != null)
  -                aThrowable.printStackTrace (System.out);
  -        }
       }
   
  -    public void error (String aComponent, Throwable aThrowable)
  -    {
  -        error (aComponent, "An exception has been thrown:", aThrowable);
  +    public Logger getLogger(Class klass) {
  +        return new LoggerImpl(
  +            LogFactory.getLog(klass)
  +        );
       }
   
  -    private boolean iIsDebugEnabled;
  -    private boolean iIsInfoEnabled;
  -    private boolean iIsWarnEnabled;
  -    private boolean iIsErrorEnabled;
   }
  
  
  
  1.1                  jakarta-pluto/portal/src/java/org/apache/pluto/portalImpl/services/log/StandardOutLogger.java
  
  Index: StandardOutLogger.java
  ===================================================================
  /*
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2003 The Apache Software Foundation.  All rights 
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer. 
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution, if
   *    any, must include the following acknowlegement:  
   *       "This product includes software developed by the 
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Pluto", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written 
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names without prior written
   *    permission of the Apache Group.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   */
  /* 
  
   */
  
  package org.apache.pluto.portalImpl.services.log;
  
  import org.apache.pluto.services.log.Logger;
  
  /** An incredible simple Logger implementation which
   *  simply directs messages to StandardOut.  This Logger
   *  is only used in cases, such as in the Deployer, when
   *  no services are registered with the ServiceManager.
   */
  public class StandardOutLogger implements Logger {
  
      public StandardOutLogger() {
      }
  
      public boolean isDebugEnabled() {
          return true;
      }
  
      public boolean isInfoEnabled() {
          return true;
      }
  
      public boolean isWarnEnabled() {
          return true;
      }
  
      public boolean isErrorEnabled() {
          return true;
      }
  
      public void debug(String aMessage) {
          System.out.println(aMessage);
      }
  
      public void debug(String aMessage, Throwable aThrowable) {
          System.out.println(aMessage);
          aThrowable.printStackTrace();
      }
  
      public void info(String aMessage) {
          System.out.println(aMessage);
      }
  
      public void warn(String aMessage) {
          System.out.println(aMessage);
      }
  
      public void error(String aMessage) {
          System.out.println(aMessage);
      }
  
      public void error(String aMessage, Throwable aThrowable) {
          System.out.println(aMessage);
          aThrowable.printStackTrace();
      }
  
      public void error(Throwable aThrowable) {
          aThrowable.printStackTrace();
      }
  
  }
  
  
  
  1.1                  jakarta-pluto/portal/src/java/org/apache/pluto/portalImpl/services/log/StandardOutLogService.java
  
  Index: StandardOutLogService.java
  ===================================================================
  /*
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2003 The Apache Software Foundation.  All rights 
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer. 
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution, if
   *    any, must include the following acknowlegement:  
   *       "This product includes software developed by the 
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Pluto", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written 
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names without prior written
   *    permission of the Apache Group.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   */
  /* 
  
   */
  
  package org.apache.pluto.portalImpl.services.log;
  
  import org.apache.pluto.services.log.Logger;
  
  /** Defines a LogService that may be used when
   *  one has not been registered with the ServiceManager.
   *  This is specifically usefull in cases, such as
   *  when the Deployer is run, in which no Service are
   *  registered.
   *
   *  The StandardOutLogService is implemented as a
   *  Singleton since all log messages will be going
   *  to StandardOut no matter what! Since all behaivior
   *  will be identical, there's no reason to create
   *  multiple instances.
   */
  public class StandardOutLogService extends LogService {
  
      private static Logger logger = null;
  
      private static LogService service;
  
      public static LogService getInstance() {
          if(service==null)
              service = new StandardOutLogService();
          return service;
      }
  
      private StandardOutLogService() {
          logger = new StandardOutLogger();
      }
  
      public Logger getLogger(String aComponent) {
          return logger;
      }
      
      public Logger getLogger(Class klass) {
          return logger;
      }
  
  }
  
  
  
  1.1                  jakarta-pluto/portal/src/java/org/apache/pluto/portalImpl/services/log/LoggerImpl.java
  
  Index: LoggerImpl.java
  ===================================================================
  /*
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2003 The Apache Software Foundation.  All rights 
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer. 
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution, if
   *    any, must include the following acknowlegement:  
   *       "This product includes software developed by the 
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Pluto", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written 
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names without prior written
   *    permission of the Apache Group.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   */
  /* 
  
   */
  
  package org.apache.pluto.portalImpl.services.log;
  
  import org.apache.commons.logging.Log;
  import org.apache.pluto.services.log.Logger;
  
  public class LoggerImpl implements Logger {
  
      private Log log = null;
  
      public LoggerImpl(Log log) {
          this.log = log;
      }
  
      public boolean isDebugEnabled() {
          return log.isDebugEnabled();
      }
  
      public boolean isInfoEnabled() {
          return log.isInfoEnabled();
      }
  
      public boolean isWarnEnabled() {
          return log.isWarnEnabled();
      }
  
      public boolean isErrorEnabled() {
          return log.isErrorEnabled();
      }
  
      public void debug(String aMessage) {
          log.debug(aMessage);
      }
  
      public void debug(String aMessage, Throwable aThrowable) {
          log.debug(aMessage, aThrowable);
      }
  
      public void info(String aMessage) {
          log.info(aMessage);
      }
  
      public void warn(String aMessage) {
          log.warn(aMessage);
      }
  
      public void error(String aMessage) {
          log.error(aMessage);
      }
  
      public void error(String aMessage, Throwable aThrowable) {
          log.error(aMessage);
      }
  
      public void error(Throwable aThrowable) {
          log.error("Exception caught: ", aThrowable);
      }
  
  }
  
  
  
  1.2       +7 -6      jakarta-pluto/portal/src/java/org/apache/pluto/portalImpl/services/portletentityregistry/PortletEntityRegistryServiceFileImpl.java
  
  Index: PortletEntityRegistryServiceFileImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-pluto/portal/src/java/org/apache/pluto/portalImpl/services/portletentityregistry/PortletEntityRegistryServiceFileImpl.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- PortletEntityRegistryServiceFileImpl.java	7 Jan 2004 20:37:20 -0000	1.1
  +++ PortletEntityRegistryServiceFileImpl.java	17 Feb 2004 14:23:57 -0000	1.2
  @@ -75,6 +75,7 @@
   import org.apache.pluto.portalImpl.om.entity.impl.PortletApplicationEntityListImpl;
   import org.apache.pluto.portalImpl.services.log.Log;
   import org.apache.pluto.portalImpl.util.Properties;
  +import org.apache.pluto.services.log.Logger;
   import org.exolab.castor.mapping.Mapping;
   import org.exolab.castor.xml.Marshaller;
   import org.exolab.castor.xml.Unmarshaller;
  @@ -99,6 +100,7 @@
       protected Mapping mapping = null;
       // Servlet Context
       protected ServletContext servletContext = null;
  +    private Logger log = null;
       // Registry
       protected PortletApplicationEntityListImpl registry = null;
       
  @@ -108,6 +110,7 @@
       public void init (ServletConfig servletConfig, Properties properties) throws Exception
       {
           servletContext = servletConfig.getServletContext();
  +        log = Log.getService().getLogger(getClass());
   
           String _mapping = properties.getString(CONFIG_MAPPING, DEFAULT_MAPPING);
           File f = new File(_mapping);
  @@ -121,7 +124,7 @@
           }
           catch (Exception e)
           {
  -            Log.error("Failed to load mapping file "+_mapping,e);
  +            log.error("Failed to load mapping file "+_mapping,e);
               throw e;
           }
       
  @@ -185,12 +188,10 @@
       {
           _load();
   
  -        if (Log.isDebugEnabled("org.apache.pluto.portalImpl.services"))
  +        if (log.isDebugEnabled())
           {
  -            Log.debug("org.apache.pluto.portalImpl.services", 
  -                      "Dumping complete object model description as it is read from the xml file...");
  -            Log.debug("org.apache.pluto.portalImpl.services", 
  -                      registry.toString());
  +            log.debug("Dumping complete object model description as it is read from the xml file...");
  +            log.debug(registry.toString());
           }
   
           fill();
  
  
  
  1.2       +19 -20    jakarta-pluto/container/src/java/org/apache/pluto/services/log/LogService.java
  
  Index: LogService.java
  ===================================================================
  RCS file: /home/cvs/jakarta-pluto/container/src/java/org/apache/pluto/services/log/LogService.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- LogService.java	7 Jan 2004 20:37:17 -0000	1.1
  +++ LogService.java	17 Feb 2004 14:23:57 -0000	1.2
  @@ -59,28 +59,27 @@
   
   import org.apache.pluto.services.ContainerService;
   
  -/**
  - * The interfaces defined in this package represent an abstract object
  - * model (OM) that is applicable for different implementations.
  - * <P>
  - * This abstraction layer helps to generalize the portlet container from
  - * special implementations like data storage and moreover it is not bound
  - * to a special implementation.
  +/** Implemented in order to provides access to
  + *  a custom Logger implementation. The Logger
  + *  provides component aware logging capabilities.
  + *
    */
  -public interface LogService extends ContainerService
  -{
  +public interface LogService extends ContainerService {
   
  +    /** Used to retrieve a Logger implementation
  +     *  which can be used to log information for the given
  +     *  component.
  +     * @param component
  +     * @return
  +     */
  +    Logger getLogger(String component);
   
  -    public boolean isDebugEnabled (String aComponent);
  -    public boolean isInfoEnabled (String aComponent);
  -    public boolean isWarnEnabled (String aComponent);
  -    public boolean isErrorEnabled (String aComponent);
  -
  -    public void debug (String aComponent, String aMessage);
  -    public void debug (String aComponent, String aMessage, Throwable aThrowable);
  -    public void info (String aComponent, String aMessage);
  -    public void warn (String aComponent, String aMessage);
  -    public void error (String aComponent, String aMessage, Throwable aThrowable);
  -    public void error (String aComponent, Throwable aThrowable);
  +    /** Used to retrieve a Logger implementation
  +     *  which can be used to log information for the given
  +     *  Class.
  +     * @param klass
  +     * @return
  +     */
  +    Logger getLogger(Class klass);
   
   }
  
  
  
  1.1                  jakarta-pluto/container/src/java/org/apache/pluto/services/log/Logger.java
  
  Index: Logger.java
  ===================================================================
  /*
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2003 The Apache Software Foundation.  All rights 
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer. 
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution, if
   *    any, must include the following acknowlegement:  
   *       "This product includes software developed by the 
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Pluto", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written 
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names without prior written
   *    permission of the Apache Group.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   */
  /* 
  
   */
  
  package org.apache.pluto.services.log;
  
  import org.apache.pluto.services.ContainerService;
  
  /** Implemented in order to provide component aware
   *  logging.
   *
   * @see LogService
   *
   */
  public interface Logger extends ContainerService
  {
  
      public boolean isDebugEnabled();
      public boolean isInfoEnabled();
      public boolean isWarnEnabled();
      public boolean isErrorEnabled();
  
      public void debug(String aMessage);
      public void debug(String aMessage, Throwable aThrowable);
      public void info(String aMessage);
      public void warn(String aMessage);
      public void error(String aMessage);
      public void error(String aMessage, Throwable aThrowable);
      public void error(Throwable aThrowable);
  
  }
  
  
  
  1.4       +8 -5      jakarta-pluto/portal/src/java/org/apache/pluto/portalImpl/aggregation/PortletFragment.java
  
  Index: PortletFragment.java
  ===================================================================
  RCS file: /home/cvs/jakarta-pluto/portal/src/java/org/apache/pluto/portalImpl/aggregation/PortletFragment.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- PortletFragment.java	9 Feb 2004 15:42:16 -0000	1.3
  +++ PortletFragment.java	17 Feb 2004 14:23:57 -0000	1.4
  @@ -93,11 +93,12 @@
   import org.apache.pluto.portalImpl.factory.FactoryAccess;
   import org.apache.pluto.portalImpl.om.window.impl.PortletWindowImpl;
   import org.apache.pluto.portalImpl.services.portletentityregistry.PortletEntityRegistry;
  +import org.apache.pluto.portalImpl.services.log.Log;
   import org.apache.pluto.portalImpl.servlet.ServletObjectAccess;
   import org.apache.pluto.portalImpl.util.ObjectID;
   import org.apache.pluto.services.information.DynamicInformationProvider;
   import org.apache.pluto.services.information.PortalContextProvider;
  -import org.apache.pluto.services.log.Log;
  +import org.apache.pluto.services.log.Logger;
   
   /**
    * <p>Responsible for rendering a single Portlet.<p>
  @@ -117,6 +118,7 @@
   public class PortletFragment extends AbstractFragmentSingle {
       
       private PortletWindow portletWindow = null;
  +    private Logger log = null;
   
       public static final String PORTLET_ERROR_MSG = "Error occurred in portlet!";
   
  @@ -128,6 +130,7 @@
               throws Exception
       {
   		super(id, config, parent, fragDesc, navigation);
  +        log = Log.getService().getLogger(getClass());
   		String portletEntityId = getInitParameters().getString("portlet");
   		PortletEntity portletEntity = PortletEntityRegistry.getPortletEntity(ObjectID.createFromString(portletEntityId));
   		portletWindow = new PortletWindowImpl(getId());
  @@ -151,12 +154,12 @@
   		try {
   			PortletContainerFactory.getPortletContainer().portletLoad(portletWindow, wrappedRequest, response);
   		} catch (PortletContainerException e) {
  -			Log.error("Error in Portlet", e);
  +			log.error("Error in Portlet", e);
   			errorMsg = getErrorMsg();
   		} catch (Throwable t) {
   			// If we catch any throwable, we want to try to continue
   			// so that the rest of the portal renders correctly
  -			Log.error("Error in Portlet", t);
  +			log.error("Error in Portlet", t);
   			if (t instanceof VirtualMachineError) {
   				// if the Throwable is a VirtualMachineError then
   				// it is very unlikely (!) that the portal is going
  @@ -198,7 +201,7 @@
   				// render the Portlet to the wrapped response, to be output later.
   				PortletContainerFactory.getPortletContainer().renderPortlet(portletWindow, wrappedRequest, wrappedResponse);
   			} catch (UnavailableException e) {
  -				Log.error("Portlet is Unavailable", e);
  +				log.error("Portlet is Unavailable", e);
   				writer2.println("the portlet is currently unavailable!");
   
   				ServletDefinitionCtrl servletDefinitionCtrl = (ServletDefinitionCtrl) ControllerObjectAccess.get(portletWindow.getPortletEntity().getPortletDefinition().getServletDefinition());
  @@ -212,7 +215,7 @@
   					servletDefinitionCtrl.setAvailable(System.currentTimeMillis() + unavailableSeconds * 1000);
   				}
   			} catch (Exception e) {
  -				Log.error("Error in Portlet", e);
  +				log.error("Error in Portlet", e);
   				writer2.println(getErrorMsg());
   			}
   			String dyn_title = ((DynamicTitleServiceImpl) FactoryAccess.getDynamicTitleContainerService()).getDynamicTitle(portletWindow, request);
  
  
  
  1.2       +9 -4      jakarta-pluto/portal/src/java/org/apache/pluto/portalImpl/om/common/impl/PreferenceSetImpl.java
  
  Index: PreferenceSetImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-pluto/portal/src/java/org/apache/pluto/portalImpl/om/common/impl/PreferenceSetImpl.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- PreferenceSetImpl.java	7 Jan 2004 20:37:16 -0000	1.1
  +++ PreferenceSetImpl.java	17 Feb 2004 14:23:57 -0000	1.2
  @@ -67,13 +67,19 @@
   import org.apache.pluto.om.common.PreferenceSet;
   import org.apache.pluto.om.common.PreferenceSetCtrl;
   import org.apache.pluto.util.StringUtils;
  -import org.apache.pluto.services.log.Log;
  +import org.apache.pluto.portalImpl.services.log.Log;
  +import org.apache.pluto.services.log.Logger;
   
   public class PreferenceSetImpl extends HashSet
   implements PreferenceSet, PreferenceSetCtrl, java.io.Serializable {
   
       private String castorPreferencesValidator; 
       private ClassLoader classLoader;
  +    private Logger log = null;
  +
  +    public PreferenceSetImpl() {
  +        this.log = Log.getService().getLogger(getClass());
  +    }
   
       // PreferenceSet implementation.
   
  @@ -102,10 +108,9 @@
               if (validator instanceof PreferencesValidator)
                   return(PreferencesValidator)validator;
               else
  -                Log.error("org.apache.pluto.portalImpl.om.common.impl.PreferenceSetImpl", 
  -                          "Specified class " + castorPreferencesValidator +" is no preferences validator.");
  +                log.error("Specified class " + castorPreferencesValidator +" is no preferences validator.");
           } catch (Exception e) {
  -            Log.error("org.apache.pluto.portalImpl.om.common.impl.PreferenceSetImpl", e.getMessage(), e);
  +            log.error(e.getMessage(), e);
           }
   
           return null;
  
  
  
  1.3       +17 -11    jakarta-pluto/container/src/java/org/apache/pluto/PortletContainerImpl.java
  
  Index: PortletContainerImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-pluto/container/src/java/org/apache/pluto/PortletContainerImpl.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- PortletContainerImpl.java	8 Jan 2004 02:20:16 -0000	1.2
  +++ PortletContainerImpl.java	17 Feb 2004 14:23:57 -0000	1.3
  @@ -75,7 +75,8 @@
   import org.apache.pluto.services.information.DynamicInformationProvider;
   import org.apache.pluto.services.information.InformationProviderAccess;
   import org.apache.pluto.services.information.PortletURLProvider;
  -import org.apache.pluto.services.log.Log;
  +import org.apache.pluto.services.log.Logger;
  +import org.apache.pluto.services.log.LogService;
   
   /**
    *  Implements the Pluto Container.
  @@ -90,6 +91,8 @@
       private Properties properties;
       private boolean initialized;
   
  +    private Logger log = null;
  +
       public void init(String uniqueContainerName,
                        ServletConfig servletConfig,
                        PortletContainerEnvironment environment,
  @@ -101,6 +104,12 @@
           PortletContainerServices.createReference(uniqueContainerName, environment);
           this.properties = properties;
           initialized = true;
  +
  +        // Initialize the Logger that we will use
  +        // from here forward for this Container:
  +        log = ((LogService)environment
  +                .getContainerService(LogService.class))
  +                .getLogger(getClass());
       }
   
       public void shutdown() throws PortletContainerException
  @@ -117,10 +126,9 @@
           PortletContainerServices.prepare(uniqueContainerName);
           PortletInvoker invoker = null;
           
  -        if (Log.isDebugEnabled("org.apache.pluto.invoker"))
  +        if (log.isDebugEnabled())
           {
  -            Log.debug("org.apache.pluto.invoker",
  -                      "PortletContainerImpl.portletService(" + portletWindow.getId() + ") called.");
  +            log.debug("PortletContainerImpl.portletService(" + portletWindow.getId() + ") called.");
           }
   
           try
  @@ -153,10 +161,9 @@
           PortletContainerServices.prepare(uniqueContainerName);
           PortletInvoker invoker = null;
   
  -        if (Log.isDebugEnabled("org.apache.pluto.invoker"))
  +        if (log.isDebugEnabled())
           {
  -            Log.debug("org.apache.pluto.invoker",
  -                      "PortletContainerImpl.performPortletAction(" + portletWindow.getId() + ") called.");
  +            log.debug("PortletContainerImpl.performPortletAction(" + portletWindow.getId() + ") called.");
           }
   
           String location = null;
  @@ -270,9 +277,8 @@
           PortletContainerServices.prepare(uniqueContainerName);
           PortletInvoker invoker = null;
   
  -        if (Log.isDebugEnabled("org.apache.pluto.invoker"))
  -            Log.debug("org.apache.pluto.invoker",
  -                      "PortletContainerImpl.portletLoad("+portletWindow.getId()+") called.");
  +        if (log.isDebugEnabled())
  +            log.debug("PortletContainerImpl.portletLoad("+portletWindow.getId()+") called.");
   
           RenderRequest renderRequest = PortletObjectAccess.getRenderRequest(portletWindow, 
                                                                              servletRequest, 
  
  
  
  1.2       +34 -13    jakarta-pluto/container/src/java/org/apache/pluto/invoker/impl/PortletInvokerImpl.java
  
  Index: PortletInvokerImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-pluto/container/src/java/org/apache/pluto/invoker/impl/PortletInvokerImpl.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- PortletInvokerImpl.java	7 Jan 2004 20:37:23 -0000	1.1
  +++ PortletInvokerImpl.java	17 Feb 2004 14:23:57 -0000	1.2
  @@ -73,17 +73,27 @@
   import org.apache.pluto.core.CoreUtils;
   import org.apache.pluto.core.InternalPortletRequest;
   import org.apache.pluto.core.InternalPortletResponse;
  -import org.apache.pluto.services.log.Log;
  +import org.apache.pluto.services.log.Logger;
  +import org.apache.pluto.services.log.LogService;
   import org.apache.pluto.invoker.PortletInvoker;
   import org.apache.pluto.om.portlet.PortletDefinition;
   import org.apache.pluto.om.servlet.ServletDefinition;
  +import org.apache.pluto.PortletContainerServices;
   
   public class PortletInvokerImpl implements PortletInvoker
   {
       private javax.servlet.ServletConfig servletConfig;
       private PortletDefinition portletDefinition;
   
  -    public PortletInvokerImpl(PortletDefinition portletDefinition, 
  +    /* This Logger can be saved due to the
  +     * fact that a unique instance of PortletInvoker
  +     * will be used for each request. We load it
  +     * lazily since we only log exceptions at
  +     * this point.
  +     */
  +    private Logger log = null;
  +
  +    public PortletInvokerImpl(PortletDefinition portletDefinition,
                                 javax.servlet.ServletConfig servletConfig)
       {
           this.portletDefinition = portletDefinition;
  @@ -93,7 +103,7 @@
       // org.apache.pluto.invoker.PortletInvoker implementation -------------------------------------
       public void action(ActionRequest request, ActionResponse response) throws PortletException,IOException
       {
  -        invoke(request,response,org.apache.pluto.Constants.METHOD_ACTION);  
  +        invoke(request,response,org.apache.pluto.Constants.METHOD_ACTION);
       }
   
       public void render(RenderRequest request, RenderResponse response) throws PortletException, IOException
  @@ -109,8 +119,7 @@
           }
           catch (IOException e)
           {
  -            Log.error("org.apache.pluto.invoker",
  -                      "PortletInvokerImpl.load() - Error while dispatching portlet.",e);
  +            getLog().error("PortletInvokerImpl.load() - Error while dispatching portlet.",e);
               throw new PortletException(e);
           }
       }
  @@ -150,8 +159,7 @@
               }
               catch (javax.servlet.UnavailableException e)
               {
  -                Log.error("org.apache.pluto.invoker",
  -                          "PortletInvokerImpl.invoke() - Error while dispatching portlet.",e);
  +                getLog().error("PortletInvokerImpl.invoke() - Error while dispatching portlet.",e);
                   if (e.isPermanent())
                   {
                       throw new javax.portlet.UnavailableException(e.getMessage());
  @@ -165,8 +173,7 @@
               {
                   if (e.getRootCause() != null)
                   {
  -                    Log.error("org.apache.pluto.invoker",
  -                              "PortletInvokerImpl.render() - Error while dispatching portlet.",
  +                    getLog().error("PortletInvokerImpl.render() - Error while dispatching portlet.",
                                 e.getRootCause());
                       if (e.getRootCause() instanceof PortletException)
                       {
  @@ -179,8 +186,7 @@
                   }
                   else
                   {
  -                    Log.error("org.apache.pluto.invoker",
  -                              "PortletInvokerImpl.invoke() - Error while dispatching portlet.",
  +                    getLog().error("PortletInvokerImpl.invoke() - Error while dispatching portlet.",
                                 e);
                       throw new PortletException(e);
                   }
  @@ -194,9 +200,24 @@
           }
           else
           {
  -            Log.error("org.apache.pluto.invoker",
  -                      "PortletInvokerImpl.action() - Unable to find RequestDispatcher.");
  +            getLog().error("PortletInvokerImpl.action() - Unable to find RequestDispatcher.");
           }
       }
       // --------------------------------------------------------------------------------------------
  +
  +    /** Provides lazy instantiation of the Logger.
  +     *  This is usefull since the log is currently only
  +     *  used when an error occurs.  B/C of this, there is
  +     *  no reason to retrieve the log until needed.
  +     * @return
  +     */
  +    private Logger getLog() {
  +        if(log==null) {
  +        // from here forward for this Container:
  +            log = ((LogService)PortletContainerServices
  +                .get(LogService.class))
  +                .getLogger(getClass());
  +        }
  +        return log;
  +    }
   }
  
  
  
  1.2       +2 -3      jakarta-pluto/portal/src/webapp/WEB-INF/config/services.properties
  
  Index: services.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-pluto/portal/src/webapp/WEB-INF/config/services.properties,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- services.properties	7 Jan 2004 20:37:19 -0000	1.1
  +++ services.properties	17 Feb 2004 14:23:57 -0000	1.2
  @@ -4,9 +4,8 @@
   
   org.apache.pluto.portalImpl.services.config.ConfigService = org.apache.pluto.portalImpl.services.config.ConfigServiceImpl
   
  -# LogServiceImpl writes to System.out. LogServiceCommonsLoggingImpl uses commons-logging
  -#org.apache.pluto.portalImpl.services.log.LogService = org.apache.pluto.portalImpl.services.log.LogServiceImpl
  -org.apache.pluto.portalImpl.services.log.LogService = org.apache.pluto.portalImpl.services.log.LogServiceCommonsLoggingImpl
  +org.apache.pluto.portalImpl.services.log.LogService= org.apache.pluto.portalImpl.services.log.LogServiceImpl
  +
   
   org.apache.pluto.portalImpl.services.factorymanager.FactoryManagerService = org.apache.pluto.portalImpl.services.factorymanager.FactoryManagerServiceImpl
   
  
  
  
  1.3       +19 -19    jakarta-pluto/portal/src/java/org/apache/pluto/portalImpl/Servlet.java
  
  Index: Servlet.java
  ===================================================================
  RCS file: /home/cvs/jakarta-pluto/portal/src/java/org/apache/pluto/portalImpl/Servlet.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Servlet.java	20 Jan 2004 09:30:10 -0000	1.2
  +++ Servlet.java	17 Feb 2004 14:23:57 -0000	1.3
  @@ -68,6 +68,7 @@
   import javax.servlet.http.HttpServletResponse;
   
   import org.apache.pluto.PortletContainerException;
  +import org.apache.pluto.services.log.Logger;
   import org.apache.pluto.om.window.PortletWindow;
   import org.apache.pluto.portalImpl.aggregation.RootFragment;
   import org.apache.pluto.portalImpl.core.PortalControlParameter;
  @@ -76,9 +77,9 @@
   import org.apache.pluto.portalImpl.core.PortletContainerEnvironment;
   import org.apache.pluto.portalImpl.core.PortletContainerFactory;
   import org.apache.pluto.portalImpl.services.ServiceManager;
  +import org.apache.pluto.portalImpl.services.log.Log;
   import org.apache.pluto.portalImpl.services.factorymanager.FactoryManager;
   import org.apache.pluto.portalImpl.factory.FactoryAccess;
  -import org.apache.pluto.portalImpl.services.log.Log;
   import org.apache.pluto.portalImpl.services.config.Config;
   import org.apache.pluto.portalImpl.services.pageregistry.PageRegistry;
   import org.apache.pluto.portalImpl.servlet.ServletObjectAccess;
  @@ -87,9 +88,7 @@
   public class Servlet extends HttpServlet
   {
   
  -    public Servlet ()
  -    {
  -    }
  +    private Logger log = null;
   
       public String getServletInfo()
       {
  @@ -122,14 +121,19 @@
               throw (new javax.servlet.UnavailableException ("Post initialization of one or more services failed."));
           }
   
  -        IS_DEBUG_ENABLED = Log.isDebugEnabled ("org.apache.pluto.portalImpl");
  +        log = Log.getService().getLogger(getClass());
   
           if (!PortletContainerFactory.getPortletContainer().isInitialized()) {
  -            log ("Initializing PortletContainer...");
  -    
  -            String uniqueContainerName = Config.getParameters().getString ("portletcontainer.uniquename", "pluto");
  +            String uniqueContainerName =
  +               Config.getParameters().getString("portletcontainer.uniquename", "pluto");
  +
  +            if(log.isInfoEnabled())
  +                log.info("Initializing PortletContainer ["
  +                          +uniqueContainerName+"]...");
       
  -            PortletContainerEnvironment environment = new PortletContainerEnvironment();
  +            PortletContainerEnvironment environment
  +                = new PortletContainerEnvironment();
  +
               environment.addContainerService(Log.getService());
               environment.addContainerService(FactoryManager.getService());
               environment.addContainerService(FactoryAccess.getInformationProviderContainerService());
  @@ -145,19 +149,20 @@
               }
               catch (PortletContainerException exc)
               {
  -                log ("Initialization of the portlet container failed!", exc);
  -    
  +                log.error("Initialization of the portlet container failed!", exc);
                   throw (new javax.servlet.UnavailableException ("Initialization of the portlet container failed."));
               }
  -        } else {
  -            log("PortletContainer already initialized");
  +        } else if(log.isInfoEnabled()) {
  +            log.info("PortletContainer already initialized");
           }
   
  -        log ("Ready to serve you.");
  +        log.debug("Ready to serve you.");
       }
   
       public void destroy()
       {
  +        if(log.isInfoEnabled())
  +            log.info("Shutting down portlet container. . .");
           try
           {
               PortletContainerFactory.
  @@ -237,10 +242,5 @@
       {
           doGet (request, response);
       }
  -
  -    // --- PRIVATE MEMBERS --- //
  -
  -
  -    private static boolean IS_DEBUG_ENABLED;
   
   }
  
  
  
  1.2       +2 -3      jakarta-pluto/portal/src/java/org/apache/pluto/portalImpl/om/servlet/impl/WebApplicationDefinitionImpl.java
  
  Index: WebApplicationDefinitionImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-pluto/portal/src/java/org/apache/pluto/portalImpl/om/servlet/impl/WebApplicationDefinitionImpl.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- WebApplicationDefinitionImpl.java	7 Jan 2004 20:37:23 -0000	1.1
  +++ WebApplicationDefinitionImpl.java	17 Feb 2004 14:23:57 -0000	1.2
  @@ -147,9 +147,8 @@
   
       public ServletContext getServletContext(ServletContext servletContext)
       {
  -        if (Log.isDebugEnabled("org.apache.pluto.portalImpl")) {
  -            Log.debug("org.apache.pluto.portalImpl",
  -                      "Looking up ServletContext for path "+contextPath);
  +        if (Log.isDebugEnabled()) {
  +            Log.debug("Looking up ServletContext for path "+contextPath);
           }
           return servletContext.getContext(contextPath);
       }
  
  
  
  1.2       +3 -5      jakarta-pluto/portal/src/java/org/apache/pluto/portalImpl/om/servlet/impl/ServletDefinitionImpl.java
  
  Index: ServletDefinitionImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-pluto/portal/src/java/org/apache/pluto/portalImpl/om/servlet/impl/ServletDefinitionImpl.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ServletDefinitionImpl.java	7 Jan 2004 20:37:23 -0000	1.1
  +++ ServletDefinitionImpl.java	17 Feb 2004 14:23:57 -0000	1.2
  @@ -147,13 +147,11 @@
       {
           ServletContext newContext = webApplication.getServletContext(servletContext);
           if (newContext==null) {
  -            Log.error("org.apache.pluto.portalImpl",
  -                      "ServletContext '"+((WebApplicationDefinitionImpl)webApplication).getContextRoot()+"' not found!");
  +            Log.error("ServletContext '"+((WebApplicationDefinitionImpl)webApplication).getContextRoot()+"' not found!");
               return null;
           }
  -        if (Log.isDebugEnabled("org.apache.pluto.portalImpl")) {
  -            Log.debug("org.apache.pluto.portalImpl",
  -                      "Looking up RequestDispatcher for servlet mapping "+servletMapping.getUrlPattern());
  +        if (Log.isDebugEnabled()) {
  +            Log.debug("Looking up RequestDispatcher for servlet mapping "+servletMapping.getUrlPattern());
           }
           return newContext.getRequestDispatcher(servletMapping.getUrlPattern());
       }
  
  
  
  1.2       +11 -13    jakarta-pluto/portal/src/java/org/apache/pluto/portalImpl/services/pageregistry/PageRegistryServiceFileImpl.java
  
  Index: PageRegistryServiceFileImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-pluto/portal/src/java/org/apache/pluto/portalImpl/services/pageregistry/PageRegistryServiceFileImpl.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- PageRegistryServiceFileImpl.java	7 Jan 2004 20:37:23 -0000	1.1
  +++ PageRegistryServiceFileImpl.java	17 Feb 2004 14:23:57 -0000	1.2
  @@ -70,6 +70,7 @@
   import org.apache.pluto.portalImpl.om.page.impl.PortalImpl;
   import org.apache.pluto.portalImpl.services.log.Log;
   import org.apache.pluto.portalImpl.util.Properties;
  +import org.apache.pluto.services.log.Logger;
   import org.exolab.castor.mapping.Mapping;
   import org.exolab.castor.xml.Marshaller;
   import org.exolab.castor.xml.Unmarshaller;
  @@ -97,12 +98,14 @@
       // Root element
       private PortalImpl registry = null;
       private RootFragment root = null;
  +    private Logger log = null;
   
       private HashMap fragments = new HashMap();
   
       public void init (ServletConfig config, Properties properties) throws Exception
       {        
           servletContext = config.getServletContext();
  +        log = Log.getService().getLogger(getClass());
   
           String _mapping = properties.getString(CONFIG_MAPPING, DEFAULT_MAPPING);
           File f = new File(_mapping);
  @@ -116,19 +119,16 @@
           }
           catch (Exception e)
           {
  -            Log.error("org.apache.pluto.portalImpl.services", 
  -                      "Failed to load mapping file "+_mapping,e);
  +            log.error("Failed to load mapping file "+_mapping,e);
               throw e;
           }
   
           load();
   
  -        if (Log.isDebugEnabled("org.apache.pluto.portalImpl.services"))
  +        if (log.isDebugEnabled())
           {
  -            Log.debug("org.apache.pluto.portalImpl.services", 
  -                      "Dumping complete object model description as it is read from the xml file...");
  -            Log.debug("org.apache.pluto.portalImpl.services", 
  -                      registry.toString());
  +            log.debug("Dumping complete object model description as it is read from the xml file...");
  +            log.debug(registry.toString());
           }        
       }
   
  @@ -136,12 +136,10 @@
           
           root = registry.build(config);
                
  -        if (Log.isDebugEnabled("org.apache.pluto.portalImpl.services"))
  +        if (log.isDebugEnabled())
           {
  -            Log.debug("org.apache.pluto.portalImpl.services", 
  -                      "Dumping complete navigation tree created of the object model...");
  -            Log.debug("org.apache.pluto.portalImpl.services", 
  -                      root.getNavigation().toString());
  +            log.debug("Dumping complete navigation tree created of the object model...");
  +            log.debug(root.getNavigation().toString());
           }
       }
   
  @@ -163,7 +161,7 @@
           } else {
   
               String msg = "Fragment with this name "+id+" already exists in the pageregistry.xml.";
  -            Log.error("org.apache.pluto.portalImpl.services", msg);
  +            log.error(msg);
               throw new Exception(msg);
           }