Author: rareddy
Date: 2009-09-23 17:09:17 -0400 (Wed, 23 Sep 2009)
New Revision: 1473
Modified:
trunk/connectors/sandbox/connector-exec/pom.xml
trunk/connectors/sandbox/connector-exec/src/main/java/com/metamatrix/connector/exec/ExecAntExecution.java
trunk/connectors/sandbox/connector-exec/src/main/java/com/metamatrix/connector/exec/ExecConnector.java
trunk/connectors/sandbox/connector-exec/src/test/java/com/metamatrix/connector/exec/FakeExecConnector.java
Log:
TEIID-854: Removing the server dependency
Modified: trunk/connectors/sandbox/connector-exec/pom.xml
===================================================================
--- trunk/connectors/sandbox/connector-exec/pom.xml 2009-09-23 20:35:59 UTC (rev 1472)
+++ trunk/connectors/sandbox/connector-exec/pom.xml 2009-09-23 21:09:17 UTC (rev 1473)
@@ -31,10 +31,5 @@
<artifactId>teiid-common-internal</artifactId>
<scope>compile</scope>
</dependency>
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-server</artifactId>
- <version>${project.version}</version>
- </dependency>
</dependencies>
</project>
\ No newline at end of file
Modified:
trunk/connectors/sandbox/connector-exec/src/main/java/com/metamatrix/connector/exec/ExecAntExecution.java
===================================================================
---
trunk/connectors/sandbox/connector-exec/src/main/java/com/metamatrix/connector/exec/ExecAntExecution.java 2009-09-23
20:35:59 UTC (rev 1472)
+++
trunk/connectors/sandbox/connector-exec/src/main/java/com/metamatrix/connector/exec/ExecAntExecution.java 2009-09-23
21:09:17 UTC (rev 1473)
@@ -52,13 +52,9 @@
import org.teiid.connector.language.IQuery;
import org.teiid.connector.metadata.runtime.RuntimeMetadata;
-import com.metamatrix.common.config.CurrentConfiguration;
-import com.metamatrix.common.config.api.Host;
-import com.metamatrix.common.util.CommonPropertyNames;
import com.metamatrix.common.util.OSPlatformUtil;
import com.metamatrix.core.util.Assertion;
import com.metamatrix.core.util.StringUtil;
-import com.metamatrix.core.util.TempDirectory;
/**
* Represents the execution of a command.
Modified:
trunk/connectors/sandbox/connector-exec/src/main/java/com/metamatrix/connector/exec/ExecConnector.java
===================================================================
---
trunk/connectors/sandbox/connector-exec/src/main/java/com/metamatrix/connector/exec/ExecConnector.java 2009-09-23
20:35:59 UTC (rev 1472)
+++
trunk/connectors/sandbox/connector-exec/src/main/java/com/metamatrix/connector/exec/ExecConnector.java 2009-09-23
21:09:17 UTC (rev 1473)
@@ -36,11 +36,6 @@
import org.teiid.connector.api.ExecutionContext;
import org.teiid.connector.basic.BasicConnector;
-import com.metamatrix.api.exception.MetaMatrixComponentException;
-import com.metamatrix.common.extensionmodule.ExtensionModuleManager;
-import com.metamatrix.common.extensionmodule.exception.ExtensionModuleNotFoundException;
-import com.metamatrix.core.util.ObjectConverterUtil;
-
/**
* Implementation of text connector.
*/
@@ -93,44 +88,23 @@
return new ExecConnection(this.env, exclusionList);
}
- protected void loadExclusionFile(String file)
- throws ConnectorException
-{
- try
- {
- if (!ExtensionModuleManager.getInstance().isSourceInUse(file)) {
- return;
- }
- byte data[] = ExtensionModuleManager.getInstance().getSource(file);
- java.io.InputStream is = ObjectConverterUtil.convertToInputStream(data);
- Properties props = new Properties();
- props.load(is);
- exclusionList = new ArrayList(props.size());
- String key;
- for(Iterator it = props.keySet().iterator(); it.hasNext();
exclusionList.add(((String)props.get(key)).trim().toLowerCase()))
- {
- key = (String)it.next();
- logger.logInfo("Exec Connector - exclude: " +
props.get(key));//$NON-NLS-1$
- }
+ protected void loadExclusionFile(String file) throws ConnectorException {
+ try {
+ Properties props = new Properties();
+ props.load(Thread.currentThread().getContextClassLoader().getResourceAsStream(file));
+ exclusionList = new ArrayList(props.size());
+ String key;
+ for (Iterator it = props.keySet().iterator(); it.hasNext();
exclusionList.add(((String) props.get(key)).trim().toLowerCase())) {
+ key = (String) it.next();
+ logger.logInfo("Exec Connector - exclude: " +
props.get(key));//$NON-NLS-1$
+ }
- }
- catch(IOException err)
- {
- throw new ConnectorException(err,
ExecPlugin.Util.getString("ExecConnector.Error_loading_exclusion_properties",
file)); //$NON-NLS-1$
- }
- catch(ExtensionModuleNotFoundException err)
- {
- throw new
ConnectorException(ExecPlugin.Util.getString("ExecConnector.Exclusion_file_not_found",
file)); //$NON-NLS-1$
- }
- catch(MetaMatrixComponentException err1)
- {
- throw new ConnectorException(err1,
ExecPlugin.Util.getString("ExecConnector.Unable_to_load_extension_module",
file)); //$NON-NLS-1$
- }
-}
+ } catch (IOException err) {
+ throw new ConnectorException(err,
ExecPlugin.Util.getString("ExecConnector.Error_loading_exclusion_properties",
file)); //$NON-NLS-1$
+ }
+ }
protected void setExclusionList(List list) {
this.exclusionList = new ArrayList(list);
}
-
-
}
Modified:
trunk/connectors/sandbox/connector-exec/src/test/java/com/metamatrix/connector/exec/FakeExecConnector.java
===================================================================
---
trunk/connectors/sandbox/connector-exec/src/test/java/com/metamatrix/connector/exec/FakeExecConnector.java 2009-09-23
20:35:59 UTC (rev 1472)
+++
trunk/connectors/sandbox/connector-exec/src/test/java/com/metamatrix/connector/exec/FakeExecConnector.java 2009-09-23
21:09:17 UTC (rev 1473)
@@ -31,39 +31,26 @@
import org.teiid.connector.api.ConnectorException;
-/**
- * Implmentation of text connector.
- */
-public class FakeExecConnector extends ExecConnector {
-
-
+public class FakeExecConnector extends ExecConnector {
- protected void loadExclusionFile(String file)
- throws ConnectorException
-{
- try
- {
- FileInputStream is = new FileInputStream(file);
-//
-// byte data[] = ExtensionModuleManager.getInstance().getSource(file);
-// java.io.InputStream is = ObjectConverterUtil.convertToInputStream(data);
- Properties props = new Properties();
- props.load(is);
- List exclusionList = new ArrayList(props.size());
- String key;
- for(Iterator it = props.keySet().iterator(); it.hasNext();
exclusionList.add(((String)props.get(key)).trim().toLowerCase()))
- {
- key = (String)it.next();
- }
- this.setExclusionList(exclusionList);
+ protected void loadExclusionFile(String file) throws ConnectorException {
+ try {
+ FileInputStream is = new FileInputStream(file);
+ //
+ Properties props = new Properties();
+ props.load(is);
+ List exclusionList = new ArrayList(props.size());
+ String key;
+ for (Iterator it = props.keySet().iterator(); it.hasNext();
exclusionList.add(((String) props.get(key)).trim().toLowerCase())) {
+ key = (String) it.next();
+ }
+ this.setExclusionList(exclusionList);
- }
- catch(IOException err)
- {
- throw new ConnectorException(err,
ExecPlugin.Util.getString("ExecConnector.Error_loading_exclusion_properties",
file)); //$NON-NLS-1$
- }
-}
+ } catch (IOException err) {
+ throw new ConnectorException(err,
ExecPlugin.Util.getString("ExecConnector.Error_loading_exclusion_properties",
file)); //$NON-NLS-1$
+ }
+ }
}