[jboss-svn-commits] JBL Code SVN: r9311 - labs/jbossesb/workspace/mlittle/harden/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 16:52:10 EST 2007
Author: mark.little at jboss.com
Date: 2007-02-03 16:52:10 -0500 (Sat, 03 Feb 2007)
New Revision: 9311
Modified:
labs/jbossesb/workspace/mlittle/harden/product/core/rosetta/src/org/jboss/soa/esb/common/ModulePropertyManager.java
Log:
http://jira.jboss.com/jira/browse/JBESB-394
Modified: labs/jbossesb/workspace/mlittle/harden/product/core/rosetta/src/org/jboss/soa/esb/common/ModulePropertyManager.java
===================================================================
--- labs/jbossesb/workspace/mlittle/harden/product/core/rosetta/src/org/jboss/soa/esb/common/ModulePropertyManager.java 2007-02-03 21:51:37 UTC (rev 9310)
+++ labs/jbossesb/workspace/mlittle/harden/product/core/rosetta/src/org/jboss/soa/esb/common/ModulePropertyManager.java 2007-02-03 21:52:10 UTC (rev 9311)
@@ -33,7 +33,12 @@
import java.util.Hashtable;
+import org.apache.log4j.Logger;
+import org.jboss.internal.soa.esb.listeners.DefaultListenerManager;
+import org.jboss.soa.esb.FatalError;
+
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 +77,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 +113,8 @@
{
theManager = initialise(name);
- if (theManager != null) {
+ if (theManager != null)
+ {
managers.put(name, theManager);
}
}
@@ -126,34 +130,56 @@
* properties file to it.
*
* set com.arjuna.common.util.propertyservice.verbosePropertyManager=ON
- * for verbose output from the PropertyManager.
+ * for verbose output from the PropertyManager on the command line.
*/
- 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