[teiid-commits] teiid SVN: r1936 - in trunk: engine/src/main/resources/com/metamatrix/dqp and 2 other directories.

teiid-commits at lists.jboss.org teiid-commits at lists.jboss.org
Mon Mar 8 16:08:41 EST 2010


Author: rareddy
Date: 2010-03-08 16:08:40 -0500 (Mon, 08 Mar 2010)
New Revision: 1936

Removed:
   trunk/runtime/src/main/java/com/metamatrix/platform/security/membership/
Modified:
   trunk/engine/src/main/java/org/teiid/dqp/internal/process/CachedFinder.java
   trunk/engine/src/main/resources/com/metamatrix/dqp/i18n.properties
   trunk/runtime/src/main/java/org/teiid/deployers/VDBDeployer.java
Log:
TEIID-833: JAXB parser was deleting the implicitly added the "SYS" model in the VDBMetadata object at the unmarshell time.  Circumvent this by adding the "SYS" model during the deployment of the VDB. Also fix a possible NPE in the cached finder.

Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/CachedFinder.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/CachedFinder.java	2010-03-08 21:03:19 UTC (rev 1935)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/CachedFinder.java	2010-03-08 21:08:40 UTC (rev 1936)
@@ -33,6 +33,7 @@
 
 import com.metamatrix.api.exception.MetaMatrixComponentException;
 import com.metamatrix.core.CoreConstants;
+import com.metamatrix.dqp.DQPPlugin;
 import com.metamatrix.query.optimizer.capabilities.BasicSourceCapabilities;
 import com.metamatrix.query.optimizer.capabilities.CapabilitiesFinder;
 import com.metamatrix.query.optimizer.capabilities.SourceCapabilities;
@@ -71,6 +72,9 @@
         for (String sourceName:model.getSourceNames()) {
         	try {
         		ConnectorManager mgr = this.connectorRepo.getConnectorManager(model.getSourceJndiName(sourceName));
+        		if (mgr == null) {
+        			throw new ConnectorException(DQPPlugin.Util.getString("CachedFinder.no_connector_found", model.getSourceJndiName(sourceName), modelName, sourceName));
+        		}
         		caps = mgr.getCapabilities();
         		break;
             } catch(ConnectorException e) {

Modified: trunk/engine/src/main/resources/com/metamatrix/dqp/i18n.properties
===================================================================
--- trunk/engine/src/main/resources/com/metamatrix/dqp/i18n.properties	2010-03-08 21:03:19 UTC (rev 1935)
+++ trunk/engine/src/main/resources/com/metamatrix/dqp/i18n.properties	2010-03-08 21:08:40 UTC (rev 1936)
@@ -514,4 +514,5 @@
 TransformationMetadata.Invalid_type=Invalid type: {0}.
 TransformationMetadata.Unable_to_determine_fullname_for_element__1=Unable to determine fullname for element
 
-CachedRequestWorkItem.not_available=Cache result is no longer available.
\ No newline at end of file
+CachedRequestWorkItem.not_available=Cache result is no longer available.
+CachedFinder.no_connector_found=No connector with jndi-name {0} found for Model {1} with source name {2} 
\ No newline at end of file

Modified: trunk/runtime/src/main/java/org/teiid/deployers/VDBDeployer.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/deployers/VDBDeployer.java	2010-03-08 21:03:19 UTC (rev 1935)
+++ trunk/runtime/src/main/java/org/teiid/deployers/VDBDeployer.java	2010-03-08 21:08:40 UTC (rev 1936)
@@ -85,10 +85,15 @@
 			throw new DeploymentException("VDB has validaity errors; failed to deploy");
 		}
 		
-		this.vdbRepository.addVDB(deployment);
+		// Add system model to the deployed VDB
+		ModelMetaData system = new ModelMetaData();
+		system.setName(CoreConstants.SYSTEM_MODEL);
+		system.setVisible(true);
+		system.setModelType(Model.Type.PHYSICAL.name());
+		system.addSourceMapping("system", "system");
+		system.setSupportsMultiSourceBindings(false);
+		deployment.addModel(system);
 		
-		TransformationMetadata metadata = null;
-		
 		// get the metadata store of the VDB (this is build in parse stage)
 		CompositeMetadataStore store = unit.getAttachment(CompositeMetadataStore.class);
 		
@@ -106,6 +111,7 @@
 		}
 		
 		// check if this is a VDB with index files, if there are then build the TransformationMetadata
+		TransformationMetadata metadata = null;
 		IndexMetadataFactory indexFactory = unit.getAttachment(IndexMetadataFactory.class);
 		UDFMetaData udf = unit.getAttachment(UDFMetaData.class);
 		if (indexFactory != null) {
@@ -126,6 +132,7 @@
 		// add transformation metadata to the repository.
 		this.vdbRepository.addMetadata(deployment, metadata);
 		this.vdbRepository.addMetadataStore(deployment, store);
+		this.vdbRepository.addVDB(deployment);
 		
 		try {
 			saveMetadataStore((VFSDeploymentUnit)unit, deployment, metadata.getMetadataStore());



More information about the teiid-commits mailing list