[teiid-commits] teiid SVN: r4194 - trunk/runtime/src/main/java/org/teiid/deployers.

teiid-commits at lists.jboss.org teiid-commits at lists.jboss.org
Thu Jun 21 12:50:24 EDT 2012


Author: shawkins
Date: 2012-06-21 12:50:23 -0400 (Thu, 21 Jun 2012)
New Revision: 4194

Modified:
   trunk/runtime/src/main/java/org/teiid/deployers/VDBRepository.java
   trunk/runtime/src/main/java/org/teiid/deployers/VDBStatusChecker.java
Log:
TEIID-2062 corrections to the runtime error handling

Modified: trunk/runtime/src/main/java/org/teiid/deployers/VDBRepository.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/deployers/VDBRepository.java	2012-06-21 11:44:43 UTC (rev 4193)
+++ trunk/runtime/src/main/java/org/teiid/deployers/VDBRepository.java	2012-06-21 16:50:23 UTC (rev 4194)
@@ -294,6 +294,7 @@
 					}
 				}
 			} 
+			validateDataSources(metadataAwareVDB);
 			metadataAwareVDB.setStatus(Status.ACTIVE);
 			LogManager.logInfo(LogConstants.CTX_RUNTIME, RuntimePlugin.Util.gs(RuntimePlugin.Event.TEIID40003,name, version, metadataAwareVDB.getStatus()));
 			notifyFinished(name, version, v);

Modified: trunk/runtime/src/main/java/org/teiid/deployers/VDBStatusChecker.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/deployers/VDBStatusChecker.java	2012-06-21 11:44:43 UTC (rev 4193)
+++ trunk/runtime/src/main/java/org/teiid/deployers/VDBStatusChecker.java	2012-06-21 16:50:23 UTC (rev 4194)
@@ -21,12 +21,12 @@
  */
 package org.teiid.deployers;
 
-import java.util.LinkedList;
+import java.util.ArrayList;
+import java.util.List;
 import java.util.concurrent.Executor;
 
 import org.teiid.adminapi.AdminProcessingException;
 import org.teiid.adminapi.Model;
-import org.teiid.adminapi.VDB;
 import org.teiid.adminapi.impl.ModelMetaData;
 import org.teiid.adminapi.impl.VDBMetaData;
 import org.teiid.adminapi.impl.VDBTranslatorMetaData;
@@ -83,8 +83,7 @@
 			
 			boolean dsReplaced = false;
 			if (!cm.getConnectionName().equals(dsName)){
-				String msg = RuntimePlugin.Util.gs(RuntimePlugin.Event.TEIID40076, vdb.getName(), vdb.getVersion(), model.getSourceTranslatorName(sourceName), dsName);
-				model.addRuntimeError(msg);
+				LogManager.logInfo(LogConstants.CTX_RUNTIME, RuntimePlugin.Util.gs(RuntimePlugin.Event.TEIID40076, vdb.getName(), vdb.getVersion(), model.getSourceTranslatorName(sourceName), dsName));
 				cm = new ConnectorManager(translatorName, dsName); 
 				cm.setExecutionFactory(ef);
 				cmr.addConnectorManager(sourceName, cm);
@@ -118,11 +117,8 @@
 	}
 
 	public void resourceAdded(String resourceName, boolean translator) {
+		List<Runnable> runnables = new ArrayList<Runnable>();
 		for (VDBMetaData vdb:getVDBRepository().getVDBs()) {
-			if (vdb.getStatus() == VDB.Status.ACTIVE) {
-				continue;
-			}
-			LinkedList<Runnable> runnables = new LinkedList<Runnable>();
 			synchronized (vdb) {
 				ConnectorManagerRepository cmr = vdb.getAttachment(ConnectorManagerRepository.class);
 				
@@ -152,19 +148,14 @@
 					}
 				}
 	
-				boolean valid = true;
-				for (ModelMetaData model:vdb.getModelMetaDatas().values()) {
-					if (model.hasRuntimeErrors()) {
-						valid = false;
-						break;
-					}
-				}
+				boolean valid = !vdb.hasErrors();
 				
 				if (!runnables.isEmpty()) {
 					//the task themselves will set the status on completion/failure
 					for (Runnable runnable : runnables) {						
 						getExecutor().execute(runnable);
 					}
+					runnables.clear();
 				} else if (valid) {
 					LogManager.logInfo(LogConstants.CTX_RUNTIME, RuntimePlugin.Util.gs(RuntimePlugin.Event.TEIID40003,vdb.getName(), vdb.getVersion(), vdb.getStatus()));
 				}



More information about the teiid-commits mailing list