[jboss-svn-commits] JBL Code SVN: r9312 - labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/common.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Sat Feb 3 17:16:36 EST 2007


Author: mark.little at jboss.com
Date: 2007-02-03 17:16:36 -0500 (Sat, 03 Feb 2007)
New Revision: 9312

Modified:
   labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/common/ModulePropertyManager.java
Log:
http://jira.jboss.com/jira/browse/JBESB-394

Modified: labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/common/ModulePropertyManager.java
===================================================================
--- labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/common/ModulePropertyManager.java	2007-02-03 21:52:10 UTC (rev 9311)
+++ labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/common/ModulePropertyManager.java	2007-02-03 22:16:36 UTC (rev 9312)
@@ -33,7 +33,13 @@
 
 import java.util.Hashtable;
 
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.FatalError;
+import org.jboss.soa.esb.common.Environment;
+import org.jboss.soa.esb.common.ModulePropertyManager;
+
 import com.arjuna.common.internal.util.propertyservice.plugins.io.XMLFilePlugin;
+import com.arjuna.common.util.exceptions.LoadPropertiesException;
 import com.arjuna.common.util.propertyservice.PropertyManager;
 import com.arjuna.common.util.propertyservice.PropertyManagerFactory;
 
@@ -72,25 +78,23 @@
  */
 public class ModulePropertyManager
 {
-	
+
 	/*
 	 * The names of the various modules in the property file.
 	 */
 
 	public static final String CORE_MODULE = "core";
-	
+
 	public static final String CONNECTION_MODULE = "connection";
-	
+
 	public static final String REGISTRY_MODULE = "registry";
 
 	public static final String TRANSPORTS_MODULE = "transports";
-	
+
 	public static final String DBSTORE_MODULE = "dbstore";
-	
+
 	public static final String ROUTER_MODULE = "messagerouting";
 
-	
-
 	/**
 	 * Get the property manager responsible for the module component in the
 	 * file.
@@ -110,7 +114,8 @@
 			{
 				theManager = initialise(name);
 
-				if (theManager != null) {
+				if (theManager != null)
+				{
 					managers.put(name, theManager);
 				}
 			}
@@ -129,31 +134,53 @@
 		 * for verbose output from the PropertyManager.
 		 */
 
-		PropertyManager propertyManager = PropertyManagerFactory
-				.getPropertyManager(
-						"org.jboss.soa.esb.propertymanager." + name, name);
-
-		String propertiesFilename = System.getProperty(
-				Environment.PROPERTIES_FILE, Environment.DEFAULT_PROPERTY_FILE);
-
-		/*
-		 * Does not cause reloading of the same file over and over. Once it is loaded,
-		 * subsequent attempts to reload are ignored internally.
-		 */
-		
 		try
 		{
-			propertyManager.load(XMLFilePlugin.class.getName(),
-					propertiesFilename);
-		} catch (Exception e)
+			PropertyManager propertyManager = PropertyManagerFactory
+					.getPropertyManager(
+							"org.jboss.soa.esb.propertymanager." + name, name);
+	
+			String propertiesFilename = System.getProperty(
+					Environment.PROPERTIES_FILE, Environment.DEFAULT_PROPERTY_FILE);
+	
+			/*
+			 * Does not cause reloading of the same file over and over. Once it is
+			 * loaded, subsequent attempts to reload are ignored internally.
+			 */
+	
+			try
+			{
+				propertyManager.load(XMLFilePlugin.class.getName(),
+						propertiesFilename);
+			}
+			catch (LoadPropertiesException ex)
+			{
+				_logger.fatal("ModulePropertyManager failed to load property file "+propertiesFilename);
+				
+				throw new FatalError(ex);
+			}
+			catch (ClassNotFoundException e)
+			{
+				// something seriously wrong; better to terminate.
+				
+				_logger.fatal("ModulePropertyManager failed to load XML plugin", e);
+				
+				throw new FatalError(e);
+			}
+	
+			return propertyManager;
+		}
+		catch (Exception e)
 		{
-			e.printStackTrace();
-
-			return null;
+			// something seriously wrong; better to terminate.
+			
+			_logger.fatal("ModulePropertyManager failed to load PropertyManager", e);
+			
+			throw new FatalError(e);
 		}
-
-		return propertyManager;
 	}
 
 	private static Hashtable<String, PropertyManager> managers = new Hashtable<String, PropertyManager>();
+	
+	private static Logger _logger = Logger.getLogger(ModulePropertyManager.class);
 }




More information about the jboss-svn-commits mailing list