Author: shawkins
Date: 2011-06-02 14:23:22 -0400 (Thu, 02 Jun 2011)
New Revision: 3213
Modified:
branches/7.4.x/api/src/main/java/org/teiid/translator/BaseDelegatingExecutionFactory.java
branches/7.4.x/api/src/main/java/org/teiid/translator/ExecutionFactory.java
branches/7.4.x/engine/src/main/java/org/teiid/dqp/internal/datamgr/ConnectorManager.java
branches/7.4.x/engine/src/main/java/org/teiid/dqp/internal/datamgr/ConnectorWorkItem.java
Log:
TEIID-1585 adding the executioncontext to getconnection
Modified:
branches/7.4.x/api/src/main/java/org/teiid/translator/BaseDelegatingExecutionFactory.java
===================================================================
---
branches/7.4.x/api/src/main/java/org/teiid/translator/BaseDelegatingExecutionFactory.java 2011-06-02
18:05:39 UTC (rev 3212)
+++
branches/7.4.x/api/src/main/java/org/teiid/translator/BaseDelegatingExecutionFactory.java 2011-06-02
18:23:22 UTC (rev 3213)
@@ -111,9 +111,8 @@
return delegate.createUpdateExecution(command, executionContext,
metadata, connection);
}
- @Override
- public C getConnection(F factory) throws TranslatorException {
- return delegate.getConnection(factory);
+ public C getConnection(F factory, ExecutionContext executionContext) throws
TranslatorException {
+ return delegate.getConnection(factory, executionContext);
}
@Override
public NullOrder getDefaultNullOrder() {
Modified: branches/7.4.x/api/src/main/java/org/teiid/translator/ExecutionFactory.java
===================================================================
--- branches/7.4.x/api/src/main/java/org/teiid/translator/ExecutionFactory.java 2011-06-02
18:05:39 UTC (rev 3212)
+++ branches/7.4.x/api/src/main/java/org/teiid/translator/ExecutionFactory.java 2011-06-02
18:23:22 UTC (rev 3213)
@@ -137,8 +137,10 @@
* The default implementation assumes a JCA {@link ConnectionFactory}. Subclasses
should override, if they use
* another type of connection factory.
*
+ * @deprecated
+ * @see #getConnection(Object, ExecutionContext)
* @param factory
- * @return
+ * @return a connection
* @throws TranslatorException
*/
@SuppressWarnings("unchecked")
@@ -157,6 +159,22 @@
}
/**
+ * Return a connection object from the given connection factory.
+ *
+ * The default implementation assumes a JCA {@link ConnectionFactory}. Subclasses
should override, if they use
+ * another type of connection factory or wish to use the {@link ExecutionContext}. By
default calls {@link #getConnection(Object)}
+ *
+ * @param factory
+ * @param executionContext null if this is a system request for a connection
+ * @return a connection
+ * @throws TranslatorException
+ */
+ public C getConnection(F factory,
+ ExecutionContext executionContext) throws TranslatorException {
+ return getConnection(factory);
+ }
+
+ /**
* Closes a connection object from the given connection factory.
*
* The default implementation assumes a JCA {@link Connection}. Subclasses should
override, if they use
@@ -842,4 +860,5 @@
public boolean supportsCommonTableExpressions() {
return false;
}
+
}
Modified:
branches/7.4.x/engine/src/main/java/org/teiid/dqp/internal/datamgr/ConnectorManager.java
===================================================================
---
branches/7.4.x/engine/src/main/java/org/teiid/dqp/internal/datamgr/ConnectorManager.java 2011-06-02
18:05:39 UTC (rev 3212)
+++
branches/7.4.x/engine/src/main/java/org/teiid/dqp/internal/datamgr/ConnectorManager.java 2011-06-02
18:23:22 UTC (rev 3213)
@@ -113,7 +113,7 @@
public MetadataStore getMetadata(String modelName, Map<String, Datatype>
datatypes, Properties importProperties) throws TranslatorException {
MetadataFactory factory = new MetadataFactory(modelName, datatypes, importProperties);
Object connectionFactory = getConnectionFactory();
- Object connection = executionFactory.getConnection(connectionFactory);
+ Object connection = executionFactory.getConnection(connectionFactory, null);
Object unwrapped = null;
if (connection instanceof WrappedConnection) {
Modified:
branches/7.4.x/engine/src/main/java/org/teiid/dqp/internal/datamgr/ConnectorWorkItem.java
===================================================================
---
branches/7.4.x/engine/src/main/java/org/teiid/dqp/internal/datamgr/ConnectorWorkItem.java 2011-06-02
18:05:39 UTC (rev 3212)
+++
branches/7.4.x/engine/src/main/java/org/teiid/dqp/internal/datamgr/ConnectorWorkItem.java 2011-06-02
18:23:22 UTC (rev 3213)
@@ -196,7 +196,7 @@
LogManager.logDetail(LogConstants.CTX_CONNECTOR, new Object[]
{this.requestMsg.getAtomicRequestID(), "Processing NEW request:",
this.requestMsg.getCommand()}); //$NON-NLS-1$
try {
this.connectionFactory = this.manager.getConnectionFactory();
- this.connection = this.connector.getConnection(this.connectionFactory);
+ this.connection = this.connector.getConnection(this.connectionFactory,
securityContext);
Object unwrapped = null;
if (connection instanceof WrappedConnection) {
Show replies by date