Author: shawkins
Date: 2011-12-01 12:18:20 -0500 (Thu, 01 Dec 2011)
New Revision: 3712
Modified:
branches/7.6.x/runtime/src/main/java/org/teiid/deployers/VDBDeployer.java
branches/7.6.x/runtime/src/main/java/org/teiid/deployers/VDBStatusChecker.java
Log:
TEIID-1832 allowing vdb specific translators to be assigned as well
Modified: branches/7.6.x/runtime/src/main/java/org/teiid/deployers/VDBDeployer.java
===================================================================
--- branches/7.6.x/runtime/src/main/java/org/teiid/deployers/VDBDeployer.java 2011-12-01
02:03:44 UTC (rev 3711)
+++ branches/7.6.x/runtime/src/main/java/org/teiid/deployers/VDBDeployer.java 2011-12-01
17:18:20 UTC (rev 3712)
@@ -79,7 +79,7 @@
TranslatorRepository repo = new TranslatorRepository();
ConnectorManagerRepository cmr = new ConnectorManagerRepository();
-
+ deployment.addAttchment(TranslatorRepository.class, repo);
boolean preview = deployment.isPreview();
if (!preview) {
Modified: branches/7.6.x/runtime/src/main/java/org/teiid/deployers/VDBStatusChecker.java
===================================================================
---
branches/7.6.x/runtime/src/main/java/org/teiid/deployers/VDBStatusChecker.java 2011-12-01
02:03:44 UTC (rev 3711)
+++
branches/7.6.x/runtime/src/main/java/org/teiid/deployers/VDBStatusChecker.java 2011-12-01
17:18:20 UTC (rev 3712)
@@ -98,7 +98,17 @@
if (!cm.getTranslatorName().equals(translatorName)) {
try {
- Translator t = this.translatorRepository.getTranslatorMetaData(translatorName);
+ TranslatorRepository repo = vdb.getAttachment(TranslatorRepository.class);
+ Translator t = null;
+ if (repo != null) {
+ t = repo.getTranslatorMetaData(translatorName);
+ }
+ if (t == null) {
+ t = this.translatorRepository.getTranslatorMetaData(translatorName);
+ }
+ if (t == null) {
+ throw new
DeploymentException(RuntimePlugin.Util.getString("translator_not_found",
vdb.getName(), vdb.getVersion(), translatorName)); //$NON-NLS-1$
+ }
ef = TranslatorUtil.buildExecutionFactory(t);
cm.setExecutionFactory(ef);
} catch (DeploymentException e) {
Show replies by date