[teiid-commits] teiid SVN: r1688 - in branches/JCA: connectors and 25 other directories.

teiid-commits at lists.jboss.org teiid-commits at lists.jboss.org
Mon Dec 21 14:43:34 EST 2009


Author: rareddy
Date: 2009-12-21 14:43:33 -0500 (Mon, 21 Dec 2009)
New Revision: 1688

Added:
   branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/base/XMLBaseManagedConnectionFactory.java
   branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/file/FileManagedConnectionFactory.java
   branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/http/HTTPManagedConnectionFactory.java
   branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/soap/SOAPManagedConnectionFactory.java
   branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xmlsource/XMLSourceManagedConnectionFactory.java
   branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xmlsource/file/FileManagedConnectionFactory.java
   branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xmlsource/soap/SecurityManagedConnectionFactory.java
   branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xmlsource/soap/SoapManagedConnectionFactory.java
   branches/JCA/connectors/connector-xml/src/main/rar/
   branches/JCA/connectors/connector-xml/src/main/rar/META-INF/
   branches/JCA/connectors/connector-xml/src/main/rar/META-INF/xml-file/
   branches/JCA/connectors/connector-xml/src/main/rar/META-INF/xml-file/ra.xml
   branches/JCA/connectors/connector-xml/src/main/rar/META-INF/xml-http/
   branches/JCA/connectors/connector-xml/src/main/rar/META-INF/xml-http/ra.xml
   branches/JCA/connectors/connector-xml/src/main/rar/META-INF/xml-soap/
   branches/JCA/connectors/connector-xml/src/main/rar/META-INF/xml-soap/ra.xml
   branches/JCA/connectors/connector-xml/src/main/rar/META-INF/xmlsource-file/
   branches/JCA/connectors/connector-xml/src/main/rar/META-INF/xmlsource-file/ra.xml
   branches/JCA/connectors/connector-xml/src/main/rar/META-INF/xmlsource-soap/
   branches/JCA/connectors/connector-xml/src/main/rar/META-INF/xmlsource-soap/ra.xml
Modified:
   branches/JCA/connector-api/src/main/java/org/teiid/connector/basic/BasicConnector.java
   branches/JCA/connector-api/src/main/java/org/teiid/connector/basic/BasicManagedConnectionFactory.java
   branches/JCA/connectors/connector-text/src/main/rar/META-INF/ra.xml
   branches/JCA/connectors/connector-xml/pom.xml
   branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/BaseXMLConnectorState.java
   branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/TrustedPayloadHandler.java
   branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/XMLConnection.java
   branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/XMLConnectorState.java
   branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/base/AbstractCachingConnector.java
   branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/base/LoggingConnector.java
   branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/base/SecureConnectorStateImpl.java
   branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/base/TrustedPayloadBridge.java
   branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/base/XMLConnectionImpl.java
   branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/base/XMLConnector.java
   branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/base/XMLConnectorStateImpl.java
   branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/file/FileConnectionImpl.java
   branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/file/FileConnectorState.java
   branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/http/DefaultTrustDeserializer.java
   branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/http/HTTPConnectionImpl.java
   branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/http/HTTPConnectorState.java
   branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/http/HTTPRequest.java
   branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/http/HTTPTrustDeserializer.java
   branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/soap/DefaultSoapTrustDeserializer.java
   branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/soap/SOAPConnectionImpl.java
   branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/soap/SOAPConnectorState.java
   branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/soap/SOAPConnectorStateImpl.java
   branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/soap/SOAPRequest.java
   branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xmlsource/XMLConnectionFacory.java
   branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xmlsource/XMLSourceConnector.java
   branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xmlsource/file/FileConnection.java
   branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xmlsource/file/FileExecution.java
   branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xmlsource/soap/SecurityToken.java
   branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xmlsource/soap/ServiceOperation.java
   branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xmlsource/soap/SoapConnection.java
   branches/JCA/connectors/connector-xml/src/test/java/com/metamatrix/connector/xml/TestCachingFileConnector.java
   branches/JCA/connectors/connector-xml/src/test/java/com/metamatrix/connector/xml/TestElementCollector.java
   branches/JCA/connectors/connector-xml/src/test/java/com/metamatrix/connector/xml/TestXMLReaderFactory.java
   branches/JCA/connectors/connector-xml/src/test/java/com/metamatrix/connector/xml/base/ProxyObjectFactory.java
   branches/JCA/connectors/connector-xml/src/test/java/com/metamatrix/connector/xml/base/TestXMLConnection.java
   branches/JCA/connectors/connector-xml/src/test/java/com/metamatrix/connector/xml/base/TestXMLConnector.java
   branches/JCA/connectors/connector-xml/src/test/java/com/metamatrix/connector/xml/base/TestXMLConnectorState.java
   branches/JCA/connectors/connector-xml/src/test/java/com/metamatrix/connector/xml/file/TestCachingFileConnectorLong.java
   branches/JCA/connectors/connector-xml/src/test/java/com/metamatrix/connector/xml/file/TestFileConnector.java
   branches/JCA/connectors/connector-xml/src/test/java/com/metamatrix/connector/xml/file/TestFileConnectorLong.java
   branches/JCA/connectors/connector-xml/src/test/java/com/metamatrix/connector/xml/file/TestFileConnectorState.java
   branches/JCA/connectors/connector-xml/src/test/java/com/metamatrix/connector/xml/http/TestHTTPConnectorState.java
   branches/JCA/connectors/connector-xml/src/test/java/com/metamatrix/connector/xmlsource/file/TestFileConnection.java
   branches/JCA/connectors/connector-xml/src/test/java/com/metamatrix/connector/xmlsource/file/TestFileExecution.java
   branches/JCA/connectors/connector-xml/src/test/java/com/metamatrix/connector/xmlsource/soap/TestSoapConnection.java
   branches/JCA/connectors/connector-xml/src/test/java/com/metamatrix/connector/xmlsource/soap/TestSoapExecution.java
   branches/JCA/connectors/pom.xml
   branches/JCA/connectors/sandbox/connector-object/src/main/java/com/metamatrix/connector/object/ObjectConnector.java
Log:
TEIID-861: Modified the XML Connector to the JCA API. Still packaging is into RAR is pending as the structure of the maven project is not aligned with all the other connectors

Modified: branches/JCA/connector-api/src/main/java/org/teiid/connector/basic/BasicConnector.java
===================================================================
--- branches/JCA/connector-api/src/main/java/org/teiid/connector/basic/BasicConnector.java	2009-12-21 19:41:26 UTC (rev 1687)
+++ branches/JCA/connector-api/src/main/java/org/teiid/connector/basic/BasicConnector.java	2009-12-21 19:43:33 UTC (rev 1688)
@@ -28,7 +28,7 @@
     public ConnectorCapabilities getCapabilities() throws ConnectorException {
     	if (capabilities == null) {
 			// create Capabilities
-    		capabilities = BasicManagedConnectionFactory.getInstance(ConnectorCapabilities.class, this.config.getCapabilitiesClass(), getDefaultCapabilities());
+    		capabilities = BasicManagedConnectionFactory.getInstance(ConnectorCapabilities.class, this.config.getCapabilitiesClass(), null, getDefaultCapabilities());
     	}
     	return capabilities;
 	}    

Modified: branches/JCA/connector-api/src/main/java/org/teiid/connector/basic/BasicManagedConnectionFactory.java
===================================================================
--- branches/JCA/connector-api/src/main/java/org/teiid/connector/basic/BasicManagedConnectionFactory.java	2009-12-21 19:41:26 UTC (rev 1687)
+++ branches/JCA/connector-api/src/main/java/org/teiid/connector/basic/BasicManagedConnectionFactory.java	2009-12-21 19:43:33 UTC (rev 1688)
@@ -23,6 +23,7 @@
 
 import java.io.IOException;
 import java.io.PrintWriter;
+import java.util.Collection;
 import java.util.Properties;
 import java.util.Set;
 
@@ -245,15 +246,15 @@
 		this.overrideCapabilitiesFile = propsFile;
 	}
 	
-    public static <T> T getInstance(Class<T> clazz, String className, Class defaultClass) throws ConnectorException {
+    public static <T> T getInstance(Class<T> expectedType, String className, Collection ctorObjs, Class defaultClass) throws ConnectorException {
     	try {
 	    	if (className == null) {
 	    		if (defaultClass == null) {
 	    			throw new ConnectorException("Neither class name or default class specified to create an instance");
 	    		}
-	    		return clazz.cast(defaultClass.newInstance());
+	    		return expectedType.cast(defaultClass.newInstance());
 	    	}
-	    	return clazz.cast(ReflectionHelper.create(className, null, Thread.currentThread().getContextClassLoader()));
+	    	return expectedType.cast(ReflectionHelper.create(className, ctorObjs, Thread.currentThread().getContextClassLoader()));
 		} catch (MetaMatrixCoreException e) {
 			throw new ConnectorException(e);
 		} catch (IllegalAccessException e) {

Modified: branches/JCA/connectors/connector-text/src/main/rar/META-INF/ra.xml
===================================================================
--- branches/JCA/connectors/connector-text/src/main/rar/META-INF/ra.xml	2009-12-21 19:41:26 UTC (rev 1687)
+++ branches/JCA/connectors/connector-text/src/main/rar/META-INF/ra.xml	2009-12-21 19:43:33 UTC (rev 1688)
@@ -44,7 +44,7 @@
                <description>Connector Class</description>
                <config-property-name>ConnectorClass</config-property-name>
                <config-property-type>java.lang.String</config-property-type>
-               <config-property-value>TextConnector.java.TextConnector</config-property-value>
+               <config-property-value>com.metamatrix.connector.text.TextConnector</config-property-value>
             </config-property>
 
             <config-property>

Modified: branches/JCA/connectors/connector-xml/pom.xml
===================================================================
--- branches/JCA/connectors/connector-xml/pom.xml	2009-12-21 19:41:26 UTC (rev 1687)
+++ branches/JCA/connectors/connector-xml/pom.xml	2009-12-21 19:43:33 UTC (rev 1688)
@@ -11,6 +11,7 @@
 	<artifactId>connector-xml</artifactId>
 	<groupId>org.jboss.teiid.connectors</groupId>
 	<name>XML Connector</name>
+    <packaging>rar</packaging>
 	<description>This connector produces the XML documents from Web
 		service and transforms the document into a relational structure.</description>
 	<dependencies>
@@ -45,100 +46,28 @@
 			<version>${project.version}</version>
 			<type>pom</type>
 		</dependency>
-	</dependencies>
+        <dependency>
+            <groupId>javax.resource</groupId>
+            <artifactId>connector-api</artifactId>
+            <scope>provided</scope>
+        </dependency>         
+    </dependencies>
     
-    <!-- This build portion is identical for all the connectors that are deployed; so when making changes make sure
-    it applies to all the connectors. This below block computes the classpath, writes to classpath.properties; it replaces
-    classpath in the xml file, then bundles current project and its dependencies and xml file in a zip for deployment-->
     <build>
         <plugins>
-            <!-- build class path -->
             <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-dependency-plugin</artifactId>
+                <artifactId>maven-jar-plugin</artifactId>
                 <executions>
                     <execution>
-                        <id>build-classpath</id>
-                        <phase>generate-sources</phase>
+                        <id>build_jar</id>
+                        <phase>process-classes</phase>
                         <goals>
-                            <goal>build-classpath</goal>
+                            <goal>jar</goal>
                         </goals>
-                        <configuration>
-                            <fileSeparator>:</fileSeparator>
-                            <pathSeparator>;</pathSeparator>
-                            <prefix>extensionjar</prefix>
-                            <excludeTransitive>false</excludeTransitive>
-                            <includeScope>runtime</includeScope>
-                            <excludeTypes>pom</excludeTypes>
-                            <outputFile>target/classpath.properties</outputFile>
-                            <regenerateFile>true</regenerateFile>
-                            <outputFilterFile>true</outputFilterFile>
-                        </configuration>
                     </execution>
                 </executions>
             </plugin>
-      
-            <!-- bundles all its dependencies in a single zip file  -->
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-dependency-plugin</artifactId>
-                <executions>
-                    <execution>
-                        <id>copy-dependencies</id>
-                        <phase>generate-sources</phase>
-                        <goals>
-                            <goal>copy-dependencies</goal>
-                        </goals>
-                        <configuration>
-                            <excludeTransitive>false</excludeTransitive>
-                            <includeScope>runtime</includeScope>
-                            <excludeTypes>pom</excludeTypes>
-                            <outputDirectory>target/dependency</outputDirectory>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>             
-            <plugin>
-                <artifactId>maven-assembly-plugin</artifactId>
-                <version>2.2-beta-2</version>
-                <configuration>
-                    <descriptors>
-                        <descriptor>src/assembly/bundle.xml</descriptor>
-                    </descriptors>
-                    <outputDirectory>target/distribution</outputDirectory>
-                    <workDirectory>target/assembly/work</workDirectory>
-                </configuration>
-                <executions>
-                    <execution>
-                        <id>make-assembly</id>
-                        <phase>package</phase>
-                        <goals>
-                            <goal>single</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
         </plugins>
-        <!-- replaces the classpath tokens in the xml file -->
-        <filters>
-            <filter>target/classpath.properties</filter>
-        </filters>
-        <resources>
-            <resource>
-                <directory>src/main/resources</directory>
-                <filtering>true</filtering>
-                <includes>
-                    <include>**/*.xml</include>
-                </includes>
-            </resource>
-            <resource>
-                <directory>src/main/resources</directory>
-                <filtering>false</filtering>
-                <excludes>
-                    <exclude>**/*.xml</exclude>
-                </excludes>
-            </resource>            
-        </resources>
-    </build>
+    </build>   
         
 </project>
\ No newline at end of file

Modified: branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/BaseXMLConnectorState.java
===================================================================
--- branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/BaseXMLConnectorState.java	2009-12-21 19:41:26 UTC (rev 1687)
+++ branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/BaseXMLConnectorState.java	2009-12-21 19:43:33 UTC (rev 1688)
@@ -25,15 +25,16 @@
 package com.metamatrix.connector.xml;
 
 
-import org.teiid.connector.api.ConnectorEnvironment;
 import org.teiid.connector.api.ConnectorException;
 import org.teiid.connector.api.ConnectorLogger;
+
+import com.metamatrix.connector.xml.base.XMLBaseManagedConnectionFactory;
 
 public interface BaseXMLConnectorState {
 
 	public abstract java.util.Properties getState();
 
-	public abstract void setState(ConnectorEnvironment env) throws ConnectorException;
+	public abstract void setState(XMLBaseManagedConnectionFactory env) throws ConnectorException;
 	
 	public abstract void setLogger(ConnectorLogger logger);
 

Modified: branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/TrustedPayloadHandler.java
===================================================================
--- branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/TrustedPayloadHandler.java	2009-12-21 19:41:26 UTC (rev 1687)
+++ branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/TrustedPayloadHandler.java	2009-12-21 19:43:33 UTC (rev 1688)
@@ -24,7 +24,7 @@
 
 package com.metamatrix.connector.xml;
 
-import java.io.Serializable;
+import javax.security.auth.Subject;
 
 import org.teiid.connector.api.ConnectorEnvironment;
 import org.teiid.connector.api.ConnectorLogger;
@@ -38,14 +38,10 @@
 	
 	public void setLogger(ConnectorLogger logger);
 	
-	public void setTrustedPayload(Serializable payload);
-	
-	public void setExecutionPayload(Serializable payload);
-	
+	public void setSubject(Subject subject);
+		
 	public void setConnectorEnvironment(ConnectorEnvironment connEnv);
 	
-	public void setConnectorName(String name);
-	
 	public void processPayloads() throws Exception;
 
 	public void setUser(String userName);

Modified: branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/XMLConnection.java
===================================================================
--- branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/XMLConnection.java	2009-12-21 19:41:26 UTC (rev 1687)
+++ branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/XMLConnection.java	2009-12-21 19:43:33 UTC (rev 1688)
@@ -25,20 +25,15 @@
 package com.metamatrix.connector.xml;
 
 import org.teiid.connector.api.Connection;
-import org.teiid.connector.api.ConnectorEnvironment;
 import org.teiid.connector.api.ConnectorException;
+
+import com.metamatrix.connector.xml.base.XMLBaseManagedConnectionFactory;
 
 public interface XMLConnection extends Connection {
 
 	public XMLConnectorState getState();
 
-	public CachingConnector getConnector();
-
-	public TrustedPayloadHandler getTrustedPayloadHandler() throws ConnectorException;
-
-	public String getQueryId();
-
-	public String getUser();
-
-	public ConnectorEnvironment getConnectorEnv();
+	public XMLBaseManagedConnectionFactory getConnectorEnv();
+	
+	public TrustedPayloadHandler getTrustedPayloadHandler() throws ConnectorException;
 }

Modified: branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/XMLConnectorState.java
===================================================================
--- branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/XMLConnectorState.java	2009-12-21 19:41:26 UTC (rev 1687)
+++ branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/XMLConnectorState.java	2009-12-21 19:43:33 UTC (rev 1688)
@@ -25,9 +25,7 @@
 
 import org.teiid.connector.api.Connection;
 import org.teiid.connector.api.ConnectorCapabilities;
-import org.teiid.connector.api.ConnectorEnvironment;
 import org.teiid.connector.api.ConnectorException;
-import org.teiid.connector.api.ExecutionContext;
 
 public interface XMLConnectorState extends BaseXMLConnectorState {
 
@@ -43,8 +41,7 @@
 
 	public abstract IQueryPreprocessor getPreprocessor();
 
-	public abstract Connection getConnection(CachingConnector connector,
-			ExecutionContext context, ConnectorEnvironment environment)
+	public abstract Connection getConnection(CachingConnector connector)
 			throws ConnectorException;
 
 	public String getPluggableInputStreamFilterClass();

Modified: branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/base/AbstractCachingConnector.java
===================================================================
--- branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/base/AbstractCachingConnector.java	2009-12-21 19:41:26 UTC (rev 1687)
+++ branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/base/AbstractCachingConnector.java	2009-12-21 19:43:33 UTC (rev 1688)
@@ -38,8 +38,8 @@
 	}
 
 	@Override
-	public void start(ConnectorEnvironment env) throws ConnectorException {
-		super.start(env);
+	public void initialize(ConnectorEnvironment env) throws ConnectorException {
+		super.initialize(env);
 	}
 
 	public void stop()

Modified: branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/base/LoggingConnector.java
===================================================================
--- branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/base/LoggingConnector.java	2009-12-21 19:41:26 UTC (rev 1687)
+++ branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/base/LoggingConnector.java	2009-12-21 19:43:33 UTC (rev 1688)
@@ -33,20 +33,17 @@
 public abstract class LoggingConnector extends BasicConnector implements StatefulConnector {
 
 	protected ConnectorLogger m_logger;
-    protected ConnectorEnvironment m_environment;
+    protected XMLBaseManagedConnectionFactory m_environment;
     protected XMLConnectorState m_state;
     
-    /* (non-Javadoc)
-	 * @see com.metamatrix.connector.xml.base.StatefulConnector#initialize(com.metamatrix.data.api.ConnectorEnvironment)
-	 */
     @Override
-	public void start(ConnectorEnvironment environment) throws ConnectorException {
+	public void initialize(ConnectorEnvironment environment) throws ConnectorException {
     	m_logger = environment.getLogger();
-    	m_environment = environment;
+    	m_environment = (XMLBaseManagedConnectionFactory)environment;
     	m_state = createState(m_environment);
     }
     
-    /* (non-Javadoc)
+    /**
 	 * @see com.metamatrix.connector.xml.base.StatefulConnector#getLogger()
 	 */
     public ConnectorLogger getLogger() {
@@ -56,7 +53,7 @@
     /* (non-Javadoc)
 	 * @see com.metamatrix.connector.xml.base.StatefulConnector#getEnvironment()
 	 */
-    public ConnectorEnvironment getEnvironment() {
+    public XMLBaseManagedConnectionFactory getEnvironment() {
         return m_environment;
     }
     
@@ -67,8 +64,8 @@
 		return m_state;
 	}
     
-	private XMLConnectorState createState(ConnectorEnvironment env) throws ConnectorException {		
-		String stateClassName = env.getProperties().getProperty(XMLConnectorState.STATE_CLASS_PROP);
+	private XMLConnectorState createState(XMLBaseManagedConnectionFactory env) throws ConnectorException {		
+		String stateClassName = env.getConnectorStateClass();
 		XMLConnectorState state = null;
 		try {
 			Class clazz = Thread.currentThread().getContextClassLoader().loadClass(stateClassName);

Modified: branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/base/SecureConnectorStateImpl.java
===================================================================
--- branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/base/SecureConnectorStateImpl.java	2009-12-21 19:41:26 UTC (rev 1687)
+++ branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/base/SecureConnectorStateImpl.java	2009-12-21 19:43:33 UTC (rev 1688)
@@ -26,7 +26,6 @@
 
 import java.util.Properties;
 
-import org.teiid.connector.api.ConnectorEnvironment;
 import org.teiid.connector.api.ConnectorException;
 
 import com.metamatrix.connector.xml.SecureConnectorState;
@@ -47,10 +46,10 @@
 	}
 	
 	@Override
-	public void setState(ConnectorEnvironment env) throws ConnectorException {
+	public void setState(XMLBaseManagedConnectionFactory env) throws ConnectorException {
 		super.setState(env);
 		
-        String secure = env.getProperties().getProperty(SECURITY_DESERIALIZER_CLASS);
+        String secure = env.getTrustDeserializerClass();
         if(secure != null && !secure.equals("")) {
         	setSecurityDeserializerClass(secure);
         } else {

Modified: branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/base/TrustedPayloadBridge.java
===================================================================
--- branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/base/TrustedPayloadBridge.java	2009-12-21 19:41:26 UTC (rev 1687)
+++ branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/base/TrustedPayloadBridge.java	2009-12-21 19:43:33 UTC (rev 1688)
@@ -24,11 +24,10 @@
 
 package com.metamatrix.connector.xml.base;
 
-import java.io.Serializable;
+import javax.security.auth.Subject;
 
 import org.teiid.connector.api.ConnectorEnvironment;
 import org.teiid.connector.api.ConnectorLogger;
-import org.teiid.connector.api.CredentialMap;
 
 import com.metamatrix.connector.xml.TrustedPayloadHandler;
 
@@ -36,12 +35,10 @@
 
 	protected String username;
 	protected String password;
-	protected String connectorName;
 	protected ConnectorEnvironment connectorEnvorinment;
-	protected Serializable m_trust = null;
-	protected Serializable m_process = null;
 	protected String m_systemName;
 	protected ConnectorLogger m_logger = null;
+	protected Subject subject;
 
 	public TrustedPayloadBridge() {
 		super();
@@ -55,10 +52,6 @@
 		return password;
 	}
 
-	public void setConnectorName(String name) {
-		this.connectorName = name;
-	}
-
 	public void setUser(String userName) {
 		this.username = userName;
 	}
@@ -67,31 +60,14 @@
 		this.password = password;
 	}
 	
-	public void setSystemName(String systemName) {
-		this.connectorName = systemName;
-	}
-
 	public void setConnectorEnvironment(ConnectorEnvironment connEnv) {
 		this.connectorEnvorinment = connEnv;
 	}
 
-	public void setTrustedPayload(Serializable payload) {
-		m_trust = payload;
+	public void setSubject(Subject subject) {
+		this.subject = subject;
 	}
 
-	public void setExecutionPayload(Serializable payload) {
-		m_process = payload;
-	}
-
-	public void processPayloads() throws Exception {
-		//check for a credentials map
-		if(m_trust instanceof CredentialMap) {
-			CredentialMap map = (CredentialMap) m_process;
-			username = map.getUser(m_systemName);
-			password = map.getPassword(m_systemName);    		
-		}
-	}
-
 	public void setLogger(ConnectorLogger logger) {
 		m_logger = logger;
 	}

Added: branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/base/XMLBaseManagedConnectionFactory.java
===================================================================
--- branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/base/XMLBaseManagedConnectionFactory.java	                        (rev 0)
+++ branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/base/XMLBaseManagedConnectionFactory.java	2009-12-21 19:43:33 UTC (rev 1688)
@@ -0,0 +1,99 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership.  Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package com.metamatrix.connector.xml.base;
+
+import org.teiid.connector.basic.BasicManagedConnectionFactory;
+
+public class XMLBaseManagedConnectionFactory extends BasicManagedConnectionFactory {
+	
+	private String connectorStateClass;
+
+	public String getConnectorStateClass() {
+		return this.connectorStateClass;
+	}
+
+	public void setConnectorStateClass(String connectorStateClass) {
+		this.connectorStateClass = connectorStateClass;
+	}
+
+	private boolean cacheEnabled;
+
+	public boolean getCacheEnabled() {
+		return this.cacheEnabled;
+	}
+
+	public void setCacheEnabled(Boolean cacheEnabled) {
+		this.cacheEnabled = cacheEnabled;
+	}
+	
+	private boolean logRequestResponseDocs;
+
+	public boolean getLogRequestResponseDocs() {
+		return this.logRequestResponseDocs;
+	}
+
+	public void setLogRequestResponseDocs(Boolean logRequestResponseDocs) {
+		this.logRequestResponseDocs = logRequestResponseDocs;
+	}
+	
+	private String saxFilterProviderClass;
+
+	public String getSaxFilterProviderClass() {
+		return this.saxFilterProviderClass;
+	}
+
+	public void setSaxFilterProviderClass(String saxFilterProviderClass) {
+		this.saxFilterProviderClass = saxFilterProviderClass;
+	}
+	
+	private String queryPreprocessorClass;
+
+	public String getQueryPreprocessorClass() {
+		return this.queryPreprocessorClass;
+	}
+
+	public void setQueryPreprocessorClass(String queryPreprocessorClass) {
+		this.queryPreprocessorClass = queryPreprocessorClass;
+	}
+
+	private String inputStreamFilterClass;
+
+	public String getInputStreamFilterClass() {
+		return this.inputStreamFilterClass;
+	}
+
+	public void setInputStreamFilterClass(String inputStreamFilterClass) {
+		this.inputStreamFilterClass = inputStreamFilterClass;
+	}
+	
+	private String trustDeserializerClass;
+
+	public String getTrustDeserializerClass() {
+		return this.trustDeserializerClass;
+	}
+
+	public void setTrustDeserializerClass(String trustDeserializerClass) {
+		this.trustDeserializerClass = trustDeserializerClass;
+	}
+	
+}

Modified: branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/base/XMLConnectionImpl.java
===================================================================
--- branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/base/XMLConnectionImpl.java	2009-12-21 19:41:26 UTC (rev 1687)
+++ branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/base/XMLConnectionImpl.java	2009-12-21 19:43:33 UTC (rev 1688)
@@ -23,12 +23,10 @@
 
 package com.metamatrix.connector.xml.base;
 
-import java.io.Serializable;
+import javax.security.auth.Subject;
 
-import org.teiid.connector.api.ConnectorEnvironment;
+import org.teiid.connector.api.ConnectionContext;
 import org.teiid.connector.api.ConnectorException;
-import org.teiid.connector.api.ConnectorLogger;
-import org.teiid.connector.api.ExecutionContext;
 import org.teiid.connector.basic.BasicConnection;
 
 import com.metamatrix.connector.xml.CachingConnector;
@@ -41,37 +39,22 @@
 
 	private CachingConnector connector;
 
-	private ConnectorEnvironment connectorEnv;
-
-	private ConnectorLogger logger;
-	
-	private String m_queryId;
-	private String m_user;
-	private Serializable m_executionPayload;
-
-	private Serializable m_trustedPayload;
-
+	private XMLBaseManagedConnectionFactory connectorEnv;
 	private TrustedPayloadHandler payloadHandler;
-
-	public XMLConnectionImpl(CachingConnector connector, ExecutionContext context,
-			ConnectorEnvironment connectorEnv) throws ConnectorException {
+	private Subject subject;
+	
+	public XMLConnectionImpl(CachingConnector connector, XMLBaseManagedConnectionFactory connectorEnv) throws ConnectorException {
 		this.connector = connector;
 		this.connectorEnv = connectorEnv;
-		logger = connector.getState().getLogger();
-		logger.logTrace("XMLConnection initialized for Request Identifier " + context.getRequestIdentifier());
-		setQueryId(context.getRequestIdentifier());
-		setUser(context.getUser());
-		setTrustedPayload(context.getTrustedPayload());
-		setExecutionPayload(context.getExecutionPayload());
+		this.subject = ConnectionContext.getSubject();
 		processTrustPayload();
 	}
 	///////////////////////////////////////////////////////////////
 	//Connection API Implementation
 	@Override
 	public void close() {
-		logger.logTrace("XMLConnection released for RequestIdentifier " + 
-				getQueryId());
 	}
+
 	//End Connection API Implementation
 	///////////////////////////////////////////////////////////////
 	
@@ -84,51 +67,17 @@
 	public CachingConnector getConnector() {
 		return connector;
 	}
-
+	
 	public TrustedPayloadHandler getTrustedPayloadHandler() {
 		return payloadHandler;
-	}
-
-	public String getQueryId() {
-		return m_queryId;
-	}
-
-	public String getUser() {
-		return m_user;
-	}
+	}	
+	
 	//End XML Connection API Implementation
 	///////////////////////////////////////////////////////////////
-	
-	private void setQueryId(String queryId) {
-		m_queryId = queryId;
-	}
-
-	private void setUser(String user) {
-		m_user = user;
-	}
-	
-	private void setExecutionPayload(Serializable ser) {
-		m_executionPayload = ser;
-	}
-
-	private Serializable getExecutionPayload() {
-		return m_executionPayload;
-	}
-
-	private void setTrustedPayload(Serializable ser) {
-		m_trustedPayload = ser;
-	}
-
-	private Serializable getTrustedPayload() {
-		return m_trustedPayload;
-	}
-
 	private void processTrustPayload() throws ConnectorException {
 		if (getState() instanceof SecureConnectorStateImpl) {
 			payloadHandler = ((SecureConnectorState)getState()).getTrustDeserializerInstance();
-			payloadHandler.setExecutionPayload(getExecutionPayload());
-			payloadHandler.setTrustedPayload(getTrustedPayload());
-			payloadHandler.setConnectorName(connectorEnv.getConnectorName());
+			payloadHandler.setSubject(this.subject);
 			payloadHandler.setLogger(connector.getLogger());
 			try {
 				payloadHandler.processPayloads();
@@ -139,7 +88,7 @@
 		}
 	}
 	
-	public ConnectorEnvironment getConnectorEnv() {
+	public XMLBaseManagedConnectionFactory getConnectorEnv() {
 		return connectorEnv;
 	}
 }

Modified: branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/base/XMLConnector.java
===================================================================
--- branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/base/XMLConnector.java	2009-12-21 19:41:26 UTC (rev 1687)
+++ branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/base/XMLConnector.java	2009-12-21 19:43:33 UTC (rev 1688)
@@ -28,11 +28,8 @@
 import org.teiid.connector.api.ConnectorEnvironment;
 import org.teiid.connector.api.ConnectorException;
 import org.teiid.connector.api.ConnectorLogger;
-import org.teiid.connector.api.ExecutionContext;
-import org.teiid.connector.api.ConnectorAnnotations.ConnectionPooling;
 
 
- at ConnectionPooling(enabled=false)
 public class XMLConnector extends AbstractCachingConnector {
 	
 	public XMLConnector() {
@@ -40,10 +37,10 @@
 	}
 
 	@Override
-	public void start(ConnectorEnvironment env) throws ConnectorException {
-		super.start(env);	
+	public void initialize(ConnectorEnvironment env) throws ConnectorException {
+		super.initialize(env);	
         getLogger().logInfo("XML Connector Framework: connector has been started"); //$NON-NLS-1$
-        getLogger().logTrace("XML Connector Framework: connector init properties: " + getEnvironment().getProperties()); //$NON-NLS-1$
+        getLogger().logTrace("XML Connector Framework: connector init properties: " + getEnvironment()); //$NON-NLS-1$
 	}
 
 	@Override
@@ -55,15 +52,11 @@
 		}
 	}
 
-	public Connection getConnection(ExecutionContext context) throws ConnectorException {
-		if(null == context) {
-			return null;
-		}
-		
+	public Connection getConnection() throws ConnectorException {
 		if (m_state == null) {
 			throw new ConnectorException(Messages.getString("XMLConnector.state.not.set")); //$NON-NLS-1$
 		}
-		return m_state.getConnection(this, context, getEnvironment());//new XMLConnectionImpl(this, context, getEnvironment());
+		return m_state.getConnection(this);
 	}
 
 	public ConnectorCapabilities getCapabilities() {

Modified: branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/base/XMLConnectorStateImpl.java
===================================================================
--- branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/base/XMLConnectorStateImpl.java	2009-12-21 19:41:26 UTC (rev 1687)
+++ branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/base/XMLConnectorStateImpl.java	2009-12-21 19:43:33 UTC (rev 1688)
@@ -26,7 +26,6 @@
 import java.util.Properties;
 
 import org.teiid.connector.api.ConnectorCapabilities;
-import org.teiid.connector.api.ConnectorEnvironment;
 import org.teiid.connector.api.ConnectorException;
 import org.teiid.connector.api.ConnectorLogger;
 
@@ -73,7 +72,6 @@
 
     private ConnectorCapabilities capabilites;
 
-    private String capabilitiesClass;
 
 	private boolean caching = false;
 
@@ -85,32 +83,16 @@
         setPluggableInputStreamFilterClass(INPUT_STREAM_FILTER_CLASS_DEFAULT);
     }
 
-    public void setState(ConnectorEnvironment env) throws ConnectorException {
+    public void setState(XMLBaseManagedConnectionFactory env) throws ConnectorException {
         if (logger == null) {
             throw new RuntimeException("Internal Exception: logger is null");
         }
-        Properties props = env.getProperties();
-        String cachingString = props.getProperty(CACHE_ENABLED);
-        if (cachingString != null) {
-        	Boolean caching = Boolean.parseBoolean(cachingString);
-        	setCaching(caching);
-        }
-        
-        String logReqRes = props.getProperty(LOG_REQUEST_RESPONSE_DOCS);
-        if (logReqRes != null) {
-            setLogRequestResponse(Boolean.valueOf(logReqRes).booleanValue());
-        }
+        setCaching(env.getCacheEnabled());
+        setLogRequestResponse(env.getLogRequestResponseDocs());
 
-        String capabilitesClass = props.getProperty(CONNECTOR_CAPABILITES);
-        if (capabilitesClass != null && !capabilitesClass.equals("")) {
-            setConnectorCapabilitiesClass(capabilitesClass);
-            setCapabilites(loadConnectorCapabilities(getConnectorCapabilitiesClass()));
-        } else {
-            throw new ConnectorException(
-                    "The Connector Capabilities Class is null or empty");
-        }
-
-        String provider = props.getProperty(SAX_FILTER_PROVIDER_CLASS);
+        setCapabilites(loadConnectorCapabilities(env.getCapabilitiesClass()));
+        
+        String provider = env.getSaxFilterProviderClass();
         if (provider != null && !provider.equals("")) {
             setSaxProviderClass(provider);
             setSAXFilterProvider(loadSAXFilter(getSaxProviderClass()));
@@ -119,7 +101,7 @@
                     "The SAX Filter Privider Class is null or empty");
         }
 
-        String preprocessor = props.getProperty(QUERY_PREPROCESS_CLASS);
+        String preprocessor = env.getQueryPreprocessorClass();
         if (preprocessor != null && !preprocessor.equals("")) {
             setQueryPreprocessorClass(preprocessor);
             setPreprocessor(loadPreprocessor(getQueryPreprocessorClass()));
@@ -128,7 +110,7 @@
                     "The Query Preprocessor Class is null or empty");
         }
         
-        String streamFilter = props.getProperty(INPUT_STREAM_FILTER_CLASS);
+        String streamFilter = env.getInputStreamFilterClass();
         if(streamFilter != null && !streamFilter.equals("")) {
         	setPluggableInputStreamFilterClass(streamFilter);
         }
@@ -155,14 +137,6 @@
         return caps;
     }
 
-    private void setConnectorCapabilitiesClass(String capabilitesClass) {
-        this.capabilitiesClass = capabilitesClass;
-    }
-
-    private String getConnectorCapabilitiesClass() {
-        return capabilitiesClass;
-    }
-
     /*
      * (non-Javadoc)
      * 

Modified: branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/file/FileConnectionImpl.java
===================================================================
--- branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/file/FileConnectionImpl.java	2009-12-21 19:41:26 UTC (rev 1687)
+++ branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/file/FileConnectionImpl.java	2009-12-21 19:43:33 UTC (rev 1688)
@@ -1,6 +1,5 @@
 package com.metamatrix.connector.xml.file;
 
-import org.teiid.connector.api.ConnectorEnvironment;
 import org.teiid.connector.api.ConnectorException;
 import org.teiid.connector.api.ExecutionContext;
 import org.teiid.connector.api.ResultSetExecution;
@@ -9,13 +8,13 @@
 import org.teiid.connector.metadata.runtime.RuntimeMetadata;
 
 import com.metamatrix.connector.xml.CachingConnector;
+import com.metamatrix.connector.xml.base.XMLBaseManagedConnectionFactory;
 import com.metamatrix.connector.xml.base.XMLConnectionImpl;
 
 public class FileConnectionImpl extends XMLConnectionImpl {
 
-	public FileConnectionImpl(CachingConnector connector, ExecutionContext context,
-			ConnectorEnvironment connectorEnv) throws ConnectorException {
-		super(connector,context, connectorEnv);
+	public FileConnectionImpl(CachingConnector connector, XMLBaseManagedConnectionFactory connectorEnv) throws ConnectorException {
+		super(connector, connectorEnv);
 	}
 	
 	///////////////////////////////////////////////////////////////

Modified: branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/file/FileConnectorState.java
===================================================================
--- branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/file/FileConnectorState.java	2009-12-21 19:41:26 UTC (rev 1687)
+++ branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/file/FileConnectorState.java	2009-12-21 19:43:33 UTC (rev 1688)
@@ -28,13 +28,13 @@
 import java.util.Properties;
 
 import org.teiid.connector.api.Connection;
-import org.teiid.connector.api.ConnectorEnvironment;
 import org.teiid.connector.api.ConnectorException;
 import org.teiid.connector.api.ConnectorLogger;
 import org.teiid.connector.api.ExecutionContext;
 
 import com.metamatrix.connector.xml.CachingConnector;
 import com.metamatrix.connector.xml.base.LoggingInputStreamFilter;
+import com.metamatrix.connector.xml.base.XMLBaseManagedConnectionFactory;
 import com.metamatrix.connector.xml.base.XMLConnectorStateImpl;
 import com.metamatrix.connector.xml.cache.CachingInputStreamFilter;
 
@@ -46,6 +46,7 @@
 	private String m_directoryPath;
 	public static final String FILE_NAME = "FileName"; //$NON-NLS-1$
 	public static final String DIRECTORY_PATH = "FilePath"; //$NON-NLS-1$
+	FileManagedConnectionFactory config;
 	
 	public FileConnectorState() {
 		super();
@@ -62,10 +63,11 @@
 	}
 	
 	@Override
-	public void setState(ConnectorEnvironment env) throws ConnectorException {
+	public void setState(XMLBaseManagedConnectionFactory env) throws ConnectorException {
         super.setState(env);
-        setFileName(env.getProperties().getProperty(FILE_NAME));
-		setDirectoryPath(env.getProperties().getProperty(DIRECTORY_PATH));
+        this.config = (FileManagedConnectionFactory)env;
+        setFileName(this.config.getFileName());
+		setDirectoryPath(this.config.getFilePath());
 	}
 
 	/**
@@ -105,8 +107,8 @@
 		return m_directoryPath;
 	}
 
-	public Connection getConnection(CachingConnector connector, ExecutionContext context, ConnectorEnvironment environment) throws ConnectorException {
-		return new FileConnectionImpl(connector, context, environment);
+	public Connection getConnection(CachingConnector connector) throws ConnectorException {
+		return new FileConnectionImpl(connector, this.config);
 	}
 
 	public InputStream addStreamFilters(InputStream stream)

Added: branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/file/FileManagedConnectionFactory.java
===================================================================
--- branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/file/FileManagedConnectionFactory.java	                        (rev 0)
+++ branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/file/FileManagedConnectionFactory.java	2009-12-21 19:43:33 UTC (rev 1688)
@@ -0,0 +1,49 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership.  Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+package com.metamatrix.connector.xml.file;
+
+import com.metamatrix.connector.xml.base.XMLBaseManagedConnectionFactory;
+
+public class FileManagedConnectionFactory extends XMLBaseManagedConnectionFactory {
+
+	private String filePath;
+
+	public String getFilePath() {
+		return this.filePath;
+	}
+
+	public void setFilePath(String filePath) {
+		this.filePath = filePath;
+	}
+
+	private String fileName;
+
+	public String getFileName() {
+		return this.fileName;
+	}
+
+	public void setFileName(String fileName) {
+		this.fileName = fileName;
+	}
+
+
+}

Modified: branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/http/DefaultTrustDeserializer.java
===================================================================
--- branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/http/DefaultTrustDeserializer.java	2009-12-21 19:41:26 UTC (rev 1687)
+++ branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/http/DefaultTrustDeserializer.java	2009-12-21 19:43:33 UTC (rev 1688)
@@ -32,6 +32,7 @@
 
 import com.metamatrix.connector.xml.XMLConnectorState;
 import com.metamatrix.connector.xml.base.TrustedPayloadBridge;
+import com.metamatrix.core.MetaMatrixRuntimeException;
 
 public class DefaultTrustDeserializer extends TrustedPayloadBridge implements HTTPTrustDeserializer {
 	
@@ -41,12 +42,6 @@
 	}
 
 	public void modifyRequest(HttpClient client, HttpMethod method) throws ConnectorException {
-		//just note of there are payloads
-		//no request modification
-		if(m_logger != null) {
-			if(m_trust != null)	m_logger.logInfo(com.metamatrix.connector.xml.http.Messages.getString("DefaultTrustDeserializer.trust.not.processed"));
-			if(m_process != null) m_logger.logInfo(com.metamatrix.connector.xml.http.Messages.getString("DefaultTrustDeserializer.process.not.processed"));
-		}
 		if(getUser() != null) {
 			updateCredentials(client, method, getUser(), getPassword());
 		}
@@ -62,4 +57,9 @@
 			throw new ConnectorException(com.metamatrix.connector.xml.http.Messages.getString("HTTPExecutor.bad.security.configuration"));
 		}
 	}
+
+	@Override
+	public void processPayloads() throws Exception {
+		throw new MetaMatrixRuntimeException("A custom trust payload processor needed based on the subject.");
+	}
 }

Modified: branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/http/HTTPConnectionImpl.java
===================================================================
--- branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/http/HTTPConnectionImpl.java	2009-12-21 19:41:26 UTC (rev 1687)
+++ branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/http/HTTPConnectionImpl.java	2009-12-21 19:43:33 UTC (rev 1688)
@@ -1,6 +1,5 @@
 package com.metamatrix.connector.xml.http;
 
-import org.teiid.connector.api.ConnectorEnvironment;
 import org.teiid.connector.api.ConnectorException;
 import org.teiid.connector.api.ExecutionContext;
 import org.teiid.connector.api.ResultSetExecution;
@@ -9,13 +8,13 @@
 import org.teiid.connector.metadata.runtime.RuntimeMetadata;
 
 import com.metamatrix.connector.xml.CachingConnector;
+import com.metamatrix.connector.xml.base.XMLBaseManagedConnectionFactory;
 import com.metamatrix.connector.xml.base.XMLConnectionImpl;
 
 public class HTTPConnectionImpl extends XMLConnectionImpl {
 
-	public HTTPConnectionImpl(CachingConnector connector, ExecutionContext context,
-			ConnectorEnvironment connectorEnv) throws ConnectorException {
-		super(connector,context, connectorEnv);
+	public HTTPConnectionImpl(CachingConnector connector, XMLBaseManagedConnectionFactory connectorEnv) throws ConnectorException {
+		super(connector,connectorEnv);
 	}
 	
 	///////////////////////////////////////////////////////////////

Modified: branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/http/HTTPConnectorState.java
===================================================================
--- branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/http/HTTPConnectorState.java	2009-12-21 19:41:26 UTC (rev 1687)
+++ branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/http/HTTPConnectorState.java	2009-12-21 19:43:33 UTC (rev 1688)
@@ -23,8 +23,6 @@
 
 package com.metamatrix.connector.xml.http;
 
-import java.util.Properties;
-
 import javax.net.ssl.HostnameVerifier;
 import javax.net.ssl.HttpsURLConnection;
 
@@ -38,15 +36,16 @@
 import org.apache.commons.httpclient.auth.AuthScope;
 import org.apache.commons.httpclient.params.HttpConnectionManagerParams;
 import org.teiid.connector.api.Connection;
-import org.teiid.connector.api.ConnectorEnvironment;
 import org.teiid.connector.api.ConnectorException;
-import org.teiid.connector.api.ExecutionContext;
 
 import com.metamatrix.connector.xml.CachingConnector;
 import com.metamatrix.connector.xml.base.SecureConnectorStateImpl;
+import com.metamatrix.connector.xml.base.XMLBaseManagedConnectionFactory;
 
 public class HTTPConnectorState extends SecureConnectorStateImpl {
 
+	private HTTPManagedConnectionFactory config;
+	
     private int m_accessMethod;
 
     private int m_parameterMethod;
@@ -136,22 +135,21 @@
     }
 
     @Override
-	public void setState(ConnectorEnvironment env) throws ConnectorException {
+	public void setState(XMLBaseManagedConnectionFactory env) throws ConnectorException {
         super.setState(env);
-        Properties props = env.getProperties();
-        setAccessMethod(props.getProperty(ACCESS_METHOD));
-        setParameterMethod(props.getProperty(PARAMETER_METHOD));
-        setUri(props.getProperty(URI));
-        setProxyUri(props.getProperty(PROXY_URI));
-        setRequestTimeout(Integer.parseInt(props.getProperty(REQUEST_TIMEOUT)));
-        setXmlParameterName(props.getProperty(XML_PARAMETER_NAME));
-        String basicAuth = props.getProperty(USE_HTTP_BASIC_AUTH);
-        boolean useAuth = Boolean.valueOf(basicAuth).booleanValue();
-        setUseHttpBasicAuth(useAuth);
-        setHttpBasicAuthUser(props.getProperty(HTTP_BASIC_USER));
-        setHttpBasicAuthPwd(props.getProperty(HTTP_BASIC_PASSWORD));
+        this.config = (HTTPManagedConnectionFactory) env;
         
-        setHostnameVerifierClassName(props.getProperty(HOSTNAME_VERIFIER));
+        setAccessMethod(this.config.getAccessMethod());
+        setParameterMethod(this.getParameterMethod());
+        setUri(this.config.getUri());
+        setProxyUri(this.config.getProxyUri());
+        setRequestTimeout(this.config.getRequestTimeout());
+        setXmlParameterName(this.config.getXMLParmName());
+        setUseHttpBasicAuth(this.config.getUseHttpBasic());
+        setHttpBasicAuthUser(this.config.getHttpBasicAuthUserName());
+        setHttpBasicAuthPwd(this.config.getHttpBasicAuthPassword());
+        
+        setHostnameVerifierClassName(this.config.getHostnameVerifier());
         if(getHostnameVerifierClassName() != null) {
         	try {
         		Class clazz = Thread.currentThread().getContextClassLoader().loadClass(getHostnameVerifierClassName());
@@ -407,10 +405,9 @@
         return m_httpBasicAuthPwd;
     }
 
-    public Connection getConnection(CachingConnector connector,
-            ExecutionContext context, ConnectorEnvironment environment)
+    public Connection getConnection(CachingConnector connector)
             throws ConnectorException {
-        return new HTTPConnectionImpl(connector, context, environment);
+        return new HTTPConnectionImpl(connector, this.config);
     }
     
     private void setHostnameVerifierClassName(String property) {

Added: branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/http/HTTPManagedConnectionFactory.java
===================================================================
--- branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/http/HTTPManagedConnectionFactory.java	                        (rev 0)
+++ branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/http/HTTPManagedConnectionFactory.java	2009-12-21 19:43:33 UTC (rev 1688)
@@ -0,0 +1,138 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership.  Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+package com.metamatrix.connector.xml.http;
+
+import com.metamatrix.connector.xml.base.XMLBaseManagedConnectionFactory;
+
+public class HTTPManagedConnectionFactory extends XMLBaseManagedConnectionFactory {
+
+	private String xMLParmName;
+
+	public String getXMLParmName() {
+		return this.xMLParmName;
+	}
+
+	public void setXMLParmName(String xMLParmName) {
+		this.xMLParmName = xMLParmName;
+	}
+
+	private Integer requestTimeout;
+
+	public Integer getRequestTimeout() {
+		return this.requestTimeout;
+	}
+
+	public void setRequestTimeout(Integer requestTimeout) {
+		this.requestTimeout = requestTimeout;
+	}
+
+	private boolean authenticate;
+
+	public boolean getAuthenticate() {
+		return this.authenticate;
+	}
+
+	public void setAuthenticate(Boolean authenticate) {
+		this.authenticate = authenticate;
+	}
+
+	private String httpBasicAuthPassword;
+
+	public String getHttpBasicAuthPassword() {
+		return this.httpBasicAuthPassword;
+	}
+
+	public void setHttpBasicAuthPassword(String httpBasicAuthPassword) {
+		this.httpBasicAuthPassword = httpBasicAuthPassword;
+	}
+
+	private String accessMethod;
+
+	public String getAccessMethod() {
+		return this.accessMethod;
+	}
+
+	public void setAccessMethod(String accessMethod) {
+		this.accessMethod = accessMethod;
+	}
+
+	private String proxyUri;
+
+	public String getProxyUri() {
+		return this.proxyUri;
+	}
+
+	public void setProxyUri(String proxyUri) {
+		this.proxyUri = proxyUri;
+	}
+
+	private String httpBasicAuthUserName;
+
+	public String getHttpBasicAuthUserName() {
+		return this.httpBasicAuthUserName;
+	}
+
+	public void setHttpBasicAuthUserName(String httpBasicAuthUserName) {
+		this.httpBasicAuthUserName = httpBasicAuthUserName;
+	}
+
+	private String uri;
+
+	public String getUri() {
+		return this.uri;
+	}
+
+	public void setUri(String uri) {
+		this.uri = uri;
+	}
+
+	private boolean useHttpBasic;
+
+	public boolean getUseHttpBasic() {
+		return this.useHttpBasic;
+	}
+
+	public void setUseHttpBasic(Boolean useHttpBasic) {
+		this.useHttpBasic = useHttpBasic;
+	}
+
+	private String parameterMethod;
+
+	public String getParameterMethod() {
+		return this.parameterMethod;
+	}
+
+	public void setParameterMethod(String parameterMethod) {
+		this.parameterMethod = parameterMethod;
+	}
+
+	private String hostnameVerifier;
+
+	public String getHostnameVerifier() {
+		return this.hostnameVerifier;
+	}
+
+	public void setHostnameVerifier(String hostnameVerifier) {
+		this.hostnameVerifier = hostnameVerifier;
+	}
+
+}

Modified: branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/http/HTTPRequest.java
===================================================================
--- branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/http/HTTPRequest.java	2009-12-21 19:41:26 UTC (rev 1687)
+++ branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/http/HTTPRequest.java	2009-12-21 19:43:33 UTC (rev 1688)
@@ -152,12 +152,9 @@
         }
         // the key consists of a String in the form of
         // |uri|parameterList|
-        String userName = execution.getConnection().getUser();
-        String session = execution.getConnection().getQueryId();
+        String session = execution.getExeContext().getRequestIdentifier();
 
         StringBuffer cacheKey = new StringBuffer();
-        cacheKey.append("|"); //$NON-NLS-1$
-        cacheKey.append(userName);
         cacheKey.append("|");
         cacheKey.append(session);
         cacheKey.append("|");
@@ -168,8 +165,7 @@
             NameValuePair[] pairs = ((PostMethod) request).getParameters();
             if (pairs == null || pairs.length == 0) {
                 if (((PostMethod) request).getRequestEntity() != null) {
-                    String requestBodyAsString = ((StringRequestEntity) (((PostMethod) request)
-                            .getRequestEntity())).getContent();
+                    String requestBodyAsString = ((StringRequestEntity) (((PostMethod) request).getRequestEntity())).getContent();
                     cacheKey.append(requestBodyAsString);
                 }
             } else {

Modified: branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/http/HTTPTrustDeserializer.java
===================================================================
--- branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/http/HTTPTrustDeserializer.java	2009-12-21 19:41:26 UTC (rev 1687)
+++ branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/http/HTTPTrustDeserializer.java	2009-12-21 19:43:33 UTC (rev 1688)
@@ -24,33 +24,19 @@
 
 package com.metamatrix.connector.xml.http;
 
-import java.io.Serializable;
-
 import org.apache.commons.httpclient.HttpClient;
 import org.apache.commons.httpclient.HttpMethod;
 import org.teiid.connector.api.ConnectorException;
-import org.teiid.connector.api.ConnectorLogger;
 
 import com.metamatrix.connector.xml.TrustedPayloadHandler;
 import com.metamatrix.connector.xml.XMLConnectorState;
 
 public interface HTTPTrustDeserializer extends TrustedPayloadHandler{
 
-	
-	public void setTrustedPayload(Serializable payload);
-	
-	public void setExecutionPayload(Serializable payload);
-	
-	public void processPayloads() throws Exception;
-	
 	public void modifyRequest(HttpClient client, HttpMethod method) throws ConnectorException;
 
-	public void setLogger(ConnectorLogger logger);
-	
 	public void setConnectorState(XMLConnectorState state);
 	
-	public void setSystemName(String name); 
-	
 	//if you desire to override the http basic authentication from the connector
 	//binding properties, here is how that would be done:
 	

Modified: branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/soap/DefaultSoapTrustDeserializer.java
===================================================================
--- branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/soap/DefaultSoapTrustDeserializer.java	2009-12-21 19:41:26 UTC (rev 1687)
+++ branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/soap/DefaultSoapTrustDeserializer.java	2009-12-21 19:43:33 UTC (rev 1688)
@@ -25,11 +25,14 @@
 package com.metamatrix.connector.xml.soap;
 
 import com.metamatrix.connector.xml.base.TrustedPayloadBridge;
+import com.metamatrix.core.MetaMatrixRuntimeException;
 
 
 public class DefaultSoapTrustDeserializer extends TrustedPayloadBridge {
 
-	
-	
+	@Override
+	public void processPayloads() throws Exception {
+		throw new MetaMatrixRuntimeException("A custom trust payload processor needed based on the subject.");
+	}
 }
 

Modified: branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/soap/SOAPConnectionImpl.java
===================================================================
--- branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/soap/SOAPConnectionImpl.java	2009-12-21 19:41:26 UTC (rev 1687)
+++ branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/soap/SOAPConnectionImpl.java	2009-12-21 19:43:33 UTC (rev 1688)
@@ -1,6 +1,5 @@
 package com.metamatrix.connector.xml.soap;
 
-import org.teiid.connector.api.ConnectorEnvironment;
 import org.teiid.connector.api.ConnectorException;
 import org.teiid.connector.api.ExecutionContext;
 import org.teiid.connector.api.ResultSetExecution;
@@ -9,14 +8,14 @@
 import org.teiid.connector.metadata.runtime.RuntimeMetadata;
 
 import com.metamatrix.connector.xml.CachingConnector;
+import com.metamatrix.connector.xml.base.XMLBaseManagedConnectionFactory;
 import com.metamatrix.connector.xml.base.XMLConnectionImpl;
 
 public class SOAPConnectionImpl extends XMLConnectionImpl {
 
-	public SOAPConnectionImpl(CachingConnector connector,
-			ExecutionContext context, ConnectorEnvironment connectorEnv)
+	public SOAPConnectionImpl(CachingConnector connector, XMLBaseManagedConnectionFactory connectorEnv)
 			throws ConnectorException {
-		super(connector, context, connectorEnv);
+		super(connector, connectorEnv);
 	}
 
 	///////////////////////////////////////////////////////////////

Modified: branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/soap/SOAPConnectorState.java
===================================================================
--- branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/soap/SOAPConnectorState.java	2009-12-21 19:41:26 UTC (rev 1687)
+++ branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/soap/SOAPConnectorState.java	2009-12-21 19:43:33 UTC (rev 1688)
@@ -28,9 +28,9 @@
 import org.teiid.connector.api.ConnectorEnvironment;
 import org.teiid.connector.api.ConnectorException;
 import org.teiid.connector.api.ConnectorLogger;
-import org.teiid.connector.api.ExecutionContext;
 
 import com.metamatrix.connector.xml.CachingConnector;
+import com.metamatrix.connector.xml.base.XMLBaseManagedConnectionFactory;
 import com.metamatrix.connector.xml.http.HTTPConnectorState;
 
 /**
@@ -41,6 +41,7 @@
 		com.metamatrix.connector.xml.SOAPConnectorState {
 
 	com.metamatrix.connector.xml.SOAPConnectorState soapState;
+	SOAPManagedConnectionFactory config;
 	/**
 	 * 
 	 */
@@ -51,9 +52,10 @@
 
 	
 	@Override
-	public void setState(ConnectorEnvironment env) throws ConnectorException {
+	public void setState(XMLBaseManagedConnectionFactory env) throws ConnectorException {
 		super.setState(env);
 		soapState.setState(env);
+		this.config = (SOAPManagedConnectionFactory)env;
 	}
 
 	@Override
@@ -83,9 +85,8 @@
 		return soapState.isExceptionOnFault();
 	}
 	
-    public Connection getConnection(CachingConnector connector,
-            ExecutionContext context, ConnectorEnvironment environment)
+    public Connection getConnection(CachingConnector connector)
             throws ConnectorException {
-        return new SOAPConnectionImpl(connector, context, environment);
+        return new SOAPConnectionImpl(connector, this.config);
     }
 }

Modified: branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/soap/SOAPConnectorStateImpl.java
===================================================================
--- branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/soap/SOAPConnectorStateImpl.java	2009-12-21 19:41:26 UTC (rev 1687)
+++ branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/soap/SOAPConnectorStateImpl.java	2009-12-21 19:43:33 UTC (rev 1688)
@@ -30,13 +30,12 @@
 import javax.net.ssl.HostnameVerifier;
 import javax.net.ssl.HttpsURLConnection;
 
-import org.teiid.connector.api.ConnectorEnvironment;
 import org.teiid.connector.api.ConnectorException;
 import org.teiid.connector.api.ConnectorLogger;
 
 import com.metamatrix.connector.xml.SOAPConnectorState;
 import com.metamatrix.connector.xml.base.Messages;
-import com.metamatrix.connector.xml.http.HTTPConnectorState;
+import com.metamatrix.connector.xml.base.XMLBaseManagedConnectionFactory;
 
 /**
  * Contains the data needed to create the SOAP Envelope around an XML Document.
@@ -58,6 +57,8 @@
 	private boolean m_exceptionOnFault; // throw connector exception by default
 	private ConnectorLogger logger;
 	private String hostnameVerifierClassName;
+	SOAPManagedConnectionFactory config;
+	
 
     public SOAPConnectorStateImpl() {
         setEncoded(true); //default to RPC/Encoded
@@ -68,11 +69,13 @@
 	private boolean isNotNullOrEmpty(String value) {
 		return (value != null && !value.equals(""));
 	}
-    
-    public void setState(ConnectorEnvironment env) throws ConnectorException {
-		// set the encoding style
-		Properties props = env.getProperties();
-		String enc = props.getProperty(ENCODING_STYLE_PROPERTY_NAME);
+    
+	@Override
+    public void setState(XMLBaseManagedConnectionFactory env) throws ConnectorException {
+		// set the encoding style
+    	this.config = (SOAPManagedConnectionFactory) env;
+    	
+		String enc = this.config.getEncodingStyle();
 		if (isNotNullOrEmpty(enc)) {
 			if (enc.equalsIgnoreCase(RPC_ENC_STYLE)
 					|| enc.equalsIgnoreCase(RPC_LITERAL_STYLE)
@@ -105,17 +108,10 @@
 			throw new ConnectorException(
 					Messages.getString("SOAPConnectorStateImpl.empty.ENCODING_STYLE_PROPERTY_NAME"));
 		}
-    	   
-    	String strExceptionOnFault = props.getProperty(CONNECTOR_EXCEPTION_ON_SOAP_FAULT);
-    	if (isNotNullOrEmpty(strExceptionOnFault)) { 
-    		boolean exOnFault = false;
-    		exOnFault = Boolean.valueOf(strExceptionOnFault).booleanValue();
-    		setExceptionOnFault(exOnFault);
-    	} else {
-    		throw new ConnectorException(Messages.getString("SOAPConnectorStateImpl.empty.CONNECTOR_EXCEPTION_ON_SOAP_FAULT"));
-    	}
+    	   
+		setExceptionOnFault(this.config.getExceptionOnSOAPFault());
     	
-        setHostnameVerifierClassName(props.getProperty(HTTPConnectorState.HOSTNAME_VERIFIER));
+        setHostnameVerifierClassName(this.config.getHostnameVerifier());
         if(getHostnameVerifierClassName() != null) {
         	try {
         		Class clazz = Thread.currentThread().getContextClassLoader().loadClass(getHostnameVerifierClassName());

Added: branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/soap/SOAPManagedConnectionFactory.java
===================================================================
--- branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/soap/SOAPManagedConnectionFactory.java	                        (rev 0)
+++ branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/soap/SOAPManagedConnectionFactory.java	2009-12-21 19:43:33 UTC (rev 1688)
@@ -0,0 +1,218 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership.  Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+package com.metamatrix.connector.xml.soap;
+
+import com.metamatrix.connector.xml.base.XMLBaseManagedConnectionFactory;
+import com.metamatrix.connector.xmlsource.soap.SecurityManagedConnectionFactory;
+
+public class SOAPManagedConnectionFactory extends XMLBaseManagedConnectionFactory implements SecurityManagedConnectionFactory{
+	private String authPassword;
+
+	public String getAuthPassword() {
+		return this.authPassword;
+	}
+
+	public void setAuthPassword(String authPassword) {
+		this.authPassword = authPassword;
+	}
+
+	private String authUserName;
+
+	public String getAuthUserName() {
+		return this.authUserName;
+	}
+
+	public void setAuthUserName(String authUserName) {
+		this.authUserName = authUserName;
+	}
+
+	private String wSSecurityType;
+
+	public String getWSSecurityType() {
+		return this.wSSecurityType;
+	}
+
+	public void setWSSecurityType(String wSSecurityType) {
+		this.wSSecurityType = wSSecurityType;
+	}
+
+	private String xMLParmName;
+
+	public String getXMLParmName() {
+		return this.xMLParmName;
+	}
+
+	public void setXMLParmName(String xMLParmName) {
+		this.xMLParmName = xMLParmName;
+	}
+
+	private String encryptUserName;
+
+	public String getEncryptUserName() {
+		return this.encryptUserName;
+	}
+
+	public void setEncryptUserName(String encryptUserName) {
+		this.encryptUserName = encryptUserName;
+	}
+
+	private boolean exceptionOnSOAPFault;
+
+	public boolean getExceptionOnSOAPFault() {
+		return this.exceptionOnSOAPFault;
+	}
+
+	public void setExceptionOnSOAPFault(Boolean exceptionOnSOAPFault) {
+		this.exceptionOnSOAPFault = exceptionOnSOAPFault;
+	}
+
+	private Integer requestTimeout;
+
+	public Integer getRequestTimeout() {
+		return this.requestTimeout;
+	}
+
+	public void setRequestTimeout(Integer requestTimeout) {
+		this.requestTimeout = requestTimeout;
+	}
+
+	private String cryptoPropertyFile;
+
+	public String getCryptoPropertyFile() {
+		return this.cryptoPropertyFile;
+	}
+
+	public void setCryptoPropertyFile(String cryptoPropertyFile) {
+		this.cryptoPropertyFile = cryptoPropertyFile;
+	}
+
+	private String sOAPAction;
+
+	public String getSOAPAction() {
+		return this.sOAPAction;
+	}
+
+	public void setSOAPAction(String sOAPAction) {
+		this.sOAPAction = sOAPAction;
+	}
+
+	private String accessMethod;
+
+	public String getAccessMethod() {
+		return this.accessMethod;
+	}
+
+	public void setAccessMethod(String accessMethod) {
+		this.accessMethod = accessMethod;
+	}
+
+	private String proxyUri;
+
+	public String getProxyUri() {
+		return this.proxyUri;
+	}
+
+	public void setProxyUri(String proxyUri) {
+		this.proxyUri = proxyUri;
+	}
+
+	private String encryptPropertyFile;
+
+	public String getEncryptPropertyFile() {
+		return this.encryptPropertyFile;
+	}
+
+	public void setEncryptPropertyFile(String encryptPropertyFile) {
+		this.encryptPropertyFile = encryptPropertyFile;
+	}
+
+	private String sAMLPropertyFile;
+
+	public String getSAMLPropertyFile() {
+		return this.sAMLPropertyFile;
+	}
+
+	public void setSAMLPropertyFile(String sAMLPropertyFile) {
+		this.sAMLPropertyFile = sAMLPropertyFile;
+	}
+
+	private String encodingStyle;
+
+	public String getEncodingStyle() {
+		return this.encodingStyle;
+	}
+
+	public void setEncodingStyle(String encodingStyle) {
+		this.encodingStyle = encodingStyle;
+	}
+
+	private String uri;
+
+	public String getUri() {
+		return this.uri;
+	}
+
+	public void setUri(String uri) {
+		this.uri = uri;
+	}
+
+	private String securityType;
+
+	public String getSecurityType() {
+		return this.securityType;
+	}
+
+	public void setSecurityType(String securityType) {
+		this.securityType = securityType;
+	}
+
+	private String parameterMethod;
+
+	public String getParameterMethod() {
+		return this.parameterMethod;
+	}
+
+	public void setParameterMethod(String parameterMethod) {
+		this.parameterMethod = parameterMethod;
+	}
+
+	private String hostnameVerifier;
+
+	public String getHostnameVerifier() {
+		return this.hostnameVerifier;
+	}
+
+	public void setHostnameVerifier(String hostnameVerifier) {
+		this.hostnameVerifier = hostnameVerifier;
+	}
+
+	private String trustType;
+
+	public String getTrustType() {
+		return this.trustType;
+	}
+
+	public void setTrustType(String trustType) {
+		this.trustType = trustType;
+	}
+
+}

Modified: branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/soap/SOAPRequest.java
===================================================================
--- branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/soap/SOAPRequest.java	2009-12-21 19:41:26 UTC (rev 1687)
+++ branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/soap/SOAPRequest.java	2009-12-21 19:43:33 UTC (rev 1688)
@@ -30,6 +30,7 @@
 import com.metamatrix.connector.xml.base.RequestGenerator;
 import com.metamatrix.connector.xml.cache.CachingOutputStream;
 import com.metamatrix.connector.xml.http.HTTPConnectorState;
+import com.metamatrix.connector.xmlsource.soap.SecurityManagedConnectionFactory;
 import com.metamatrix.connector.xmlsource.soap.SecurityToken;
 
 public class SOAPRequest extends com.metamatrix.connector.xml.http.HTTPRequest {
@@ -56,7 +57,7 @@
 	protected InputStream executeRequest() throws ConnectorException {
 		try {
 			TrustedPayloadHandler handler = execution.getConnection().getTrustedPayloadHandler();
-			ConnectorEnvironment env = execution.getConnection().getConnectorEnv();
+			SecurityManagedConnectionFactory env = (SecurityManagedConnectionFactory)execution.getConnection().getConnectorEnv();
 			secToken = SecurityToken.getSecurityToken(env, handler);
 			
             QName svcQname = new QName("http://org.apache.cxf", "foo");
@@ -119,10 +120,8 @@
 
 	protected String getCacheKey() throws ConnectorException {
         StringBuffer cacheKey = new StringBuffer();
-        cacheKey.append("|"); //$NON-NLS-1$
-        cacheKey.append(execution.getConnection().getUser());
         cacheKey.append("|");
-        cacheKey.append(execution.getConnection().getQueryId());
+        cacheKey.append(execution.getExeContext().getRequestIdentifier());
         cacheKey.append("|");
         cacheKey.append(getUriString());
         cacheKey.append(requestNumber);

Modified: branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xmlsource/XMLConnectionFacory.java
===================================================================
--- branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xmlsource/XMLConnectionFacory.java	2009-12-21 19:41:26 UTC (rev 1687)
+++ branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xmlsource/XMLConnectionFacory.java	2009-12-21 19:43:33 UTC (rev 1688)
@@ -22,17 +22,16 @@
 
 package com.metamatrix.connector.xmlsource;
 
-import java.lang.reflect.Constructor;
+import java.util.ArrayList;
 
 import org.teiid.connector.api.Connection;
 import org.teiid.connector.api.ConnectorEnvironment;
 import org.teiid.connector.api.ConnectorException;
-import org.teiid.connector.api.ExecutionContext;
 
 
 
 /** 
- * This Connection facory which will handle the different connection semantics
+ * This Connection factory which will handle the different connection semantics
  * the supported type will be
  * - File Based XML Document
  * - SOAP Based XML Document
@@ -40,11 +39,11 @@
  * 
  */
 public class XMLConnectionFacory {
-    ConnectorEnvironment env;
+	XMLSourceManagedConnectionFactory env;
 
     
     public XMLConnectionFacory(ConnectorEnvironment env) {
-        this.env = env;
+        this.env = (XMLSourceManagedConnectionFactory)env;
     }
     
     /**
@@ -53,16 +52,11 @@
      * @return
      * @throws ConnectorException
      */
-    public Connection createConnection(ExecutionContext context) 
+    public Connection createConnection() 
         throws ConnectorException {
-        String connectionTypeClass = env.getProperties().getProperty("ConnectionType"); //$NON-NLS-1$
-        try {
-            Class clazz = Thread.currentThread().getContextClassLoader().loadClass(connectionTypeClass);
-            Constructor c = clazz.getConstructor(new Class[] {ConnectorEnvironment.class});                       
-            XMLSourceConnection conn = (XMLSourceConnection)c.newInstance(new Object[] {this.env});
-            return conn;
-        } catch (Exception e) {
-            throw new ConnectorException(e);
-        }
+        String connectionTypeClass = env.getConnectionType();
+        ArrayList ctorParams = new  ArrayList();
+        ctorParams.add(this.env);
+        return XMLSourceManagedConnectionFactory.getInstance(XMLSourceConnection.class, connectionTypeClass, ctorParams, null);
     }
 }

Modified: branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xmlsource/XMLSourceConnector.java
===================================================================
--- branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xmlsource/XMLSourceConnector.java	2009-12-21 19:41:26 UTC (rev 1687)
+++ branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xmlsource/XMLSourceConnector.java	2009-12-21 19:43:33 UTC (rev 1688)
@@ -23,31 +23,24 @@
 package com.metamatrix.connector.xmlsource;
 
 import org.teiid.connector.api.Connection;
-import org.teiid.connector.api.ConnectorCapabilities;
 import org.teiid.connector.api.ConnectorEnvironment;
 import org.teiid.connector.api.ConnectorException;
-import org.teiid.connector.api.ExecutionContext;
-import org.teiid.connector.api.ConnectorAnnotations.ConnectionPooling;
 import org.teiid.connector.basic.BasicConnector;
 
 /**
  * XML Source connector
  */
- at ConnectionPooling
 public class XMLSourceConnector extends BasicConnector {
 
     private ConnectorEnvironment env;
     private XMLConnectionFacory connFactory;
-    private boolean start = false;
 
     /**
      * Initialization with environment.
      */
 
     @Override
-	public void start(ConnectorEnvironment environment) throws ConnectorException {
-        start = true;
-
+	public void initialize(ConnectorEnvironment environment) throws ConnectorException {
         this.env = environment;
         this.connFactory = new XMLConnectionFacory(this.env);
         
@@ -55,30 +48,13 @@
         XMLSourcePlugin.logInfo(this.env.getLogger(), "Connector_started"); //$NON-NLS-1$
     }
 
-    /**
-     * Stop the Connector 
-     * @see org.teiid.connector.api.Connector#stop()
-     */
-    public void stop() {
-        if (!start) {
-            return;
-        }
-        start = false;
-        XMLSourcePlugin.logInfo(this.env.getLogger(), "Connector_stoped"); //$NON-NLS-1$
-    }
-
     /*
      * Get a Connection to the XML Source requested.
      * @see com.metamatrix.data.Connector#getConnection(com.metamatrix.data.SecurityContext)
      */
     @Override
-    public Connection getConnection(ExecutionContext context) throws ConnectorException {
-        return this.connFactory.createConnection(context);
+    public Connection getConnection() throws ConnectorException {
+        return this.connFactory.createConnection();
     }
 
-    @Override
-	public ConnectorCapabilities getCapabilities() {
-		return XMLSourceCapabilities.INSTANCE;
-	}
-
 }

Added: branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xmlsource/XMLSourceManagedConnectionFactory.java
===================================================================
--- branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xmlsource/XMLSourceManagedConnectionFactory.java	                        (rev 0)
+++ branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xmlsource/XMLSourceManagedConnectionFactory.java	2009-12-21 19:43:33 UTC (rev 1688)
@@ -0,0 +1,37 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership.  Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+package com.metamatrix.connector.xmlsource;
+
+import org.teiid.connector.basic.BasicManagedConnectionFactory;
+
+public class XMLSourceManagedConnectionFactory extends BasicManagedConnectionFactory {
+
+	private String connectionType;
+
+	public String getConnectionType() {
+		return this.connectionType;
+	}
+
+	public void setConnectionType(String connectionType) {
+		this.connectionType = connectionType;
+	}
+}

Modified: branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xmlsource/file/FileConnection.java
===================================================================
--- branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xmlsource/file/FileConnection.java	2009-12-21 19:41:26 UTC (rev 1687)
+++ branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xmlsource/file/FileConnection.java	2009-12-21 19:43:33 UTC (rev 1688)
@@ -23,7 +23,6 @@
 package com.metamatrix.connector.xmlsource.file;
 
 import java.io.File;
-import java.util.Properties;
 
 import org.teiid.connector.api.ConnectorEnvironment;
 import org.teiid.connector.api.ConnectorException;
@@ -41,9 +40,9 @@
  */
 public class FileConnection extends XMLSourceConnection {
     
-    private static final String DIRECTORY_LOCATION = "DirectoryLocation"; //$NON-NLS-1$
     boolean connected = false;
     File rootDirectory = null; // root directory where the XML files are stored 
+    private FileManagedConnectionFactory config;
     
     /**
      * ctor 
@@ -53,14 +52,15 @@
     public FileConnection(ConnectorEnvironment env) 
         throws ConnectorException {
         super(env);
+        this.config = (FileManagedConnectionFactory)env;
         connect();
     }
-
+    
     @Override
     public ProcedureExecution createProcedureExecution(IProcedure command,
     		ExecutionContext executionContext, RuntimeMetadata metadata)
     		throws ConnectorException {
-        return new FileExecution(command, this.env, metadata, executionContext, getXMLDirectory());
+        return new FileExecution(command, this.config, metadata, executionContext, getXMLDirectory());
     }
 
     /** 
@@ -76,8 +76,7 @@
      * Connect to the source 
      */
     void connect() throws ConnectorException {
-        Properties props = this.env.getProperties();
-        String dirPath = props.getProperty(DIRECTORY_LOCATION); 
+        String dirPath = this.config.getDirectoryLocation(); 
         
         if (dirPath == null) {
             throw new ConnectorException(XMLSourcePlugin.Util.getString("XML_dir_property_missing")); //$NON-NLS-1$            
@@ -89,7 +88,7 @@
             throw new ConnectorException(XMLSourcePlugin.Util.getString("XML_dir_property_wrong", new Object[] {dirPath})); //$NON-NLS-1$            
         }
         this.connected = true;        
-        XMLSourcePlugin.logDetail(this.env.getLogger(), "file_connection_open", new Object[] {this.rootDirectory.getAbsolutePath()}); //$NON-NLS-1$
+        XMLSourcePlugin.logDetail(this.config.getLogger(), "file_connection_open", new Object[] {this.rootDirectory.getAbsolutePath()}); //$NON-NLS-1$
     }
 
     /**
@@ -97,7 +96,7 @@
      */
     void disconnect() {
         this.connected = false;
-        XMLSourcePlugin.logDetail(this.env.getLogger(), "file_connection_closed", new Object[] {this.rootDirectory.getAbsolutePath()}); //$NON-NLS-1$
+        XMLSourcePlugin.logDetail(this.config.getLogger(), "file_connection_closed", new Object[] {this.rootDirectory.getAbsolutePath()}); //$NON-NLS-1$
         this.rootDirectory = null;
     }
 

Modified: branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xmlsource/file/FileExecution.java
===================================================================
--- branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xmlsource/file/FileExecution.java	2009-12-21 19:41:26 UTC (rev 1687)
+++ branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xmlsource/file/FileExecution.java	2009-12-21 19:43:33 UTC (rev 1688)
@@ -26,12 +26,10 @@
 import java.io.FileInputStream;
 import java.io.IOException;
 import java.io.InputStreamReader;
-import java.util.Properties;
 
 import javax.xml.transform.Source;
 import javax.xml.transform.stream.StreamSource;
 
-import org.teiid.connector.api.ConnectorEnvironment;
 import org.teiid.connector.api.ConnectorException;
 import org.teiid.connector.api.ExecutionContext;
 import org.teiid.connector.language.IProcedure;
@@ -46,14 +44,13 @@
  * Execution class for File based XML Source.
  */
 public class FileExecution extends XMLSourceExecution {
-    private static final String ENCODING = "CharacterEncodingScheme"; //$NON-NLS-1$
-    private static final String ISO8859 = "ISO-8859-1"; //$NON-NLS-1$
     
     RuntimeMetadata metadata = null;
     Source returnValue = null;
     ExecutionContext context;
     File rootFolder;
     private IProcedure procedure;
+    private FileManagedConnectionFactory config;
     
     /** 
      * @param env
@@ -61,13 +58,14 @@
      * @param context
      * @param metadata
      */
-    public FileExecution(IProcedure proc, ConnectorEnvironment env, RuntimeMetadata metadata, ExecutionContext context, File rootFolder) 
+    public FileExecution(IProcedure proc, FileManagedConnectionFactory env, RuntimeMetadata metadata, ExecutionContext context, File rootFolder) 
         throws ConnectorException{
         super(env);
         this.metadata = metadata;
         this.context = context;
         this.rootFolder = rootFolder;
         this.procedure = proc;
+        this.config = env;
     }
     
     /** 
@@ -93,8 +91,7 @@
             throw new ConnectorException(XMLSourcePlugin.Util.getString("XML_file_not_found", new Object[] {fileName, this.rootFolder.getAbsolutePath()})); //$NON-NLS-1$            
         }        
         
-        Properties props = this.env.getProperties();
-        String encoding = props.getProperty(ENCODING, ISO8859);
+        String encoding = this.config.getCharacterEncodingScheme();
         
         try {
 			this.returnValue = new StreamSource(new InputStreamReader(new FileInputStream(xmlFile), encoding));

Added: branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xmlsource/file/FileManagedConnectionFactory.java
===================================================================
--- branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xmlsource/file/FileManagedConnectionFactory.java	                        (rev 0)
+++ branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xmlsource/file/FileManagedConnectionFactory.java	2009-12-21 19:43:33 UTC (rev 1688)
@@ -0,0 +1,49 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership.  Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+package com.metamatrix.connector.xmlsource.file;
+
+import com.metamatrix.connector.xmlsource.XMLSourceManagedConnectionFactory;
+
+public class FileManagedConnectionFactory extends XMLSourceManagedConnectionFactory {
+	private static final long serialVersionUID = -592145141733613031L;
+
+	private String characterEncodingScheme = "ISO-8859-1";
+
+	public String getCharacterEncodingScheme() {
+		return this.characterEncodingScheme;
+	}
+
+	public void setCharacterEncodingScheme(String characterEncodingScheme) {
+		this.characterEncodingScheme = characterEncodingScheme;
+	}
+
+	private String directoryLocation;
+
+	public String getDirectoryLocation() {
+		return this.directoryLocation;
+	}
+
+	public void setDirectoryLocation(String directoryLocation) {
+		this.directoryLocation = directoryLocation;
+	}
+
+}

Added: branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xmlsource/soap/SecurityManagedConnectionFactory.java
===================================================================
--- branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xmlsource/soap/SecurityManagedConnectionFactory.java	                        (rev 0)
+++ branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xmlsource/soap/SecurityManagedConnectionFactory.java	2009-12-21 19:43:33 UTC (rev 1688)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership.  Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+package com.metamatrix.connector.xmlsource.soap;
+
+import org.teiid.connector.api.ConnectorEnvironment;
+
+public interface SecurityManagedConnectionFactory extends ConnectorEnvironment {
+	String getAuthPassword();
+	void setAuthPassword(String authPassword);
+	String getAuthUserName();
+	void setAuthUserName(String authUserName);
+	String getWSSecurityType();
+	void setWSSecurityType(String wSSecurityType);
+	String getEncryptUserName();
+	void setEncryptUserName(String encryptUserName);
+	String getCryptoPropertyFile();
+	void setCryptoPropertyFile(String cryptoPropertyFile);
+	String getEncryptPropertyFile();
+	void setEncryptPropertyFile(String encryptPropertyFile);
+	String getSAMLPropertyFile();
+	void setSAMLPropertyFile(String sAMLPropertyFile);;
+	String getSecurityType()	;
+	void setSecurityType(String securityType);
+	String getTrustType();
+	void setTrustType(String trustType);
+}

Modified: branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xmlsource/soap/SecurityToken.java
===================================================================
--- branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xmlsource/soap/SecurityToken.java	2009-12-21 19:41:26 UTC (rev 1687)
+++ branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xmlsource/soap/SecurityToken.java	2009-12-21 19:43:33 UTC (rev 1688)
@@ -65,13 +65,13 @@
     public static final String ISSUER_SERIAL = "IssuerSerial"; //$NON-NLS-1$
     public static final String DIRECT_REFERENCE = "DirectReference"; //$NON-NLS-1$
     
-    ConnectorEnvironment env;
+    SecurityManagedConnectionFactory env;
     String username;
     String password;
     
-    public static SecurityToken getSecurityToken(ConnectorEnvironment env, TrustedPayloadHandler trustedPayloadHandler) {
+    public static SecurityToken getSecurityToken(SecurityManagedConnectionFactory env, TrustedPayloadHandler trustedPayloadHandler) {
         // first find out what type of security we are going to handle
-        String securityType = env.getProperties().getProperty(SoapConnectorProperties.AUTHORIZATION_TYPE);
+        String securityType = env.getSecurityType();
         
         if (securityType != null) {            
             // the first two are non-ws-security based; and they can not be nested.
@@ -83,7 +83,7 @@
             }
             else if (securityType.equalsIgnoreCase(WS_SECURITY)) {   
 
-                String wsSecurityType = env.getProperties().getProperty(SoapConnectorProperties.WS_SECURITY_TYPE);
+                String wsSecurityType = env.getWSSecurityType();
                 if (wsSecurityType != null && wsSecurityType.length() > 0) {
 
                     // if this is WS-security then we need to find sub-category of it
@@ -131,7 +131,7 @@
         return new NoProvider(env, trustedPayloadHandler);
     }
     
-    SecurityToken(ConnectorEnvironment env, TrustedPayloadHandler trustedPayloadHandler) {
+    SecurityToken(SecurityManagedConnectionFactory env, TrustedPayloadHandler trustedPayloadHandler) {
         this.env = env;
         if (null != trustedPayloadHandler) {
         	String tempPassword = trustedPayloadHandler.getPassword();
@@ -148,8 +148,8 @@
     }
 
 	private void setCredentialsFromEnv() {
-		username = this.env.getProperties().getProperty(SoapConnectorProperties.USERNAME);
-		password = this.env.getProperties().getProperty(SoapConnectorProperties.PASSWORD);
+		username = this.env.getAuthUserName();
+		password = this.env.getAuthPassword();
 	}
     
     public String getUsername() {
@@ -160,12 +160,9 @@
         return password;
     }
     
-    String getProperty(String name) {
-        return this.env.getProperties().getProperty(name);
-    }
     
     String getTrustType() {
-        String type = this.env.getProperties().getProperty(SoapConnectorProperties.TRUST_TYPE);
+        String type = this.env.getTrustType();
         if (type != null) {
             if (type.equalsIgnoreCase(ISSUER_SERIAL)) {
                 return ISSUER_SERIAL;
@@ -187,7 +184,7 @@
 class WSSecurityToken extends SecurityToken implements CallbackHandler {
     WSSecurityToken nextToken;
     
-    public WSSecurityToken(ConnectorEnvironment env, TrustedPayloadHandler trustedPayloadHandler) {
+    public WSSecurityToken(SecurityManagedConnectionFactory env, TrustedPayloadHandler trustedPayloadHandler) {
         super(env, trustedPayloadHandler);
     }
     
@@ -241,7 +238,7 @@
  * defines that there is no security provider 
  */
 class NoProvider extends SecurityToken{
-    public NoProvider(ConnectorEnvironment env, TrustedPayloadHandler trustedPayloadHandler){
+    public NoProvider(SecurityManagedConnectionFactory env, TrustedPayloadHandler trustedPayloadHandler){
         super(env, trustedPayloadHandler);
     }
     @Override
@@ -254,7 +251,7 @@
  * in HTTP Headers.  Uses Basic-Relam.
  */
 class HTTPBasic extends SecurityToken{
-    public HTTPBasic(ConnectorEnvironment env, TrustedPayloadHandler trustedPayloadHandler){
+    public HTTPBasic(SecurityManagedConnectionFactory env, TrustedPayloadHandler trustedPayloadHandler){
         super(env, trustedPayloadHandler);
     }
     @Override
@@ -270,7 +267,7 @@
  */
 class TimestampProfile extends WSSecurityToken {
 
-    public TimestampProfile(ConnectorEnvironment env, TrustedPayloadHandler trustedPayloadHandler) {
+    public TimestampProfile(SecurityManagedConnectionFactory env, TrustedPayloadHandler trustedPayloadHandler) {
         super(env, trustedPayloadHandler);
         XMLSourcePlugin.logDetail(this.env.getLogger(), "using_timestamp_profile"); //$NON-NLS-1$
     }
@@ -292,7 +289,7 @@
 class UsernameTokenProfile extends WSSecurityToken {        
     boolean encryptedPassword = false;
     
-    public UsernameTokenProfile(ConnectorEnvironment env, TrustedPayloadHandler trustedPayloadHandler, boolean encryptedPassword){
+    public UsernameTokenProfile(SecurityManagedConnectionFactory env, TrustedPayloadHandler trustedPayloadHandler, boolean encryptedPassword){
         super(env, trustedPayloadHandler);
         this.encryptedPassword = encryptedPassword;
         XMLSourcePlugin.logDetail(this.env.getLogger(), "using_username_profile"); //$NON-NLS-1$
@@ -342,7 +339,7 @@
 }
 
 class EncryptProfile extends WSSecurityToken {            
-    public EncryptProfile(ConnectorEnvironment env, TrustedPayloadHandler trustedPayloadHandler){
+    public EncryptProfile(SecurityManagedConnectionFactory env, TrustedPayloadHandler trustedPayloadHandler){
         super(env, trustedPayloadHandler);
         XMLSourcePlugin.logDetail(this.env.getLogger(), "using_encrypt_profile"); //$NON-NLS-1$
     }
@@ -350,7 +347,7 @@
     @Override
 	public void addSecurity(Call call) {
         setAction(call, WSHandlerConstants.ENCRYPT);
-        String user = getProperty(SoapConnectorProperties.ENCRYPTION_USER);
+        String user = this.env.getEncryptUserName();
         if (user == null || user.length() == 0) {            
             call.setProperty(WSHandlerConstants.ENCRYPTION_USER, getUsername());
         }
@@ -360,7 +357,7 @@
         call.setProperty(WSHandlerConstants.USER, getUsername());
         
         //Configuration of public key used to encrypt message goes to properties file.
-        String encryptionProp = getProperty(SoapConnectorProperties.ENCRYPTION_PROPERTY_FILE);
+        String encryptionProp = this.env.getEncryptPropertyFile();
         if (encryptionProp == null || encryptionProp.length() == 0) {
             throw new RuntimeException(XMLSourcePlugin.Util.getString("no_encryption_property_file")); //$NON-NLS-1$ 
         }
@@ -374,7 +371,7 @@
  */                
 class SignatureProfile extends WSSecurityToken {
 
-    public SignatureProfile(ConnectorEnvironment env, TrustedPayloadHandler trustedPayloadHandler) {
+    public SignatureProfile(SecurityManagedConnectionFactory env, TrustedPayloadHandler trustedPayloadHandler) {
         super(env, trustedPayloadHandler);
         XMLSourcePlugin.logDetail(this.env.getLogger(), "using_signature_profile"); //$NON-NLS-1$
     }
@@ -385,7 +382,7 @@
         call.setProperty(WSHandlerConstants.USER, getUsername());
         call.setProperty(WSHandlerConstants.PW_CALLBACK_REF, this);
         
-        String cryptoFile = getProperty(SoapConnectorProperties.SIGNATURE_PROPERTY_FILE);
+        String cryptoFile = this.env.getCryptoPropertyFile();
         if (cryptoFile == null || cryptoFile.length() == 0) {
             throw new RuntimeException(XMLSourcePlugin.Util.getString("no_crypto_property_file")); //$NON-NLS-1$ 
         }
@@ -401,7 +398,7 @@
 class SAMLTokenProfile extends WSSecurityToken {
     boolean signed = false;
     
-    public SAMLTokenProfile(ConnectorEnvironment env, TrustedPayloadHandler trustedPayloadHandler, boolean signed){
+    public SAMLTokenProfile(SecurityManagedConnectionFactory env, TrustedPayloadHandler trustedPayloadHandler, boolean signed){
         super(env, trustedPayloadHandler);
         this.signed = signed;
     }
@@ -412,7 +409,7 @@
         if (signed) {
             setAction(call, WSHandlerConstants.SAML_TOKEN_SIGNED);
             
-            String cryptoFile = getProperty(SoapConnectorProperties.SIGNATURE_PROPERTY_FILE);
+            String cryptoFile = this.env.getCryptoPropertyFile();
             if (cryptoFile == null || cryptoFile.length() == 0) {
                 throw new RuntimeException(XMLSourcePlugin.Util.getString("no_crypto_property_file")); //$NON-NLS-1$ 
             }
@@ -432,7 +429,7 @@
         }
         
         // set the SAML Properties file
-        String samlPropertyFile = getProperty(SoapConnectorProperties.SAML_PROPERTY_FILE);
+        String samlPropertyFile = this.env.getSAMLPropertyFile();
         if (samlPropertyFile == null || samlPropertyFile.length() == 0) {
             throw new RuntimeException(XMLSourcePlugin.Util.getString("no_saml_property_file")); //$NON-NLS-1$ 
         }

Modified: branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xmlsource/soap/ServiceOperation.java
===================================================================
--- branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xmlsource/soap/ServiceOperation.java	2009-12-21 19:41:26 UTC (rev 1687)
+++ branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xmlsource/soap/ServiceOperation.java	2009-12-21 19:43:33 UTC (rev 1688)
@@ -43,7 +43,6 @@
 import org.apache.axis.wsdl.symbolTable.Parameter;
 import org.apache.axis.wsdl.symbolTable.Parameters;
 import org.apache.axis.wsdl.symbolTable.TypeEntry;
-import org.teiid.connector.api.ConnectorEnvironment;
 import org.w3c.dom.Element;
 
 import com.metamatrix.connector.xmlsource.XMLSourcePlugin;
@@ -61,14 +60,14 @@
     String portName;
     boolean usesComplexType = false;
     String style;
-    ConnectorEnvironment env;
+    SoapManagedConnectionFactory env;
     
     /**
      * ctor 
      * @param name
      * @param parms
      */
-    ServiceOperation(ConnectorEnvironment env, String name, Parameters parms, String portName, String style) {
+    ServiceOperation(SoapManagedConnectionFactory env, String name, Parameters parms, String portName, String style) {
         this.name = name;
         this.parameters = parms;
         this.portName = portName;
@@ -95,15 +94,11 @@
     }
     
     int getQueryTimeout() {
-        String timeout = this.env.getProperties().getProperty(SoapConnectorProperties.QUERY_TIMEOUT);
-        if (timeout != null && timeout.length() > 0) {
-            return Integer.parseInt(timeout)*1000;
-        }
-        return -1;
+    	return this.env.getQueryTimeout();
     }
     
     String getEndPoint() {
-        return this.env.getProperties().getProperty(SoapConnectorProperties.END_POINT);
+        return this.env.getEndPoint();
     }
         
     /**

Modified: branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xmlsource/soap/SoapConnection.java
===================================================================
--- branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xmlsource/soap/SoapConnection.java	2009-12-21 19:41:26 UTC (rev 1687)
+++ branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xmlsource/soap/SoapConnection.java	2009-12-21 19:43:33 UTC (rev 1688)
@@ -26,7 +26,6 @@
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
-import java.util.Properties;
 import java.util.Vector;
 
 import javax.wsdl.Binding;
@@ -68,6 +67,7 @@
     SoapService service = null; // wsdl service
     Map operationsMap = new HashMap();
     SecurityToken securityToken = null;
+    private SoapManagedConnectionFactory config;
     
     /** 
      * @param env
@@ -75,6 +75,7 @@
      */
     public SoapConnection(ConnectorEnvironment env) throws ConnectorException {
         super(env);
+       this.config = (SoapManagedConnectionFactory)env;
         connect();
     }
     
@@ -103,9 +104,8 @@
     }
     
     void connect() throws ConnectorException {
-        Properties props = this.env.getProperties();        
-        String wsdl = props.getProperty(SoapConnectorProperties.WSDL);
-        String portName = props.getProperty(SoapConnectorProperties.PORT_NAME);
+        String wsdl = this.config.getWsdl();
+        String portName = this.config.getPortName();
         
         // check if WSDL is supplied
         if (wsdl == null || wsdl.trim().length() == 0) {
@@ -123,7 +123,7 @@
             Service wsdlService = getService(wsdlParser.getSymbolTable());
 
             // WS-Security handler provider
-            this.securityToken = SecurityToken.getSecurityToken(this.env, null);
+            this.securityToken = SecurityToken.getSecurityToken(this.config, null);
             
             // now create a AXIS based service 
             this.service  = new SoapService(wsdlParser, wsdlService.getQName(), this.securityToken);            
@@ -180,7 +180,7 @@
             Parameters parameters = bEntry.getParameters(operation);
 
             // create operation with the available details
-            ServiceOperation so = new ServiceOperation(this.env, operation.getName(), parameters, usePort.getName(), style);
+            ServiceOperation so = new ServiceOperation(this.config, operation.getName(), parameters, usePort.getName(), style);
        
             // collect all the services available
             map.put(operation.getName(), so);

Added: branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xmlsource/soap/SoapManagedConnectionFactory.java
===================================================================
--- branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xmlsource/soap/SoapManagedConnectionFactory.java	                        (rev 0)
+++ branches/JCA/connectors/connector-xml/src/main/java/com/metamatrix/connector/xmlsource/soap/SoapManagedConnectionFactory.java	2009-12-21 19:43:33 UTC (rev 1688)
@@ -0,0 +1,158 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership.  Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+package com.metamatrix.connector.xmlsource.soap;
+
+import com.metamatrix.connector.xmlsource.XMLSourceManagedConnectionFactory;
+
+public class SoapManagedConnectionFactory extends XMLSourceManagedConnectionFactory implements SecurityManagedConnectionFactory {
+	private static final long serialVersionUID = 6175706287620555719L;
+
+	private String authPassword;
+
+	public String getAuthPassword() {
+		return this.authPassword;
+	}
+
+	public void setAuthPassword(String authPassword) {
+		this.authPassword = authPassword;
+	}
+
+	private String sAMLPropertyFile;
+
+	public String getSAMLPropertyFile() {
+		return this.sAMLPropertyFile;
+	}
+
+	public void setSAMLPropertyFile(String sAMLPropertyFile) {
+		this.sAMLPropertyFile = sAMLPropertyFile;
+	}
+
+	private String wsdl;
+
+	public String getWsdl() {
+		return this.wsdl;
+	}
+
+	public void setWsdl(String wsdl) {
+		this.wsdl = wsdl;
+	}
+
+	private String authUserName;
+
+	public String getAuthUserName() {
+		return this.authUserName;
+	}
+
+	public void setAuthUserName(String authUserName) {
+		this.authUserName = authUserName;
+	}
+
+	private String wSSecurityType;
+
+	public String getWSSecurityType() {
+		return this.wSSecurityType;
+	}
+
+	public void setWSSecurityType(String wSSecurityType) {
+		this.wSSecurityType = wSSecurityType;
+	}
+
+	private String encryptUserName;
+
+	public String getEncryptUserName() {
+		return this.encryptUserName;
+	}
+
+	public void setEncryptUserName(String encryptUserName) {
+		this.encryptUserName = encryptUserName;
+	}
+
+	private String endPoint;
+
+	public String getEndPoint() {
+		return this.endPoint;
+	}
+
+	public void setEndPoint(String endPoint) {
+		this.endPoint = endPoint;
+	}
+
+	private String securityType;
+
+	public String getSecurityType() {
+		return this.securityType;
+	}
+
+	public void setSecurityType(String securityType) {
+		this.securityType = securityType;
+	}
+
+	private String cryptoPropertyFile;
+
+	public String getCryptoPropertyFile() {
+		return this.cryptoPropertyFile;
+	}
+
+	public void setCryptoPropertyFile(String cryptoPropertyFile) {
+		this.cryptoPropertyFile = cryptoPropertyFile;
+	}
+
+	private String encryptPropertyFile;
+
+	public String getEncryptPropertyFile() {
+		return this.encryptPropertyFile;
+	}
+
+	public void setEncryptPropertyFile(String encryptPropertyFile) {
+		this.encryptPropertyFile = encryptPropertyFile;
+	}
+
+	private String trustType;
+
+	public String getTrustType() {
+		return this.trustType;
+	}
+
+	public void setTrustType(String trustType) {
+		this.trustType = trustType;
+	}
+	
+	private String portName;
+
+	public String getPortName() {
+		return portName;
+	}
+
+	public void setPortName(String portName) {
+		this.portName = portName;
+	} 
+
+	private int queryTimeout;
+
+	public int getQueryTimeout() {
+		return queryTimeout;
+	}
+
+	public void setQueryTimeout(Integer queryTimeout) {
+		this.queryTimeout = queryTimeout;
+	}
+}

Added: branches/JCA/connectors/connector-xml/src/main/rar/META-INF/xml-file/ra.xml
===================================================================
--- branches/JCA/connectors/connector-xml/src/main/rar/META-INF/xml-file/ra.xml	                        (rev 0)
+++ branches/JCA/connectors/connector-xml/src/main/rar/META-INF/xml-file/ra.xml	2009-12-21 19:43:33 UTC (rev 1688)
@@ -0,0 +1,166 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<connector xmlns="http://java.sun.com/xml/ns/j2ee"
+           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+           xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
+           http://java.sun.com/xml/ns/j2ee/connector_1_5.xsd"
+           version="1.5">
+
+   <vendor-name>Red Hat Middleware LLC</vendor-name>
+   <eis-type>Teiid XML-Relational File Connector</eis-type>
+   <resourceadapter-version>1.0</resourceadapter-version>
+   <license>
+      <description>
+ JBoss, Home of Professional Open Source.
+ Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ as indicated by the @author tags. See the copyright.txt file in the
+ distribution for a full listing of individual contributors.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+      </description>
+      <license-required>true</license-required>
+   </license>
+   <resourceadapter>
+      <resourceadapter-class>org.teiid.connector.basic.BasicResourceAdapter</resourceadapter-class>
+
+      <outbound-resourceadapter>
+         <connection-definition>
+            <managedconnectionfactory-class> com.metamatrix.connector.xml.file.FileManagedConnectionFactory</managedconnectionfactory-class>
+
+            <config-property>
+               <description>Connector Class</description>
+               <config-property-name>ConnectorClass</config-property-name>
+               <config-property-type>java.lang.String</config-property-type>
+               <config-property-value>com.metamatrix.connector.xml.base.XMLConnector</config-property-value>
+            </config-property>
+
+            <config-property>
+               <description>Connector Capabilities</description>
+               <description>The class to use to provide the Connector Capabilities</description>
+               <config-property-name>CapabilitiesClass</config-property-name>
+               <config-property-type>java.lang.String</config-property-type>
+               <config-property-value>com.metamatrix.connector.xml.base.XMLCapabilities</config-property-value>
+            </config-property>
+            
+            <config-property>
+               <description>Is Immutable</description>
+               <description>Is Immutable, True if the source never changes.</description>
+               <config-property-name>Immutable</config-property-name>
+               <config-property-type>java.lang.Boolean</config-property-type>
+               <config-property-value>true</config-property-value>
+            </config-property>
+            
+            <config-property>
+               <description>Is XA Capable</description>
+               <description>True, if this connector supports XA Transactions</description>
+               <config-property-name>XaCapable</config-property-name>
+               <config-property-type>java.lang.Boolean</config-property-type>
+               <config-property-value>false</config-property-value>
+            </config-property>            
+
+            <config-property>             
+               <description>Exception on Exceeding Max Rows</description>
+               <description>Indicates if an Exception should be thrown if the specified value for Maximum Result Rows is exceeded; else no exception and no more than the maximum will be returned</description>
+               <config-property-name>ExceptionOnMaxRows</config-property-name>
+               <config-property-type>java.lang.Boolean</config-property-type>
+               <config-property-value>true</config-property-value>
+            </config-property>
+
+            <config-property>
+               <description>Maximum Result Rows</description>
+               <description>Maximum Result Rows allowed</description>
+               <config-property-name>MaxResultRows</config-property-name>
+               <config-property-type>java.lang.Integer</config-property-type>
+               <config-property-value>10000</config-property-value>
+            </config-property>
+
+            <!--  XML-Relational File Connector Specific properties -->
+
+            <config-property>
+                <description>File Path</description>
+                <config-property-name>FilePath</config-property-name>
+                <config-property-type>java.lang.String</config-property-type>
+            </config-property>
+            
+            <config-property>
+                <description>Enable Document Caching</description>
+                <config-property-name>CacheEnabled</config-property-name>
+                <config-property-type>java.lang.Boolean</config-property-type>
+                <config-property-value>false</config-property-value>
+            </config-property>
+            
+            <config-property>
+                <description>XML Filter Provider</description>
+                <description>The class the provides extended XML Filters</description>
+                <config-property-name>SaxFilterProviderClass</config-property-name>
+                <config-property-type>java.lang.String</config-property-type>
+                <config-property-value>com.metamatrix.connector.xml.base.NoExtendedFilters</config-property-value>
+            </config-property>
+            
+            <config-property>
+                <description>Connector State Class</description>
+                <config-property-name>ConnectorStateClass</config-property-name>
+                <config-property-type>java.lang.String</config-property-type>
+                <config-property-value>com.metamatrix.connector.xml.file.FileConnectorState</config-property-value>
+            </config-property>
+            
+            <config-property>
+                <description>Log XML Request and Response Documents</description>
+                <description>Write the request and response documents to the log at Info level</description>
+                <config-property-name>LogRequestResponseDocs</config-property-name>
+                <config-property-type>java.lang.Boolean</config-property-type>
+                <config-property-value>false</config-property-value>
+            </config-property>
+            
+            <config-property>
+                <description>Input Stream Filter Class</description>
+                <description>The class to use to preprocess raw XML input stream</description>
+                <config-property-name>InputStreamFilterClass</config-property-name>
+                <config-property-type>java.lang.String</config-property-type>
+                <config-property-value>com.metamatrix.connector.xml.base.PluggableInputStreamFilterImpl</config-property-value>
+            </config-property>
+            
+            <config-property>
+                <description>File Name</description>
+                <config-property-name>FileName</config-property-name>
+                <config-property-type>java.lang.String</config-property-type>
+            </config-property>
+            
+            <config-property>
+                <description>Query Preprocessor Class</description>
+                <description>The class to use to preprocess the IQuery</description>
+                <config-property-name>QueryPreprocessorClass</config-property-name>
+                <config-property-type>java.lang.String</config-property-type>
+                <config-property-value>com.metamatrix.connector.xml.base.NoQueryPreprocessing</config-property-value>
+            </config-property>
+            
+            <connectionfactory-interface>org.teiid.connector.api.Connector</connectionfactory-interface>
+            <connectionfactory-impl-class>org.teiid.connector.basic.WrappedConnector</connectionfactory-impl-class>
+            <connection-interface>org.teiid.connector.api.Connection</connection-interface>
+            <connection-impl-class>org.teiid.connector.basic.WrappedConnection</connection-impl-class>
+
+         </connection-definition>
+         
+         <transaction-support>NoTransaction</transaction-support>
+        
+        <authentication-mechanism>
+            <authentication-mechanism-type>BasicPassword</authentication-mechanism-type>
+            <credential-interface>javax.resource.spi.security.PasswordCredential</credential-interface>
+        </authentication-mechanism>
+        <reauthentication-support>false</reauthentication-support>
+      </outbound-resourceadapter>
+   </resourceadapter>
+</connector>

Added: branches/JCA/connectors/connector-xml/src/main/rar/META-INF/xml-http/ra.xml
===================================================================
--- branches/JCA/connectors/connector-xml/src/main/rar/META-INF/xml-http/ra.xml	                        (rev 0)
+++ branches/JCA/connectors/connector-xml/src/main/rar/META-INF/xml-http/ra.xml	2009-12-21 19:43:33 UTC (rev 1688)
@@ -0,0 +1,234 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<connector xmlns="http://java.sun.com/xml/ns/j2ee"
+           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+           xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
+           http://java.sun.com/xml/ns/j2ee/connector_1_5.xsd"
+           version="1.5">
+
+   <vendor-name>Red Hat Middleware LLC</vendor-name>
+   <eis-type>Teiid XML-Relational HTTP Connector</eis-type>
+   <resourceadapter-version>1.0</resourceadapter-version>
+   <license>
+      <description>
+ JBoss, Home of Professional Open Source.
+ Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ as indicated by the @author tags. See the copyright.txt file in the
+ distribution for a full listing of individual contributors.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+      </description>
+      <license-required>true</license-required>
+   </license>
+   <resourceadapter>
+      <resourceadapter-class>org.teiid.connector.basic.BasicResourceAdapter</resourceadapter-class>
+
+      <outbound-resourceadapter>
+         <connection-definition>
+            <managedconnectionfactory-class>com.metamatrix.connector.xml.http.HTTPManagedConnectionFactory</managedconnectionfactory-class>
+
+            <config-property>
+               <description>Connector Class</description>
+               <config-property-name>ConnectorClass</config-property-name>
+               <config-property-type>java.lang.String</config-property-type>
+               <config-property-value>com.metamatrix.connector.xml.base.XMLConnector</config-property-value>
+            </config-property>
+
+            <config-property>
+               <description>Connector Capabilities</description>
+               <description>The class to use to provide the Connector Capabilities</description>
+               <config-property-name>CapabilitiesClass</config-property-name>
+               <config-property-type>java.lang.String</config-property-type>
+               <config-property-value>com.metamatrix.connector.xml.base.XMLCapabilities</config-property-value>
+            </config-property>
+            
+            <config-property>
+               <description>Is Immutable</description>
+               <description>Is Immutable, True if the source never changes.</description>
+               <config-property-name>Immutable</config-property-name>
+               <config-property-type>java.lang.Boolean</config-property-type>
+               <config-property-value>false</config-property-value>
+            </config-property>
+            
+            <config-property>
+               <description>Is XA Capable</description>
+               <description>True, if this connector supports XA Transactions</description>
+               <config-property-name>XaCapable</config-property-name>
+               <config-property-type>java.lang.Boolean</config-property-type>
+               <config-property-value>false</config-property-value>
+            </config-property>            
+
+            <config-property>             
+               <description>Exception on Exceeding Max Rows</description>
+               <description>Indicates if an Exception should be thrown if the specified value for Maximum Result Rows is exceeded; else no exception and no more than the maximum will be returned</description>
+               <config-property-name>ExceptionOnMaxRows</config-property-name>
+               <config-property-type>java.lang.Boolean</config-property-type>
+               <config-property-value>true</config-property-value>
+            </config-property>
+
+            <config-property>
+               <description>Maximum Result Rows</description>
+               <description>Maximum Result Rows allowed</description>
+               <config-property-name>MaxResultRows</config-property-name>
+               <config-property-type>java.lang.Integer</config-property-type>
+               <config-property-value>10000</config-property-value>
+            </config-property>
+
+            <!--  XML-Relational HTTP Connector Specific properties -->
+
+            <config-property>
+                <description>XML Filter Provider</description>
+                <description>The class the provides extended XML Filters</description>
+                <config-property-name>SaxFilterProviderClass</config-property-name>
+                <config-property-type>java.lang.String</config-property-type>
+                <config-property-value>com.metamatrix.connector.xml.base.NoExtendedFilters</config-property-value>
+            </config-property>
+            
+            <config-property>
+                <description>XML Parameter Name</description>
+                <config-property-name>XMLParmName</config-property-name>
+                <config-property-type>java.lang.String</config-property-type>
+            </config-property>
+            
+            <config-property>
+                <description>Request Timeout (in Milliseconds)</description>
+                <config-property-name>RequestTimeout</config-property-name>
+                <config-property-type>java.lang.Integer</config-property-type>
+                <config-property-value>10000</config-property-value>
+            </config-property>
+            
+            <config-property>
+                <description>Authentication Required</description>
+                <config-property-name>Authenticate</config-property-name>
+                <config-property-type>java.lang.Boolean</config-property-type>
+                <config-property-value>false</config-property-value>
+            </config-property>
+            
+            <config-property>
+                <description>Connector State Class</description>
+                <config-property-name>ConnectorStateClass</config-property-name>
+                <config-property-type>java.lang.String</config-property-type>
+                <config-property-value>com.metamatrix.connector.xml.http.HTTPConnectorState</config-property-value>
+            </config-property>
+            
+            <config-property>
+                <description>HTTP Basic Authentication Password</description>
+                <description>Password value for HTTP basic authentication</description>
+                <config-property-name>HttpBasicAuthPassword</config-property-name>
+                <config-property-type>java.lang.String</config-property-type>
+            </config-property>
+            
+            <config-property>
+                <description>Access Method</description>
+                <description>ALLOWED:get,post</description>
+                <config-property-name>AccessMethod</config-property-name>
+                <config-property-type>java.lang.String</config-property-type>
+                <config-property-value>get</config-property-value>
+            </config-property>
+            
+            <config-property>
+                <description>Proxy Server URI</description>
+                <description>The URI of the proxy server</description>
+                <config-property-name>ProxyUri</config-property-name>
+                <config-property-type>java.lang.String</config-property-type>
+            </config-property>
+            
+            <config-property>
+                <description>HTTP Basic Authentication Name</description>
+                <description>Name value for HTTP basic authentication</description>
+                <config-property-name>HttpBasicAuthUserName</config-property-name>
+                <config-property-type>java.lang.String</config-property-type>
+            </config-property>
+            
+            <config-property>
+                <description>Server URI</description>
+                <description>The URI of the HTTP source</description>
+                <config-property-name>Uri</config-property-name>
+                <config-property-type>java.lang.String</config-property-type>
+            </config-property>
+            
+            <config-property>
+                <description>Use HTTP Basic authentication</description>
+                <description>Use basic HTTP Authentication</description>
+                <config-property-name>UseHttpBasic</config-property-name>
+                <config-property-type>java.lang.Boolean</config-property-type>
+                <config-property-value>false</config-property-value>
+            </config-property>
+            
+            <config-property>
+                <description>Log XML Request and Response Documents</description>
+                <description>Write the request and response documents to the log at Info level</description>
+                <config-property-name>LogRequestResponseDocs</config-property-name>
+                <config-property-type>java.lang.Boolean</config-property-type>
+                <config-property-value>false</config-property-value>
+            </config-property>
+            
+            <config-property>
+                <description>Trust Deserializer Class</description>
+                <description>The class to use to process trusted payloads and execution payloads</description>
+                <config-property-name>TrustDeserializerClass</config-property-name>
+                <config-property-type>java.lang.String</config-property-type>
+                <config-property-value>com.metamatrix.connector.xml.http.DefaultTrustDeserializer</config-property-value>
+            </config-property>
+            
+            <config-property>
+                <description>Parameter Method</description>
+                <description>ALLOWED:None,Name/Value,XMLRequest,XMLInQueryString</description>
+                <config-property-name>ParameterMethod</config-property-name>
+                <config-property-type>java.lang.String</config-property-type>
+                <config-property-value>None</config-property-value>
+            </config-property>
+            
+            <config-property>
+                <description>Input Stream Filter Class</description>
+                <description>The class to use to preprocess raw XML input stream</description>
+                <config-property-name>InputStreamFilterClass</config-property-name>
+                <config-property-type>java.lang.String</config-property-type>
+                <config-property-value>com.metamatrix.connector.xml.base.PluggableInputStreamFilterImpl</config-property-value>
+            </config-property>
+            
+            <config-property>
+                <description>Hostname Verifier</description>
+                <description>Class implementing javax.net.ssl.HostnameVerifier.  Used to implement a hostname mismatch workaround.</description>
+                <config-property-name>HostnameVerifier</config-property-name>
+                <config-property-type>java.lang.String</config-property-type>
+            </config-property>
+            
+            <config-property>
+                <description>Query Preprocessor Class</description>
+                <description>The class to use to preprocess the IQuery</description>
+                <config-property-name>QueryPreprocessorClass</config-property-name>
+                <config-property-type>java.lang.String</config-property-type>
+                <config-property-value>com.metamatrix.connector.xml.base.NoQueryPreprocessing</config-property-value>
+            </config-property>                    
+            
+            <connectionfactory-interface>org.teiid.connector.api.Connector</connectionfactory-interface>
+            <connectionfactory-impl-class>org.teiid.connector.basic.WrappedConnector</connectionfactory-impl-class>
+            <connection-interface>org.teiid.connector.api.Connection</connection-interface>
+            <connection-impl-class>org.teiid.connector.basic.WrappedConnection</connection-impl-class>
+
+         </connection-definition>
+         
+         <transaction-support>NoTransaction</transaction-support>
+        
+        <authentication-mechanism>
+            <authentication-mechanism-type>BasicPassword</authentication-mechanism-type>
+            <credential-interface>javax.resource.spi.security.PasswordCredential</credential-interface>
+        </authentication-mechanism>
+        <reauthentication-support>false</reauthentication-support>
+      </outbound-resourceadapter>
+   </resourceadapter>
+</connector>

Added: branches/JCA/connectors/connector-xml/src/main/rar/META-INF/xml-soap/ra.xml
===================================================================
--- branches/JCA/connectors/connector-xml/src/main/rar/META-INF/xml-soap/ra.xml	                        (rev 0)
+++ branches/JCA/connectors/connector-xml/src/main/rar/META-INF/xml-soap/ra.xml	2009-12-21 19:43:33 UTC (rev 1688)
@@ -0,0 +1,302 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<connector xmlns="http://java.sun.com/xml/ns/j2ee"
+           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+           xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
+           http://java.sun.com/xml/ns/j2ee/connector_1_5.xsd"
+           version="1.5">
+
+   <vendor-name>Red Hat Middleware LLC</vendor-name>
+   <eis-type>Teiid XML-Relational SOAP Connector</eis-type>
+   <resourceadapter-version>1.0</resourceadapter-version>
+   <license>
+      <description>
+ JBoss, Home of Professional Open Source.
+ Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ as indicated by the @author tags. See the copyright.txt file in the
+ distribution for a full listing of individual contributors.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+      </description>
+      <license-required>true</license-required>
+   </license>
+   <resourceadapter>
+      <resourceadapter-class>org.teiid.connector.basic.BasicResourceAdapter</resourceadapter-class>
+
+      <outbound-resourceadapter>
+         <connection-definition>
+            <managedconnectionfactory-class>com.metamatrix.connector.xml.soap.SOAPManagedConnectionFactory</managedconnectionfactory-class>
+
+            <config-property>
+               <description>Connector Class</description>
+               <config-property-name>ConnectorClass</config-property-name>
+               <config-property-type>java.lang.String</config-property-type>
+               <config-property-value>com.metamatrix.connector.xml.base.XMLConnector</config-property-value>
+            </config-property>
+
+            <config-property>
+               <description>Connector Capabilities</description>
+               <description>The class to use to provide the Connector Capabilities</description>
+               <config-property-name>CapabilitiesClass</config-property-name>
+               <config-property-type>java.lang.String</config-property-type>
+               <config-property-value>com.metamatrix.connector.xml.base.XMLCapabilities</config-property-value>
+            </config-property>
+            
+            <config-property>
+               <description>Is Immutable</description>
+               <description>Is Immutable, True if the source never changes.</description>
+               <config-property-name>Immutable</config-property-name>
+               <config-property-type>java.lang.Boolean</config-property-type>
+               <config-property-value>false</config-property-value>
+            </config-property>
+            
+            <config-property>
+               <description>Is XA Capable</description>
+               <description>True, if this connector supports XA Transactions</description>
+               <config-property-name>XaCapable</config-property-name>
+               <config-property-type>java.lang.Boolean</config-property-type>
+               <config-property-value>false</config-property-value>
+            </config-property>            
+
+            <config-property>             
+               <description>Exception on Exceeding Max Rows</description>
+               <description>Indicates if an Exception should be thrown if the specified value for Maximum Result Rows is exceeded; else no exception and no more than the maximum will be returned</description>
+               <config-property-name>ExceptionOnMaxRows</config-property-name>
+               <config-property-type>java.lang.Boolean</config-property-type>
+               <config-property-value>true</config-property-value>
+            </config-property>
+
+            <config-property>
+               <description>Maximum Result Rows</description>
+               <description>Maximum Result Rows allowed</description>
+               <config-property-name>MaxResultRows</config-property-name>
+               <config-property-type>java.lang.Integer</config-property-type>
+               <config-property-value>10000</config-property-value>
+            </config-property>
+
+            <!--  XML-Relational SOAP Connector Specific properties -->
+
+            <config-property>
+                <description>Authentication User Password</description>
+                <description>Password value for authentication</description>
+                <config-property-name>AuthPassword</config-property-name>
+                <config-property-type>java.lang.String</config-property-type>
+            </config-property>
+            
+            <config-property>
+                <description>XML Filter Provider</description>
+                <description>The class the provides extended XML Filters</description>
+                <config-property-name>SaxFilterProviderClass</config-property-name>
+                <config-property-type>java.lang.String</config-property-type>
+                <config-property-value>com.metamatrix.connector.xml.base.NoExtendedFilters</config-property-value>
+            </config-property>
+            
+            <config-property>
+                <description>Authentication User Name</description>
+                <description>Name value for authentication</description>
+                <config-property-name>AuthUserName</config-property-name>
+                <config-property-type>java.lang.String</config-property-type>
+            </config-property>
+            
+            <config-property>
+                <description>WS-Security Type(UsernameToken, SAML..)</description>
+                <description>Type of WS-Security to be used; Combinations of multiple security types can be used with a space in-between. Allowed types are: (UsernameToken, UsernameToken-Digest, SAMLTokenUnsigned, SAMLTokenSigned, Signature, Timestamp, Encrypt)</description>
+                <config-property-name>WSSecurityType</config-property-name>
+                <config-property-type>java.lang.String</config-property-type>
+            </config-property>
+            
+            <config-property>
+                <description>XML Parameter Name</description>
+                <config-property-name>XMLParmName</config-property-name>
+                <config-property-type>java.lang.String</config-property-type>
+            </config-property>
+            
+            <config-property>
+                <description>Encrypt UserName (only if Encrypt profile used)</description>
+                <description>The username to be used in the encryption; if blank uses auth username</description>
+                <config-property-name>EncryptUserName</config-property-name>
+                <config-property-type>java.lang.String</config-property-type>
+            </config-property>
+            
+            <config-property>
+                <description>Exception on SOAP Fault</description>
+                <description>Throw connector exception when SOAP fault is returned from source.</description>
+                <config-property-name>ExceptionOnSOAPFault</config-property-name>
+                <config-property-type>java.lang.Boolean</config-property-type>
+                <config-property-value>true</config-property-value>
+            </config-property>
+            
+            <config-property>
+                <description>Request Timeout (in Milliseconds)</description>
+                <config-property-name>RequestTimeout</config-property-name>
+                <config-property-type>java.lang.Integer</config-property-type>
+                <config-property-value>10000</config-property-value>
+            </config-property>
+            
+            <config-property>
+                <description>User Crypto Property File (If SAML or Signature profile used)</description>
+                <description>The file defines properties of cryptography;defines the certificates;(crypto.properties)</description>
+                <config-property-name>CryptoPropertyFile</config-property-name>
+                <config-property-type>java.lang.String</config-property-type>
+            </config-property>
+            
+            <config-property>
+                <description>Connector State Class</description>
+                <config-property-name>ConnectorStateClass</config-property-name>
+                <config-property-type>java.lang.String</config-property-type>
+                <config-property-value>com.metamatrix.connector.xml.soap.SOAPConnectorState</config-property-value>
+            </config-property>
+            
+            <config-property>
+                <description>SOAP-Action</description>
+                <description>Value for SOAP-Action header</description>
+                <config-property-name>SOAPAction</config-property-name>
+                <config-property-type>java.lang.String</config-property-type>
+            </config-property>
+            
+            <config-property>
+                <description>Access Method (Get, Post)</description>
+                <description>ALLOWED:get,post</description>
+                <config-property-name>AccessMethod</config-property-name>
+                <config-property-type>java.lang.String</config-property-type>
+                <config-property-value>post</config-property-value>
+            </config-property>
+            
+            <config-property>
+                <description>Proxy Server URI</description>
+                <description>The URI of the proxy server</description>
+                <config-property-name>ProxyUri</config-property-name>
+                <config-property-type>java.lang.String</config-property-type>
+            </config-property>
+            
+            <config-property>
+                <description>Encrypt crypto property file (only if Encrypt profile used)</description>
+                <description>The file defines properties of cryptography for encryption of the message;(crypto.properties)</description>
+                <config-property-name>EncryptPropertyFile</config-property-name>
+                <config-property-type>java.lang.String</config-property-type>
+            </config-property>
+            
+            <config-property>
+                <description>Connector Capabilities Class</description>
+                <description>The class to use to provide the Connector Capabilities</description>
+                <config-property-name>ConnectorCapabilities</config-property-name>
+                <config-property-type>java.lang.String</config-property-type>
+                <config-property-value>com.metamatrix.connector.xml.base.XMLCapabilities</config-property-value>
+            </config-property>
+            
+            <config-property>
+                <description>SAML Property File (only required when SAML profile used)</description>
+                <description>SAML Security property file (saml.properties)</description>
+                <config-property-name>SAMLPropertyFile</config-property-name>
+                <config-property-type>java.lang.String</config-property-type>
+            </config-property>
+            
+            <config-property>
+                <description>Encoding Style (RPC - Encoded, RPC - Literal, Document - Literal, Document - Encoded)</description>
+                <description>Encoding Style</description>
+                <description>ALLOWED:RPC - Encoded,RPC - Literal,Document - Literal,Document - Encoded</description>
+                <config-property-name>EncodingStyle</config-property-name>
+                <config-property-type>java.lang.String</config-property-type>
+                <config-property-value>Document - Literal</config-property-value>
+            </config-property>
+            
+            <config-property>
+                <description>Server URI</description>
+                <description>The URI of the HTTP source</description>
+                <config-property-name>Uri</config-property-name>
+                <config-property-type>java.lang.String</config-property-type>
+            </config-property>
+            
+            <config-property>
+                <description>WebService Security Used(None, HTTPBasic, WS-Security)</description>
+                <description>Type of Authentication to used with the web service; If WS-Secuirty is being used, then WS-Secuirty type must be defined</description>
+                <config-property-name>SecurityType</config-property-name>
+                <config-property-type>java.lang.String</config-property-type>
+                <config-property-value>None</config-property-value>
+            </config-property>
+            
+            <config-property>
+                <description>Log XML Request and Response Documents</description>
+                <description>Write the request and response documents to the log at Info level</description>
+                <config-property-name>LogRequestResponseDocs</config-property-name>
+                <config-property-type>java.lang.Boolean</config-property-type>
+                <config-property-value>false</config-property-value>
+            </config-property>
+            
+            <config-property>
+                <description>Trust Deserializer Class</description>
+                <description>The class to use to process trusted payloads and execution payloads</description>
+                <config-property-name>TrustDeserializerClass</config-property-name>
+                <config-property-type>java.lang.String</config-property-type>
+                <config-property-value>com.metamatrix.connector.xml.soap.DefaultSoapTrustDeserializer</config-property-value>
+            </config-property>
+            
+            <config-property>
+                <description>Parameter Method (None, Name/Value, XMLRequest, XMLInQueryString)</description>
+                <description>ALLOWED:None,Name/Value,XMLRequest,XMLInQueryString,</description>
+                <config-property-name>ParameterMethod</config-property-name>
+                <config-property-type>java.lang.String</config-property-type>
+                <config-property-value>XMLRequest</config-property-value>
+            </config-property>
+            
+            <config-property>
+                <description>Input Stream Filter Class</description>
+                <description>The class to use to preprocess raw XML input stream</description>
+                <config-property-name>InputStreamFilterClass</config-property-name>
+                <config-property-type>java.lang.String</config-property-type>
+                <config-property-value>com.metamatrix.connector.xml.base.PluggableInputStreamFilterImpl</config-property-value>
+            </config-property>
+            
+            <config-property>
+                <description>Hostname Verifier</description>
+                <description>a class implmenting javax.net.ssl.HostnameVerifier.  Used to implement a hostname mismatch workaround.</description>
+                <config-property-name>HostnameVerifier</config-property-name>
+                <config-property-type>java.lang.String</config-property-type>
+            </config-property>
+            
+            <config-property>
+                <description>Trust Type:(DirectReference or IssuerSerial)</description>
+                <description>Only required for Signature and Signed SAML; The issuer-serial method presumes that all trusted users of the service are known to the service and have pre-registered their certificate chains before using the service. The direct-reference method presumes that the service operator trusts all users with certificates issued by a trusted CA.</description>
+                <config-property-name>TrustType</config-property-name>
+                <config-property-type>java.lang.String</config-property-type>
+                <config-property-value>DirectReference</config-property-value>
+            </config-property>
+            
+            <config-property>
+                <description>Query Preprocessor Class</description>
+                <description>The class to use to preprocess the IQuery</description>
+                <config-property-name>QueryPreprocessorClass</config-property-name>
+                <config-property-type>java.lang.String</config-property-type>
+                <config-property-value>com.metamatrix.connector.xml.base.NoQueryPreprocessing</config-property-value>
+            </config-property>
+            
+            <connectionfactory-interface>org.teiid.connector.api.Connector</connectionfactory-interface>
+            <connectionfactory-impl-class>org.teiid.connector.basic.WrappedConnector</connectionfactory-impl-class>
+            <connection-interface>org.teiid.connector.api.Connection</connection-interface>
+            <connection-impl-class>org.teiid.connector.basic.WrappedConnection</connection-impl-class>
+
+         </connection-definition>
+         
+         <transaction-support>NoTransaction</transaction-support>
+        
+        <authentication-mechanism>
+            <authentication-mechanism-type>BasicPassword</authentication-mechanism-type>
+            <credential-interface>javax.resource.spi.security.PasswordCredential</credential-interface>
+        </authentication-mechanism>
+        <reauthentication-support>false</reauthentication-support>
+      </outbound-resourceadapter>
+   </resourceadapter>
+</connector>

Added: branches/JCA/connectors/connector-xml/src/main/rar/META-INF/xmlsource-file/ra.xml
===================================================================
--- branches/JCA/connectors/connector-xml/src/main/rar/META-INF/xmlsource-file/ra.xml	                        (rev 0)
+++ branches/JCA/connectors/connector-xml/src/main/rar/META-INF/xmlsource-file/ra.xml	2009-12-21 19:43:33 UTC (rev 1688)
@@ -0,0 +1,130 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<connector xmlns="http://java.sun.com/xml/ns/j2ee"
+           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+           xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
+           http://java.sun.com/xml/ns/j2ee/connector_1_5.xsd"
+           version="1.5">
+
+   <vendor-name>Red Hat Middleware LLC</vendor-name>
+   <eis-type>Teiid XML File Connector</eis-type>
+   <resourceadapter-version>1.0</resourceadapter-version>
+   <license>
+      <description>
+ JBoss, Home of Professional Open Source.
+ Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ as indicated by the @author tags. See the copyright.txt file in the
+ distribution for a full listing of individual contributors.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+      </description>
+      <license-required>true</license-required>
+   </license>
+   <resourceadapter>
+      <resourceadapter-class>org.teiid.connector.basic.BasicResourceAdapter</resourceadapter-class>
+
+      <outbound-resourceadapter>
+         <connection-definition>
+            <managedconnectionfactory-class>com.metamatrix.connector.xmlsource.soap.SoapManagedConnectionFactory</managedconnectionfactory-class>
+
+            <config-property>
+               <description>Connector Class</description>
+               <config-property-name>ConnectorClass</config-property-name>
+               <config-property-type>java.lang.String</config-property-type>
+               <config-property-value>com.metamatrix.connector.xmlsource.XMLSourceConnector</config-property-value>
+            </config-property>
+
+            <config-property>
+               <description>Connector Capabilities</description>
+               <description>The class to use to provide the Connector Capabilities</description>
+               <config-property-name>CapabilitiesClass</config-property-name>
+               <config-property-type>java.lang.String</config-property-type>
+               <config-property-value>com.metamatrix.connector.xmlsource.XMLSourceCapabilities</config-property-value>
+            </config-property>
+            
+            <config-property>
+               <description>Is Immutable</description>
+               <description>Is Immutable, True if the source never changes.</description>
+               <config-property-name>Immutable</config-property-name>
+               <config-property-type>java.lang.Boolean</config-property-type>
+               <config-property-value>true</config-property-value>
+            </config-property>
+            
+            <config-property>
+               <description>Is XA Capable</description>
+               <description>True, if this connector supports XA Transactions</description>
+               <config-property-name>XaCapable</config-property-name>
+               <config-property-type>java.lang.Boolean</config-property-type>
+               <config-property-value>false</config-property-value>
+            </config-property>            
+
+            <config-property>             
+               <description>Exception on Exceeding Max Rows</description>
+               <description>Indicates if an Exception should be thrown if the specified value for Maximum Result Rows is exceeded; else no exception and no more than the maximum will be returned</description>
+               <config-property-name>ExceptionOnMaxRows</config-property-name>
+               <config-property-type>java.lang.Boolean</config-property-type>
+               <config-property-value>true</config-property-value>
+            </config-property>
+
+            <config-property>
+               <description>Maximum Result Rows</description>
+               <description>Maximum Result Rows allowed</description>
+               <config-property-name>MaxResultRows</config-property-name>
+               <config-property-type>java.lang.Integer</config-property-type>
+               <config-property-value>10000</config-property-value>
+            </config-property>
+
+            <!--  XML File Connector Specific properties -->
+
+            <config-property>
+                <description>File Encoding Used</description>
+                <description>A character-encoding scheme is a mapping between a coded character set and a set of octet (eight-bit byte) sequences. Some samples are UTF-8,ISO-8859-1,UTF-16)</description>
+                <config-property-name>CharacterEncodingScheme</config-property-name>
+                <config-property-type>java.lang.String</config-property-type>
+                <config-property-value>ISO-8859-1</config-property-value>
+            </config-property>
+            
+            <config-property>
+                <description>Type Of XML Connection</description>
+                <description>Connection type used to get the XML data</description>
+                <config-property-name>ConnectionType</config-property-name>
+                <config-property-type>java.lang.String</config-property-type>
+                <config-property-value>com.metamatrix.connector.xmlsource.file.FileConnection</config-property-value>
+            </config-property>
+            
+            <config-property>
+                <description>XML File(s) Directory Location</description>
+                <config-property-name>DirectoryLocation</config-property-name>
+                <config-property-type>java.lang.String</config-property-type>
+            </config-property>
+            
+            <connectionfactory-interface>org.teiid.connector.api.Connector</connectionfactory-interface>
+            <connectionfactory-impl-class>org.teiid.connector.basic.WrappedConnector</connectionfactory-impl-class>
+            <connection-interface>org.teiid.connector.api.Connection</connection-interface>
+            <connection-impl-class>org.teiid.connector.basic.WrappedConnection</connection-impl-class>
+
+         </connection-definition>
+         
+         <transaction-support>NoTransaction</transaction-support>
+        
+        <authentication-mechanism>
+            <authentication-mechanism-type>BasicPassword</authentication-mechanism-type>
+            <credential-interface>javax.resource.spi.security.PasswordCredential</credential-interface>
+        </authentication-mechanism>
+        <reauthentication-support>false</reauthentication-support>
+      </outbound-resourceadapter>
+   </resourceadapter>
+</connector>

Added: branches/JCA/connectors/connector-xml/src/main/rar/META-INF/xmlsource-soap/ra.xml
===================================================================
--- branches/JCA/connectors/connector-xml/src/main/rar/META-INF/xmlsource-soap/ra.xml	                        (rev 0)
+++ branches/JCA/connectors/connector-xml/src/main/rar/META-INF/xmlsource-soap/ra.xml	2009-12-21 19:43:33 UTC (rev 1688)
@@ -0,0 +1,208 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<connector xmlns="http://java.sun.com/xml/ns/j2ee"
+           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+           xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
+           http://java.sun.com/xml/ns/j2ee/connector_1_5.xsd"
+           version="1.5">
+
+   <vendor-name>Red Hat Middleware LLC</vendor-name>
+   <eis-type>Teiid XML SOAP Connector</eis-type>
+   <resourceadapter-version>1.0</resourceadapter-version>
+   <license>
+      <description>
+ JBoss, Home of Professional Open Source.
+ Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ as indicated by the @author tags. See the copyright.txt file in the
+ distribution for a full listing of individual contributors.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+      </description>
+      <license-required>true</license-required>
+   </license>
+   <resourceadapter>
+      <resourceadapter-class>org.teiid.connector.basic.BasicResourceAdapter</resourceadapter-class>
+
+      <outbound-resourceadapter>
+         <connection-definition>
+            <managedconnectionfactory-class>com.metamatrix.connector.xmlsource.file.FileManagedConnectionFactory</managedconnectionfactory-class>
+
+            <config-property>
+               <description>Connector Class</description>
+               <config-property-name>ConnectorClass</config-property-name>
+               <config-property-type>java.lang.String</config-property-type>
+               <config-property-value>com.metamatrix.connector.xmlsource.XMLSourceConnector</config-property-value>
+            </config-property>
+
+            <config-property>
+               <description>Connector Capabilities</description>
+               <description>The class to use to provide the Connector Capabilities</description>
+               <config-property-name>CapabilitiesClass</config-property-name>
+               <config-property-type>java.lang.String</config-property-type>
+               <config-property-value>com.metamatrix.connector.xmlsource.XMLSourceCapabilities</config-property-value>
+            </config-property>
+            
+            <config-property>
+               <description>Is Immutable</description>
+               <description>Is Immutable, True if the source never changes.</description>
+               <config-property-name>Immutable</config-property-name>
+               <config-property-type>java.lang.Boolean</config-property-type>
+               <config-property-value>true</config-property-value>
+            </config-property>
+            
+            <config-property>
+               <description>Is XA Capable</description>
+               <description>True, if this connector supports XA Transactions</description>
+               <config-property-name>XaCapable</config-property-name>
+               <config-property-type>java.lang.Boolean</config-property-type>
+               <config-property-value>false</config-property-value>
+            </config-property>            
+
+            <config-property>             
+               <description>Exception on Exceeding Max Rows</description>
+               <description>Indicates if an Exception should be thrown if the specified value for Maximum Result Rows is exceeded; else no exception and no more than the maximum will be returned</description>
+               <config-property-name>ExceptionOnMaxRows</config-property-name>
+               <config-property-type>java.lang.Boolean</config-property-type>
+               <config-property-value>true</config-property-value>
+            </config-property>
+
+            <config-property>
+               <description>Maximum Result Rows</description>
+               <description>Maximum Result Rows allowed</description>
+               <config-property-name>MaxResultRows</config-property-name>
+               <config-property-type>java.lang.Integer</config-property-type>
+               <config-property-value>10000</config-property-value>
+            </config-property>
+
+            <!--  XML Source SOAP Connector Specific properties -->
+
+            <config-property>
+                <description>Authentication User Password</description>
+                <description>Password value for authentication</description>
+                <config-property-name>AuthPassword</config-property-name>
+                <config-property-type>java.lang.String</config-property-type>
+            </config-property>
+            
+            <config-property>
+                <description>SAML Property File (only required when SAML profile used)</description>
+                <description>SAML Security property file (saml.properties)</description>
+                <config-property-name>SAMLPropertyFile</config-property-name>
+                <config-property-type>java.lang.String</config-property-type>
+            </config-property>
+            
+            <config-property>
+                <description>WSDL File (URL)</description>
+                <description>URL to Web Service Definition File</description>
+                <config-property-name>wsdl</config-property-name>
+                <config-property-type>java.lang.String</config-property-type>
+            </config-property>
+            
+            <config-property>
+                <description>Authentication User Name</description>
+                <description>Name value for authentication</description>
+                <config-property-name>AuthUserName</config-property-name>
+                <config-property-type>java.lang.String</config-property-type>
+            </config-property>
+            
+            <config-property>
+                <description>WS-Security Type(UsernameToken, SAML..)</description>
+                <description>Type of WS-Security to be used; Combinations of multiple security types can be used with a space in-between. Allowed types are: (UsernameToken, UsernameToken-Digest, SAMLTokenUnsigned, SAMLTokenSigned, Signature, Timestamp, Encrypt)</description>
+                <config-property-name>WSSecurityType</config-property-name>
+                <config-property-type>java.lang.String</config-property-type>
+            </config-property>
+            
+            <config-property>
+                <description>Encrypt UserName (only if Encrypt profile used)</description>
+                <description>The username to be used in the encryption; if blank uses auth username</description>
+                <config-property-name>EncryptUserName</config-property-name>
+                <config-property-type>java.lang.String</config-property-type>
+            </config-property>
+            
+            <config-property>
+                <description>Alternate End Point</description>
+                <description>An alternate service endpoint other than one specified in WSDL, to execute the service</description>
+                <config-property-name>EndPoint</config-property-name>
+                <config-property-type>java.lang.String</config-property-type>
+            </config-property>
+            
+            <config-property>
+                <description>WebService Security Used(None, HTTPBasic, WS-Security)</description>
+                <description>Type of Authentication to used with the web service; If WS-Secuirty is being used, then WS-Secuirty type must be defined</description>
+                <config-property-name>SecurityType</config-property-name>
+                <config-property-type>java.lang.String</config-property-type>
+                <config-property-value>None</config-property-value>
+            </config-property>
+            
+            <config-property>
+                <description>User Crypto Property File (If SAML or Signature profile used)</description>
+                <description>The file defines properties of cryptography;defines the certificates;(crypto.properties)</description>
+                <config-property-name>CryptoPropertyFile</config-property-name>
+                <config-property-type>java.lang.String</config-property-type>
+            </config-property>
+            
+            <config-property>
+                <description>Type Of XML Connection</description>
+                <description>Connection type used to get the XML data</description>
+                <config-property-name>ConnectionType</config-property-name>
+                <config-property-type>java.lang.String</config-property-type>
+                <config-property-value>com.metamatrix.connector.xmlsource.soap.SoapConnection</config-property-value>
+            </config-property>
+            
+            <config-property>
+                <description>Encrypt crypto property file (only if Encrypt profile used)</description>
+                <description>The file defines properties of cryptography for encryption of the message;(crypto.properties)</description>
+                <config-property-name>EncryptPropertyFile</config-property-name>
+                <config-property-type>java.lang.String</config-property-type>
+            </config-property>
+            
+            <config-property>
+                <description>Trust Type:(DirectReference or IssuerSerial)</description>
+                <description>Only required for Signature and Signed SAML; The issuer-serial method presumes that all trusted users of the service are known to the service and have pre-registered their certificate chains before using the service. The direct-reference method presumes that the service operator trusts all users with certificates issued by a trusted CA.</description>
+                <config-property-name>TrustType</config-property-name>
+                <config-property-type>java.lang.String</config-property-type>
+                <config-property-value>DirectReference</config-property-value>
+            </config-property>
+                    
+            <config-property>
+                <description>Port Name</description>
+                <config-property-name>PortName</config-property-name>
+                <config-property-type>java.lang.String</config-property-type>
+            </config-property>
+
+            <config-property>
+                <description>Query Timeout</description>
+                <config-property-name>QueryTimeout</config-property-name>
+                <config-property-type>java.lang.Integer</config-property-type>
+                <config-property-value>-1</config-property-value>
+            </config-property>
+            
+            <connectionfactory-interface>org.teiid.connector.api.Connector</connectionfactory-interface>
+            <connectionfactory-impl-class>org.teiid.connector.basic.WrappedConnector</connectionfactory-impl-class>
+            <connection-interface>org.teiid.connector.api.Connection</connection-interface>
+            <connection-impl-class>org.teiid.connector.basic.WrappedConnection</connection-impl-class>
+
+         </connection-definition>
+         
+         <transaction-support>NoTransaction</transaction-support>
+        
+        <authentication-mechanism>
+            <authentication-mechanism-type>BasicPassword</authentication-mechanism-type>
+            <credential-interface>javax.resource.spi.security.PasswordCredential</credential-interface>
+        </authentication-mechanism>
+        <reauthentication-support>false</reauthentication-support>
+      </outbound-resourceadapter>
+   </resourceadapter>
+</connector>

Modified: branches/JCA/connectors/connector-xml/src/test/java/com/metamatrix/connector/xml/TestCachingFileConnector.java
===================================================================
--- branches/JCA/connectors/connector-xml/src/test/java/com/metamatrix/connector/xml/TestCachingFileConnector.java	2009-12-21 19:41:26 UTC (rev 1687)
+++ branches/JCA/connectors/connector-xml/src/test/java/com/metamatrix/connector/xml/TestCachingFileConnector.java	2009-12-21 19:43:33 UTC (rev 1688)
@@ -2,17 +2,18 @@
 
 
 import java.util.List;
-import java.util.Properties;
 
 import junit.framework.TestCase;
 
+import org.mockito.Mockito;
 import org.teiid.connector.api.Connector;
 import org.teiid.connector.api.ConnectorException;
+import org.teiid.connector.api.ExecutionContext;
 
 import com.metamatrix.cdk.api.ConnectorHost;
 import com.metamatrix.connector.xml.base.ProxyObjectFactory;
 import com.metamatrix.connector.xml.base.XMLConnector;
-import com.metamatrix.connector.xml.file.FileConnectorState;
+import com.metamatrix.connector.xml.file.FileManagedConnectionFactory;
 
 public class TestCachingFileConnector extends TestCase {
 
@@ -22,11 +23,14 @@
 	@Override
 	public void setUp() throws Exception {
 		connector = new XMLConnector();
-		Properties props = ProxyObjectFactory.getDefaultFileProps();
-		props.setProperty(FileConnectorState.FILE_NAME, "purchaseOrdersShort.xml");
+		FileManagedConnectionFactory env = ProxyObjectFactory.getDefaultFileProps();
+		env.setFileName("purchaseOrdersShort.xml");
+		
 		String vdbPath = ProxyObjectFactory.getDocumentsFolder() + "/File/purchase_orders.vdb";
-		host = new ConnectorHost(connector, props, vdbPath);
-		host.setSecurityContext("purchase_orders", "1", "root", null);
+		host = new ConnectorHost(connector, env, vdbPath);
+
+		ExecutionContext context = Mockito.mock(ExecutionContext.class);
+		host.setExecutionContext(context);
 	}
 	
 	public void testSelect() {

Modified: branches/JCA/connectors/connector-xml/src/test/java/com/metamatrix/connector/xml/TestElementCollector.java
===================================================================
--- branches/JCA/connectors/connector-xml/src/test/java/com/metamatrix/connector/xml/TestElementCollector.java	2009-12-21 19:41:26 UTC (rev 1687)
+++ branches/JCA/connectors/connector-xml/src/test/java/com/metamatrix/connector/xml/TestElementCollector.java	2009-12-21 19:43:33 UTC (rev 1688)
@@ -15,12 +15,12 @@
 import org.teiid.connector.language.IQuery;
 import org.teiid.connector.metadata.runtime.RuntimeMetadata;
 
-import com.metamatrix.cdk.api.EnvironmentUtility;
 import com.metamatrix.cdk.api.SysLogger;
 import com.metamatrix.connector.xml.base.ExecutionInfo;
 import com.metamatrix.connector.xml.base.ProxyObjectFactory;
 import com.metamatrix.connector.xml.base.QueryAnalyzer;
 import com.metamatrix.connector.xml.file.FileConnectorState;
+import com.metamatrix.connector.xml.file.FileManagedConnectionFactory;
 import com.metamatrix.connector.xml.streaming.DocumentImpl;
 import com.metamatrix.connector.xml.streaming.ElementProcessor;
 import com.metamatrix.connector.xml.streaming.ReaderFactory;
@@ -38,8 +38,7 @@
 		Map prefixes = new HashMap<String, String>();
 		prefixes.put("po", "http://www.example.com/PO1");
 		prefixes.put("xsd", "http://www.w3.org/2001/XMLSchema");
-		ConnectorEnvironment env = EnvironmentUtility.createEnvironment(
-    			ProxyObjectFactory.getDefaultFileProps());
+		FileManagedConnectionFactory env = ProxyObjectFactory.getDefaultFileProps();
 		ConnectorLogger logger = new SysLogger(false);
     	XMLConnectorState state = new FileConnectorState();
     	state.setLogger(logger);

Modified: branches/JCA/connectors/connector-xml/src/test/java/com/metamatrix/connector/xml/TestXMLReaderFactory.java
===================================================================
--- branches/JCA/connectors/connector-xml/src/test/java/com/metamatrix/connector/xml/TestXMLReaderFactory.java	2009-12-21 19:41:26 UTC (rev 1687)
+++ branches/JCA/connectors/connector-xml/src/test/java/com/metamatrix/connector/xml/TestXMLReaderFactory.java	2009-12-21 19:43:33 UTC (rev 1688)
@@ -4,7 +4,6 @@
 
 import org.xml.sax.XMLReader;
 
-import com.metamatrix.cdk.api.EnvironmentUtility;
 import com.metamatrix.cdk.api.SysLogger;
 import com.metamatrix.connector.xml.base.ProxyObjectFactory;
 import com.metamatrix.connector.xml.file.FileConnectorState;
@@ -19,8 +18,7 @@
 		super.setUp();
 		state = new FileConnectorState();
     	state.setLogger(new SysLogger(false));
-    	state.setState(EnvironmentUtility.createEnvironment(
-    			ProxyObjectFactory.getDefaultFileProps()));
+    	state.setState(ProxyObjectFactory.getDefaultFileProps());
 	}
 
 	@Override

Modified: branches/JCA/connectors/connector-xml/src/test/java/com/metamatrix/connector/xml/base/ProxyObjectFactory.java
===================================================================
--- branches/JCA/connectors/connector-xml/src/test/java/com/metamatrix/connector/xml/base/ProxyObjectFactory.java	2009-12-21 19:41:26 UTC (rev 1687)
+++ branches/JCA/connectors/connector-xml/src/test/java/com/metamatrix/connector/xml/base/ProxyObjectFactory.java	2009-12-21 19:43:33 UTC (rev 1688)
@@ -30,22 +30,24 @@
 
 import org.jdom.Document;
 import org.jdom.input.SAXBuilder;
+import org.mockito.Mockito;
 import org.teiid.connector.api.ConnectorEnvironment;
 import org.teiid.connector.api.ConnectorException;
 import org.teiid.connector.api.ExecutionContext;
 import org.teiid.connector.language.IQuery;
 import org.teiid.connector.metadata.runtime.RuntimeMetadata;
 
-import com.metamatrix.cdk.api.EnvironmentUtility;
 import com.metamatrix.cdk.api.TranslationUtility;
+import com.metamatrix.common.util.PropertiesUtils;
 import com.metamatrix.connector.xml.SecureConnectorState;
 import com.metamatrix.connector.xml.XMLConnectorState;
-import com.metamatrix.connector.xml.file.FileConnectorState;
+import com.metamatrix.connector.xml.file.FileManagedConnectionFactory;
 import com.metamatrix.connector.xml.http.HTTPConnectorState;
+import com.metamatrix.connector.xml.http.HTTPManagedConnectionFactory;
 import com.metamatrix.connector.xml.soap.SOAPConnectorStateImpl;
+import com.metamatrix.connector.xml.soap.SOAPManagedConnectionFactory;
 import com.metamatrix.connector.xmlsource.soap.SecurityToken;
 import com.metamatrix.connector.xmlsource.soap.SoapConnectorProperties;
-import com.metamatrix.core.util.UnitTestUtil;
 /**
  *
  */
@@ -61,48 +63,57 @@
     }
     
     public static ConnectorEnvironment getDefaultTestConnectorEnvironment() {
-       Properties props = getDefaultFileProps(); 
-       ConnectorEnvironment env = EnvironmentUtility.createEnvironment(props, false);
+       FileManagedConnectionFactory env = getDefaultFileProps(); 
        return env;
     }
     
-    public static ConnectorEnvironment getHTTPTestConnectorEnvironment(Properties props) {
+    public static HTTPManagedConnectionFactory getHTTPTestConnectorEnvironment(Properties props) {
         if (props == null) {
         	props = getDefaultHTTPProps(); 
         }
-        ConnectorEnvironment env = EnvironmentUtility.createEnvironment(props, false);
+        HTTPManagedConnectionFactory env = new HTTPManagedConnectionFactory();
+        PropertiesUtils.setBeanProperties(env, props, null);
         return env;
      }
     
     public static ExecutionContext getDefaultSecurityContext() {
-        return EnvironmentUtility.createSecurityContext("MetaMatrixAdmin");
+        return Mockito.mock(ExecutionContext.class);
     }
     
     public static ExecutionContext getDefaultExecutionContext() {
-        return EnvironmentUtility.createExecutionContext("Request", "testPartId");        
+    	ExecutionContext ec = Mockito.mock(ExecutionContext.class);
+    	Mockito.stub(ec.getRequestIdentifier()).toReturn("request");
+    	Mockito.stub(ec.getPartIdentifier()).toReturn("testPartId");
+    	
+       return ec;        
     }
     
     public static ExecutionContext getExecutionContext(String requestID, String partId) {
-       return EnvironmentUtility.createExecutionContext(requestID, partId);        
+    	ExecutionContext ec = Mockito.mock(ExecutionContext.class);
+    	Mockito.stub(ec.getRequestIdentifier()).toReturn(requestID);
+    	Mockito.stub(ec.getPartIdentifier()).toReturn(partId);
+    	
+       return ec;        
     }
     
-    public static Properties getDefaultFileProps() {
-       Properties testFileProps = new Properties();
-        testFileProps.setProperty(XMLConnectorStateImpl.CACHE_ENABLED, "false");
-        testFileProps.setProperty(XMLConnectorState.STATE_CLASS_PROP, "com.metamatrix.connector.xml.file.FileConnectorState");
-        testFileProps.setProperty(XMLConnectorStateImpl.QUERY_PREPROCESS_CLASS, "com.metamatrix.connector.xml.base.NoQueryPreprocessing");
-        testFileProps.setProperty(XMLConnectorStateImpl.SAX_FILTER_PROVIDER_CLASS, "com.metamatrix.connector.xml.base.NoExtendedFilters"); 
-        testFileProps.put(XMLConnectorStateImpl.CONNECTOR_CAPABILITES, "com.metamatrix.connector.xml.base.XMLCapabilities");
-        testFileProps.put(FileConnectorState.FILE_NAME, "state_college2.xml");
+    public static FileManagedConnectionFactory getDefaultFileProps() {
+    	FileManagedConnectionFactory env = new FileManagedConnectionFactory();
+    	env.setCacheEnabled(false);
+    	env.setConnectorStateClass( "com.metamatrix.connector.xml.file.FileConnectorState");
+    	env.setQueryPreprocessorClass("com.metamatrix.connector.xml.base.NoQueryPreprocessing");
+    	env.setSaxFilterProviderClass("com.metamatrix.connector.xml.base.NoExtendedFilters");
+    	env.setCapabilitiesClass("com.metamatrix.connector.xml.base.XMLCapabilities");
+    	env.setFileName("state_college2.xml");
+    	
 
         URL url = ProxyObjectFactory.class.getClassLoader().getResource("documents");
     	try {
-			testFileProps.setProperty(FileConnectorState.DIRECTORY_PATH, new File(url.toURI()).toString());
+    		env.setFilePath(new File(url.toURI()).toString());
 		} catch (URISyntaxException e) {
 			throw new RuntimeException(e);
 		}
         
-        return testFileProps;
+        return env;
     }
     
     public static Properties getDefaultHTTPProps() {
@@ -158,19 +169,22 @@
 		return soapProps;
 	}
 	
-	public static ConnectorEnvironment createSOAPStateHTTPBasic() {
+	public static SOAPManagedConnectionFactory createSOAPStateHTTPBasic() {
 		Properties props = createSOAPState();
         props.setProperty(SoapConnectorProperties.AUTHORIZATION_TYPE, SecurityToken.HTTP_BASIC_AUTH); 
         props.setProperty(SoapConnectorProperties.USERNAME, "foo"); //$NON-NLS-1$ 
         props.setProperty(SoapConnectorProperties.PASSWORD, "foopassword"); //$NON-NLS-1$ 
-		return EnvironmentUtility.createEnvironment(props);
+        
+        SOAPManagedConnectionFactory env = new SOAPManagedConnectionFactory();
+        PropertiesUtils.setBeanProperties(env, props, null);
+		return env;
 	}
 
     public static XMLConnector getDefaultXMLConnector() {
         XMLConnector conn;
         try {
             conn = new XMLConnector();
-            conn.start(getDefaultTestConnectorEnvironment());
+            conn.initialize(getDefaultTestConnectorEnvironment());
         } catch (ConnectorException ce) {
             ce.printStackTrace();
             conn = null;
@@ -182,7 +196,7 @@
         XMLConnector conn;
         try {
             conn = new XMLConnector();
-            conn.start(getHTTPTestConnectorEnvironment(props));
+            conn.initialize(getHTTPTestConnectorEnvironment(props));
         } catch (ConnectorException ce) {
             ce.printStackTrace();
             conn = null;
@@ -194,7 +208,7 @@
         XMLConnectionImpl connection;
         try {
             ExecutionContext ctx = getDefaultSecurityContext();
-            connection = (XMLConnectionImpl) getDefaultXMLConnector().getConnection(ctx);           
+            connection = (XMLConnectionImpl) getDefaultXMLConnector().getConnection();           
         } catch (ConnectorException ce) {
             connection = null;
         } catch (NullPointerException ne) {
@@ -207,7 +221,7 @@
     	XMLConnectionImpl connection;
         try {
             ExecutionContext ctx = getDefaultSecurityContext();
-            connection = (XMLConnectionImpl) getDefaultHTTPConnector(props).getConnection(ctx);           
+            connection = (XMLConnectionImpl) getDefaultHTTPConnector(props).getConnection();           
         } catch (ConnectorException ce) {
             connection = null;
         } catch (NullPointerException ne) {
@@ -253,9 +267,4 @@
         return docFolder;
     }
     
-	public static ConnectorEnvironment getDefaultTestConnectorEnvironment(Properties props) {        
-        ConnectorEnvironment env = EnvironmentUtility.createEnvironment(props, false);
-        return env;
-     }
-
 }

Modified: branches/JCA/connectors/connector-xml/src/test/java/com/metamatrix/connector/xml/base/TestXMLConnection.java
===================================================================
--- branches/JCA/connectors/connector-xml/src/test/java/com/metamatrix/connector/xml/base/TestXMLConnection.java	2009-12-21 19:41:26 UTC (rev 1687)
+++ branches/JCA/connectors/connector-xml/src/test/java/com/metamatrix/connector/xml/base/TestXMLConnection.java	2009-12-21 19:43:33 UTC (rev 1688)
@@ -46,17 +46,10 @@
 		super(arg0);
 	}
     
-//	removing hansel while testing clover
-/*	
-    public static Test suite() {
-    	return new CoverageDecorator(XMLConnectionTest.class, new Class[] {XMLConnectionImpl.class}); 
-    }
-*/    
-    
     public void testInit() {
         try {
         	ExecutionContext ctx = ProxyObjectFactory.getDefaultSecurityContext();
-        	XMLConnectionImpl connection = (XMLConnectionImpl) CONNECTOR.getConnection(ctx);
+        	XMLConnectionImpl connection = (XMLConnectionImpl) CONNECTOR.getConnection();
         } catch (ConnectorException ex) {
             ex.printStackTrace();
             fail(ex.getMessage());
@@ -69,23 +62,11 @@
         conn.close();        
     }
     
-    public void testGetQueryId() {
-        XMLConnectionImpl conn = getXMLConnection();
-        String id = conn.getQueryId();
-        assertNotNull("queryId is null", id);
-        assertEquals(id, ProxyObjectFactory.getDefaultExecutionContext().getRequestIdentifier());
-    }
     
-    public void testGetConnector() {
-        XMLConnectionImpl conn = getXMLConnection();
-        assertNotNull("XMLConnectionImpl is null", conn.getConnector());
-        
-    }
-    
     private XMLConnectionImpl getXMLConnection() {
         XMLConnectionImpl connection;
         try {
-            connection = (XMLConnectionImpl) CONNECTOR.getConnection(ProxyObjectFactory.getDefaultSecurityContext());           
+            connection = (XMLConnectionImpl) CONNECTOR.getConnection();           
         } catch (Exception e) {
             connection = null;
             assertTrue("The connection is null", false);

Modified: branches/JCA/connectors/connector-xml/src/test/java/com/metamatrix/connector/xml/base/TestXMLConnector.java
===================================================================
--- branches/JCA/connectors/connector-xml/src/test/java/com/metamatrix/connector/xml/base/TestXMLConnector.java	2009-12-21 19:41:26 UTC (rev 1687)
+++ branches/JCA/connectors/connector-xml/src/test/java/com/metamatrix/connector/xml/base/TestXMLConnector.java	2009-12-21 19:43:33 UTC (rev 1688)
@@ -31,9 +31,10 @@
 import org.teiid.connector.api.ConnectorException;
 import org.teiid.connector.api.ExecutionContext;
 
-import com.metamatrix.cdk.api.EnvironmentUtility;
+import com.metamatrix.common.util.PropertiesUtils;
 import com.metamatrix.connector.xml.XMLConnectorState;
 import com.metamatrix.connector.xml.file.FileConnectorState;
+import com.metamatrix.connector.xml.file.FileManagedConnectionFactory;
 
 
 public class TestXMLConnector extends TestCase {
@@ -62,7 +63,7 @@
     public void testInitMethod() {
         XMLConnector connector = new XMLConnector();          
         try {        
-        	connector.start(m_env);
+        	connector.initialize(m_env);
             assertNotNull("state is null", connector.getState());
             assertNotNull("Logger is null", connector.getLogger());
         } catch (ConnectorException ex) {
@@ -74,14 +75,14 @@
     
     public void testStart() throws Exception {
         XMLConnector connector = new XMLConnector();
-         connector.start(m_env);
+         connector.initialize(m_env);
     }
     
     public void testStop() {
      XMLConnector connector = new XMLConnector();
      
      try {
-      connector.start(m_env);
+      connector.initialize(m_env);
       
      } catch (ConnectorException ex) {
       ex.printStackTrace();
@@ -96,16 +97,13 @@
     	XMLConnector connector = new XMLConnector();
                         
         try {
-         connector.start(m_env);
-         XMLConnectionImpl conn = (XMLConnectionImpl) connector.getConnection(m_secCtx);
+         connector.initialize(m_env);
+         XMLConnectionImpl conn = (XMLConnectionImpl) connector.getConnection();
          assertNotNull("XMLConnectionImpl is null", conn);
          
          // is the connector ref set?
          assertEquals(connector, conn.getConnector());
          
-         //is the query id set?
-         assertEquals(m_secCtx.getRequestIdentifier(), conn.getQueryId());
-         
         } catch (ConnectorException ex) {
             ex.printStackTrace();
             fail(ex.getMessage());
@@ -117,7 +115,7 @@
         XMLConnector connector = new XMLConnector();
         
         try {
-            XMLConnectionImpl conn = (XMLConnectionImpl) connector.getConnection(m_secCtx);
+            XMLConnectionImpl conn = (XMLConnectionImpl) connector.getConnection();
             fail("connector created a connection with unset state");           
         } catch (ConnectorException e) {
             
@@ -143,8 +141,10 @@
             		testFileProps.put(FileConnectorState.DIRECTORY_PATH, "");
             	}
             }
-    	    ConnectorEnvironment env = EnvironmentUtility.createEnvironment(testFileProps);
-    		connector.start(env);
+    	    
+    	    FileManagedConnectionFactory env = new FileManagedConnectionFactory();
+    	    PropertiesUtils.setBeanProperties(env, testFileProps, null);
+    		connector.initialize(env);
     		fail("connector should have failed on get state");
     	} catch (ConnectorException e) {
     		assertTrue(true);
@@ -155,7 +155,7 @@
         XMLConnector connector = new XMLConnector();
         
         try {
-            connector.start(m_env);
+            connector.initialize(m_env);
             assertNotNull(connector.getLogger());
             connector.getLogger().logInfo("Logger is properly initialized");
         } catch (ConnectorException ex) {

Modified: branches/JCA/connectors/connector-xml/src/test/java/com/metamatrix/connector/xml/base/TestXMLConnectorState.java
===================================================================
--- branches/JCA/connectors/connector-xml/src/test/java/com/metamatrix/connector/xml/base/TestXMLConnectorState.java	2009-12-21 19:41:26 UTC (rev 1687)
+++ branches/JCA/connectors/connector-xml/src/test/java/com/metamatrix/connector/xml/base/TestXMLConnectorState.java	2009-12-21 19:43:33 UTC (rev 1688)
@@ -27,12 +27,10 @@
 import junit.framework.TestCase;
 
 import org.teiid.connector.api.Connection;
-import org.teiid.connector.api.ConnectorEnvironment;
 import org.teiid.connector.api.ConnectorException;
-import org.teiid.connector.api.ExecutionContext;
 
-import com.metamatrix.cdk.api.EnvironmentUtility;
 import com.metamatrix.cdk.api.SysLogger;
+import com.metamatrix.common.util.PropertiesUtils;
 import com.metamatrix.connector.xml.CachingConnector;
 import com.metamatrix.connector.xml.XMLConnectorState;
 
@@ -69,7 +67,9 @@
     	XMLConnectorState state = new TestXMLConnectorStateImpl();
         try {
         	state.setLogger(new SysLogger(false));
-        	state.setState(EnvironmentUtility.createEnvironment(m_testFileProps));
+        	XMLBaseManagedConnectionFactory env = new XMLBaseManagedConnectionFactory();
+        	PropertiesUtils.setBeanProperties(env, m_testFileProps, null);
+        	state.setState(env);
             
         } catch (ConnectorException ce) {
          ce.printStackTrace();
@@ -84,7 +84,7 @@
     		super();
     	}
 
-		public Connection getConnection(CachingConnector connector, ExecutionContext context, ConnectorEnvironment environment) throws ConnectorException {
+		public Connection getConnection(CachingConnector connector) throws ConnectorException {
 			return null;
 		}
     }

Modified: branches/JCA/connectors/connector-xml/src/test/java/com/metamatrix/connector/xml/file/TestCachingFileConnectorLong.java
===================================================================
--- branches/JCA/connectors/connector-xml/src/test/java/com/metamatrix/connector/xml/file/TestCachingFileConnectorLong.java	2009-12-21 19:41:26 UTC (rev 1687)
+++ branches/JCA/connectors/connector-xml/src/test/java/com/metamatrix/connector/xml/file/TestCachingFileConnectorLong.java	2009-12-21 19:43:33 UTC (rev 1688)
@@ -2,17 +2,17 @@
 
 
 import java.util.List;
-import java.util.Properties;
 
 import junit.framework.TestCase;
 
+import org.mockito.Mockito;
 import org.teiid.connector.api.Connector;
 import org.teiid.connector.api.ConnectorException;
+import org.teiid.connector.api.ExecutionContext;
 
 import com.metamatrix.cdk.api.ConnectorHost;
 import com.metamatrix.connector.xml.base.ProxyObjectFactory;
 import com.metamatrix.connector.xml.base.XMLConnector;
-import com.metamatrix.connector.xml.base.XMLConnectorStateImpl;
 
 public class TestCachingFileConnectorLong extends TestCase {
 
@@ -22,12 +22,13 @@
 	@Override
 	public void setUp() throws Exception {
 		connector = new XMLConnector();
-		Properties props = ProxyObjectFactory.getDefaultFileProps();
-        props.setProperty(XMLConnectorStateImpl.CACHE_ENABLED, "true");
-		props.setProperty(FileConnectorState.FILE_NAME, "purchaseOrders.xml");
+		FileManagedConnectionFactory env = ProxyObjectFactory.getDefaultFileProps();
+		env.setCacheEnabled(true);
+		env.setFileName("purchaseOrders.xml");
 		String vdbPath = ProxyObjectFactory.getDocumentsFolder() + "/purchase_orders.vdb";
-		host = new ConnectorHost(connector, props, vdbPath);
-		host.setSecurityContext("purchase_orders", "1", "root", null);
+		host = new ConnectorHost(connector, env, vdbPath);
+		ExecutionContext context = Mockito.mock(ExecutionContext.class);
+		host.setExecutionContext(context);
 	}
 	
 	/**

Modified: branches/JCA/connectors/connector-xml/src/test/java/com/metamatrix/connector/xml/file/TestFileConnector.java
===================================================================
--- branches/JCA/connectors/connector-xml/src/test/java/com/metamatrix/connector/xml/file/TestFileConnector.java	2009-12-21 19:41:26 UTC (rev 1687)
+++ branches/JCA/connectors/connector-xml/src/test/java/com/metamatrix/connector/xml/file/TestFileConnector.java	2009-12-21 19:43:33 UTC (rev 1688)
@@ -2,35 +2,32 @@
 
 
 import java.util.List;
-import java.util.Properties;
 
 import junit.framework.TestCase;
 
-import org.teiid.connector.api.Connector;
+import org.mockito.Mockito;
 import org.teiid.connector.api.ConnectorException;
+import org.teiid.connector.api.ExecutionContext;
 
 import com.metamatrix.cdk.api.ConnectorHost;
 import com.metamatrix.connector.xml.base.ProxyObjectFactory;
 import com.metamatrix.connector.xml.base.XMLConnector;
-import com.metamatrix.connector.xml.base.XMLConnectorStateImpl;
 
 public class TestFileConnector extends TestCase {
 
-	Connector connector;
-	ConnectorHost host;
-	
-	@Override
-	public void setUp() throws Exception {
-		connector = new XMLConnector();
-		Properties props = ProxyObjectFactory.getDefaultFileProps();
-		props.setProperty(XMLConnectorStateImpl.CACHE_ENABLED, "false");
-		props.setProperty(FileConnectorState.FILE_NAME, "purchaseOrdersShort.xml");
+	public void testSelect() throws Exception{
+		
+		XMLConnector connector = new XMLConnector();
+		FileManagedConnectionFactory env = ProxyObjectFactory.getDefaultFileProps();
+		env.setCacheEnabled(false);
+		env.setFileName("purchaseOrdersShort.xml");
+		
 		String vdbPath = ProxyObjectFactory.getDocumentsFolder() + "/purchase_orders.vdb";
-		host = new ConnectorHost(connector, props, vdbPath);
-		host.setSecurityContext("purchase_orders", "1", "root", null);
-	}
-	
-	public void testSelect() {
+		ConnectorHost host = new ConnectorHost(connector, env, vdbPath);
+		
+		ExecutionContext context = Mockito.mock(ExecutionContext.class);
+		host.setExecutionContext(context);
+		
 		try {
 			List result = host.executeCommand("SELECT * FROM file_po_list.ITEM");
 			assertEquals(2, result.size());

Modified: branches/JCA/connectors/connector-xml/src/test/java/com/metamatrix/connector/xml/file/TestFileConnectorLong.java
===================================================================
--- branches/JCA/connectors/connector-xml/src/test/java/com/metamatrix/connector/xml/file/TestFileConnectorLong.java	2009-12-21 19:41:26 UTC (rev 1687)
+++ branches/JCA/connectors/connector-xml/src/test/java/com/metamatrix/connector/xml/file/TestFileConnectorLong.java	2009-12-21 19:43:33 UTC (rev 1688)
@@ -2,12 +2,13 @@
 
 
 import java.util.List;
-import java.util.Properties;
 
 import junit.framework.TestCase;
 
+import org.mockito.Mockito;
 import org.teiid.connector.api.Connector;
 import org.teiid.connector.api.ConnectorException;
+import org.teiid.connector.api.ExecutionContext;
 
 import com.metamatrix.cdk.api.ConnectorHost;
 import com.metamatrix.connector.xml.base.ProxyObjectFactory;
@@ -21,11 +22,15 @@
 	@Override
 	public void setUp() throws Exception {
 		connector = new XMLConnector();
-		Properties props = ProxyObjectFactory.getDefaultFileProps();
-		props.setProperty(FileConnectorState.FILE_NAME, "purchaseOrders.xml");
+		FileManagedConnectionFactory env = ProxyObjectFactory.getDefaultFileProps();
+		env.setCacheEnabled(true);
+		env.setFileName("purchaseOrders.xml");
+		
 		String vdbPath = ProxyObjectFactory.getDocumentsFolder() + "/purchase_orders.vdb";
-		host = new ConnectorHost(connector, props, vdbPath);
-		host.setSecurityContext("purchase_orders", "1", "root", null);
+		host = new ConnectorHost(connector, env, vdbPath);
+		
+		ExecutionContext context = Mockito.mock(ExecutionContext.class);
+		host.setExecutionContext(context);	
 	}
 	
 	public void testSelect() throws ConnectorException {

Modified: branches/JCA/connectors/connector-xml/src/test/java/com/metamatrix/connector/xml/file/TestFileConnectorState.java
===================================================================
--- branches/JCA/connectors/connector-xml/src/test/java/com/metamatrix/connector/xml/file/TestFileConnectorState.java	2009-12-21 19:41:26 UTC (rev 1687)
+++ branches/JCA/connectors/connector-xml/src/test/java/com/metamatrix/connector/xml/file/TestFileConnectorState.java	2009-12-21 19:43:33 UTC (rev 1688)
@@ -28,7 +28,6 @@
 
 import org.teiid.connector.api.ConnectorException;
 
-import com.metamatrix.cdk.api.EnvironmentUtility;
 import com.metamatrix.cdk.api.SysLogger;
 import com.metamatrix.connector.xml.base.ProxyObjectFactory;
 
@@ -53,15 +52,14 @@
 
     public void testSetGetState() {
     	try {
-    		Properties props = ProxyObjectFactory.getDefaultFileProps();
+    		FileManagedConnectionFactory env = ProxyObjectFactory.getDefaultFileProps();
     		FileConnectorState state = new FileConnectorState();
 	    	state.setLogger(new SysLogger(false));
-    		state.setState(EnvironmentUtility.createEnvironment(props));
+    		state.setState(env);
 	    	Properties retProps = state.getState();
 	    	assertNotNull(retProps);
-	    	assertEquals(props.getProperty(FileConnectorState.FILE_NAME), retProps.getProperty(FileConnectorState.FILE_NAME));
-	    	assertEquals(props.getProperty(FileConnectorState.DIRECTORY_PATH),
-	    			retProps.getProperty(FileConnectorState.DIRECTORY_PATH));
+	    	assertEquals(env.getFileName(), retProps.getProperty(FileConnectorState.FILE_NAME));
+	    	assertEquals(env.getFilePath(), retProps.getProperty(FileConnectorState.DIRECTORY_PATH));
 	    } catch (ConnectorException e) {
 	    	fail(e.getMessage());
 	    }
@@ -80,15 +78,14 @@
      */
     public void testFileConnectorStateProperties() {
        	try {
-       		Properties props = ProxyObjectFactory.getDefaultFileProps();
+    		FileManagedConnectionFactory env = ProxyObjectFactory.getDefaultFileProps();
 	       	FileConnectorState state = new FileConnectorState();
 	    	state.setLogger(new SysLogger(false));
-	    	state.setState(EnvironmentUtility.createEnvironment(props));
+	    	state.setState(env);
 	    	Properties retProps = state.getState();
 	    	assertNotNull(retProps);
-	    	assertEquals(props.getProperty(FileConnectorState.FILE_NAME), retProps.getProperty(FileConnectorState.FILE_NAME));
-	    	assertEquals(props.getProperty(FileConnectorState.DIRECTORY_PATH), 
-	    			retProps.getProperty(FileConnectorState.DIRECTORY_PATH));
+	    	assertEquals(env.getFileName(), retProps.getProperty(FileConnectorState.FILE_NAME));
+	    	assertEquals(env.getFilePath(), retProps.getProperty(FileConnectorState.DIRECTORY_PATH));
        	} catch (ConnectorException e) {
 	    	fail(e.getMessage());
 	    }

Modified: branches/JCA/connectors/connector-xml/src/test/java/com/metamatrix/connector/xml/http/TestHTTPConnectorState.java
===================================================================
--- branches/JCA/connectors/connector-xml/src/test/java/com/metamatrix/connector/xml/http/TestHTTPConnectorState.java	2009-12-21 19:41:26 UTC (rev 1687)
+++ branches/JCA/connectors/connector-xml/src/test/java/com/metamatrix/connector/xml/http/TestHTTPConnectorState.java	2009-12-21 19:43:33 UTC (rev 1688)
@@ -28,8 +28,8 @@
 
 import org.teiid.connector.api.ConnectorException;
 
-import com.metamatrix.cdk.api.EnvironmentUtility;
 import com.metamatrix.cdk.api.SysLogger;
+import com.metamatrix.common.util.PropertiesUtils;
 import com.metamatrix.connector.xml.base.ProxyObjectFactory;
 
 /**
@@ -99,10 +99,11 @@
         Properties props = ProxyObjectFactory.getDefaultXMLRequestProps();
         props.put("HostnameVerifier", "com.metamatrix.connector.xml.MockHostnameVerifier");
         HTTPConnectorState state = new HTTPConnectorState();
-        Properties propOut = null;
         try {
+        	HTTPManagedConnectionFactory env = new HTTPManagedConnectionFactory();
+        	PropertiesUtils.setBeanProperties(env, props, null);
            	state.setLogger(new SysLogger(false));
-           	state.setState(EnvironmentUtility.createEnvironment(props));
+           	state.setState(env);
         } catch (ConnectorException ce) {
         	fail(ce.getMessage());
         }
@@ -112,10 +113,11 @@
         Properties props = ProxyObjectFactory.getDefaultXMLRequestProps();
         props.put("HostnameVerifier", "com.metamatrix.connector.xml.BogusHostnameVerifier");
         HTTPConnectorState state = new HTTPConnectorState();
-        Properties propOut = null;
         try {
            	state.setLogger(new SysLogger(false));
-           	state.setState(EnvironmentUtility.createEnvironment(props));
+        	HTTPManagedConnectionFactory env = new HTTPManagedConnectionFactory();
+        	PropertiesUtils.setBeanProperties(env, props, null);
+           	state.setState(env);
         } catch (ConnectorException ce) {
         	return;
         }

Modified: branches/JCA/connectors/connector-xml/src/test/java/com/metamatrix/connector/xmlsource/file/TestFileConnection.java
===================================================================
--- branches/JCA/connectors/connector-xml/src/test/java/com/metamatrix/connector/xmlsource/file/TestFileConnection.java	2009-12-21 19:41:26 UTC (rev 1687)
+++ branches/JCA/connectors/connector-xml/src/test/java/com/metamatrix/connector/xmlsource/file/TestFileConnection.java	2009-12-21 19:43:33 UTC (rev 1688)
@@ -22,14 +22,12 @@
 
 package com.metamatrix.connector.xmlsource.file;
 
-import java.util.Properties;
-
 import junit.framework.TestCase;
 
-import org.teiid.connector.api.ConnectorEnvironment;
+import org.mockito.Mockito;
 import org.teiid.connector.api.ConnectorException;
+import org.teiid.connector.api.ConnectorLogger;
 
-import com.metamatrix.cdk.api.EnvironmentUtility;
 import com.metamatrix.core.util.UnitTestUtil;
 
 
@@ -39,12 +37,12 @@
 
     
     public void testBadDirectory() {
-        Properties props = new Properties();
-        props.setProperty("DirectoryLocation", "BadDirectory"); //$NON-NLS-1$  //$NON-NLS-2$
-        ConnectorEnvironment env = EnvironmentUtility.createEnvironment(props, false);
+        FileManagedConnectionFactory config = Mockito.mock(FileManagedConnectionFactory.class);
+        Mockito.stub(config.getLogger()).toReturn(Mockito.mock(ConnectorLogger.class));
+        Mockito.stub(config.getDirectoryLocation()).toReturn("BadDirectory");        
         
         try {
-            new FileConnection(env);
+            new FileConnection(config);
             fail("Must have failed because of bad directory location"); //$NON-NLS-1$
         } catch (ConnectorException e) {
         }            
@@ -53,12 +51,13 @@
     
     public void testGoodDirectory() {
         String file = UnitTestUtil.getTestDataPath(); 
-        Properties props = new Properties();
-        props.setProperty("DirectoryLocation", file); //$NON-NLS-1$  
-        ConnectorEnvironment env = EnvironmentUtility.createEnvironment(props, false);
+
+        FileManagedConnectionFactory config = Mockito.mock(FileManagedConnectionFactory.class);
+        Mockito.stub(config.getLogger()).toReturn(Mockito.mock(ConnectorLogger.class));
+        Mockito.stub(config.getDirectoryLocation()).toReturn(file);        
         
         try {
-            FileConnection conn = new FileConnection(env);
+            FileConnection conn = new FileConnection(config);
             assertTrue(conn.isConnected());
         } catch (ConnectorException e) {
             fail("mast have passed connection"); //$NON-NLS-1$
@@ -66,11 +65,11 @@
     }    
     
     public void testNoDirectory() {
-        Properties props = new Properties();
-        ConnectorEnvironment env = EnvironmentUtility.createEnvironment(props, false);
+        FileManagedConnectionFactory config = Mockito.mock(FileManagedConnectionFactory.class);
+        Mockito.stub(config.getLogger()).toReturn(Mockito.mock(ConnectorLogger.class));
         
         try {
-            new FileConnection(env);
+            new FileConnection(config);
             fail("Must have failed because of bad directory location"); //$NON-NLS-1$
         } catch (ConnectorException e) {
         }            

Modified: branches/JCA/connectors/connector-xml/src/test/java/com/metamatrix/connector/xmlsource/file/TestFileExecution.java
===================================================================
--- branches/JCA/connectors/connector-xml/src/test/java/com/metamatrix/connector/xmlsource/file/TestFileExecution.java	2009-12-21 19:41:26 UTC (rev 1687)
+++ branches/JCA/connectors/connector-xml/src/test/java/com/metamatrix/connector/xmlsource/file/TestFileExecution.java	2009-12-21 19:43:33 UTC (rev 1688)
@@ -23,22 +23,21 @@
 package com.metamatrix.connector.xmlsource.file;
 
 import java.io.FileReader;
+import java.io.PrintWriter;
 import java.io.Reader;
 import java.sql.SQLXML;
 import java.util.List;
-import java.util.Properties;
 
 import junit.framework.TestCase;
 
 import org.mockito.Mockito;
-import org.teiid.connector.api.ConnectorEnvironment;
 import org.teiid.connector.api.ConnectorException;
+import org.teiid.connector.api.ExecutionContext;
 import org.teiid.connector.language.ILanguageFactory;
 import org.teiid.connector.language.IProcedure;
 import org.teiid.connector.metadata.runtime.Procedure;
 import org.teiid.connector.metadata.runtime.RuntimeMetadata;
 
-import com.metamatrix.cdk.api.EnvironmentUtility;
 import com.metamatrix.core.util.UnitTestUtil;
 
 
@@ -48,19 +47,19 @@
     
     public void testGoodFile() throws Exception {
         String file = UnitTestUtil.getTestDataPath(); 
-        Properties props = new Properties();
-        props.setProperty("DirectoryLocation", file); //$NON-NLS-1$  
-        ConnectorEnvironment env = EnvironmentUtility.createEnvironment(props, false);
+        FileManagedConnectionFactory config = new FileManagedConnectionFactory();
+        config.setLogWriter(Mockito.mock(PrintWriter.class));
+        config.setDirectoryLocation(file);
         
         try {
-            FileConnection conn = new FileConnection(env);
+            FileConnection conn = new FileConnection(config);
             assertTrue(conn.isConnected());
             RuntimeMetadata metadata = Mockito.mock(RuntimeMetadata.class);
 
-            ILanguageFactory fact = env.getLanguageFactory();
+            ILanguageFactory fact = config.getLanguageFactory();
            	IProcedure procedure = fact.createProcedure("GetXMLFile", null, createMockProcedureMetadata("BookCollection.xml")); //$NON-NLS-1$
 
-            FileExecution exec = (FileExecution)conn.createExecution(procedure, EnvironmentUtility.createExecutionContext("100", "100"), metadata); //$NON-NLS-1$ //$NON-NLS-2$
+            FileExecution exec = (FileExecution)conn.createExecution(procedure, Mockito.mock(ExecutionContext.class), metadata); //$NON-NLS-1$ //$NON-NLS-2$
             
             exec.execute();
             
@@ -87,18 +86,19 @@
         }                    
     }
         
-    public void testBadFile() {
+    public void testBadFile() throws Exception {
         String file = UnitTestUtil.getTestDataPath(); 
-        Properties props = new Properties();
-        props.setProperty("DirectoryLocation", file); //$NON-NLS-1$  
-        ConnectorEnvironment env = EnvironmentUtility.createEnvironment(props, false);
+        FileManagedConnectionFactory config = new FileManagedConnectionFactory();
+        config.setLogWriter(Mockito.mock(PrintWriter.class));
+        config.setDirectoryLocation(file);
+
         
         try {
-            FileConnection conn = new FileConnection(env);
+            FileConnection conn = new FileConnection(config);
             assertTrue(conn.isConnected());
             RuntimeMetadata metadata = Mockito.mock(RuntimeMetadata.class);
-            ILanguageFactory fact = env.getLanguageFactory();
-            FileExecution exec = (FileExecution)conn.createExecution(fact.createProcedure("GetXMLFile", null, createMockProcedureMetadata("nofile.xml")), EnvironmentUtility.createExecutionContext("100", "100"), metadata); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+            ILanguageFactory fact = config.getLanguageFactory();
+            FileExecution exec = (FileExecution)conn.createExecution(fact.createProcedure("GetXMLFile", null, createMockProcedureMetadata("nofile.xml")), Mockito.mock(ExecutionContext.class), metadata); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
             
             
             exec.execute();

Modified: branches/JCA/connectors/connector-xml/src/test/java/com/metamatrix/connector/xmlsource/soap/TestSoapConnection.java
===================================================================
--- branches/JCA/connectors/connector-xml/src/test/java/com/metamatrix/connector/xmlsource/soap/TestSoapConnection.java	2009-12-21 19:41:26 UTC (rev 1687)
+++ branches/JCA/connectors/connector-xml/src/test/java/com/metamatrix/connector/xmlsource/soap/TestSoapConnection.java	2009-12-21 19:43:33 UTC (rev 1688)
@@ -27,10 +27,11 @@
 
 import junit.framework.TestCase;
 
+import org.mockito.Mockito;
 import org.teiid.connector.api.ConnectorEnvironment;
 import org.teiid.connector.api.ConnectorException;
+import org.teiid.connector.api.ConnectorLogger;
 
-import com.metamatrix.cdk.api.EnvironmentUtility;
 import com.metamatrix.core.util.UnitTestUtil;
 
 
@@ -39,9 +40,9 @@
 public class TestSoapConnection extends TestCase{
     
     public void testNoWSDL() throws Exception {
-        Properties props = new Properties();
-        ConnectorEnvironment env = EnvironmentUtility.createEnvironment(props, false);
-        
+        SoapManagedConnectionFactory env = Mockito.mock(SoapManagedConnectionFactory.class);
+        Mockito.stub(env.getLogger()).toReturn(Mockito.mock(ConnectorLogger.class));
+
         try {
             new SoapConnection(env);
             fail("WSDL is not set; must have failed"); //$NON-NLS-1$
@@ -52,9 +53,10 @@
 
     public void testWSDLLoad() throws Exception {
         File wsdlFile = new File(UnitTestUtil.getTestDataPath()+"/stockquotes.xml"); //$NON-NLS-1$
-        Properties props = new Properties();
-        props.setProperty("wsdl", wsdlFile.toURL().toString()); //$NON-NLS-1$  
-        ConnectorEnvironment env = EnvironmentUtility.createEnvironment(props, false);
+
+        SoapManagedConnectionFactory env = Mockito.mock(SoapManagedConnectionFactory.class);
+        Mockito.stub(env.getLogger()).toReturn(Mockito.mock(ConnectorLogger.class));
+        Mockito.stub(env.getWsdl()).toReturn(wsdlFile.toURL().toString());
         
         SoapConnection conn = new SoapConnection(env);
         assertTrue(conn.isConnected());
@@ -70,9 +72,10 @@
     
     public void testFindOperation() throws Exception {
         File wsdlFile = new File(UnitTestUtil.getTestDataPath()+"/stockquotes.xml"); //$NON-NLS-1$
-        Properties props = new Properties();
-        props.setProperty("wsdl", wsdlFile.toURL().toString()); //$NON-NLS-1$  
-        ConnectorEnvironment env = EnvironmentUtility.createEnvironment(props, false);
+
+        SoapManagedConnectionFactory env = Mockito.mock(SoapManagedConnectionFactory.class);
+        Mockito.stub(env.getLogger()).toReturn(Mockito.mock(ConnectorLogger.class));
+        Mockito.stub(env.getWsdl()).toReturn(wsdlFile.toURL().toString());
         
         SoapConnection conn = new SoapConnection(env);
         ServiceOperation operation = conn.findOperation("GetQuote"); //$NON-NLS-1$

Modified: branches/JCA/connectors/connector-xml/src/test/java/com/metamatrix/connector/xmlsource/soap/TestSoapExecution.java
===================================================================
--- branches/JCA/connectors/connector-xml/src/test/java/com/metamatrix/connector/xmlsource/soap/TestSoapExecution.java	2009-12-21 19:41:26 UTC (rev 1687)
+++ branches/JCA/connectors/connector-xml/src/test/java/com/metamatrix/connector/xmlsource/soap/TestSoapExecution.java	2009-12-21 19:43:33 UTC (rev 1688)
@@ -23,10 +23,10 @@
 package com.metamatrix.connector.xmlsource.soap;
 
 import java.io.File;
+import java.io.PrintWriter;
 import java.sql.SQLXML;
 import java.util.ArrayList;
 import java.util.List;
-import java.util.Properties;
 
 import junit.extensions.TestSetup;
 import junit.framework.Test;
@@ -34,7 +34,7 @@
 import junit.framework.TestSuite;
 
 import org.mockito.Mockito;
-import org.teiid.connector.api.ConnectorEnvironment;
+import org.teiid.connector.api.ExecutionContext;
 import org.teiid.connector.api.ProcedureExecution;
 import org.teiid.connector.language.ILanguageFactory;
 import org.teiid.connector.language.IParameter;
@@ -42,8 +42,6 @@
 import org.teiid.connector.language.IParameter.Direction;
 import org.teiid.connector.metadata.runtime.RuntimeMetadata;
 
-import com.metamatrix.cdk.api.EnvironmentUtility;
-import com.metamatrix.cdk.api.SysLogger;
 import com.metamatrix.connector.xmlsource.file.TestFileExecution;
 import com.metamatrix.connector.xmlsource.soap.service.WebServiceServer;
 import com.metamatrix.core.util.UnitTestUtil;
@@ -80,26 +78,31 @@
 	
 	
     public void defer_testExternalWSDLExecution_getMovies() throws Exception {        
-        Properties props = new Properties();
-        props.setProperty("wsdl", "http://www.ignyte.com/webservices/ignyte.whatsshowing.webservice/moviefunctions.asmx?wsdl"); //$NON-NLS-1$  //$NON-NLS-2$
+        SoapManagedConnectionFactory env = new SoapManagedConnectionFactory();
+        env.setLogWriter(Mockito.mock(PrintWriter.class));
+        env.setWsdl("http://www.ignyte.com/webservices/ignyte.whatsshowing.webservice/moviefunctions.asmx?wsdl");
+
         String in = "<tns:GetTheatersAndMovies xmlns:soapenc=\"http://schemas.xmlsoap.org/soap/encoding/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:tns=\"http://www.ignyte.com/whatsshowing\" xmlns:xs=\"http://www.w3.org/2001/XMLSchema\"><tns:zipCode>63011</tns:zipCode> <tns:radius>7</tns:radius> </tns:GetTheatersAndMovies>"; //$NON-NLS-1$
-        executeSOAP("GetTheatersAndMovies", new Object[] {in}, props, null); //$NON-NLS-1$ 
+        executeSOAP("GetTheatersAndMovies", new Object[] {in}, env, null); //$NON-NLS-1$ 
     }    
     
     public void defer_testExternalWSDLExecution_getRate() throws Exception {        
-        Properties props = new Properties();
-        props.setProperty("wsdl", "http://www.xmethods.net/sd/2001/CurrencyExchangeService.wsdl"); //$NON-NLS-1$  //$NON-NLS-2$
+        SoapManagedConnectionFactory env = new SoapManagedConnectionFactory();
+        env.setLogWriter(Mockito.mock(PrintWriter.class));
+        env.setWsdl("http://www.xmethods.net/sd/2001/CurrencyExchangeService.wsdl");
+
         String out = "<return type=\"java.lang.Float\">1.0</return>"; //$NON-NLS-1$
-        executeSOAP("getRate", new Object[] {"USA", "USA"}, props, out); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$        
+        executeSOAP("getRate", new Object[] {"USA", "USA"}, env, out); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$        
     }     
     
     public void testWithNoSourceName() throws Exception {
         
         File wsdlFile = new File(UnitTestUtil.getTestDataPath()+"/stockquotes.xml"); //$NON-NLS-1$
-        Properties props = new Properties();
-        props.setProperty("wsdl", wsdlFile.toURL().toString()); //$NON-NLS-1$  
+        SoapManagedConnectionFactory env = new SoapManagedConnectionFactory();
+        env.setLogWriter(Mockito.mock(PrintWriter.class));
+        env.setWsdl(wsdlFile.toURL().toString());
         try {
-            executeSOAP("", new Object[] {"MSFT"}, props, null); //$NON-NLS-1$ //$NON-NLS-2$
+            executeSOAP("", new Object[] {"MSFT"}, env, null); //$NON-NLS-1$ //$NON-NLS-2$
             fail("must have failed since we did not provide a name in source property to execute"); //$NON-NLS-1$
         }catch(Exception e) {            
         }
@@ -108,24 +111,25 @@
     public void defer_testExternalWithSuppliedPortType() throws Exception {
         
         File wsdlFile = new File(UnitTestUtil.getTestDataPath()+"/stockquotes.xml"); //$NON-NLS-1$
-        Properties props = new Properties();
-        props.setProperty("wsdl", wsdlFile.toURL().toString()); //$NON-NLS-1$  
-        props.setProperty("PortName", "StockQuotesSoap12"); //$NON-NLS-1$  //$NON-NLS-2$
+        SoapManagedConnectionFactory env = new SoapManagedConnectionFactory();
+        env.setLogWriter(Mockito.mock(PrintWriter.class));
+        env.setWsdl(wsdlFile.toURL().toString());
+        env.setPortName("StockQuotesSoap12");
         
-        executeSOAP("GetQuote", new Object[] {"MSFT"}, props, null); //$NON-NLS-1$ //$NON-NLS-2$        
+        executeSOAP("GetQuote", new Object[] {"MSFT"}, env, null); //$NON-NLS-1$ //$NON-NLS-2$        
     }    
     
     public void testDocLitralExecution() throws Exception {
         server.deployService(UnitTestUtil.getTestDataPath()+"/service/StockQuotes/doc-literal-deploy.wsdd"); //$NON-NLS-1$
         
         try {
-            // now write the test
-            Properties props = new Properties();
-            props.setProperty("wsdl", "http://localhost:7001/axis/services/StockQuotes?wsdl"); //$NON-NLS-1$  //$NON-NLS-2$
+            SoapManagedConnectionFactory env = new SoapManagedConnectionFactory();
+            env.setLogWriter(Mockito.mock(PrintWriter.class));
+            env.setWsdl("http://localhost:7001/axis/services/StockQuotes?wsdl");
             String in = "<tns1:symbol xmlns:soapenc=\"http://schemas.xmlsoap.org/soap/encoding/\" xmlns:tns1=\"http://service.soap.xmlsource.connector.metamatrix.com\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xs=\"http://www.w3.org/2001/XMLSchema\">MSFT</tns1:symbol>"; //$NON-NLS-1$
             
             String expected = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><symbolReturn xmlns=\"http://service.soap.xmlsource.connector.metamatrix.com\">&lt;company name=\"Microsoft Corp\"&gt;23.23&lt;/company&gt;</symbolReturn>"; //$NON-NLS-1$
-            executeSOAP("GetQuote", new Object[] {in}, props, expected); //$NON-NLS-1$ 
+            executeSOAP("GetQuote", new Object[] {in}, env, expected); //$NON-NLS-1$ 
             // end of test
         }
         finally {        
@@ -138,11 +142,12 @@
         
         try {
             // now write the test
-            Properties props = new Properties();
-            props.setProperty("wsdl", "http://localhost:7001/axis/services/StockQuotes?wsdl"); //$NON-NLS-1$  //$NON-NLS-2$
+            SoapManagedConnectionFactory env = new SoapManagedConnectionFactory();
+            env.setLogWriter(Mockito.mock(PrintWriter.class));
+            env.setWsdl("http://localhost:7001/axis/services/StockQuotes?wsdl");
                                       
             String expected = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><return type=\"java.lang.String\">&lt;company name=\"Microsoft Corp\"&gt;23.23&lt;/company&gt;</return>";//$NON-NLS-1$            
-            executeSOAP("GetQuote", new Object[] {"MSFT"}, props, expected); //$NON-NLS-1$ //$NON-NLS-2$                
+            executeSOAP("GetQuote", new Object[] {"MSFT"}, env, expected); //$NON-NLS-1$ //$NON-NLS-2$                
             // end of test
         }
         finally {           
@@ -155,11 +160,12 @@
 
         try {
             // now write the test
-            Properties props = new Properties();
-            props.setProperty("wsdl", "http://localhost:7001/axis/services/StockQuotes?wsdl"); //$NON-NLS-1$  //$NON-NLS-2$
-                                      
+            SoapManagedConnectionFactory env = new SoapManagedConnectionFactory();
+            env.setLogWriter(Mockito.mock(PrintWriter.class));
+            env.setWsdl("http://localhost:7001/axis/services/StockQuotes?wsdl");
+
             String expected = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><return type=\"java.lang.String\">&lt;company name=\"Microsoft Corp\"&gt;23.23&lt;/company&gt;</return>"; //$NON-NLS-1$
-            executeSOAP("GetQuote", new Object[] {"MSFT"}, props, expected); //$NON-NLS-1$ //$NON-NLS-2$                
+            executeSOAP("GetQuote", new Object[] {"MSFT"}, env, expected); //$NON-NLS-1$ //$NON-NLS-2$                
             // end of test
         } 
         finally {            
@@ -173,12 +179,13 @@
         try {
             // now write the test
             File wsdlFile = new File(UnitTestUtil.getTestDataPath()+"/service/distance/Distance.xml"); //$NON-NLS-1$
-            Properties props = new Properties();
-            props.setProperty("wsdl", wsdlFile.toURL().toString()); //$NON-NLS-1$  
-            props.setProperty("EndPoint", "http://localhost:7001/axis/services/Distance"); //$NON-NLS-1$ //$NON-NLS-2$
+            SoapManagedConnectionFactory env = new SoapManagedConnectionFactory();
+            env.setLogWriter(Mockito.mock(PrintWriter.class));
+            env.setWsdl(wsdlFile.toURL().toString());
+            env.setEndPoint("http://localhost:7001/axis/services/Distance");
                                           
             String expected = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><return type=\"java.lang.String\">IL</return>"; //$NON-NLS-1$
-            executeSOAP("getState", new Object[] {"63011"}, props, expected); //$NON-NLS-1$ //$NON-NLS-2$                
+            executeSOAP("getState", new Object[] {"63011"}, env, expected); //$NON-NLS-1$ //$NON-NLS-2$                
             // end of test
         }
         finally {        
@@ -192,12 +199,13 @@
         try {
             // now write the test
             File wsdlFile = new File(UnitTestUtil.getTestDataPath()+"/service/movies/movies.wsdl"); //$NON-NLS-1$
-            Properties props = new Properties();
-            props.setProperty("wsdl", wsdlFile.toURL().toString()); //$NON-NLS-1$  
+            SoapManagedConnectionFactory env = new SoapManagedConnectionFactory();
+            env.setLogWriter(Mockito.mock(PrintWriter.class));
+            env.setWsdl(wsdlFile.toURL().toString());
     
             String in = "<tns:GetTheatersAndMovies xmlns:soapenc=\"http://schemas.xmlsoap.org/soap/encoding/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:tns=\"http://www.metamatrix.com/whatsshowing\" xmlns:xs=\"http://www.w3.org/2001/XMLSchema\"><tns:zipCode>63011</tns:zipCode> <tns:radius>7</tns:radius> </tns:GetTheatersAndMovies>"; //$NON-NLS-1$                                      
             String expected = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><GetTheatersAndMoviesResponse xmlns=\"http://www.metamatrix.com/whatsshowing\"><GetTheatersAndMoviesReturn><GetTheatersAndMoviesReturn><Name>AMC Chesterfield 14</Name><Address>3rd Floor Chesterfield Mall, Chesterfield, MO</Address><Movies><Movie><Rating>PG</Rating><Name>Barnyard: The Original Party Animals</Name><RunningTime>1 hr 30 mins</RunningTime><ShowTimes>12:10pm | 2:25pm | 4:45pm | 7:10pm | 9:30pm</ShowTimes></Movie><Movie><Rating>G</Rating><Name>Cars</Name><RunningTime>1 hr 30 mins</RunningTime><ShowTimes>1 hr 57 mins</ShowTimes></Movie></Movies></GetTheatersAndMoviesReturn></GetTheatersAndMoviesReturn></GetTheatersAndMoviesResponse>"; //$NON-NLS-1$
-            executeSOAP("GetTheatersAndMovies", new Object[] {in}, props, expected); //$NON-NLS-1$ 
+            executeSOAP("GetTheatersAndMovies", new Object[] {in}, env, expected); //$NON-NLS-1$ 
             // end of test
         }
         finally {        
@@ -211,10 +219,11 @@
         try {
             // now write the test
             File wsdlFile = new File(UnitTestUtil.getTestDataPath()+"/service/movies/movies.wsdl"); //$NON-NLS-1$
-            Properties props = new Properties();
-            props.setProperty("wsdl", wsdlFile.toURL().toString()); //$NON-NLS-1$  
+            SoapManagedConnectionFactory env = new SoapManagedConnectionFactory();
+            env.setLogWriter(Mockito.mock(PrintWriter.class));
+            env.setWsdl(wsdlFile.toURL().toString());
                                                       
-            executeSOAP("getTheatersAndMovies", new Object[] {"63011", "7"}, props, null); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+            executeSOAP("getTheatersAndMovies", new Object[] {"63011", "7"}, env, null); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
             fail("must have failed, since this is doc-litral and we need to supply xml fragment as input"); //$NON-NLS-1$
             // end of test
         } catch(Exception e) {
@@ -230,13 +239,14 @@
         try {
             // now write the test
             File wsdlFile = new File(UnitTestUtil.getTestDataPath()+"/service/distance/Distance.xml"); //$NON-NLS-1$
-            Properties props = new Properties();
-            props.setProperty("wsdl", wsdlFile.toURL().toString()); //$NON-NLS-1$  
-            props.setProperty("EndPoint", "http://localhost:7001/axis/services/Distance"); //$NON-NLS-1$ //$NON-NLS-2$
+            SoapManagedConnectionFactory env = new SoapManagedConnectionFactory();
+            env.setLogWriter(Mockito.mock(PrintWriter.class));
+            env.setWsdl(wsdlFile.toURL().toString());
+            env.setEndPoint("http://localhost:7001/axis/services/Distance");
     
             try {
                 String expected = "IL"; //$NON-NLS-1$
-                executeSOAP("getState", new Object[] {"63011", "63011"}, props, expected); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+                executeSOAP("getState", new Object[] {"63011", "63011"}, env, expected); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
                 fail("must have failed to execute, as we suuplied more input parameters than expected"); //$NON-NLS-1$
             }catch(Exception e) {
                 
@@ -254,12 +264,13 @@
         try {
             // now write the test
             File wsdlFile = new File(UnitTestUtil.getTestDataPath()+"/service/books/Books.wsdl"); //$NON-NLS-1$
-            Properties props = new Properties();
-            props.setProperty("wsdl", wsdlFile.toURL().toString()); //$NON-NLS-1$  
+            SoapManagedConnectionFactory env = new SoapManagedConnectionFactory();
+            env.setLogWriter(Mockito.mock(PrintWriter.class));
+            env.setWsdl(wsdlFile.toURL().toString());
                                           
             String in = "<s0:AuthorBooks_Input xmlns:soapenc=\"http://schemas.xmlsoap.org/soap/encoding/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns:s0=\"http://www.metamatrix.com/BooksView_Input\"> <ID>1</ID> </s0:AuthorBooks_Input>"; //$NON-NLS-1$
             String expected = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Books_Output xmlns=\"http://www.metamatrix.com/BooksView_Output\"><item xmlns=\"\"><FIRSTNAME>Elfriede</FIRSTNAME><LASTNAME>Dustin</LASTNAME><TITLE>Automated Software Testing</TITLE><ID>1</ID></item></Books_Output>"; //$NON-NLS-1$
-            executeSOAP("getBooks", new Object[] {in}, props, expected); //$NON-NLS-1$ 
+            executeSOAP("getBooks", new Object[] {in}, env, expected); //$NON-NLS-1$ 
             // end of test
         } finally {        
             server.undeployService(UnitTestUtil.getTestDataPath()+"/service/books/undeploy.wsdd"); //$NON-NLS-1$
@@ -272,10 +283,12 @@
         try {
             // now write the test
             File wsdlFile = new File(UnitTestUtil.getTestDataPath()+"/service/CurrencyExchange/CurrencyExchangeService.wsdl"); //$NON-NLS-1$
-            Properties props = new Properties();
-            props.setProperty("wsdl", wsdlFile.toURL().toString()); //$NON-NLS-1$  
+            SoapManagedConnectionFactory env = new SoapManagedConnectionFactory();
+            env.setLogWriter(Mockito.mock(PrintWriter.class));
+            env.setWsdl(wsdlFile.toURL().toString());
+            
             String expected = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><return type=\"java.lang.Float\">1.0</return>"; //$NON-NLS-1$
-            executeSOAP("getRate", new Object[] {"USA", "INDIA"}, props, expected); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$                
+            executeSOAP("getRate", new Object[] {"USA", "INDIA"}, env, expected); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$                
             // end of test
         } finally {        
             server.undeployService(UnitTestUtil.getTestDataPath()+"/service/CurrencyExchange/undeploy.wsdd"); //$NON-NLS-1$
@@ -284,43 +297,52 @@
     
     public void testUserNameProfile_clear_text_Pass() throws Exception {
         String wsddFile = UnitTestUtil.getTestDataPath()+"/service/CurrencyExchange/username_clear_deploy.wsdd"; //$NON-NLS-1$
-        Properties props = new Properties();
-        props.setProperty(SoapConnectorProperties.AUTHORIZATION_TYPE, SecurityToken.WS_SECURITY); 
-        props.setProperty(SoapConnectorProperties.WS_SECURITY_TYPE, SecurityToken.USERNAME_TOKEN_PROFILE_CLEAR_TEXT); 
-        props.setProperty(SoapConnectorProperties.USERNAME, "foo"); //$NON-NLS-1$ 
-        props.setProperty(SoapConnectorProperties.PASSWORD, "foopassword"); //$NON-NLS-1$ 
-        helpTestSecurity(true, wsddFile, props);
+
+        SoapManagedConnectionFactory env = new SoapManagedConnectionFactory();
+        env.setLogWriter(Mockito.mock(PrintWriter.class));
+        env.setSecurityType(SecurityToken.WS_SECURITY);
+        env.setWSSecurityType(SecurityToken.USERNAME_TOKEN_PROFILE_CLEAR_TEXT);
+        env.setAuthUserName("foo");
+        env.setAuthPassword("foopassword");
+        
+        helpTestSecurity(true, wsddFile, env);
     }
 
     public void testUserNameProfile_clear_text_fail() throws Exception {
         String wsddFile = UnitTestUtil.getTestDataPath()+"/service/CurrencyExchange/username_clear_deploy.wsdd"; //$NON-NLS-1$
-        Properties props = new Properties();
-        props.setProperty(SoapConnectorProperties.AUTHORIZATION_TYPE, SecurityToken.WS_SECURITY); 
-        props.setProperty(SoapConnectorProperties.WS_SECURITY_TYPE, SecurityToken.USERNAME_TOKEN_PROFILE_CLEAR_TEXT); 
-        props.setProperty(SoapConnectorProperties.USERNAME, "foo"); //$NON-NLS-1$ 
-        //props.setProperty(SoapConnectorProperties.PASSWORD, "foopassword"); //$NON-NLS-1$ //$NON-NLS-2$        
-        helpTestSecurity(false, wsddFile, props);
+        SoapManagedConnectionFactory env = new SoapManagedConnectionFactory();
+        env.setLogWriter(Mockito.mock(PrintWriter.class));
+        env.setSecurityType(SecurityToken.WS_SECURITY);
+        env.setWSSecurityType(SecurityToken.USERNAME_TOKEN_PROFILE_CLEAR_TEXT);
+        env.setAuthUserName("foo");
+        helpTestSecurity(false, wsddFile, env);
     }
     
     // this one uses the nounce (the random number) and Timestamp to deter the attack 
     public void testUserNameProfile_digest_text_Pass() throws Exception {
         String wsddFile = UnitTestUtil.getTestDataPath()+"/service/CurrencyExchange/username_digest_deploy.wsdd"; //$NON-NLS-1$
-        Properties props = new Properties();
-        props.setProperty(SoapConnectorProperties.AUTHORIZATION_TYPE, SecurityToken.WS_SECURITY); 
-        props.setProperty(SoapConnectorProperties.WS_SECURITY_TYPE, SecurityToken.USERNAME_TOKEN_PROFILE_DIGEST); 
-        props.setProperty(SoapConnectorProperties.USERNAME, "foo"); //$NON-NLS-1$ 
-        props.setProperty(SoapConnectorProperties.PASSWORD, "foopassword"); //$NON-NLS-1$ 
-        helpTestSecurity(true, wsddFile, props);
+
+        SoapManagedConnectionFactory env = new SoapManagedConnectionFactory();
+        env.setLogWriter(Mockito.mock(PrintWriter.class));
+        env.setSecurityType(SecurityToken.WS_SECURITY);
+        env.setWSSecurityType(SecurityToken.USERNAME_TOKEN_PROFILE_DIGEST);
+        env.setAuthUserName("foo");
+        env.setAuthPassword("foopassword");
+        
+        helpTestSecurity(true, wsddFile, env);
     }
 
     public void testUserNameProfile_digest_text_fail() throws Exception {
         String wsddFile = UnitTestUtil.getTestDataPath()+"/service/CurrencyExchange/username_digest_deploy.wsdd"; //$NON-NLS-1$
-        Properties props = new Properties();
-        props.setProperty(SoapConnectorProperties.AUTHORIZATION_TYPE, SecurityToken.WS_SECURITY); 
-        props.setProperty(SoapConnectorProperties.WS_SECURITY_TYPE, SecurityToken.USERNAME_TOKEN_PROFILE_DIGEST); 
-        props.setProperty(SoapConnectorProperties.USERNAME, "foo"); //$NON-NLS-1$ 
-        props.setProperty(SoapConnectorProperties.PASSWORD, "badpass"); //$NON-NLS-1$ 
-        helpTestSecurity(false, wsddFile, props);
+        
+        SoapManagedConnectionFactory env = new SoapManagedConnectionFactory();
+        env.setLogWriter(Mockito.mock(PrintWriter.class));
+        env.setSecurityType(SecurityToken.WS_SECURITY);
+        env.setWSSecurityType(SecurityToken.USERNAME_TOKEN_PROFILE_DIGEST);
+        env.setAuthUserName("foo");
+        env.setAuthPassword("badpass");
+        
+        helpTestSecurity(false, wsddFile, env);
     }
 
     // TODO: Needs this to be hooked to a Http proxy to sniff the header out
@@ -328,46 +350,60 @@
         //        System.setProperty("http.proxyHost","myproxy" ); //$NON-NLS-1$ //$NON-NLS-2$
         //        System.setProperty("http.proxyPort", "8080" ); //$NON-NLS-1$ //$NON-NLS-2$        
         String wsddFile = UnitTestUtil.getTestDataPath()+"/service/CurrencyExchange/httpbasic_deploy.wsdd"; //$NON-NLS-1$
-        Properties props = new Properties();
-        props.setProperty(SoapConnectorProperties.AUTHORIZATION_TYPE, SecurityToken.HTTP_BASIC_AUTH); 
-        props.setProperty(SoapConnectorProperties.USERNAME, "foo"); //$NON-NLS-1$ 
-        props.setProperty(SoapConnectorProperties.PASSWORD, "foopassword"); //$NON-NLS-1$ 
-        helpTestSecurity(true, wsddFile, props);
+
+        SoapManagedConnectionFactory env = new SoapManagedConnectionFactory();
+        env.setLogWriter(Mockito.mock(PrintWriter.class));
+        env.setSecurityType(SecurityToken.HTTP_BASIC_AUTH);
+        env.setAuthUserName("foo");
+        env.setAuthPassword("foopassword");
+
+        helpTestSecurity(true, wsddFile, env);
     }
 
     public void testWSSecurityTypeMissing() throws Exception {
         String wsddFile = UnitTestUtil.getTestDataPath()+"/service/CurrencyExchange/timestamp_deploy.wsdd"; //$NON-NLS-1$
-        Properties props = new Properties();
-        props.setProperty(SoapConnectorProperties.AUTHORIZATION_TYPE, SecurityToken.WS_SECURITY); 
-        helpTestSecurity(false, wsddFile, props);
+
+        SoapManagedConnectionFactory env = new SoapManagedConnectionFactory();
+        env.setLogWriter(Mockito.mock(PrintWriter.class));
+        env.setSecurityType(SecurityToken.WS_SECURITY);
+
+        helpTestSecurity(false, wsddFile, env);
     }
     
     public void testWrongWSSecurityType() throws Exception {
         String wsddFile = UnitTestUtil.getTestDataPath()+"/service/CurrencyExchange/timestamp_deploy.wsdd"; //$NON-NLS-1$
-        Properties props = new Properties();
-        props.setProperty(SoapConnectorProperties.AUTHORIZATION_TYPE, SecurityToken.WS_SECURITY); 
-        props.setProperty(SoapConnectorProperties.WS_SECURITY_TYPE, "UnKnown"); //$NON-NLS-1$ 
-        helpTestSecurity(false, wsddFile, props);
+
+        SoapManagedConnectionFactory env = new SoapManagedConnectionFactory();
+        env.setLogWriter(Mockito.mock(PrintWriter.class));
+        env.setSecurityType(SecurityToken.WS_SECURITY);
+        env.setWSSecurityType("UnKnown");
+        
+        helpTestSecurity(false, wsddFile, env);
     }    
     
     public void testTimestampProfile() throws Exception {
         String wsddFile = UnitTestUtil.getTestDataPath()+"/service/CurrencyExchange/timestamp_deploy.wsdd"; //$NON-NLS-1$
-        Properties props = new Properties();    
-        props.setProperty(SoapConnectorProperties.AUTHORIZATION_TYPE, SecurityToken.WS_SECURITY); 
-        props.setProperty(SoapConnectorProperties.WS_SECURITY_TYPE, SecurityToken.TIMESTAMP); 
-        helpTestSecurity(true, wsddFile, props);
+
+        SoapManagedConnectionFactory env = new SoapManagedConnectionFactory();
+        env.setLogWriter(Mockito.mock(PrintWriter.class));
+        env.setSecurityType(SecurityToken.WS_SECURITY);
+        env.setWSSecurityType(SecurityToken.TIMESTAMP);
+        
+        helpTestSecurity(true, wsddFile, env);
     }
     
     public void defer_testEncryptProfile() throws Exception {
         String wsddFile = UnitTestUtil.getTestDataPath()+"/service/CurrencyExchange/encrypt_deploy.wsdd"; //$NON-NLS-1$
-        Properties props = new Properties();
-        props.setProperty(SoapConnectorProperties.USERNAME, "client"); //$NON-NLS-1$ 
-        props.setProperty(SoapConnectorProperties.ENCRYPTION_USER, "server"); //$NON-NLS-1$ 
-        //props.setProperty(SoapConnectorProperties.PASSWORD, "clientpassword"); //$NON-NLS-1$ //$NON-NLS-2$
-        props.setProperty(SoapConnectorProperties.AUTHORIZATION_TYPE, SecurityToken.WS_SECURITY); 
-        props.setProperty(SoapConnectorProperties.WS_SECURITY_TYPE, SecurityToken.ENCRYPT); 
-        props.setProperty(SoapConnectorProperties.ENCRYPTION_PROPERTY_FILE, "com/metamatrix/connector/xmlsource/soap/client_crypto.properties"); //$NON-NLS-1$
-        helpTestSecurity(true, wsddFile,  props);
+
+        SoapManagedConnectionFactory env = new SoapManagedConnectionFactory();
+        env.setLogWriter(Mockito.mock(PrintWriter.class));
+        env.setSecurityType(SecurityToken.WS_SECURITY);
+        env.setWSSecurityType(SecurityToken.ENCRYPT);
+        env.setEncryptPropertyFile("com/metamatrix/connector/xmlsource/soap/client_crypto.properties");
+        env.setAuthUserName("client");
+        env.setEncryptUserName("server");
+        
+        helpTestSecurity(true, wsddFile,  env);
     }      
     
     /**
@@ -392,22 +428,27 @@
     // this is sender vouches
     public void testSAMLToken_unsigned_sendervouches() throws Exception {
         String wsddFile = UnitTestUtil.getTestDataPath()+"/service/CurrencyExchange/saml_unsigned_deploy.wsdd"; //$NON-NLS-1$
-        Properties props = new Properties();
-        props.setProperty(SoapConnectorProperties.AUTHORIZATION_TYPE, SecurityToken.WS_SECURITY); 
-        props.setProperty(SoapConnectorProperties.WS_SECURITY_TYPE, SecurityToken.SAML_TOKEN_UNSIGNED); 
-        props.setProperty(SoapConnectorProperties.SAML_PROPERTY_FILE, "com/metamatrix/connector/xmlsource/soap/saml_unsigned_prop.properties"); //$NON-NLS-1$        
-        helpTestSecurity(true, wsddFile, props);
+        SoapManagedConnectionFactory env = new SoapManagedConnectionFactory();
+        env.setLogWriter(Mockito.mock(PrintWriter.class));
+        env.setSecurityType(SecurityToken.WS_SECURITY);
+        env.setWSSecurityType(SecurityToken.SAML_TOKEN_UNSIGNED);
+        env.setSAMLPropertyFile("com/metamatrix/connector/xmlsource/soap/saml_unsigned_prop.properties");
+        
+        helpTestSecurity(true, wsddFile, env);
     }
 
     public void testSAMLToken_unsigned_keyHolder() throws Exception {
         String wsddFile = UnitTestUtil.getTestDataPath()+"/service/CurrencyExchange/saml_unsigned_deploy.wsdd"; //$NON-NLS-1$
-        Properties props = new Properties();   
-        props.setProperty(SoapConnectorProperties.USERNAME, "client"); //$NON-NLS-1$ 
-        props.setProperty(SoapConnectorProperties.PASSWORD, "clientpassword"); //$NON-NLS-1$ 
-        props.setProperty(SoapConnectorProperties.AUTHORIZATION_TYPE, SecurityToken.WS_SECURITY); 
-        props.setProperty(SoapConnectorProperties.WS_SECURITY_TYPE, SecurityToken.SAML_TOKEN_UNSIGNED); 
-        props.setProperty(SoapConnectorProperties.SAML_PROPERTY_FILE, "com/metamatrix/connector/xmlsource/soap/saml_unsigned_keyholder.properties"); //$NON-NLS-1$        
-        helpTestSecurity(false, wsddFile, props);
+
+        SoapManagedConnectionFactory env = new SoapManagedConnectionFactory();
+        env.setLogWriter(Mockito.mock(PrintWriter.class));
+        env.setSecurityType(SecurityToken.WS_SECURITY);
+        env.setWSSecurityType(SecurityToken.SAML_TOKEN_UNSIGNED);
+        env.setSAMLPropertyFile("com/metamatrix/connector/xmlsource/soap/saml_unsigned_keyholder.properties");
+        env.setAuthUserName("client");
+        env.setAuthPassword("clientpassword");
+        
+        helpTestSecurity(false, wsddFile, env);
     }
     
     /**
@@ -415,9 +456,10 @@
      */
     public void testSAMLToken_unsigned_fail() throws Exception {
         String wsddFile = UnitTestUtil.getTestDataPath()+"/service/CurrencyExchange/saml_unsigned_deploy.wsdd"; //$NON-NLS-1$
-        Properties props = new Properties();
+        SoapManagedConnectionFactory env = new SoapManagedConnectionFactory();
+        env.setLogWriter(Mockito.mock(PrintWriter.class));
         // having lack of crendentials like test before; this will fail
-        helpTestSecurity(false, wsddFile, props);
+        helpTestSecurity(false, wsddFile, env);
     } 
         
     /**
@@ -434,40 +476,49 @@
      */
     public void testSignature_DirectReferece() throws Exception {
         String wsddFile = UnitTestUtil.getTestDataPath()+"/service/CurrencyExchange/signature_deploy.wsdd"; //$NON-NLS-1$
-        Properties props = new Properties();
-        props.setProperty(SoapConnectorProperties.USERNAME, "client"); //$NON-NLS-1$ 
-        props.setProperty(SoapConnectorProperties.PASSWORD, "clientpassword"); //$NON-NLS-1$ 
-        props.setProperty(SoapConnectorProperties.AUTHORIZATION_TYPE, SecurityToken.WS_SECURITY); 
-        props.setProperty(SoapConnectorProperties.WS_SECURITY_TYPE, SecurityToken.SIGNATURE); 
-        props.setProperty(SoapConnectorProperties.SIGNATURE_PROPERTY_FILE, "com/metamatrix/connector/xmlsource/soap/client_crypto.properties"); //$NON-NLS-1$
-        props.setProperty(SoapConnectorProperties.TRUST_TYPE, SecurityToken.DIRECT_REFERENCE); 
-        helpTestSecurity(true, wsddFile,  props);
+
+        SoapManagedConnectionFactory env = new SoapManagedConnectionFactory();
+        env.setLogWriter(Mockito.mock(PrintWriter.class));
+        env.setSecurityType(SecurityToken.WS_SECURITY);
+        env.setWSSecurityType(SecurityToken.SIGNATURE);
+        env.setAuthUserName("client");
+        env.setAuthPassword("clientpassword");
+        env.setTrustType(SecurityToken.DIRECT_REFERENCE);
+        env.setCryptoPropertyFile("com/metamatrix/connector/xmlsource/soap/client_crypto.properties");
+        
+        helpTestSecurity(true, wsddFile,  env);
     }     
     
     // This will not work with trusted; this will only work with the certificates which are
     // installed in the both sides. with each other's public keys
     public void testSignature_IssueSerial_NonTrusted() throws Exception {
         String wsddFile = UnitTestUtil.getTestDataPath()+"/service/CurrencyExchange/signature_deploy.wsdd"; //$NON-NLS-1$
-        Properties props = new Properties();
-        props.setProperty(SoapConnectorProperties.USERNAME, "client"); //$NON-NLS-1$ 
-        props.setProperty(SoapConnectorProperties.PASSWORD, "clientpassword"); //$NON-NLS-1$ 
-        props.setProperty(SoapConnectorProperties.AUTHORIZATION_TYPE, SecurityToken.WS_SECURITY); 
-        props.setProperty(SoapConnectorProperties.WS_SECURITY_TYPE, SecurityToken.SIGNATURE); 
-        props.setProperty(SoapConnectorProperties.SIGNATURE_PROPERTY_FILE, "com/metamatrix/connector/xmlsource/soap/client_crypto.properties"); //$NON-NLS-1$
-        props.setProperty(SoapConnectorProperties.TRUST_TYPE, SecurityToken.ISSUER_SERIAL); 
-        helpTestSecurity(true, wsddFile,  props);
+
+        SoapManagedConnectionFactory env = new SoapManagedConnectionFactory();
+        env.setLogWriter(Mockito.mock(PrintWriter.class));
+        env.setSecurityType(SecurityToken.WS_SECURITY);
+        env.setWSSecurityType(SecurityToken.SIGNATURE);
+        env.setAuthUserName("client");
+        env.setAuthPassword("clientpassword");
+        env.setTrustType(SecurityToken.ISSUER_SERIAL);
+        env.setCryptoPropertyFile("com/metamatrix/connector/xmlsource/soap/client_crypto.properties");
+        
+        helpTestSecurity(true, wsddFile,  env);
     }     
     
     public void testSignature_IssueSerial_Trusted() throws Exception {
         String wsddFile = UnitTestUtil.getTestDataPath()+"/service/CurrencyExchange/signature_trusted_deploy.wsdd"; //$NON-NLS-1$
-        Properties props = new Properties();
-        props.setProperty(SoapConnectorProperties.USERNAME, "client"); //$NON-NLS-1$ 
-        props.setProperty(SoapConnectorProperties.PASSWORD, "clientpassword"); //$NON-NLS-1$ 
-        props.setProperty(SoapConnectorProperties.AUTHORIZATION_TYPE, SecurityToken.WS_SECURITY);         
-        props.setProperty(SoapConnectorProperties.WS_SECURITY_TYPE, SecurityToken.SIGNATURE);       
-        props.setProperty(SoapConnectorProperties.SIGNATURE_PROPERTY_FILE, "com/metamatrix/connector/xmlsource/soap/client_trusted_crypto.properties"); //$NON-NLS-1$
-        props.setProperty(SoapConnectorProperties.TRUST_TYPE, SecurityToken.ISSUER_SERIAL); 
-        helpTestSecurity(false, wsddFile,  props);
+
+        SoapManagedConnectionFactory env = new SoapManagedConnectionFactory();
+        env.setLogWriter(Mockito.mock(PrintWriter.class));
+        env.setSecurityType(SecurityToken.WS_SECURITY);
+        env.setWSSecurityType(SecurityToken.SIGNATURE);
+        env.setAuthUserName("client");
+        env.setAuthPassword("clientpassword");
+        env.setTrustType(SecurityToken.ISSUER_SERIAL);
+        env.setCryptoPropertyFile("com/metamatrix/connector/xmlsource/soap/client_trusted_crypto.properties");
+
+        helpTestSecurity(false, wsddFile,  env);
     }     
     
     /**
@@ -475,61 +526,67 @@
      */       
     public void testSAMLToken_Signed_SenderVouches() throws Exception {
         String wsddFile = UnitTestUtil.getTestDataPath()+"/service/CurrencyExchange/saml_signed_deploy.wsdd"; //$NON-NLS-1$
-        Properties props = new Properties();
-        props.setProperty(SoapConnectorProperties.USERNAME, "client"); //$NON-NLS-1$ 
-        props.setProperty(SoapConnectorProperties.PASSWORD, "clientpassword"); //$NON-NLS-1$ 
-        props.setProperty(SoapConnectorProperties.AUTHORIZATION_TYPE, SecurityToken.WS_SECURITY);       
-        props.setProperty(SoapConnectorProperties.WS_SECURITY_TYPE, SecurityToken.SAML_TOKEN_SIGNED);       
-        props.setProperty(SoapConnectorProperties.SAML_PROPERTY_FILE, "com/metamatrix/connector/xmlsource/soap/saml_signed_sendervouches.properties"); //$NON-NLS-1$
-        props.setProperty(SoapConnectorProperties.SIGNATURE_PROPERTY_FILE, "com/metamatrix/connector/xmlsource/soap/client_crypto.properties"); //$NON-NLS-1$
-        props.setProperty(SoapConnectorProperties.TRUST_TYPE, SecurityToken.DIRECT_REFERENCE); 
-        helpTestSecurity(false, wsddFile,  props);
+
+        SoapManagedConnectionFactory env = new SoapManagedConnectionFactory();
+        env.setLogWriter(Mockito.mock(PrintWriter.class));
+        env.setSecurityType(SecurityToken.WS_SECURITY);
+        env.setWSSecurityType(SecurityToken.SAML_TOKEN_SIGNED);
+        env.setAuthUserName("client");
+        env.setAuthPassword("clientpassword");
+        env.setTrustType(SecurityToken.DIRECT_REFERENCE);
+        env.setCryptoPropertyFile("com/metamatrix/connector/xmlsource/soap/client_crypto.properties");
+        env.setSAMLPropertyFile("com/metamatrix/connector/xmlsource/soap/saml_signed_sendervouches.properties");
+        
+        helpTestSecurity(false, wsddFile,  env);
     }    
          
     
     // Worked with both self cert and trusted certificates
     public void testSAMLToken_Signed_KeyHolder_directRef() throws Exception {
         String wsddFile = UnitTestUtil.getTestDataPath()+"/service/CurrencyExchange/saml_signed_deploy.wsdd"; //$NON-NLS-1$
-        Properties props = new Properties();
-        props.setProperty(SoapConnectorProperties.USERNAME, "client"); //$NON-NLS-1$ 
-        props.setProperty(SoapConnectorProperties.PASSWORD, "clientpassword"); //$NON-NLS-1$ 
-        props.setProperty(SoapConnectorProperties.AUTHORIZATION_TYPE, SecurityToken.WS_SECURITY); 
-        props.setProperty(SoapConnectorProperties.WS_SECURITY_TYPE, SecurityToken.TIMESTAMP + " " + SecurityToken.SAML_TOKEN_SIGNED); //$NON-NLS-1$      
-        props.setProperty(SoapConnectorProperties.SAML_PROPERTY_FILE, "com/metamatrix/connector/xmlsource/soap/saml_signed_keyholder.properties"); //$NON-NLS-1$
-        props.setProperty(SoapConnectorProperties.SIGNATURE_PROPERTY_FILE, "com/metamatrix/connector/xmlsource/soap/client_crypto.properties"); //$NON-NLS-1$
-        // TODO - still need to investigate for IssueSerial here - looks like WSS4J does not support this
-        props.setProperty(SoapConnectorProperties.TRUST_TYPE, SecurityToken.DIRECT_REFERENCE); 
-        helpTestSecurity(true, wsddFile,  props);
+
+        SoapManagedConnectionFactory env = new SoapManagedConnectionFactory();
+        env.setLogWriter(Mockito.mock(PrintWriter.class));
+        env.setSecurityType(SecurityToken.WS_SECURITY);
+        env.setWSSecurityType(SecurityToken.TIMESTAMP + " " + SecurityToken.SAML_TOKEN_SIGNED);
+        env.setAuthUserName("client");
+        env.setAuthPassword("clientpassword");
+        env.setTrustType(SecurityToken.DIRECT_REFERENCE);
+        env.setCryptoPropertyFile("com/metamatrix/connector/xmlsource/soap/client_crypto.properties");
+        env.setSAMLPropertyFile("com/metamatrix/connector/xmlsource/soap/saml_signed_keyholder.properties");
+        env.setCryptoPropertyFile("com/metamatrix/connector/xmlsource/soap/client_crypto.properties");
+        
+        helpTestSecurity(true, wsddFile,  env);
     }    
     
     public void defer_testMultiple_sig_time_username() throws Exception {
         String wsddFile = UnitTestUtil.getTestDataPath()+"/service/CurrencyExchange/multiple_deploy.wsdd"; //$NON-NLS-1$
-        Properties props = new Properties();
-        props.setProperty(SoapConnectorProperties.USERNAME, "client"); //$NON-NLS-1$ 
-        props.setProperty(SoapConnectorProperties.PASSWORD, "clientpassword"); //$NON-NLS-1$ 
 
-        props.setProperty(SoapConnectorProperties.ENCRYPTION_USER, "server"); //$NON-NLS-1$ 
-        
-        props.setProperty(SoapConnectorProperties.AUTHORIZATION_TYPE, SecurityToken.WS_SECURITY); 
-        props.setProperty(SoapConnectorProperties.WS_SECURITY_TYPE, SecurityToken.USERNAME_TOKEN_PROFILE_CLEAR_TEXT+ " " +SecurityToken.SIGNATURE+ " " +SecurityToken.ENCRYPT + " " + SecurityToken.TIMESTAMP); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ 
+        SoapManagedConnectionFactory env = new SoapManagedConnectionFactory();
+        env.setLogWriter(Mockito.mock(PrintWriter.class));
+        env.setSecurityType(SecurityToken.WS_SECURITY);
+        env.setWSSecurityType(SecurityToken.USERNAME_TOKEN_PROFILE_CLEAR_TEXT+ " " +SecurityToken.SIGNATURE+ " " +SecurityToken.ENCRYPT + " " + SecurityToken.TIMESTAMP);
+        env.setAuthUserName("client");
+        env.setAuthPassword("clientpassword");
+        env.setTrustType(SecurityToken.DIRECT_REFERENCE);
+        env.setCryptoPropertyFile("com/metamatrix/connector/xmlsource/soap/client_crypto.properties");
+        env.setEncryptPropertyFile("com/metamatrix/connector/xmlsource/soap/client_crypto.properties");
+        env.setEncryptUserName("server;");
 
-        props.setProperty(SoapConnectorProperties.SIGNATURE_PROPERTY_FILE, "com/metamatrix/connector/xmlsource/soap/client_crypto.properties"); //$NON-NLS-1$        
-        props.setProperty(SoapConnectorProperties.TRUST_TYPE, SecurityToken.DIRECT_REFERENCE);     
-        props.setProperty(SoapConnectorProperties.ENCRYPTION_PROPERTY_FILE, "com/metamatrix/connector/xmlsource/soap/client_crypto.properties"); //$NON-NLS-1$        
-        helpTestSecurity(true, wsddFile,  props);
+        helpTestSecurity(true, wsddFile,  env);
     }     
     
-    void helpTestSecurity(boolean passScenario, String serverWsddFile, Properties props) throws Exception {
+    void helpTestSecurity(boolean passScenario, String serverWsddFile, SoapManagedConnectionFactory env) throws Exception {
         server.deployService(serverWsddFile); 
 
         try {
             try {
                 // now write the test
                 File wsdlFile = new File(UnitTestUtil.getTestDataPath()+"/service/CurrencyExchange/CurrencyExchangeService.wsdl"); //$NON-NLS-1$
-                props.setProperty("wsdl", wsdlFile.toURL().toString()); //$NON-NLS-1$  
+                env.setWsdl(wsdlFile.toURL().toString());
                 
                 String expected = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><return type=\"java.lang.Float\">1.0</return>";//$NON-NLS-1$
-                executeSOAP("getRate", new Object[] {"USA", "INDIA"}, props, expected); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+                executeSOAP("getRate", new Object[] {"USA", "INDIA"}, env, expected); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
                 if (!passScenario) fail("The SOAP Request Must have failed; but passed"); //$NON-NLS-1$
                 // end of test
             } catch (Exception e) {
@@ -542,8 +599,7 @@
     
     
     // utility method to execute a service
-    void executeSOAP(String procName, Object[] args, Properties props, String expected) throws Exception{
-        ConnectorEnvironment env = EnvironmentUtility.createEnvironment(props, new SysLogger(false));        
+    void executeSOAP(String procName, Object[] args, SoapManagedConnectionFactory env, String expected) throws Exception{
 
         SoapConnection conn = new SoapConnection(env);
         RuntimeMetadata metadata = Mockito.mock(RuntimeMetadata.class);
@@ -557,7 +613,7 @@
         }
         IProcedure procedure = fact.createProcedure("AnyNAME", parameters, TestFileExecution.createMockProcedureMetadata(procName)); //$NON-NLS-1$
 
-        ProcedureExecution exec = (ProcedureExecution)conn.createExecution(procedure, EnvironmentUtility.createExecutionContext("100", "100"), metadata); //$NON-NLS-1$ //$NON-NLS-2$
+        ProcedureExecution exec = (ProcedureExecution)conn.createExecution(procedure, Mockito.mock(ExecutionContext.class), metadata); //$NON-NLS-1$ //$NON-NLS-2$
         exec.execute();
         
         List result = exec.next();

Modified: branches/JCA/connectors/pom.xml
===================================================================
--- branches/JCA/connectors/pom.xml	2009-12-21 19:41:26 UTC (rev 1687)
+++ branches/JCA/connectors/pom.xml	2009-12-21 19:43:33 UTC (rev 1688)
@@ -89,11 +89,6 @@
     <module>salesforce-api</module>
     <module>connector-xml-common</module>
     <module>sandbox</module>
-   
-    <!--
     <module>connector-xml</module>
-    
-    
-     -->
   </modules>
 </project>
\ No newline at end of file

Modified: branches/JCA/connectors/sandbox/connector-object/src/main/java/com/metamatrix/connector/object/ObjectConnector.java
===================================================================
--- branches/JCA/connectors/sandbox/connector-object/src/main/java/com/metamatrix/connector/object/ObjectConnector.java	2009-12-21 19:41:26 UTC (rev 1687)
+++ branches/JCA/connectors/sandbox/connector-object/src/main/java/com/metamatrix/connector/object/ObjectConnector.java	2009-12-21 19:43:33 UTC (rev 1688)
@@ -44,13 +44,13 @@
     @Override
     public void initialize(ConnectorEnvironment environment) throws ConnectorException {
         this.config = (ObjectManagedConnectionFactory)environment;
-        this.objectSourceFactory = BasicManagedConnectionFactory.getInstance(IObjectSourceFactory.class, this.config.getObjectSourceFactoryClass(), null);
+        this.objectSourceFactory = BasicManagedConnectionFactory.getInstance(IObjectSourceFactory.class, this.config.getObjectSourceFactoryClass(), null, null);
     }
 
    
     @Override
     public Connection getConnection()throws ConnectorException {
-    	ISourceTranslator translator = BasicManagedConnectionFactory.getInstance(ISourceTranslator.class, this.config.getExtensionResultsTranslationClass(), BasicSourceTranslator.class);
+    	ISourceTranslator translator = BasicManagedConnectionFactory.getInstance(ISourceTranslator.class, this.config.getExtensionResultsTranslationClass(), null, BasicSourceTranslator.class);
     	translator.initialize(this.config);
     	
         return new ObjectConnection(config, objectSourceFactory.getObjectSource(this.config), translator);



More information about the teiid-commits mailing list