Author: nfilotto
Date: 2010-04-30 14:16:15 -0400 (Fri, 30 Apr 2010)
New Revision: 2347
Modified:
kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/configuration/ConfigurationManager.java
kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/configuration/ConfigurationManagerImpl.java
kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/definition/PortalContainerConfig.java
kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/monitor/jvm/J2EEServerInfo.java
kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/util/ContainerUtil.java
Log:
EXOJCR-711: The changes done are the following:
1. In ContainerUtil, we retrieve the path before opening the stream to avoid getting null
path in the error message
2. The constants related to the configuration logging have been moved from
ConfigurationManagerImpl to ConfigurationManager in order to be able to use it in other
classes without adding a dependency to an implementation
3. Some info messages have me added to PortalContainerConfig to give more information
about how the external settings are loaded
4. In J2EEServerInfo, a "System.out.println" has been replaced with a
"log.info"
Modified:
kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/configuration/ConfigurationManager.java
===================================================================
---
kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/configuration/ConfigurationManager.java 2010-04-30
14:53:46 UTC (rev 2346)
+++
kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/configuration/ConfigurationManager.java 2010-04-30
18:16:15 UTC (rev 2347)
@@ -34,6 +34,18 @@
*/
public interface ConfigurationManager
{
+ /**
+ * The name of the system property that indicates whether the logger of the
configuration
+ * must be in debug more or not.
+ */
+ public static final String LOG_DEBUG_PROPERTY =
"org.exoplatform.container.configuration.debug";
+
+ /**
+ * Constant that indicates whether the logger of the configuration
+ * must be in debug more or not.
+ */
+ public static final boolean LOG_DEBUG = System.getProperty(LOG_DEBUG_PROPERTY) !=
null;
+
public Configuration getConfiguration();
public Component getComponent(String service);
Modified:
kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/configuration/ConfigurationManagerImpl.java
===================================================================
---
kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/configuration/ConfigurationManagerImpl.java 2010-04-30
14:53:46 UTC (rev 2346)
+++
kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/configuration/ConfigurationManagerImpl.java 2010-04-30
18:16:15 UTC (rev 2347)
@@ -48,10 +48,6 @@
{
final static public String WAR_CONF_LOCATION = "/WEB-INF";
- final static public String LOG_DEBUG_PROPERTY =
"org.exoplatform.container.configuration.debug";
-
- final static public boolean LOG_DEBUG = System.getProperty(LOG_DEBUG_PROPERTY) !=
null;
-
private static final Log log =
ExoLogger.getLogger("exo.kernel.container.ConfigurationManagerImpl");
protected Configuration configurations_;
Modified:
kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/definition/PortalContainerConfig.java
===================================================================
---
kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/definition/PortalContainerConfig.java 2010-04-30
14:53:46 UTC (rev 2346)
+++
kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/definition/PortalContainerConfig.java 2010-04-30
18:16:15 UTC (rev 2347)
@@ -803,12 +803,29 @@
{
// The file exists so we will use it
url = file.toURI().toURL();
+ if (ConfigurationManager.LOG_DEBUG)
+ {
+ log.info("The external settings could be found in the directory
${exo-conf}/portal, "
+ + "it will be used as external settings of the "
+ + (isPath4DefaultPCD ? "default portal container" :
"portal container '" + def.getName() + "'"));
+ }
}
+ else if (ConfigurationManager.LOG_DEBUG)
+ {
+ log.info("No external settings could be found in the directory
${exo-conf}/portal for the "
+ + (isPath4DefaultPCD ? "default portal container" :
"portal container '" + def.getName() + "'"));
+ }
}
if (url == null)
{
// We assume that the path is an eXo standard path
url = cm.getURL(path);
+ if (ConfigurationManager.LOG_DEBUG)
+ {
+ log.info("Trying to retrieve the external settings from the url
'" + url
+ + "', it will be used as external settings of the "
+ + (isPath4DefaultPCD ? "default portal container" :
"portal container '" + def.getName() + "'"));
+ }
}
// We load the properties from the url found
return ContainerUtil.loadProperties(url, false);
Modified:
kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/monitor/jvm/J2EEServerInfo.java
===================================================================
---
kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/monitor/jvm/J2EEServerInfo.java 2010-04-30
14:53:46 UTC (rev 2346)
+++
kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/monitor/jvm/J2EEServerInfo.java 2010-04-30
18:16:15 UTC (rev 2347)
@@ -18,6 +18,9 @@
*/
package org.exoplatform.container.monitor.jvm;
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.log.Log;
+
import java.io.File;
import java.lang.management.ManagementFactory;
import java.lang.reflect.Method;
@@ -32,6 +35,10 @@
*/
public class J2EEServerInfo
{
+ /**
+ * The logger
+ */
+ private static final Log log =
ExoLogger.getLogger("exo.kernel.container.J2EEServerInfo");
/**
* The name of the JVM parameter that allows us to change the location of the
@@ -158,7 +165,7 @@
String exoConfHome = System.getProperty(EXO_CONF_PARAM);
if (exoConfHome != null && exoConfHome.length() > 0)
{
- System.out.println("[INFO] Override exo-conf directory '" +
exoConfDir_ + "' with location '" + exoConfHome
+ log.info("Override exo-conf directory '" + exoConfDir_ +
"' with location '" + exoConfHome
+ "'");
exoConfDir_ = exoConfHome;
}
Modified:
kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/util/ContainerUtil.java
===================================================================
---
kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/util/ContainerUtil.java 2010-04-30
14:53:46 UTC (rev 2346)
+++
kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/util/ContainerUtil.java 2010-04-30
18:16:15 UTC (rev 2347)
@@ -227,8 +227,8 @@
//
if (url != null)
{
+ path = url.getPath();
in = url.openStream();
- path = url.getPath();
}
//
Show replies by date