[teiid-commits] teiid SVN: r895 - trunk/server/src/main/java/com/metamatrix/platform/config/service.

teiid-commits at lists.jboss.org teiid-commits at lists.jboss.org
Fri May 8 12:00:00 EDT 2009


Author: vhalbert at redhat.com
Date: 2009-05-08 11:59:59 -0400 (Fri, 08 May 2009)
New Revision: 895

Modified:
   trunk/server/src/main/java/com/metamatrix/platform/config/service/ConfigurationServiceImpl.java
Log:
Teiid 442 - simplifying configuration mechanics, these changes continue that process of seperating to either use the read-only configuration or the transaction config.   Additionally, the addVMComponent method was updated so that it used a method on the object editor that did not pass the configuration as an argument, (instead passed the ConfigurationID) because the read-only version was being updated using that method.    The other method just created the VM without adding it to the current configuration.

Modified: trunk/server/src/main/java/com/metamatrix/platform/config/service/ConfigurationServiceImpl.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/platform/config/service/ConfigurationServiceImpl.java	2009-05-08 14:59:38 UTC (rev 894)
+++ trunk/server/src/main/java/com/metamatrix/platform/config/service/ConfigurationServiceImpl.java	2009-05-08 15:59:59 UTC (rev 895)
@@ -165,7 +165,7 @@
      * @throws ConfigurationException if an error occurred within or during communication with the Configuration Service.
      */
     public Configuration getCurrentConfiguration() throws ConfigurationException {
-        return this.getDesignatedConfiguration();
+        return getReadOnlyConfigurationModel().getConfiguration();
     }
 
     /**
@@ -175,17 +175,11 @@
      * @throws ConfigurationException if an error occurred within or during communication with the Configuration Service.
      */
     public Configuration getNextStartupConfiguration() throws ConfigurationException{
-        return this.getDesignatedConfiguration();
+        return getReadOnlyConfigurationModel().getConfiguration();
     }
 
-    private Configuration getDesignatedConfiguration() throws ConfigurationException {
-        XMLConfigurationConnector transaction = getConnection(null);
-        return transaction.getConfigurationModel().getConfiguration();
-    }
-
     public ConfigurationModelContainer getConfigurationModel(String configName) throws ConfigurationException {
-    	XMLConfigurationConnector transaction = getConnection(null);
-        return transaction.getConfigurationModel();
+         return getReadOnlyConfigurationModel();
 	}
 
     /**
@@ -255,8 +249,8 @@
     }
 
     public Collection getAllComponentTypes(boolean includeDeprecated) throws ConfigurationException {
-		XMLConfigurationConnector transaction = getConnection(null);
-		Map types = transaction.getConfigurationModel().getComponentTypes();
+//		XMLConfigurationConnector transaction = getConnection(null);
+		Map types = getReadOnlyConfigurationModel().getComponentTypes();
 		Collection result = new LinkedList(types.values());
 
 		if (result.size() > 0) {
@@ -637,7 +631,7 @@
             Properties defaultProps = config.getDefaultPropertyValues(VMComponentDefn.VM_COMPONENT_TYPE_ID);
 
             // create defn first
-            processDefn = editor.createVMComponentDefn(config.getConfiguration(),
+            processDefn = editor.createVMComponentDefn((ConfigurationID) config.getConfiguration().getID(),
                                                        (HostID)host.getID(),
                                                        VMComponentDefn.VM_COMPONENT_TYPE_ID,
                                                        processName);




More information about the teiid-commits mailing list