teiid SVN: r1690 - trunk/test-integration/db/src/main/java/org/teiid/test/client.
by teiid-commits@lists.jboss.org
Author: vhalbert(a)redhat.com
Date: 2009-12-21 15:06:52 -0500 (Mon, 21 Dec 2009)
New Revision: 1690
Modified:
trunk/test-integration/db/src/main/java/org/teiid/test/client/TransactionFactory.java
Log:
Teiid 781 - updated to support the new autocommit txn options
Modified: trunk/test-integration/db/src/main/java/org/teiid/test/client/TransactionFactory.java
===================================================================
--- trunk/test-integration/db/src/main/java/org/teiid/test/client/TransactionFactory.java 2009-12-21 20:01:48 UTC (rev 1689)
+++ trunk/test-integration/db/src/main/java/org/teiid/test/client/TransactionFactory.java 2009-12-21 20:06:52 UTC (rev 1690)
@@ -25,7 +25,7 @@
import org.teiid.test.framework.TransactionContainer;
import org.teiid.test.framework.exception.QueryTestFailedException;
import org.teiid.test.framework.exception.TransactionRuntimeException;
-import org.teiid.test.framework.transaction.AutoWrapTransaction;
+import org.teiid.test.framework.transaction.AutoCommitTransaction;
import org.teiid.test.framework.transaction.JNDITransaction;
import org.teiid.test.framework.transaction.LocalTransaction;
import org.teiid.test.framework.transaction.OffWrapTransaction;
@@ -91,7 +91,7 @@
transacton = new OnWrapTransaction();
}
else if (type.equalsIgnoreCase(TRANSACTION_TYPES.AUTOWRAP_TRANSACTION)) {
- transacton = new AutoWrapTransaction();
+ transacton = new AutoCommitTransaction();
} else {
throw new TransactionRuntimeException("Invalid property value of " + type + " for " + TRANSACTION_TYPE );
15 years
teiid SVN: r1689 - in trunk/engine/src/test/java/com/metamatrix/query: processor and 1 other directory.
by teiid-commits@lists.jboss.org
Author: loleary
Date: 2009-12-21 15:01:48 -0500 (Mon, 21 Dec 2009)
New Revision: 1689
Modified:
trunk/engine/src/test/java/com/metamatrix/query/optimizer/TestOptimizer.java
trunk/engine/src/test/java/com/metamatrix/query/processor/TestProcessor.java
Log:
TEIID-912: Add unit test methods from JBEDSP-1137: StackOverflowError when top level query uses the same symbol name and group alias that is in a second level query or sub-query
Tests migrated from JBEDSP-1137 (R050503)
Reviewed by shawkins
Modified: trunk/engine/src/test/java/com/metamatrix/query/optimizer/TestOptimizer.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/query/optimizer/TestOptimizer.java 2009-12-21 19:43:33 UTC (rev 1688)
+++ trunk/engine/src/test/java/com/metamatrix/query/optimizer/TestOptimizer.java 2009-12-21 20:01:48 UTC (rev 1689)
@@ -6736,6 +6736,108 @@
TestOptimizer.SHOULD_SUCCEED);
}
+ /**
+ * Test the query optimizer's ability to properly plan and optimize a query
+ * that uses ambiguous alias names in the top level query and its sub-query.
+ * <p>
+ * No source table is being used. For example, <code>SELECT A.e2 FROM
+ * (SELECT e2 FROM (SELECT 1 AS e2) AS A) AS A</code>
+ * <p>
+ * The test is to ensure that A.e2 from the top level is not confused with
+ * e2 in the second level.
+ * <p>
+ * Related Defects: JBEDSP-1137
+ */
+ @Test public void testAmbiguousAliasInSubQueryNoSource() {
+ // Create query
+ String sql = "SELECT A.e2 AS e2 FROM (" + //$NON-NLS-1$
+ " SELECT e2 AS e2 FROM (" + //$NON-NLS-1$
+ " SELECT 5 AS e2" + //$NON-NLS-1$
+ " ) AS A" + //$NON-NLS-1$
+ ") AS A"; //$NON-NLS-1$
+
+ helpPlan(sql, FakeMetadataFactory.example1(), new String[] {});
+ }
+
+ /**
+ * Test the query optimizer's ability to properly plan and optimize a query
+ * that uses ambiguous alias names in the top level query and its sub-query
+ * and uses columns belonging to the alias as a parameter to a function.
+ * <p>
+ * No source table is being used. For example, <code>SELECT CONVERT(A.e2,
+ * biginteger) AS e2 FROM (SELECT CONVERT(e2, long) AS e2 FROM (SELECT 1 AS
+ * e2) AS A) AS A</code>
+ * <p>
+ * The test is to ensure that A.e2 from the top level is not confused with
+ * e2 in the second level.
+ * <p>
+ * Related Defects: JBEDSP-1137
+ */
+ @Test public void testAmbiguousAliasFunctionInSubQueryNoSource() {
+ // Create query
+ String sql = "SELECT CONVERT(A.e2, biginteger) AS e2 FROM (" + //$NON-NLS-1$
+ " SELECT CONVERT(e2, long) AS e2 FROM (" + //$NON-NLS-1$
+ " SELECT 5 AS e2" + //$NON-NLS-1$
+ " ) AS A" + //$NON-NLS-1$
+ ") AS A"; //$NON-NLS-1$
+
+ helpPlan(sql, FakeMetadataFactory.example1(), new String[] {});
+ }
+
+ /**
+ * Test the query optimizer's ability to properly plan and optimize a query
+ * that uses ambiguous alias names in the top level query and its sub-query.
+ * <p>
+ * For example, <code>SELECT A.e2 FROM (SELECT e12FROM pm1.g1 AS A) AS A</code>
+ * <p>
+ * The test is to ensure that A.e2 from the top level is not confused with
+ * e2 in the second level.
+ * <p>
+ * Related Defects: JBEDSP-1137
+ */
+ @Test public void testAmbiguousAliasInSubQuerySource() {
+ // Create query
+ String sql = "SELECT A.e2 AS e2 FROM (" + //$NON-NLS-1$
+ " SELECT e2 AS e2 FROM pm1.g1 AS A" + //$NON-NLS-1$
+ ") AS A"; //$NON-NLS-1$
+
+ helpPlan(sql, FakeMetadataFactory.example1(), new String[] {"SELECT e2 FROM pm1.g1 AS A"}); //$NON-NLS-1$
+ }
+
+ /**
+ * Test the query optimizer's ability to properly plan and optimize a query
+ * that uses ambiguous alias names in the top level query and its sub-query
+ * and uses columns belonging to the alias as a parameter to a function.
+ * <p>
+ * For example, <code>SELECT CONVERT(A.e2, biginteger) AS e2 FROM (SELECT
+ * CONVERT(e2, long) AS e2 FROM pm1.g1 AS A) AS A</code>
+ * <p>
+ * The test is to ensure that A.e2 from the top level is not confused with
+ * e2 in the second level.
+ * <p>
+ * Related Defects: JBEDSP-1137
+ */
+ @Test public void testAmbiguousAliasFunctionInSubQuerySource() {
+ // Create query
+ String sql = "SELECT CONVERT(A.e2, biginteger) AS e2 FROM (" + //$NON-NLS-1$
+ " SELECT CONVERT(e2, long) AS e2 FROM pm1.g1 AS A" + //$NON-NLS-1$
+ ") AS A"; //$NON-NLS-1$
+
+ helpPlan(sql, FakeMetadataFactory.example1(), new String[] {"SELECT e2 FROM pm1.g1 AS A"}); //$NON-NLS-1$
+
+ // Add convert capability to pm1 and try it again
+ FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
+ BasicSourceCapabilities caps = TestOptimizer.getTypicalCapabilities();
+ caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
+ caps.setFunctionSupport("convert", true); //$NON-NLS-1$
+ capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
+ FakeMetadataFacade metadata = FakeMetadataFactory.example1();
+
+ helpPlan(sql, metadata, null, capFinder,
+ new String[] {"SELECT CONVERT(CONVERT(e2, long), biginteger) FROM pm1.g1 AS A"}, //$NON-NLS-1$
+ SHOULD_SUCCEED );
+ }
+
public static final boolean DEBUG = false;
}
Modified: trunk/engine/src/test/java/com/metamatrix/query/processor/TestProcessor.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/query/processor/TestProcessor.java 2009-12-21 19:43:33 UTC (rev 1688)
+++ trunk/engine/src/test/java/com/metamatrix/query/processor/TestProcessor.java 2009-12-21 20:01:48 UTC (rev 1689)
@@ -7510,6 +7510,40 @@
helpProcess(plan, dataManager, expected);
}
-
+
+ /**
+ * Test a query that uses ambiguous alias names in the top level query and
+ * its sub-query and uses columns belonging to the alias as a parameter to a
+ * function.
+ * <p>
+ * For example, <code>SELECT CONVERT(A.e2, biginteger) AS e2 FROM (SELECT
+ * CONVERT(e2, long) AS e2 FROM pm1.g1 AS A) AS A</code>
+ * <p>
+ * The test is to ensure that A.e2 from the top level is not confused with
+ * e2 in the second level.
+ * <p>
+ * Related Defects: JBEDSP-1137
+ */
+ @Test public void testAliasReuseInFunctionInSubQuery() throws Exception {
+ // Create query
+ String sql = "SELECT CONVERT(A.e2, biginteger) AS e2 FROM (" + //$NON-NLS-1$
+ " SELECT CONVERT(e2, long) AS e2 FROM pm1.g1 AS A WHERE e1 = 'a'" + //$NON-NLS-1$
+ ") AS A"; //$NON-NLS-1$
+
+ FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
+
+ ProcessorPlan plan = helpGetPlan(helpParse(sql), metadata, TestOptimizer.getGenericFinder());
+
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { new BigInteger("0") }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { new BigInteger("3") }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { new BigInteger("0") }), //$NON-NLS-1$
+ };
+
+ FakeDataManager manager = new FakeDataManager();
+ sampleData1(manager);
+ helpProcess(plan, manager, expected);
+ }
+
private static final boolean DEBUG = false;
}
15 years
teiid SVN: r1688 - in branches/JCA: connectors and 25 other directories.
by teiid-commits@lists.jboss.org
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;
-@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
*/
-@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/moviefun..."); //$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/moviefun...");
+
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\"><company name=\"Microsoft Corp\">23.23</company></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\"><company name=\"Microsoft Corp\">23.23</company></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\"><company name=\"Microsoft Corp\">23.23</company></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);
15 years
teiid SVN: r1687 - trunk/test-integration/db/src/main/java/org/teiid/test/framework.
by teiid-commits@lists.jboss.org
Author: vhalbert(a)redhat.com
Date: 2009-12-21 14:41:26 -0500 (Mon, 21 Dec 2009)
New Revision: 1687
Modified:
trunk/test-integration/db/src/main/java/org/teiid/test/framework/ConfigPropertyNames.java
Log:
Teiid 781 - added back for backwards compatibility testing
Modified: trunk/test-integration/db/src/main/java/org/teiid/test/framework/ConfigPropertyNames.java
===================================================================
--- trunk/test-integration/db/src/main/java/org/teiid/test/framework/ConfigPropertyNames.java 2009-12-21 15:13:10 UTC (rev 1686)
+++ trunk/test-integration/db/src/main/java/org/teiid/test/framework/ConfigPropertyNames.java 2009-12-21 19:41:26 UTC (rev 1687)
@@ -123,7 +123,10 @@
public static final String AUTO_WRAP_OFF = ExecutionProperties.TXN_WRAP_OFF; //$NON-NLS-1$
public static final String AUTO_WRAP_ON = ExecutionProperties.TXN_WRAP_ON; //$NON-NLS-1$
public static final String AUTO_WRAP_AUTO = ExecutionProperties.TXN_WRAP_AUTO; //$NON-NLS-1$
-
+
+ public static final String AUTO_WRAP_PESSIMISTIC = "PESSIMISTIC"; //$NON-NLS-1$
+ public static final String AUTO_WRAP_OPTIMISTIC = "OPTIMISTIC"; //$NON-NLS-1$
+
}
}
15 years
teiid SVN: r1686 - trunk/test-integration/db/src/main/java/org/teiid/test/framework.
by teiid-commits@lists.jboss.org
Author: vhalbert(a)redhat.com
Date: 2009-12-21 10:13:10 -0500 (Mon, 21 Dec 2009)
New Revision: 1686
Modified:
trunk/test-integration/db/src/main/java/org/teiid/test/framework/TestLogger.java
Log:
Teiid 781 - fix logger
Modified: trunk/test-integration/db/src/main/java/org/teiid/test/framework/TestLogger.java
===================================================================
--- trunk/test-integration/db/src/main/java/org/teiid/test/framework/TestLogger.java 2009-12-19 03:45:09 UTC (rev 1685)
+++ trunk/test-integration/db/src/main/java/org/teiid/test/framework/TestLogger.java 2009-12-21 15:13:10 UTC (rev 1686)
@@ -34,52 +34,51 @@
*/
public class TestLogger {
- public static final Level INFO = Level.FINER;
- public static final Level DEBUG = Level.FINEST;
- public static final Level IMPORTANT = Level.FINE;
+ public static final Level INFO = Level.INFO;
+ public static final Level DEBUG = Level.FINE;
+ public static final Level CONFIG = Level.CONFIG;
- // private static final Logger LOGGER = Logger.getLogger("org.teiid.test");
+ private static final Logger LOGGER = Logger.getLogger("org.teiid.test");
static {
BasicConfigurator.configure(new ConsoleAppender());
-// LOGGER.setLevel(INFO);
+ LOGGER.setLevel(INFO);
}
public static final void setLogLevel(Level level) {
-// LOGGER.setLevel(level);
+ LOGGER.setLevel(level);
}
public static final void logDebug(String msg) {
- log(Level.ALL, msg, null);
+ log(DEBUG, msg, null);
}
public static final void logDebug(String msg, Throwable t) {
- log(Level.ALL, msg, t);
+ log(DEBUG, msg, t);
}
// info related messages, which
public static final void logInfo(String msg) {
- log(Level.INFO, msg, null);
+ log(INFO, msg, null);
}
// configuration related messages
public static final void logConfig(String msg) {
- log(Level.CONFIG, msg, null);
+ log(CONFIG, msg, null);
}
// most important messages
public static final void log(String msg) {
- log(Level.INFO, msg, null);
+ log(INFO, msg, null);
}
private static final void log(Level javaLevel, Object msg, Throwable t) {
- System.out.println(msg);
-// if (LOGGER.isLoggable(javaLevel)) {
-//
-// LOGGER.log(javaLevel, msg.toString(), t);
-// }
+ if (LOGGER.isLoggable(javaLevel)) {
+
+ LOGGER.log(javaLevel, msg.toString(), t);
+ }
}
}
15 years
teiid SVN: r1685 - in branches/JCA: build/kit-jboss-container/deploy and 16 other directories.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2009-12-18 22:45:09 -0500 (Fri, 18 Dec 2009)
New Revision: 1685
Added:
branches/JCA/jboss-integration/src/test/java/org/
branches/JCA/jboss-integration/src/test/java/org/teiid/
branches/JCA/jboss-integration/src/test/java/org/teiid/adminapi/
branches/JCA/jboss-integration/src/test/java/org/teiid/adminapi/jboss/
branches/JCA/jboss-integration/src/test/java/org/teiid/adminapi/jboss/BaseConnection.java
branches/JCA/jboss-integration/src/test/java/org/teiid/adminapi/jboss/TestConnectorBindings.java
branches/JCA/jboss-integration/src/test/resources/TransactionsRevisited.vdb
Removed:
branches/JCA/build/kit-jboss-container/deploy/teiid-connector-metadata.rar
branches/JCA/jboss-integration/src/main/java/com/metamatrix/dqp/embedded/admin/
branches/JCA/jboss-integration/src/test/java/com/metamatrix/dqp/embedded/admin/
Modified:
branches/JCA/client/src/main/java/org/teiid/adminapi/ConfigurationAdmin.java
branches/JCA/client/src/main/java/org/teiid/adminapi/MonitoringAdmin.java
branches/JCA/client/src/main/java/org/teiid/adminapi/RuntimeStateAdmin.java
branches/JCA/client/src/main/java/org/teiid/adminapi/TeiidAdmin.java
branches/JCA/client/src/main/java/org/teiid/adminapi/VDB.java
branches/JCA/client/src/main/java/org/teiid/adminapi/impl/ModelMetaData.java
branches/JCA/client/src/main/java/org/teiid/adminapi/impl/VDBMetaData.java
branches/JCA/jboss-integration/pom.xml
branches/JCA/jboss-integration/src/main/java/org/teiid/adminapi/jboss/Admin.java
branches/JCA/jboss-integration/src/main/java/org/teiid/adminapi/jboss/ManagedUtil.java
branches/JCA/jboss-integration/src/main/java/org/teiid/templates/connector/ConnectorTypeTemplate.java
branches/JCA/pom.xml
branches/JCA/runtime/src/main/java/com/metamatrix/dqp/embedded/admin/DQPConfigAdminImpl.java
branches/JCA/runtime/src/main/java/com/metamatrix/dqp/embedded/admin/DQPMonitoringAdminImpl.java
branches/JCA/runtime/src/main/java/org/teiid/deployers/DynamicVDBDeployer.java
branches/JCA/runtime/src/main/java/org/teiid/deployers/VDBParserDeployer.java
branches/JCA/runtime/src/test/java/com/metamatrix/platform/security/TestAdminAuthInterceptor.java
Log:
TEIID-910: adding VDB specific Admin API methods
Deleted: branches/JCA/build/kit-jboss-container/deploy/teiid-connector-metadata.rar
===================================================================
(Binary files differ)
Modified: branches/JCA/client/src/main/java/org/teiid/adminapi/ConfigurationAdmin.java
===================================================================
--- branches/JCA/client/src/main/java/org/teiid/adminapi/ConfigurationAdmin.java 2009-12-19 03:37:05 UTC (rev 1684)
+++ branches/JCA/client/src/main/java/org/teiid/adminapi/ConfigurationAdmin.java 2009-12-19 03:45:09 UTC (rev 1685)
@@ -22,6 +22,7 @@
package org.teiid.adminapi;
+import java.net.URL;
import java.util.Properties;
import com.metamatrix.admin.RolesAllowed;
@@ -124,23 +125,15 @@
void deleteConnectorBinding(String deployedName) throws AdminException;
/**
- * Import a {@link VDB} file.
- * <br>A VDB file with internal definitions. Thise is the default VDB export configuration
- * begining with MetaMatrix version 4.3.</br>
- *
- * @param name
- * VDB Name
- * @param vdbFile
- * byte array of the VDB Archive
- * @param options The perferred options when executing this method. There are choices about
- * what to do when a connector binding with the given identifier already exists in the system.
+ * Deploy a {@link VDB} file.
+ * @param name Name of the VDB file to save under
+ * @param URL VDB file location.
* @throws AdminException
* if there's a system error.
* @return the {@link VDB} representing the current property values and runtime state.
* @since 4.3
*/
- VDB addVDB(String name,
- byte[] vdbFile, AdminOptions options) throws AdminException;
+ public void deployVDB(String fileName, URL vdbURL) throws AdminException;
/**
@@ -149,7 +142,7 @@
* @param version
* @throws AdminException
*/
- void deleteVDB(String vdbName, String version) throws AdminException;
+ void deleteVDB(String vdbName, int vdbVersion) throws AdminException;
/**
* Get the {@link LogConfiguration}
Modified: branches/JCA/client/src/main/java/org/teiid/adminapi/MonitoringAdmin.java
===================================================================
--- branches/JCA/client/src/main/java/org/teiid/adminapi/MonitoringAdmin.java 2009-12-19 03:37:05 UTC (rev 1684)
+++ branches/JCA/client/src/main/java/org/teiid/adminapi/MonitoringAdmin.java 2009-12-19 03:45:09 UTC (rev 1685)
@@ -48,21 +48,23 @@
Set<String> getConnectorTypes() throws AdminException;
/**
- * Get the VDBs that correspond to the specified identifier pattern.
+ * Get the VDBs that currently deployed in the system
*
- * @param vdbIdentifier the unique identifier for for a {@link VDB} in the system
- * <ul>
- * <li> <code>"*"</code> - for all VDBs in the system
- * <li> <code>"name"</code> or <code>"name*"</code> - for all the VDBs that begin with given name
- * <li><code>"name<{@link AdminObject#DELIMITER_CHAR}>version"</code> - for single VDB
- * </ul>
* @return Collection of {@link VDB}s. There could be multiple VDBs with the
* same name in the Collection but they will differ by VDB version.
* @throws AdminException if there's a system error.
- * @since 4.3
*/
@RolesAllowed(value=AdminRoles.RoleName.ANONYMOUS)
- Collection<VDB> getVDBs(String vdbIdentifier) throws AdminException;
+ Set<VDB> getVDBs() throws AdminException;
+
+ /**
+ * Get the VDB
+ * @param vdbName
+ * @param vbdVersion
+ * @throws AdminException if there's a system error.
+ * @return
+ */
+ VDB getVDB(String vdbName, int vbdVersion) throws AdminException;
/**
* Get the Connector Bindings that are available in the configuration
@@ -88,7 +90,7 @@
* @throws AdminException if there's a system error.
* @since 4.3
*/
- Collection<ConnectorBinding> getConnectorBindingsInVDB(String vdbName, String vdbVersion) throws AdminException;
+ Collection<ConnectorBinding> getConnectorBindingsInVDB(String vdbName, int vdbVersion) throws AdminException;
/**
* Get the Extension Modules that correspond to the specified identifier pattern
Modified: branches/JCA/client/src/main/java/org/teiid/adminapi/RuntimeStateAdmin.java
===================================================================
--- branches/JCA/client/src/main/java/org/teiid/adminapi/RuntimeStateAdmin.java 2009-12-19 03:37:05 UTC (rev 1684)
+++ branches/JCA/client/src/main/java/org/teiid/adminapi/RuntimeStateAdmin.java 2009-12-19 03:45:09 UTC (rev 1685)
@@ -39,32 +39,17 @@
/**
* Start Connector Binding
*
- * @param connectorBindingIdentifier identifier for {@link org.teiid.adminapi.ConnectorBinding}
- * <ul>
- * <li> <code>"*"</code> - for all connector bindings in the system
- * <li> <code>"name*"</code> - for all connector bindings that begin with given name
- * <li><code>"name"</code> - for single connector binding by the given name
- * </ul>
+ * @param deployedName
* @throws AdminException if there's a system error.
- * @since 4.3
*/
- void startConnectorBinding(String connectorBindingIdentifier) throws AdminException;
+ void startConnectorBinding(String deployedName) throws AdminException;
/**
* Stop Connector Binding
*
- * @param connectorBindingIdentifier identifier for {@link org.teiid.adminapi.ConnectorBinding}
- * <ul>
- * <li> <code>"*"</code> - for all connector bindings in the system
- * <li> <code>"name*"</code> - for all connector bindings that begin with given name
- * <li><code>"name"</code> - for single connector binding by the given name
- * </ul>
- * @param stopNow If true, stop the process forcefully. If false, wait until any pending work is done.
- * @throws AdminException - if there's a system error.
- * @since 4.3
+ * @param deployedName identifier for {@link org.teiid.adminapi.ConnectorBinding}
*/
- void stopConnectorBinding(String connectorBindingIdentifier,
- boolean stopNow) throws AdminException;
+ void stopConnectorBinding(String deployedName, boolean stopNow) throws AdminException;
/**
* Clear the cache or caches specified by the cacheIdentifier.
Modified: branches/JCA/client/src/main/java/org/teiid/adminapi/TeiidAdmin.java
===================================================================
--- branches/JCA/client/src/main/java/org/teiid/adminapi/TeiidAdmin.java 2009-12-19 03:37:05 UTC (rev 1684)
+++ branches/JCA/client/src/main/java/org/teiid/adminapi/TeiidAdmin.java 2009-12-19 03:45:09 UTC (rev 1685)
@@ -60,13 +60,6 @@
}
@Override
- public VDB addVDB(String name, byte[] vdbFile, AdminOptions options)
- throws AdminException {
- // rameshTODO Auto-generated method stub
- return null;
- }
-
- @Override
public void assignBindingToModel(String connectorBindingName,
String vdbName, String vdbVersion, String modelName)
throws AdminException {
@@ -107,12 +100,8 @@
}
- @Override
- public void deleteVDB(String vdbName, String version) throws AdminException {
- // rameshTODO Auto-generated method stub
-
- }
+
@Override
public char[] exportConfiguration() throws AdminException {
// rameshTODO Auto-generated method stub
@@ -205,12 +194,6 @@
return null;
}
- @Override
- public Collection<ConnectorBinding> getConnectorBindingsInVDB(
- String vdbName, String vdbVersion) throws AdminException {
- // rameshTODO Auto-generated method stub
- return null;
- }
@Override
public Collection<PropertyDefinition> getConnectorTypePropertyDefinitions(
@@ -261,12 +244,8 @@
return null;
}
- @Override
- public Collection<VDB> getVDBs(String vdbIdentifier) throws AdminException {
- // rameshTODO Auto-generated method stub
- return null;
- }
+
@Override
public void cancelRequest(String identifier) throws AdminException {
// rameshTODO Auto-generated method stub
@@ -304,21 +283,8 @@
}
- @Override
- public void startConnectorBinding(String connectorBindingIdentifier)
- throws AdminException {
- // rameshTODO Auto-generated method stub
-
- }
@Override
- public void stopConnectorBinding(String connectorBindingIdentifier,
- boolean stopNow) throws AdminException {
- // rameshTODO Auto-generated method stub
-
- }
-
- @Override
public void terminateSession(String identifier) throws AdminException {
// rameshTODO Auto-generated method stub
Modified: branches/JCA/client/src/main/java/org/teiid/adminapi/VDB.java
===================================================================
--- branches/JCA/client/src/main/java/org/teiid/adminapi/VDB.java 2009-12-19 03:37:05 UTC (rev 1684)
+++ branches/JCA/client/src/main/java/org/teiid/adminapi/VDB.java 2009-12-19 03:45:09 UTC (rev 1685)
@@ -22,7 +22,6 @@
package org.teiid.adminapi;
-import java.net.URL;
import java.util.Collection;
import java.util.List;
@@ -71,7 +70,7 @@
* Get the URL for the VDB
* @return
*/
- public URL getUrl();
+ public String getUrl();
/**
* Get the description of the VDB
Modified: branches/JCA/client/src/main/java/org/teiid/adminapi/impl/ModelMetaData.java
===================================================================
--- branches/JCA/client/src/main/java/org/teiid/adminapi/impl/ModelMetaData.java 2009-12-19 03:37:05 UTC (rev 1684)
+++ branches/JCA/client/src/main/java/org/teiid/adminapi/impl/ModelMetaData.java 2009-12-19 03:45:09 UTC (rev 1685)
@@ -113,6 +113,12 @@
public void addConnectorBinding(String binding) {
this.connectorBindings.add(binding);
}
+
+ public void setConnectorBinding(List<String> bindings) {
+ this.connectorBindings.clear();
+ this.connectorBindings.addAll(bindings);
+ }
+
public void setSupportsMultiSourceBindings(boolean supports) {
this.supportsMultiSourceBindings = supports;
Modified: branches/JCA/client/src/main/java/org/teiid/adminapi/impl/VDBMetaData.java
===================================================================
--- branches/JCA/client/src/main/java/org/teiid/adminapi/impl/VDBMetaData.java 2009-12-19 03:37:05 UTC (rev 1684)
+++ branches/JCA/client/src/main/java/org/teiid/adminapi/impl/VDBMetaData.java 2009-12-19 03:45:09 UTC (rev 1685)
@@ -21,7 +21,6 @@
*/
package org.teiid.adminapi.impl;
-import java.net.URL;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
@@ -44,7 +43,7 @@
private static final long serialVersionUID = -4723595252013356436L;
private HashSet<ModelMetaData> models = new HashSet<ModelMetaData>();
- private URL fileUrl = null;
+ private String fileUrl = null;
private int version = 1;
private Status status;
private String description;
@@ -91,11 +90,11 @@
@Override
@ManagementProperty(description = "The VDB file url", readOnly=true)
- public URL getUrl() {
+ public String getUrl() {
return this.fileUrl;
}
- public void setUrl(URL url) {
+ public void setUrl(String url) {
this.fileUrl = url;
}
@@ -134,6 +133,10 @@
this.errors.add(error);
}
+ public void setValidityErrors(ArrayList<String> errors) {
+ this.errors = errors;
+ }
+
@Override
@ManagementProperty(description = "Is VDB Valid", readOnly=true)
public boolean isValid() {
Modified: branches/JCA/jboss-integration/pom.xml
===================================================================
--- branches/JCA/jboss-integration/pom.xml 2009-12-19 03:37:05 UTC (rev 1684)
+++ branches/JCA/jboss-integration/pom.xml 2009-12-19 03:45:09 UTC (rev 1685)
@@ -11,6 +11,40 @@
<version>7.0.0-SNAPSHOT</version>
<description>JBoss specific integration layer for teiid</description>
+ <build>
+ <testResources>
+ <testResource>
+ <directory>target/jboss-embedded</directory>
+ </testResource>
+ </testResources>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>unpack</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-jboss-embedded</artifactId>
+ <type>jar</type>
+ <overWrite>true</overWrite>
+ <outputDirectory>target/jboss-embedded</outputDirectory>
+ </artifactItem>
+ </artifactItems>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
<dependencies>
<dependency>
<groupId>org.jboss.teiid</groupId>
@@ -26,6 +60,13 @@
</dependency>
<dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-common-core</artifactId>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
<groupId>org.jboss.man</groupId>
<artifactId>jboss-managed</artifactId>
<scope>provided</scope>
@@ -49,6 +90,13 @@
<version>2.0.6.GA</version>
<scope>provided</scope>
</dependency>
+
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-jboss-embedded</artifactId>
+ <scope>test</scope>
+ </dependency>
+
</dependencies>
-</project>
\ No newline at end of file
+</project>
Modified: branches/JCA/jboss-integration/src/main/java/org/teiid/adminapi/jboss/Admin.java
===================================================================
--- branches/JCA/jboss-integration/src/main/java/org/teiid/adminapi/jboss/Admin.java 2009-12-19 03:37:05 UTC (rev 1684)
+++ branches/JCA/jboss-integration/src/main/java/org/teiid/adminapi/jboss/Admin.java 2009-12-19 03:45:09 UTC (rev 1685)
@@ -22,6 +22,7 @@
package org.teiid.adminapi.jboss;
+import java.net.URL;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
@@ -35,52 +36,65 @@
import org.jboss.aop.microcontainer.aspects.jmx.JMX;
import org.jboss.deployers.spi.management.ManagementView;
+import org.jboss.deployers.spi.management.deploy.DeploymentManager;
import org.jboss.managed.api.ComponentType;
import org.jboss.managed.api.DeploymentTemplateInfo;
import org.jboss.managed.api.ManagedComponent;
+import org.jboss.managed.api.ManagedDeployment;
import org.jboss.managed.api.ManagedProperty;
-import org.jboss.managed.api.ManagedOperation.Impact;
-import org.jboss.managed.api.annotation.ManagementComponent;
-import org.jboss.managed.api.annotation.ManagementObject;
-import org.jboss.managed.api.annotation.ManagementOperation;
-import org.jboss.managed.api.annotation.ManagementParameter;
-import org.jboss.managed.api.annotation.ManagementProperties;
import org.jboss.metatype.api.types.MapCompositeMetaType;
import org.jboss.metatype.api.values.MapCompositeValueSupport;
import org.jboss.metatype.api.values.MetaValue;
import org.jboss.metatype.api.values.SimpleValueSupport;
import org.jboss.profileservice.spi.NoSuchDeploymentException;
+import org.jboss.profileservice.spi.ProfileService;
import org.teiid.adminapi.AdminComponentException;
import org.teiid.adminapi.AdminException;
import org.teiid.adminapi.AdminObject;
import org.teiid.adminapi.AdminProcessingException;
import org.teiid.adminapi.ConnectorBinding;
+import org.teiid.adminapi.Model;
import org.teiid.adminapi.TeiidAdminMBean;
+import org.teiid.adminapi.VDB;
+import org.teiid.adminapi.Visibility;
import org.teiid.adminapi.impl.BaseAdmin;
import org.teiid.adminapi.impl.ConnectorBindingMetaData;
+import org.teiid.adminapi.impl.ModelMetaData;
+import org.teiid.adminapi.impl.VDBMetaData;
-@ManagementObject(description="Teiid Admin Interface", componentType=@ManagementComponent(type="teiid",subtype="admin"), properties=ManagementProperties.EXPLICIT, isRuntime=true)
+import com.metamatrix.core.CoreConstants;
+
@JMX(name="jboss.teiid:service=teiid-admin", exposedInterface=TeiidAdminMBean.class, registerDirectly=true)
public class Admin extends BaseAdmin implements TeiidAdminMBean{
private static final long serialVersionUID = 7081309086056911304L;
- private ManagementView managementView = null;
+ private static ComponentType VDBTYPE = new ComponentType("teiid", "vdb");
+ private static ComponentType MODELTYPE = new ComponentType("teiid", "model");
+ private static ComponentType NOTXTYPE = new ComponentType("ConnectionFactory", "NoTx");
+ private static ComponentType TXTYPE = new ComponentType("ConnectionFactory", "Tx");
private ManagementView getView() throws AdminComponentException {
- if (this.managementView == null) {
- try {
- InitialContext context = new InitialContext();
- this.managementView = (ManagementView)context.lookup("java:ManagementView");
- this.managementView.load();
- } catch (NamingException e) {
- throw new AdminComponentException(e);
- }
+ try {
+ InitialContext context = new InitialContext();
+ ManagementView managementView = (ManagementView)context.lookup("java:ManagementView");
+ managementView.load();
+ return managementView;
+ } catch (NamingException e) {
+ throw new AdminComponentException(e);
+ }
+ }
+
+ private DeploymentManager getDeploymentManager() throws AdminComponentException {
+ try {
+ InitialContext context = new InitialContext();
+ ProfileService ps = (ProfileService) context.lookup("ProfileService");
+ return ps.getDeploymentManager();
+ } catch (NamingException e) {
+ throw new AdminComponentException(e);
}
- return this.managementView;
}
@Override
- @ManagementOperation(description="Get names of avaialable connector bindings", impact=Impact.ReadOnly)
public Collection<ConnectorBinding> getConnectorBindings() throws AdminException {
ArrayList<ConnectorBinding> bindings = new ArrayList<ConnectorBinding>();
findConnectorBindings(bindings, "NoTx");
@@ -89,17 +103,72 @@
}
@Override
- @ManagementOperation(description="Get names of avaialable connector bindings", impact=Impact.ReadOnly)
public ConnectorBinding getConnectorBinding(String deployedName) throws AdminException {
- Collection<ConnectorBinding> bindings = getConnectorBindings();
- for(ConnectorBinding cb:bindings) {
- if (cb.getName().equals(deployedName)) {
- return cb;
+ ManagedComponent mc = getConnectorBindingComponent(deployedName);
+ if (mc != null) {
+ return buildConnectorBinding(mc);
+ }
+ return null;
+ }
+
+ private ManagedComponent getConnectorBindingComponent(String deployedName) throws AdminProcessingException {
+ try {
+ Set<ManagedComponent> components = getView().getComponentsForType(NOTXTYPE);
+ for (ManagedComponent mc: components) {
+ if (isConnectorBinding(mc)) {
+ String name = ManagedUtil.getSimpleValue(mc, "name", String.class);
+ if (name.equals(deployedName)) {
+ return mc;
+ }
+ }
}
+
+ components = getView().getComponentsForType(TXTYPE);
+ for (ManagedComponent mc: components) {
+ if (isConnectorBinding(mc)) {
+ String name = ManagedUtil.getSimpleValue(mc, "name", String.class);
+ if (name.equals(deployedName)) {
+ return mc;
+ }
+ }
+ }
+ } catch(Exception e) {
+ throw new AdminProcessingException(e.getMessage(), e);
}
return null;
}
+ private ConnectorBinding buildConnectorBinding(ManagedComponent mc) {
+ ConnectorBindingMetaData connector = new ConnectorBindingMetaData();
+ connector.setName(mc.getName());
+ connector.setComponentType(mc.getType());
+
+ for (String key:mc.getProperties().keySet()) {
+ ManagedProperty property = mc.getProperty(key);
+ MetaValue value = property.getValue();
+
+ //TODO: All properties need to be added
+ if (value != null) {
+ if(value instanceof SimpleValueSupport) {
+ connector.addProperty(key, ManagedUtil.stringValue(value));
+ }
+ else if (value.getMetaType() instanceof MapCompositeValueSupport) {
+ MapCompositeValueSupport v1 = (MapCompositeValueSupport)value;
+ MapCompositeMetaType metaType = v1.getMetaType();
+ for (String configProperty:metaType.keySet()) {
+ connector.addProperty(configProperty, ManagedUtil.stringValue(v1.get(configProperty)));
+ }
+ }
+ }
+ }
+ return connector;
+ }
+
+ private boolean isConnectorBinding(ManagedComponent mc) {
+ String connectionDefinition = ManagedUtil.getSimpleValue(mc, "connection-definition", String.class);
+ return "org.teiid.connector.api.Connector".equals(connectionDefinition);
+ }
+
private void findConnectorBindings(ArrayList<ConnectorBinding> bindings, String subType) throws AdminException {
try {
ComponentType type = new ComponentType("ConnectionFactory", subType);
@@ -140,11 +209,6 @@
}
@Override
- @ManagementOperation(description="Add a new Connector Binding",
- impact=Impact.WriteOnly,
- params={@ManagementParameter(name="deploymentName", description="Name of the Connector Binding"),
- @ManagementParameter(name="typeName", description="Connector Type Template name"),
- @ManagementParameter(name="properties", description="Properties for the Connector Binding")})
public void addConnectorBinding(String deploymentName, String typeName, Properties properties) throws AdminException{
try {
if (getConnectorBinding(deploymentName) != null) {
@@ -197,20 +261,57 @@
@Override
public void deleteConnectorBinding(String deployedName) throws AdminException {
- ConnectorBindingMetaData cb = (ConnectorBindingMetaData)getConnectorBinding(deployedName);
- if (cb != null) {
+ ManagedComponent mc = getConnectorBindingComponent(deployedName);
+ if (mc != null) {
+ ManagedUtil.removeArchive(getDeploymentManager(),mc.getDeployment().getName());
+ }
+ }
+
+ @Override
+ public void startConnectorBinding(String deployedName) throws AdminException {
+ ManagedComponent mc = getConnectorBindingComponent(deployedName);
+ if (mc != null) {
try {
- ManagedComponent mc = getView().getComponent(cb.getName(), (ComponentType)cb.getComponentType());
- if (mc != null) {
- getView().removeComponent(mc);
- }
+ ManagedUtil.execute(getDeploymentManager().start(deployedName), "Failed to start Connector Binding = " + deployedName);
} catch (Exception e) {
- throw new AdminComponentException(e.getMessage(), e);
+ ManagedUtil.handleException(e);
}
}
}
+
+ @Override
+ public void stopConnectorBinding(String deployedName,boolean stopNow) throws AdminException {
+ ManagedComponent mc = getConnectorBindingComponent(deployedName);
+ if (mc != null) {
+ try {
+ ManagedUtil.execute(getDeploymentManager().stop(deployedName), "Failed to Stop Connector Binding = " + deployedName);
+ } catch (Exception e) {
+ ManagedUtil.handleException(e);
+ }
+ }
+ }
@Override
+ public Collection<ConnectorBinding> getConnectorBindingsInVDB(String vdbName, int vdbVersion) throws AdminException {
+ HashMap<String, ConnectorBinding> bindingMap = new HashMap<String, ConnectorBinding>();
+ VDB vdb = getVDB(vdbName, vdbVersion);
+ if (vdb != null) {
+ for (Model model:vdb.getModels()) {
+ if (model.isSource()) {
+ for (String bindingName : model.getConnectorBindingNames()) {
+ ConnectorBinding binding = getConnectorBinding(bindingName);
+ if (binding != null) {
+ bindingMap.put(bindingName, binding);
+ }
+ }
+ }
+ }
+ }
+ return bindingMap.values();
+ }
+
+
+ @Override
public Set<String> getConnectorTypes() throws AdminException{
Set<String> names = getView().getTemplateNames();
HashSet<String> matched = new HashSet<String>();
@@ -227,4 +328,103 @@
regEx = regEx.replaceAll(AdminObject.ESCAPED_DELIMITER, ""); //$NON-NLS-1$
return value.matches(regEx);
}
+
+ @Override
+ public void deployVDB(String fileName, URL vdbURL) throws AdminException {
+ if (!fileName.endsWith(".vdb") && !fileName.endsWith("-vdb.xml")) {
+ throw new AdminProcessingException("The extension of the file name must be either .vdb designer vdbs or -vdb.xml for dynamic VDBs");
+ }
+ ManagedUtil.deployArchive(getDeploymentManager(), fileName, vdbURL, false);
+ }
+
+
+ @Override
+ public void deleteVDB(String vdbName, int vdbVersion) throws AdminException {
+ ManagedComponent mc = getVDBManagedComponent(vdbName, vdbVersion);
+ if (mc != null) {
+ ManagedUtil.removeArchive(getDeploymentManager(), mc.getDeployment().getName());
+ }
+ }
+
+ @Override
+ public VDB getVDB(String vdbName, int vdbVersion) throws AdminException{
+ ManagedComponent mc = getVDBManagedComponent(vdbName, vdbVersion);
+ if (mc != null) {
+ return buildVDB(mc);
+ }
+ return null;
+ }
+
+ private ManagedComponent getVDBManagedComponent(String vdbName, int vdbVersion) throws AdminException{
+ try {
+ ComponentType type = new ComponentType("teiid", "vdb");
+ Set<ManagedComponent> vdbComponents = getView().getComponentsForType(type);
+ for (ManagedComponent mc: vdbComponents) {
+ String name = ManagedUtil.getSimpleValue(mc, "name", String.class);
+ int version = ManagedUtil.getSimpleValue(mc, "version", Integer.class);
+ if (name.equals(vdbName) && version == vdbVersion) {
+ return mc;
+ }
+ }
+ return null;
+ } catch (Exception e) {
+ throw new AdminComponentException(e.getMessage(), e);
+ }
+ }
+
+ @Override
+ public Set<VDB> getVDBs() throws AdminException {
+ try {
+ Set<VDB> vdbs = new HashSet<VDB>();
+ Set<ManagedComponent> vdbComponents = getView().getComponentsForType(VDBTYPE);
+ for (ManagedComponent mc: vdbComponents) {
+ vdbs.add(buildVDB(mc));
+ }
+ return vdbs;
+ } catch (Exception e) {
+ throw new AdminComponentException(e.getMessage(), e);
+ }
+ }
+
+ private VDB buildVDB(ManagedComponent mc) {
+ VDBMetaData vdb = new VDBMetaData();
+ vdb.setName(ManagedUtil.getSimpleValue(mc, "name", String.class));
+ vdb.setDescription(ManagedUtil.getSimpleValue(mc, "description", String.class));
+ vdb.setStatus(VDB.Status.valueOf(ManagedUtil.getSimpleValue(mc, "status", String.class)));
+ vdb.setVersion(ManagedUtil.getSimpleValue(mc, "version", Integer.class));
+ vdb.setUrl(mc.getDeployment().getName());
+
+ ArrayList<String> errors = new ArrayList<String>();
+ ManagedUtil.getCollectionValue(mc, "validityErrors", errors, String.class);
+ vdb.setValidityErrors(errors);
+
+ ManagedDeployment deployment = mc.getDeployment();
+ Collection<ManagedComponent> models = deployment.getComponents().values();
+ for (ManagedComponent mm:models) {
+ if (mm.getType().equals(MODELTYPE)) {
+ String modelName = ManagedUtil.getSimpleValue(mc, "name", String.class);
+ if (!modelName.equals(CoreConstants.SYSTEM_MODEL)) {
+ vdb.addModel(buildModel(mm));
+ }
+ }
+ }
+ return vdb;
+ }
+
+ private ModelMetaData buildModel(ManagedComponent mc) {
+ ModelMetaData model = new ModelMetaData();
+ model.setName(ManagedUtil.getSimpleValue(mc, "name", String.class));
+ model.setModelURI(ManagedUtil.getSimpleValue(mc, "modeluri", String.class));
+ model.setModelType(ManagedUtil.getSimpleValue(mc, "modeltype", String.class));
+ model.setPath(ManagedUtil.getSimpleValue(mc, "modelpath", String.class));
+ model.setUuid(ManagedUtil.getSimpleValue(mc, "uuid", String.class));
+ model.setSupportsMultiSourceBindings(ManagedUtil.getSimpleValue(mc, "supportsMultiSourceBindings", Boolean.class));
+ model.setVisibility(Visibility.valueOf(ManagedUtil.getSimpleValue(mc, "visibility", String.class)));
+
+ ArrayList<String> bindings = new ArrayList<String>();
+ ManagedUtil.getCollectionValue(mc, "connectorBindingNames", bindings, String.class);
+ model.setConnectorBinding(bindings);
+
+ return model;
+ }
}
Modified: branches/JCA/jboss-integration/src/main/java/org/teiid/adminapi/jboss/ManagedUtil.java
===================================================================
--- branches/JCA/jboss-integration/src/main/java/org/teiid/adminapi/jboss/ManagedUtil.java 2009-12-19 03:37:05 UTC (rev 1684)
+++ branches/JCA/jboss-integration/src/main/java/org/teiid/adminapi/jboss/ManagedUtil.java 2009-12-19 03:45:09 UTC (rev 1685)
@@ -23,16 +23,30 @@
import java.math.BigDecimal;
import java.math.BigInteger;
+import java.net.URL;
import java.text.ParseException;
import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
import java.util.Map;
+import org.jboss.deployers.spi.management.deploy.DeploymentManager;
+import org.jboss.deployers.spi.management.deploy.DeploymentProgress;
+import org.jboss.deployers.spi.management.deploy.DeploymentStatus;
+import org.jboss.managed.api.ManagedComponent;
+import org.jboss.managed.api.ManagedProperty;
import org.jboss.metatype.api.types.MetaType;
import org.jboss.metatype.api.types.SimpleMetaType;
+import org.jboss.metatype.api.values.CollectionValue;
+import org.jboss.metatype.api.values.EnumValue;
import org.jboss.metatype.api.values.MapCompositeValueSupport;
import org.jboss.metatype.api.values.MetaValue;
import org.jboss.metatype.api.values.SimpleValue;
import org.jboss.metatype.api.values.SimpleValueSupport;
+import org.jboss.profileservice.spi.DeploymentOption;
+import org.teiid.adminapi.AdminException;
+import org.teiid.adminapi.AdminProcessingException;
import com.metamatrix.core.MetaMatrixRuntimeException;
@@ -84,6 +98,42 @@
return null;
}
+ public static <T> T getSimpleValue(ManagedComponent mc, String prop, Class<T> expectedType) {
+ ManagedProperty mp = mc.getProperty(prop);
+ if (mp != null) {
+ MetaType metaType = mp.getMetaType();
+ if (metaType.isSimple()) {
+ SimpleValue simpleValue = (SimpleValue)mp.getValue();
+ return expectedType.cast((simpleValue != null) ? simpleValue.getValue() : null);
+ }
+ else if (metaType.isEnum()) {
+ EnumValue enumValue = (EnumValue)mp.getValue();
+ return expectedType.cast((enumValue != null) ? enumValue.getValue() : null);
+ }
+ throw new IllegalStateException(prop+ " is not a simple type");
+ }
+ return null;
+ }
+
+ public static <T> void getCollectionValue(ManagedComponent mc, String prop, Collection<T> list, Class<T> expectedType) {
+ ManagedProperty mp = mc.getProperty(prop);
+ if (mp != null) {
+ MetaType metaType = mp.getMetaType();
+ if (metaType.isCollection()) {
+ CollectionValue collectionValue = (CollectionValue)mp.getValue();
+ for(MetaValue value:collectionValue.getElements()) {
+ if (value.getMetaType().isSimple()) {
+ SimpleValue simpleValue = (SimpleValue)value;
+ list.add(expectedType.cast(simpleValue.getValue()));
+ }
+ else {
+ throw new IllegalStateException(prop+ " is not a simple type");
+ }
+ }
+ }
+ }
+ }
+
public static SimpleValue wrap(MetaType type, String value) {
if (type instanceof SimpleMetaType) {
SimpleMetaType st = (SimpleMetaType)type;
@@ -136,4 +186,67 @@
}
throw new MetaMatrixRuntimeException("Failed to convert from String value to \""+ type.getClassName() +"\" type");
}
+
+
+ public static void deployArchive(DeploymentManager deploymentManager, String fileName, URL resourceURL, boolean deployExploded) throws AdminProcessingException {
+
+ List<DeploymentOption> deploymentOptions = new ArrayList<DeploymentOption>();
+ deploymentOptions.add(DeploymentOption.FailIfExists);
+ if (deployExploded) {
+ deploymentOptions.add(DeploymentOption.Explode);
+ }
+
+ // try to deploy
+ DeploymentProgress progress = null;
+ try {
+ progress = deploymentManager.distribute(fileName, resourceURL, deploymentOptions.toArray(new DeploymentOption[deploymentOptions.size()]));
+ execute(progress, fileName+" Distribute failed for unknown reason.");
+ } catch (Exception e) {
+ handleException(e);
+ }
+
+ // Now that we've successfully distributed the deployment, we need to
+ // start it.
+ String[] deploymentNames = progress.getDeploymentID().getRepositoryNames();
+ try {
+ progress = deploymentManager.start(deploymentNames);
+ execute(progress, "Start of the deployment Failed");
+ } catch(Exception e) {
+ try {
+ // if failed to start remove it.
+ execute(deploymentManager.remove(deploymentNames), "Failed to remove the deployment");
+ } catch (Exception e1) {
+ handleException(e1);
+ }
+ handleException(e);
+ }
+ }
+
+ public static void handleException(Exception e) throws AdminProcessingException {
+ if (e instanceof AdminProcessingException) {
+ throw (AdminProcessingException)e;
+ }
+ throw new AdminProcessingException(e.getMessage(), e);
+ }
+
+ public static void execute(DeploymentProgress progress, String errorMessage) throws AdminProcessingException {
+ progress.run();
+ DeploymentStatus status = progress.getDeploymentStatus();
+
+ if (status.isFailed()) {
+ if (status.getFailure() != null) {
+ throw new AdminProcessingException(status.getFailure().getMessage(), status.getFailure());
+ }
+ throw new AdminProcessingException(errorMessage);
+ }
+ }
+
+ public static void removeArchive(DeploymentManager deploymentManager, String... deploymentNames) throws AdminProcessingException{
+ try {
+ execute(deploymentManager.remove(deploymentNames), "Failed to remove the deployment");
+ } catch (Exception e) {
+ handleException(e);
+ }
+ }
+
}
Modified: branches/JCA/jboss-integration/src/main/java/org/teiid/templates/connector/ConnectorTypeTemplate.java
===================================================================
--- branches/JCA/jboss-integration/src/main/java/org/teiid/templates/connector/ConnectorTypeTemplate.java 2009-12-19 03:37:05 UTC (rev 1684)
+++ branches/JCA/jboss-integration/src/main/java/org/teiid/templates/connector/ConnectorTypeTemplate.java 2009-12-19 03:45:09 UTC (rev 1685)
@@ -36,7 +36,13 @@
import org.teiid.adminapi.jboss.ManagedUtil;
/**
- * The connection factory template implementation.
+ * The connection factory template implementation. Here the idea is "targetTemplate" is the actual template we store
+ * the information under, which is the "connection factory" that container generates. However, we have got data
+ * passed under Teiid owned template. Now this classe'ss JOB is to transfer the properties from the source template
+ * into target template and write the target template.
+ *
+ * When the properties are written to target template, and source has a new property that is not defined in target, that
+ * property will be written as "config-property"
*/
public class ConnectorTypeTemplate implements DeploymentTemplate {
@@ -58,20 +64,19 @@
return deploymentBaseName;
}
- public VirtualFile applyTemplate(DeploymentTemplateInfo connectorInfo) throws Exception {
+ public VirtualFile applyTemplate(DeploymentTemplateInfo sourceInfo) throws Exception {
try {
- ManagedProperty rar = connectorInfo.getProperties().get("rar-name");
+ ManagedProperty rar = sourceInfo.getProperties().get("rar-name");
String rarName = ManagedUtil.stringValue(rar.getValue());
if (!isValidRar(rarName)) {
throw new AdminProcessingException("Invalid RAR specified; please supply correct RAR file. "+rarName);
}
- DeploymentTemplateInfo targetInfo = getTargetTemplate().getInfo();
+ DeploymentTemplateInfo targetInfo = this.targetTemplate.getInfo();
// override these properties always.
targetInfo.getProperties().get("connection-definition").setValue(SimpleValueSupport.wrap("org.teiid.connector.api.Connector"));
- connectorInfo.getProperties().get("connection-definition").setValue(SimpleValueSupport.wrap("org.teiid.connector.api.Connector"));
//config-properties list
Map<String, String> configProps = new HashMap<String, String>();
@@ -81,11 +86,12 @@
// walk through the supplied properties and assign properly to either template
// or config-properties.
- for (String key:connectorInfo.getProperties().keySet()) {
+ for (String key:sourceInfo.getProperties().keySet()) {
ManagedProperty mp = propertyMap.get(key);
if (mp != null) {
- MetaValue value = connectorInfo.getProperties().get(key).getValue();
+ // property found in target, so just add as value
+ MetaValue value = sourceInfo.getProperties().get(key).getValue();
if (ManagedUtil.sameValue(mp.getDefaultValue(), value)) {
continue;
}
@@ -95,7 +101,8 @@
}
}
else {
- mp = connectorInfo.getProperties().get(key);
+ // property not found in the target; add as "config-property"
+ mp = sourceInfo.getProperties().get(key);
if (ManagedUtil.sameValue(mp.getDefaultValue(), mp.getValue())) {
continue;
}
@@ -111,7 +118,7 @@
MetaValue metaValue = ManagedUtil.compositeValueMap(configProps);
targetInfo.getProperties().get("config-property").setValue(metaValue);
}
- return getTargetTemplate().applyTemplate(targetInfo);
+ return this.targetTemplate.applyTemplate(targetInfo);
} catch (NoSuchDeploymentException e) {
throw new AdminComponentException(e.getMessage(), e);
@@ -121,7 +128,7 @@
}
private boolean isValidRar(String rarName) {
- return true;
+ return rarName != null;
}
@Override
@@ -133,10 +140,6 @@
this.info = info;
}
- private DeploymentTemplate getTargetTemplate() {
- return this.targetTemplate;
- }
-
public void setTargetTemplate(DeploymentTemplate target) {
this.targetTemplate = target;
}
Added: branches/JCA/jboss-integration/src/test/java/org/teiid/adminapi/jboss/BaseConnection.java
===================================================================
--- branches/JCA/jboss-integration/src/test/java/org/teiid/adminapi/jboss/BaseConnection.java (rev 0)
+++ branches/JCA/jboss-integration/src/test/java/org/teiid/adminapi/jboss/BaseConnection.java 2009-12-19 03:45:09 UTC (rev 1685)
@@ -0,0 +1,61 @@
+package org.teiid.adminapi.jboss;
+
+import java.sql.Connection;
+import java.sql.ResultSet;
+import java.sql.ResultSetMetaData;
+import java.sql.SQLException;
+import java.sql.Statement;
+
+import org.teiid.jdbc.TeiidDataSource;
+
+
+public class BaseConnection {
+ static String user = "ramesh";
+ static String password = "mm";
+
+ interface ConnectionFactory{
+ Connection getConnection(String vdbName) throws Exception;
+ }
+
+ static class ServerDatasourceConnection implements ConnectionFactory {
+ public Connection getConnection(String vdbName) throws Exception {
+ TeiidDataSource ds = new TeiidDataSource();
+ ds.setUser(user);
+ ds.setPassword(password);
+ ds.setServerName("localhost");
+ ds.setPortNumber(31000);
+ ds.setDatabaseName(vdbName);
+ return ds.getConnection();
+ }
+ }
+
+ public void execute(ConnectionFactory connF, String vdbName, String sql) throws Exception {
+ Connection connection = connF.getConnection(vdbName);
+ try {
+ connection.getMetaData();
+ Statement statement = connection.createStatement();
+
+ ResultSet results = statement.executeQuery(sql);
+
+ ResultSetMetaData metadata = results.getMetaData();
+ int columns = metadata.getColumnCount();
+
+ while(results.next()) {
+ for (int i = 0; i < columns; i++) {
+ System.out.print(results.getString(i+1));
+ System.out.print(",");
+ }
+ System.out.println("");
+ }
+ System.out.println("Done getting results!");
+ results.close();
+ statement.close();
+ } catch (SQLException e) {
+ e.printStackTrace();
+ } finally {
+ if (connection != null) {
+ connection.close();
+ }
+ }
+ }
+}
Added: branches/JCA/jboss-integration/src/test/java/org/teiid/adminapi/jboss/TestConnectorBindings.java
===================================================================
--- branches/JCA/jboss-integration/src/test/java/org/teiid/adminapi/jboss/TestConnectorBindings.java (rev 0)
+++ branches/JCA/jboss-integration/src/test/java/org/teiid/adminapi/jboss/TestConnectorBindings.java 2009-12-19 03:45:09 UTC (rev 1685)
@@ -0,0 +1,80 @@
+package org.teiid.adminapi.jboss;
+
+
+import static junit.framework.Assert.assertNotNull;
+import static junit.framework.Assert.assertNull;
+import static junit.framework.Assert.assertTrue;
+
+import java.io.File;
+import java.util.Properties;
+import java.util.Set;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.teiid.adminapi.Admin;
+import org.teiid.adminapi.ConnectorBinding;
+import org.teiid.adminapi.VDB;
+
+import com.metamatrix.core.util.UnitTestUtil;
+
+
+public class TestConnectorBindings extends BaseConnection {
+ ServerDatasourceConnection ds;
+ Admin admin;
+
+ @Before
+ public void setUp() throws Exception {
+ //if (!Bootstrap.getInstance().isStarted()) Bootstrap.getInstance().bootstrap();
+ ds = new ServerDatasourceConnection();
+ com.metamatrix.jdbc.api.Connection conn = (com.metamatrix.jdbc.api.Connection)ds.getConnection("admin");
+ admin = conn.getAdminAPI();
+ }
+
+ @Test public void testConnectorBinding() throws Exception {
+ ConnectorBinding binding = admin.getConnectorBinding("test-mysql-cb");
+
+ assertNull(binding);
+
+ Properties p = new Properties();
+ p.setProperty("jndi-name", "test-mysql-cb");
+ p.setProperty("rar-name", "connector-jdbc-7.0.0-SNAPSHOT.rar");
+ p.setProperty("CapabilitiesClass", "org.teiid.connector.jdbc.derby.DerbyCapabilities");
+ p.setProperty("XaCapable", "true");
+ p.setProperty("SourceJNDIName", "java:DerbyDS");
+ admin.addConnectorBinding("test-mysql-cb","connector-jdbc-template", p);
+
+ binding = admin.getConnectorBinding("test-mysql-cb");
+
+ assertNotNull(binding);
+
+ admin.deleteConnectorBinding("test-mysql-cb");
+
+ binding = admin.getConnectorBinding("test-mysql-cb");
+
+ assertNull(binding);
+ }
+
+ @Test public void testVDBDeploy() throws Exception {
+
+ VDB vdb = admin.getVDB("TransactionsRevisited", 1);
+ if (vdb != null) {
+ admin.deleteVDB("TransactionsRevisited", 1);
+ }
+
+ assertNull(admin.getVDB("TransactionsRevisited", 1));
+
+ File f = UnitTestUtil.getTestDataFile("TransactionsRevisited.vdb");
+
+ admin.deployVDB(f.getName(), f.toURI().toURL());
+
+ assertNotNull(admin.getVDB("TransactionsRevisited", 1));
+
+ Set<VDB> vdbs = admin.getVDBs();
+ assertTrue(vdbs.size() >= 1);
+
+// admin.deleteVDB("TransactionsRevisited", 1);
+//
+// assertNull(admin.getVDB("TransactionsRevisited", 1));
+ }
+
+}
Added: branches/JCA/jboss-integration/src/test/resources/TransactionsRevisited.vdb
===================================================================
(Binary files differ)
Property changes on: branches/JCA/jboss-integration/src/test/resources/TransactionsRevisited.vdb
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: branches/JCA/pom.xml
===================================================================
--- branches/JCA/pom.xml 2009-12-19 03:37:05 UTC (rev 1684)
+++ branches/JCA/pom.xml 2009-12-19 03:45:09 UTC (rev 1685)
@@ -366,6 +366,12 @@
<artifactId>teiid-runtime</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-jboss-embedded</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
<!-- External dependencies -->
<dependency>
@@ -516,6 +522,7 @@
<module>hibernate-dialect</module>
<module>jboss-integration</module>
<module>connector-sdk</module>
+ <module>jboss-embedded</module>
</modules>
<distributionManagement>
Modified: branches/JCA/runtime/src/main/java/com/metamatrix/dqp/embedded/admin/DQPConfigAdminImpl.java
===================================================================
--- branches/JCA/runtime/src/main/java/com/metamatrix/dqp/embedded/admin/DQPConfigAdminImpl.java 2009-12-19 03:37:05 UTC (rev 1684)
+++ branches/JCA/runtime/src/main/java/com/metamatrix/dqp/embedded/admin/DQPConfigAdminImpl.java 2009-12-19 03:45:09 UTC (rev 1685)
@@ -520,7 +520,7 @@
}
@Override
- public void deleteVDB(String vdbName, String vdbVersion) throws AdminException {
+ public void deleteVDB(String vdbName, int vdbVersion) throws AdminException {
//super.changeVDBStatus(vdbName, vdbVersion, VDB.DELETED);
}
Modified: branches/JCA/runtime/src/main/java/com/metamatrix/dqp/embedded/admin/DQPMonitoringAdminImpl.java
===================================================================
--- branches/JCA/runtime/src/main/java/com/metamatrix/dqp/embedded/admin/DQPMonitoringAdminImpl.java 2009-12-19 03:37:05 UTC (rev 1684)
+++ branches/JCA/runtime/src/main/java/com/metamatrix/dqp/embedded/admin/DQPMonitoringAdminImpl.java 2009-12-19 03:45:09 UTC (rev 1685)
@@ -25,10 +25,8 @@
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
-import java.util.Iterator;
import java.util.List;
-import org.teiid.adminapi.AdminComponentException;
import org.teiid.adminapi.AdminException;
import org.teiid.adminapi.AdminProcessingException;
import org.teiid.adminapi.Cache;
@@ -44,10 +42,7 @@
import org.teiid.adminapi.Transaction;
import org.teiid.adminapi.VDB;
-import com.metamatrix.api.exception.MetaMatrixComponentException;
-import com.metamatrix.common.vdb.api.VDBArchive;
import com.metamatrix.dqp.embedded.DQPEmbeddedPlugin;
-import com.metamatrix.dqp.service.TransactionService;
import com.metamatrix.jdbc.EmbeddedConnectionFactoryImpl;
import com.metamatrix.server.serverapi.RequestInfo;
@@ -123,7 +118,7 @@
@Override
- public Collection<ConnectorBinding> getConnectorBindingsInVDB(String vdbName, String vdbVersion) throws AdminException{
+ public Collection<ConnectorBinding> getConnectorBindingsInVDB(String vdbName, int vdbVersion) throws AdminException{
// try {
// VDBArchive vdb = getConfigurationService().getVDB(vdbName, vdbVersion);
// if (vdb != null) {
Modified: branches/JCA/runtime/src/main/java/org/teiid/deployers/DynamicVDBDeployer.java
===================================================================
--- branches/JCA/runtime/src/main/java/org/teiid/deployers/DynamicVDBDeployer.java 2009-12-19 03:37:05 UTC (rev 1684)
+++ branches/JCA/runtime/src/main/java/org/teiid/deployers/DynamicVDBDeployer.java 2009-12-19 03:45:09 UTC (rev 1685)
@@ -48,7 +48,7 @@
model.setSupportsMultiSourceBindings(false);
}
- def.setUrl(unit.getRoot().toURL());
+ def.setUrl(unit.getRoot().toURL().toExternalForm());
log.debug("VDB "+unit.getRoot().getName()+" has been parsed.");
return def;
}
Modified: branches/JCA/runtime/src/main/java/org/teiid/deployers/VDBParserDeployer.java
===================================================================
--- branches/JCA/runtime/src/main/java/org/teiid/deployers/VDBParserDeployer.java 2009-12-19 03:37:05 UTC (rev 1684)
+++ branches/JCA/runtime/src/main/java/org/teiid/deployers/VDBParserDeployer.java 2009-12-19 03:45:09 UTC (rev 1685)
@@ -97,7 +97,7 @@
// merge mainfest and def
def = merge(def, manifest);
- def.setUrl(unit.getRoot().toURL());
+ def.setUrl(unit.getRoot().toURL().toExternalForm());
// add the entries and determine their visibility
VirtualFile root = unit.getRoot();
Modified: branches/JCA/runtime/src/test/java/com/metamatrix/platform/security/TestAdminAuthInterceptor.java
===================================================================
--- branches/JCA/runtime/src/test/java/com/metamatrix/platform/security/TestAdminAuthInterceptor.java 2009-12-19 03:37:05 UTC (rev 1684)
+++ branches/JCA/runtime/src/test/java/com/metamatrix/platform/security/TestAdminAuthInterceptor.java 2009-12-19 03:45:09 UTC (rev 1685)
@@ -102,7 +102,7 @@
@Test public void testGetVDBs() throws Exception {
Set<String> userRoles = new HashSet<String>();
Admin serverAdmin = getTestServerAdmin(userRoles, Admin.class);
- serverAdmin.getVDBs("*"); //$NON-NLS-1$
+ serverAdmin.getVDBs(); //$NON-NLS-1$
}
@Test(expected=AdminProcessingException.class) public void testReadOnlyFails() throws Exception {
15 years
teiid SVN: r1684 - in branches/JCA: jboss-embedded and 13 other directories.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2009-12-18 22:37:05 -0500 (Fri, 18 Dec 2009)
New Revision: 1684
Added:
branches/JCA/jboss-embedded/
branches/JCA/jboss-embedded/pom.xml
branches/JCA/jboss-embedded/src/
branches/JCA/jboss-embedded/src/main/
branches/JCA/jboss-embedded/src/main/resources/
branches/JCA/jboss-embedded/src/main/resources/bootstrap/
branches/JCA/jboss-embedded/src/main/resources/bootstrap/META-INF/
branches/JCA/jboss-embedded/src/main/resources/bootstrap/META-INF/persistence.properties
branches/JCA/jboss-embedded/src/main/resources/bootstrap/commons-logging.properties
branches/JCA/jboss-embedded/src/main/resources/bootstrap/conf/
branches/JCA/jboss-embedded/src/main/resources/bootstrap/conf/bootstrap-beans.xml
branches/JCA/jboss-embedded/src/main/resources/bootstrap/conf/jboss-service.xml
branches/JCA/jboss-embedded/src/main/resources/bootstrap/conf/jbossjta-properties.xml
branches/JCA/jboss-embedded/src/main/resources/bootstrap/conf/login-config.xml
branches/JCA/jboss-embedded/src/main/resources/bootstrap/conf/props/
branches/JCA/jboss-embedded/src/main/resources/bootstrap/conf/props/messaging-roles.properties
branches/JCA/jboss-embedded/src/main/resources/bootstrap/conf/props/messaging-users.properties
branches/JCA/jboss-embedded/src/main/resources/bootstrap/deploy/
branches/JCA/jboss-embedded/src/main/resources/bootstrap/deploy/ejb3-interceptors-aop.xml
branches/JCA/jboss-embedded/src/main/resources/bootstrap/deploy/hsqldb-ds.xml
branches/JCA/jboss-embedded/src/main/resources/bootstrap/deploy/jboss-local-jdbc.rar/
branches/JCA/jboss-embedded/src/main/resources/bootstrap/deploy/jboss-local-jdbc.rar/META-INF/
branches/JCA/jboss-embedded/src/main/resources/bootstrap/deploy/jboss-local-jdbc.rar/META-INF/ra.xml
branches/JCA/jboss-embedded/src/main/resources/bootstrap/deploy/jboss-xa-jdbc.rar
branches/JCA/jboss-embedded/src/main/resources/bootstrap/deploy/jms-ra.rar
branches/JCA/jboss-embedded/src/main/resources/bootstrap/deploy/messaging/
branches/JCA/jboss-embedded/src/main/resources/bootstrap/deploy/messaging/connection-factories-service.xml
branches/JCA/jboss-embedded/src/main/resources/bootstrap/deploy/messaging/destinations-service.xml
branches/JCA/jboss-embedded/src/main/resources/bootstrap/deploy/messaging/hsqldb-persistence-service.xml
branches/JCA/jboss-embedded/src/main/resources/bootstrap/deploy/messaging/jms-ds.xml
branches/JCA/jboss-embedded/src/main/resources/bootstrap/deploy/messaging/legacy-service.xml
branches/JCA/jboss-embedded/src/main/resources/bootstrap/deploy/messaging/messaging-service.xml
branches/JCA/jboss-embedded/src/main/resources/bootstrap/deploy/messaging/remoting-service.xml
branches/JCA/jboss-embedded/src/main/resources/bootstrap/deploy/remoting-service.xml
branches/JCA/jboss-embedded/src/main/resources/bootstrap/deployers/
branches/JCA/jboss-embedded/src/main/resources/bootstrap/deployers/aspect-deployer-beans.xml
branches/JCA/jboss-embedded/src/main/resources/bootstrap/deployers/ejb-deployer-beans.xml
branches/JCA/jboss-embedded/src/main/resources/bootstrap/deployers/ejb3-deployers-beans.xml
branches/JCA/jboss-embedded/src/main/resources/bootstrap/deployers/jboss-aspect-library-beans.xml
branches/JCA/jboss-embedded/src/main/resources/bootstrap/deployers/jca-deployers-beans.xml
branches/JCA/jboss-embedded/src/main/resources/bootstrap/deployers/metadata-beans.xml
branches/JCA/jboss-embedded/src/main/resources/bootstrap/deployers/security-deployer-beans.xml
branches/JCA/jboss-embedded/src/main/resources/bootstrap/jndi.properties
branches/JCA/jboss-embedded/src/main/resources/bootstrap/log4j.xml
branches/JCA/jboss-embedded/src/main/resources/bootstrap/stylesheets/
branches/JCA/jboss-embedded/src/main/resources/bootstrap/stylesheets/NoJRMPConnectionFactoryTemplate.xsl
branches/JCA/jboss-embedded/src/main/resources/readme.txt
Log:
TEIID-833: Adding Jboss Embedded for creating integrated container test environment
Property changes on: branches/JCA/jboss-embedded
___________________________________________________________________
Name: svn:ignore
+ .settings
.project
.classpath
Added: branches/JCA/jboss-embedded/pom.xml
===================================================================
--- branches/JCA/jboss-embedded/pom.xml (rev 0)
+++ branches/JCA/jboss-embedded/pom.xml 2009-12-19 03:37:05 UTC (rev 1684)
@@ -0,0 +1,32 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <artifactId>teiid</artifactId>
+ <groupId>org.jboss.teiid</groupId>
+ <version>7.0.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-jboss-embedded</artifactId>
+ <name>teiid-jboss-embedded</name>
+ <version>7.0.0-SNAPSHOT</version>
+ <description>JBoss Embedded Engine for Testing Purposes</description>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.embedded</groupId>
+ <artifactId>jboss-embedded-all</artifactId>
+ <version>beta3.SP10</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.embedded</groupId>
+ <artifactId>jboss-embedded</artifactId>
+ <version>beta3.SP10</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.embedded</groupId>
+ <artifactId>thirdparty-all</artifactId>
+ <version>beta3.SP10</version>
+ </dependency>
+ </dependencies>
+
+</project>
Added: branches/JCA/jboss-embedded/src/main/resources/bootstrap/META-INF/persistence.properties
===================================================================
--- branches/JCA/jboss-embedded/src/main/resources/bootstrap/META-INF/persistence.properties (rev 0)
+++ branches/JCA/jboss-embedded/src/main/resources/bootstrap/META-INF/persistence.properties 2009-12-19 03:37:05 UTC (rev 1684)
@@ -0,0 +1,17 @@
+hibernate.transaction.manager_lookup_class=org.hibernate.transaction.JBossTransactionManagerLookup
+#hibernate.connection.release_mode=after_statement
+#hibernate.transaction.flush_before_completion=false
+#hibernate.transaction.auto_close_session=false
+#hibernate.query.factory_class=org.hibernate.hql.ast.ASTQueryTranslatorFactory
+#hibernate.hbm2ddl.auto=create-drop
+#hibernate.hbm2ddl.auto=create
+hibernate.cache.provider_class=org.hibernate.cache.HashtableCacheProvider
+# Clustered cache with TreeCache
+#hibernate.cache.provider_class=org.jboss.ejb3.entity.TreeCacheProviderHook
+#hibernate.treecache.mbean.object_name=jboss.cache:service=EJB3EntityTreeCache
+#hibernate.dialect=org.hibernate.dialect.HSQLDialect
+hibernate.jndi.java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+hibernate.jndi.java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
+hibernate.bytecode.use_reflection_optimizer=false
+# I don't think this is honored, but EJB3Deployer uses it
+hibernate.bytecode.provider=javassist
\ No newline at end of file
Added: branches/JCA/jboss-embedded/src/main/resources/bootstrap/commons-logging.properties
===================================================================
--- branches/JCA/jboss-embedded/src/main/resources/bootstrap/commons-logging.properties (rev 0)
+++ branches/JCA/jboss-embedded/src/main/resources/bootstrap/commons-logging.properties 2009-12-19 03:37:05 UTC (rev 1684)
@@ -0,0 +1,5 @@
+# The Sun JSF RI bundles and wraps commons-logging, which, for unknown reasons, disables any other
+# commons-logging (my guess: the LogFactoryImpl detection routine is broken). This configuration
+# file makes it work again (also for unknown reasons).
+org.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.LogFactoryImpl
+org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger
\ No newline at end of file
Added: branches/JCA/jboss-embedded/src/main/resources/bootstrap/conf/bootstrap-beans.xml
===================================================================
--- branches/JCA/jboss-embedded/src/main/resources/bootstrap/conf/bootstrap-beans.xml (rev 0)
+++ branches/JCA/jboss-embedded/src/main/resources/bootstrap/conf/bootstrap-beans.xml 2009-12-19 03:37:05 UTC (rev 1684)
@@ -0,0 +1,238 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ The bootstrap of the server
+-->
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+ <bean name="SystemProperties" class="org.jboss.embedded.util.SystemProperties">
+ <property name="properties">
+ <map keyClass="java.lang.String" valueClass="java.lang.String">
+ <entry>
+ <key>jboss.bind.address</key>
+ <value>0.0.0.0</value>
+ </entry>
+ <entry>
+ <key>com.arjuna.ats.arjuna.common.propertiesFile</key>
+ <value>${jboss.home.dir}/conf/jbossjta-properties.xml</value>
+ </entry>
+ <entry>
+ <key>com.arjuna.ats.arjuna.objectstore.objectStoreDir</key>
+ <value>${jboss.server.data.dir}/ObjectStore</value>
+ </entry>
+ </map>
+ </property>
+ </bean>
+
+ <!-- The legacy JMX kernel -->
+ <bean name="JMXKernel" class="org.jboss.embedded.adapters.JMXKernel">
+ <property name="kernel">
+ <inject bean="jboss.kernel:service=Kernel"/>
+ </property>
+ <property name="serverConfig">
+ <inject bean="ServerConfig"/>
+ </property>
+ </bean>
+
+ <!-- The MainDeployer -->
+ <bean name="MainDeployer" class="org.jboss.deployers.plugins.main.MainDeployerImpl">
+ <property name="structuralDeployers"><inject bean="StructuralDeployers"/></property>
+ <property name="deployers"><inject bean="Deployers"/></property>
+ </bean>
+
+ <!-- The holder for deployers that determine structure -->
+ <bean name="StructuralDeployers" class="org.jboss.deployers.vfs.plugins.structure.VFSStructuralDeployersImpl">
+ <property name="structureBuilder">
+ <!-- The consolidator of the structure information -->
+ <bean name="StructureBuilder" class="org.jboss.deployers.vfs.plugins.structure.VFSStructureBuilder"/>
+ </property>
+ <!-- Accept any implementor of structure deployer -->
+ <incallback method="addDeployer"/>
+ <uncallback method="removeDeployer"/>
+ </bean>
+
+ <!-- The holder for deployers that do real deployment -->
+ <bean name="Deployers" class="org.jboss.deployers.plugins.deployers.DeployersImpl">
+ <constructor><parameter><inject bean="jboss.kernel:service=KernelController"/></parameter></constructor>
+ <!-- Accept any implementor of deployer -->
+ <incallback method="addDeployer"/>
+ <uncallback method="removeDeployer"/>
+ </bean>
+
+ <!-- A declared structure descriptor deployer -->
+ <bean name="DeclaredStructure" class="org.jboss.deployers.vfs.plugins.structure.explicit.DeclaredStructure"></bean>
+
+ <!-- JAR Structure -->
+ <bean name="JARStructure" class="org.jboss.deployers.vfs.plugins.structure.jar.JARStructure">
+ <!-- Unless specified the default list of suffixes is .zip, .ear, .jar, ,.rar, .war, .sar, .har, .aop -->
+ <constructor>
+ <parameter>
+ <set elementClass="java.lang.String">
+ <value>.zip</value>
+ <value>.ear</value>
+ <value>.jar</value>
+ <value>.rar</value>
+ <value>.war</value>
+ <value>.sar</value>
+ <value>.har</value>
+ <value>.aop</value>
+ <value>.deployer</value>
+ <value>.beans</value>
+ </set>
+ </parameter>
+ </constructor>
+ <property name="candidateStructureVisitorFactory">
+ <!-- Any file that is not an ordinary directory is a candidate -->
+ <bean name="JARStructureCandidates" class="org.jboss.deployers.vfs.spi.structure.helpers.DefaultCandidateStructureVisitorFactory">
+ <!-- A filter to exclude some obvious non-subdeployments -->
+ <property name="filter">
+ <bean name="JARFilter" class="org.jboss.virtual.plugins.vfs.helpers.SuffixesExcludeFilter">
+ <constructor><parameter>
+ <list elementClass="java.lang.String">
+ <!-- Exclude class files as subdeployments -->
+ <value>.class</value>
+ </list>
+ </parameter></constructor>
+ </bean>
+ </property>
+ </bean>
+ </property>
+ </bean>
+
+ <!-- File Structure -->
+ <bean name="FileStructure" class="org.jboss.deployers.vfs.plugins.structure.file.FileStructure">
+ <!-- Unless specified the default list of suffixes is -service.xml, -beans.xml, -ds.xml, -aop.xml -->
+ <constructor>
+ <parameter>
+ <set elementClass="java.lang.String">
+ <value>-service.xml</value>
+ <value>-beans.xml</value>
+ <value>-ds.xml</value>
+ <value>-aop.xml</value>
+ </set>
+ </parameter>
+ </constructor>
+ </bean>
+
+ <!-- POJO Deployment -->
+ <bean name="BeanDeployer" class="org.jboss.deployers.vfs.deployer.kernel.BeanDeployer">
+ <property name="type">beans</property>
+ </bean>
+ <bean name="KernelDeploymentDeployer" class="org.jboss.deployers.vfs.deployer.kernel.KernelDeploymentDeployer">
+ <property name="type">beans</property>
+ </bean>
+ <bean name="BeanMetaDataDeployer" class="org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer">
+ <constructor><parameter><inject bean="jboss.kernel:service=Kernel"/></parameter></constructor>
+ <property name="type">beans</property>
+ </bean>
+
+ <!-- JMX Deployment -->
+ <bean name="SARDeployer" class="org.jboss.system.deployers.SARDeployer">
+ <property name="type">sar</property>
+ </bean>
+ <bean name="ServiceClassLoaderDeployer" class="org.jboss.embedded.ClassLoaderDeployer"/>
+ <bean name="ServiceDeploymentDeployer" class="org.jboss.system.deployers.ServiceDeploymentDeployer">
+ <property name="type">sar</property>
+ </bean>
+ <bean name="ServiceDeployer" class="org.jboss.system.deployers.ServiceDeployer">
+ <constructor><parameter><inject bean="JMXKernel" property="serviceController"/></parameter></constructor>
+ <property name="type">sar</property>
+ </bean>
+
+ <!-- A filter for excluding files from the scanner -->
+ <bean name="DeploymentFilter" class="org.jboss.virtual.plugins.vfs.helpers.ExtensibleFilter">
+ <!-- Files starting with theses strings are ignored -->
+ <property name="prefixes">#,%,\,,.,_$</property>
+ <!-- Files ending with theses strings are ignored -->
+ <property name="suffixes">#,$,%,~,\,v,.BAK,.bak,.old,.orig,.tmp,.rej,.sh</property>
+ <!-- Files matching with theses strings are ignored -->
+ <property name="matches">.make.state,.nse_depinfo,CVS,CVS.admin,RCS,RCSLOG,SCCS,TAGS,core,tags</property>
+ </bean>
+
+ <!--
+ JNDI Initialization of basic beans (NO REMOTING)
+ -->
+ <bean name="Naming" class="org.jnp.server.SingletonNamingServer"/>
+ <bean name="java:comp" class="org.jboss.naming.JavaCompInitializer"/>
+
+ <!-- register Naming bean with dispatcher just in case we want to have a remote JNDI connection -->
+ <bean name="JndiRegistration" class="org.jboss.aspects.remoting.DispatcherRegistration">
+ <property name="oid">JNDI</property>
+ <property name="target"><inject bean="Naming"/></property>
+ </bean>
+
+ <!--
+ Bootstrap old JMX-based core services
+ setup deployers
+ setup deploy/ directory
+ -->
+ <bean name="ResourcesToDeploy" class="org.jboss.embedded.DeploymentScanner">
+ <property name="filter">
+ <inject bean="DeploymentFilter"/>
+ </property>
+ <property name="mainDeployer">
+ <inject bean="MainDeployer"/>
+ </property>
+ <property name="kernel">
+ <inject bean="jboss.kernel:service=Kernel"/>
+ </property>
+ <property name="resources">
+ <list elementClass="java.lang.String">
+ <value>${jboss.embedded.bootstrap.resource.path}conf/jboss-service.xml</value>
+ </list>
+ </property>
+ </bean>
+
+ <bean name="UserTransaction" class="org.jboss.embedded.adapters.LocalOnlyUserTransaction"/>
+
+ <bean name="UserTransactionBinding" class="org.jboss.naming.JndiBinder">
+ <property name="target">
+ <inject bean="UserTransaction"/>
+ </property>
+ <property name="bindTo">UserTransaction</property>
+ <property name="serializable">false</property>
+ </bean>
+
+ <!-- FIXME EMB-2 -->
+ <bean name="UserTransactionBinding2" class="org.jboss.naming.JndiBinder">
+ <property name="target">
+ <inject bean="UserTransaction"/>
+ </property>
+ <property name="bindTo">java:comp/UserTransaction</property>
+ <property name="serializable">false</property>
+ </bean>
+
+
+ <bean name="ResourcesToDeploy2" class="org.jboss.embedded.DeploymentScanner">
+ <property name="filter">
+ <inject bean="DeploymentFilter"/>
+ </property>
+ <property name="mainDeployer">
+ <inject bean="MainDeployer"/>
+ </property>
+ <property name="kernel">
+ <inject bean="jboss.kernel:service=Kernel"/>
+ </property>
+ <property name="directoriesByResource">
+ <list elementClass="java.lang.String">
+ <value>${jboss.embedded.bootstrap.resource.path}conf/jboss-service.xml/../deployers</value>
+ </list>
+ </property>
+ </bean>
+ <bean name="ResourcesToDeploy3" class="org.jboss.embedded.DeploymentScanner">
+ <property name="filter">
+ <inject bean="DeploymentFilter"/>
+ </property>
+ <property name="mainDeployer">
+ <inject bean="MainDeployer"/>
+ </property>
+ <property name="kernel">
+ <inject bean="jboss.kernel:service=Kernel"/>
+ </property>
+ <property name="directoriesByResource">
+ <list elementClass="java.lang.String">
+ <value>${jboss.embedded.bootstrap.resource.path}conf/jboss-service.xml/../deploy</value>
+ </list>
+ </property>
+ </bean>
+</deployment>
Added: branches/JCA/jboss-embedded/src/main/resources/bootstrap/conf/jboss-service.xml
===================================================================
--- branches/JCA/jboss-embedded/src/main/resources/bootstrap/conf/jboss-service.xml (rev 0)
+++ branches/JCA/jboss-embedded/src/main/resources/bootstrap/conf/jboss-service.xml 2009-12-19 03:37:05 UTC (rev 1684)
@@ -0,0 +1,132 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- $Id: jboss-service.xml 58969 2006-12-11 01:17:41Z scott.stark(a)jboss.org $ -->
+
+<!-- ===================================================================== -->
+<!-- JBoss Server Configuration -->
+<!-- ===================================================================== -->
+
+<server>
+
+ <!-- ==================================================================== -->
+ <!-- Main Deployer -->
+ <!-- ==================================================================== -->
+ <mbean code="org.jboss.deployment.MainDeployer"
+ name="jboss.system:service=MainDeployer">
+ <!-- This is used to delegate the deployment handling -->
+ <attribute name="KernelMainDeployer"><inject bean="MainDeployer" /></attribute>
+ </mbean>
+
+ <!-- ==================================================================== -->
+ <!-- SAR Deployer -->
+ <!-- ==================================================================== -->
+ <mbean code="org.jboss.deployment.SARDeployer"
+ name="jboss.system:service=ServiceDeployer">
+ <depends>jboss.system:service=MainDeployer</depends>
+ </mbean>
+
+ <!-- ==================================================================== -->
+ <!-- Security -->
+ <!-- ==================================================================== -->
+
+ <mbean code="org.jboss.security.plugins.SecurityConfig"
+ name="jboss.security:service=SecurityConfig">
+ <attribute name="LoginConfig">jboss.security:service=XMLLoginConfig</attribute>
+ <depends>jboss.security:service=XMLLoginConfig</depends>
+ </mbean>
+ <mbean code="org.jboss.security.auth.login.XMLLoginConfig"
+ name="jboss.security:service=XMLLoginConfig">
+ <attribute name="ConfigResource">${jboss.embedded.bootstrap.resource.path}conf/login-config.xml</attribute>
+ </mbean>
+
+ <!-- JAAS security manager and realm mapping -->
+ <mbean code="org.jboss.security.plugins.JaasSecurityManagerService"
+ name="jboss.security:service=JaasSecurityManager">
+ <!-- A flag which indicates whether the SecurityAssociation server mode
+ is set on service creation. This is true by default since the
+ SecurityAssociation should be thread local for multi-threaded server
+ operation.
+ -->
+ <attribute name="ServerMode">true</attribute>
+ <attribute name="SecurityManagerClassName">org.jboss.security.plugins.JaasSecurityManager</attribute>
+ <attribute name="DefaultUnauthenticatedPrincipal">anonymous</attribute>
+ <!-- DefaultCacheTimeout: Specifies the default timed cache policy timeout
+ in seconds.
+ If you want to disable caching of security credentials, set this to 0 to
+ force authentication to occur every time. This has no affect if the
+ AuthenticationCacheJndiName has been changed from the default value.
+ -->
+ <attribute name="DefaultCacheTimeout">1800</attribute>
+ <!-- DefaultCacheResolution: Specifies the default timed cache policy
+ resolution in seconds. This controls the interval at which the cache
+ current timestamp is updated and should be less than the DefaultCacheTimeout
+ in order for the timeout to be meaningful. This has no affect if the
+ AuthenticationCacheJndiName has been changed from the default value.
+ -->
+ <attribute name="DefaultCacheResolution">60</attribute>
+ <!-- DeepCopySubjectMode: This set the copy mode of subjects done by the
+ security managers to be deep copies that makes copies of the subject
+ principals and credentials if they are cloneable. It should be set to
+ true if subject include mutable content that can be corrupted when
+ multiple threads have the same identity and cache flushes/logout clearing
+ the subject in one thread results in subject references affecting other
+ threads.
+ -->
+ <attribute name="DeepCopySubjectMode">false</attribute>
+ </mbean>
+
+ <!-- Authorization manager-->
+ <mbean code="org.jboss.security.plugins.AuthorizationManagerService"
+ name="jboss.security:service=AuthorizationManager">
+ <attribute name="AuthorizationManagerClassName">org.jboss.security.plugins.JBossAuthorizationManager</attribute>
+ </mbean>
+
+ <!-- ==================================================================== -->
+ <!-- Transactions -->
+ <!-- ==================================================================== -->
+
+ <!-- JBossTS JTA -->
+ <mbean code="com.arjuna.ats.jbossatx.jta.TransactionManagerService"
+ name="jboss:service=TransactionManager">
+ <attribute name="TransactionTimeout">300</attribute>
+ <attribute name="ObjectStoreDir">${jboss.server.data.dir}/tx-object-store</attribute>
+ </mbean>
+
+ <mbean code="org.jboss.util.threadpool.BasicThreadPool"
+ name="jboss.jca:service=WorkManagerThreadPool">
+ <!-- The name that appears in thread names -->
+ <attribute name="Name">WorkManager</attribute>
+ <!-- The maximum amount of work in the queue -->
+ <attribute name="MaximumQueueSize">1024</attribute>
+ <!-- The maximum number of active threads -->
+ <attribute name="MaximumPoolSize">100</attribute>
+ <!-- How long to keep threads alive after their last work (default one minute) -->
+ <attribute name="KeepAliveTime">60000</attribute>
+ </mbean>
+
+ <mbean code="org.jboss.resource.work.JBossWorkManager"
+ name="jboss.jca:service=WorkManager">
+ <depends optional-attribute-name="ThreadPoolName">jboss.jca:service=WorkManagerThreadPool</depends>
+ <depends optional-attribute-name="XATerminatorName">jboss:service=TransactionManager</depends>
+ </mbean>
+
+ <!--
+ | The CachedConnectionManager is used partly to relay started UserTransactions to
+ | open connections so they may be enrolled in the new tx.
+ -->
+ <mbean code="org.jboss.resource.connectionmanager.CachedConnectionManager"
+ name="jboss.jca:service=CachedConnectionManager">
+ <depends optional-attribute-name="TransactionManagerServiceName">jboss:service=TransactionManager</depends>
+
+ <!-- Enable connection close debug monitoring -->
+ <attribute name="Debug">true</attribute>
+
+ </mbean>
+
+ <mbean code="org.jboss.naming.JNDIView"
+ name="jboss:service=JNDIView">
+ <!-- The HANamingService service name -->
+ <attribute name="HANamingService">jboss:service=HAJNDI</attribute>
+ </mbean>
+
+</server>
Added: branches/JCA/jboss-embedded/src/main/resources/bootstrap/conf/jbossjta-properties.xml
===================================================================
--- branches/JCA/jboss-embedded/src/main/resources/bootstrap/conf/jbossjta-properties.xml (rev 0)
+++ branches/JCA/jboss-embedded/src/main/resources/bootstrap/conf/jbossjta-properties.xml 2009-12-19 03:37:05 UTC (rev 1684)
@@ -0,0 +1,243 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<transaction-service>
+ <properties depends="common" name="arjuna">
+ <!--
+ Transaction Reaper Timeout (default is 120000 ms).
+ -->
+ <property
+ name="com.arjuna.ats.arjuna.coordinator.txReaperTimeout" value="120000"/>
+ <!--
+ Transaction Reaper Mode, can be: NORMAL or DYNAMIC (default is NORMAL).
+ -->
+ <property name="com.arjuna.ats.arjuna.coordinator.txReaperMode" value="DYNAMIC"/>
+ <!--
+ Transaction Reaper Cancel Wait Period (default is 500 ms, min is 10 msecs).
+ -->
+ <property
+ name="com.arjuna.ats.arjuna.coordinator.txReaperCancelWaitPeriod" value="500"/>
+ <!--
+ Transaction Reaper Cancel Fail Wait Period (default is 500 ms, min is 10 msecs).
+ -->
+ <property
+ name="com.arjuna.ats.arjuna.coordinator.txReaperCancelFailWaitPeriod" value="500"/>
+ <!--
+ Transaction Reaper Zombie Max (default is 8).
+ -->
+ <property
+ name="com.arjuna.ats.arjuna.coordinator.txReaperZombieMax" value="8"/>
+ <!--
+ (default is NO)
+ -->
+ <property name="com.arjuna.ats.arjuna.coordinator.asyncCommit" value="NO"/>
+ <!--
+ (default is NO)
+ -->
+ <property name="com.arjuna.ats.arjuna.coordinator.asyncPrepare" value="NO"/>
+ <!--
+ (default is YES)
+ -->
+ <property
+ name="com.arjuna.ats.arjuna.coordinator.commitOnePhase" value="YES"/>
+ <!--
+ (default is defaultStore)
+ -->
+ <property name="com.arjuna.ats.arjuna.objectstore.localOSRoot" value="defaultStore"/>
+ <!--
+ default is under user.home - must be writeable!)
+ -->
+ <property
+ name="com.arjuna.ats.arjuna.objectstore.objectStoreDir" value="PutObjectStoreDirHere"/>
+ <!--
+ (default is ON)
+ -->
+ <property
+ name="com.arjuna.ats.arjuna.objectstore.objectStoreSync" value="ON"/>
+ <!--
+ (default is ShadowNoFileLockStore)
+ -->
+ <property
+ name="com.arjuna.ats.arjuna.objectstore.objectStoreType" value="ShadowNoFileLockStore"/>
+ <!--
+ (default is 255)
+ -->
+ <property
+ name="com.arjuna.ats.arjuna.objectstore.hashedDirectories" value="255"/>
+ <!--
+ (default is ON)
+ -->
+ <property
+ name="com.arjuna.ats.arjuna.objectstore.transactionSync" value="ON"/>
+ <!--
+ (Must be unique across all Arjuna instances.)
+ -->
+ <property name="com.arjuna.ats.arjuna.xa.nodeIdentifier" value="1"/>
+ <!-- property
+ name="com.arjuna.ats.arjuna.coordinator.actionStore"
+ value="HashedActionStore"
+ value="JDBCActionStore"
+ -->
+ <!-- property
+ name="com.arjuna.ats.arjuna.objectstore.jdbcTxDbAccess"
+ value="JDBCAccess"
+ -->
+ <!-- property
+ name="com.arjuna.ats.arjuna.objectstore.objectStoreType"
+ value="ShadowNoFileLockStore"
+ value="JDBCStore"
+ -->
+ <!-- property
+ name="com.arjuna.ats.arjuna.objectstore.jdbcUserDbAccess"
+ value="JDBCAccess"
+ -->
+ <!-- property
+ name="com.arjuna.ats.arjuna.objectstore.jdbcPoolSizeInitial"
+ value="1"
+ -->
+ <!-- property
+ name="com.arjuna.ats.arjuna.objectstore.jdbcPoolSizeMaximum"
+ value="1"
+ -->
+ <!-- property
+ name="com.arjuna.ats.arjuna.objectstore.jdbcPoolPutConnections"
+ value="false"
+ -->
+ <!-- property
+ name="com.arjuna.ats.arjuna.internal.arjuna.objectstore.cacheStore.size"
+ value=""
+ -->
+ <!-- property
+ name="com.arjuna.ats.arjuna.internal.arjuna.objectstore.cacheStore.period"
+ value=""
+ -->
+ <!--
+ The location for creating temporary files, e.g., Uids.
+ Default is under user.home.
+ IMPORTANT: make sure the directory is lockable, e.g., /tmp on Unix
+ may not be!
+ -->
+ <!--
+ <property
+ name="com.arjuna.ats.arjuna.common.varDir"
+ value="var"/>
+ -->
+ </properties>
+ <properties name="common">
+ <!-- CLF 2.0 properties -->
+ <property name="com.arjuna.common.util.logging.DebugLevel"
+ type="System" value="0x00000000"/>
+ <property name="com.arjuna.common.util.logging.FacilityLevel"
+ type="System" value="0xffffffff"/>
+ <property name="com.arjuna.common.util.logging.VisibilityLevel"
+ type="System" value="0xffffffff"/>
+ <property name="com.arjuna.common.util.logger" type="System" value="log4j"/>
+ </properties>
+ <properties depends="arjuna" name="txoj">
+ <!--
+ (default is LockStore of installation - must be writeable!)
+ -->
+ <!--
+ <property
+ name="com.arjuna.ats.txoj.lockstore.lockStoreDir"
+ value="LockStore"/>
+ -->
+ <!--
+ (default is BasicLockStore)
+ -->
+ <property name="com.arjuna.ats.txoj.lockstore.lockStoreType" value="BasicLockStore"/>
+ <!--
+ (default is NO)
+ -->
+ <property name="com.arjuna.ats.txoj.lockstore.multipleLockStore" value="NO"/>
+ <!--
+ (default is YES)
+ -->
+ <property name="com.arjuna.ats.txoj.lockstore.singleLockStore" value="YES"/>
+ <!--
+ (default is YES)
+ -->
+ <property
+ name="com.arjuna.ats.txoj.lockstore.allowNestedLocking" value="YES"/>
+ </properties>
+ <properties depends="arjuna" name="jta">
+ <!--
+ Support subtransactions in the JTA layer?
+ Default is NO.
+ -->
+ <property name="com.arjuna.ats.jta.supportSubtransactions" value="NO"/>
+ <property name="com.arjuna.ats.jta.jtaTMImplementation" value="com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionManagerImple"/>
+ <!--
+ com.arjuna.ats.internal.jta.transaction.jts.TransactionManagerImple
+ -->
+ <property name="com.arjuna.ats.jta.jtaUTImplementation" value="com.arjuna.ats.internal.jta.transaction.arjunacore.UserTransactionImple"/>
+ <!--
+ com.arjuna.ats.internal.jta.transaction.jts.UserTransactionImple
+ -->
+ </properties>
+ <properties depends="arjuna,txoj,jta" name="recoverymanager">
+ <!--
+ Properties used only by the RecoveryManager.
+ -->
+ <!--
+ Periodic recovery settings.
+ Time values in this section are in seconds.
+ -->
+ <!--
+ Interval in seconds between initiating the periodic recovery modules.
+ Default is 120 seconds.
+ -->
+ <property
+ name="com.arjuna.ats.arjuna.recovery.periodicRecoveryPeriod" value="120"/>
+ <!--
+ Interval in seconds between first and second pass of periodic recovery.
+ Default is 10 seconds.
+ -->
+ <property
+ name="com.arjuna.ats.arjuna.recovery.recoveryBackoffPeriod" value="10"/>
+ <!--
+ Periodic recovery modules to use. Invoked in sort-order of names.
+ -->
+ <property
+ name="com.arjuna.ats.arjuna.recovery.recoveryExtension1" value="com.arjuna.ats.internal.arjuna.recovery.AtomicActionRecoveryModule"/>
+ <property
+ name="com.arjuna.ats.arjuna.recovery.recoveryExtension2" value="com.arjuna.ats.internal.txoj.recovery.TORecoveryModule"/>
+ <property
+ name="com.arjuna.ats.arjuna.recovery.recoveryExtension3" value="com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule"/>
+ <!--
+ Expired entry removal
+ -->
+ <!--
+ Expiry scanners to use (order of invocation is random).
+ Names must begin with "com.arjuna.ats.arjuna.recovery.expiryScanner"
+ -->
+ <property
+ name="com.arjuna.ats.arjuna.recovery.expiryScannerTransactionStatusManager" value="com.arjuna.ats.internal.arjuna.recovery.ExpiredTransactionStatusManagerScanner"/>
+ <!--
+ Interval, in hours, between running the expiry scanners.
+ This can be quite long. The absolute value determines the interval -
+ if the value is negative, the scan will NOT be run until after one
+ interval has elapsed. If positive the first scan will be immediately
+ after startup. Zero will prevent any scanning.
+ Default = 12 = run immediately, then every 12 hours.
+ -->
+ <property
+ name="com.arjuna.ats.arjuna.recovery.expiryScanInterval" value="12"/>
+ <!--
+ Age, in hours, for removal of transaction status manager item.
+ This should be longer than any ts-using process will remain running.
+ Zero = Never removed. Default is 12.
+ -->
+ <property
+ name="com.arjuna.ats.arjuna.recovery.transactionStatusManagerExpiryTime" value="12"/>
+ <!--
+ Use this to fix the port on which the TransactionStatusManager listens,
+ The default behaviour is to use any free port.
+ -->
+ <property
+ name="com.arjuna.ats.arjuna.recovery.transactionStatusManagerPort" value="0"/>
+ </properties>
+ <properties depends="jta" name="jdbc">
+ <!--
+ property name="com.arjuna.ats.jdbc.isolationLevel" value="TRANSACTION_SERIALIZABLE"/>
+ -->
+ </properties>
+</transaction-service>
Added: branches/JCA/jboss-embedded/src/main/resources/bootstrap/conf/login-config.xml
===================================================================
--- branches/JCA/jboss-embedded/src/main/resources/bootstrap/conf/login-config.xml (rev 0)
+++ branches/JCA/jboss-embedded/src/main/resources/bootstrap/conf/login-config.xml 2009-12-19 03:37:05 UTC (rev 1684)
@@ -0,0 +1,86 @@
+<?xml version='1.0'?>
+
+<!DOCTYPE policy PUBLIC
+ "-//JBoss//DTD JBOSS Security Config 3.0//EN"
+ "http://www.jboss.org/j2ee/dtd/security_config.dtd">
+
+<!-- The XML based JAAS login configuration read by the
+org.jboss.security.auth.login.XMLLoginConfig mbean. Add
+an application-policy element for each security domain.
+
+The outline of the application-policy is:
+<application-policy name="security-domain-name">
+ <authentication>
+ <login-module code="login.module1.class.name" flag="control_flag">
+ <module-option name = "option1-name">option1-value</module-option>
+ <module-option name = "option2-name">option2-value</module-option>
+ ...
+ </login-module>
+
+ <login-module code="login.module2.class.name" flag="control_flag">
+ ...
+ </login-module>
+ ...
+ </authentication>
+</application-policy>
+
+$Revision: 42748 $
+-->
+
+<policy>
+ <application-policy name="HsqlDbRealm">
+ <authentication>
+ <login-module code="org.jboss.resource.security.ConfiguredIdentityLoginModule"
+ flag="required">
+ <module-option name="principal">sa</module-option>
+ <module-option name="userName">sa</module-option>
+ <module-option name="password"></module-option>
+ <module-option name="managedConnectionFactoryName">jboss.jca:service=LocalTxCM,name=DefaultDS</module-option>
+ </login-module>
+ </authentication>
+ </application-policy>
+
+ <application-policy name="messaging">
+ <authentication>
+ <login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule" flag = "required">
+ <module-option name="unauthenticatedIdentity">guest</module-option>
+ <module-option name="usersProperties">conf/props/messaging-users.properties</module-option>
+ <module-option name="rolesProperties">conf/props/messaging-roles.properties</module-option>
+ </login-module>
+ </authentication>
+ </application-policy>
+
+
+ <!-- Used by clients within the application server VM such as
+ mbeans and servlets that access EJBs.
+ -->
+ <application-policy name="client-login">
+ <authentication>
+ <login-module code="org.jboss.security.ClientLoginModule"
+ flag="required">
+ <!-- Any existing security context will be restored on logout -->
+ <module-option name="restore-login-identity">true</module-option>
+ </login-module>
+ </authentication>
+ </application-policy>
+
+ <application-policy name="other">
+ <!-- A simple server login module, which can be used when the number
+ of users is relatively small. It uses two properties files:
+ users.properties, which holds users (key) and their password (value).
+ roles.properties, which holds users (key) and a comma-separated list of
+ their roles (value).
+ The unauthenticatedIdentity property defines the name of the principal
+ that will be used when a null username and password are presented as is
+ the case for an unuathenticated web client or MDB. If you want to
+ allow such users to be authenticated add the property, e.g.,
+ unauthenticatedIdentity="nobody"
+ -->
+ <authentication>
+ <login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule"
+ flag="required"/>
+ </authentication>
+ </application-policy>
+
+</policy>
+
Added: branches/JCA/jboss-embedded/src/main/resources/bootstrap/conf/props/messaging-roles.properties
===================================================================
--- branches/JCA/jboss-embedded/src/main/resources/bootstrap/conf/props/messaging-roles.properties (rev 0)
+++ branches/JCA/jboss-embedded/src/main/resources/bootstrap/conf/props/messaging-roles.properties 2009-12-19 03:37:05 UTC (rev 1684)
@@ -0,0 +1,4 @@
+#
+# user=role1,role2,...
+#
+guest=guest
Added: branches/JCA/jboss-embedded/src/main/resources/bootstrap/conf/props/messaging-users.properties
===================================================================
--- branches/JCA/jboss-embedded/src/main/resources/bootstrap/conf/props/messaging-users.properties (rev 0)
+++ branches/JCA/jboss-embedded/src/main/resources/bootstrap/conf/props/messaging-users.properties 2009-12-19 03:37:05 UTC (rev 1684)
@@ -0,0 +1,4 @@
+#
+# user=password
+#
+guest=guest
Added: branches/JCA/jboss-embedded/src/main/resources/bootstrap/deploy/ejb3-interceptors-aop.xml
===================================================================
--- branches/JCA/jboss-embedded/src/main/resources/bootstrap/deploy/ejb3-interceptors-aop.xml (rev 0)
+++ branches/JCA/jboss-embedded/src/main/resources/bootstrap/deploy/ejb3-interceptors-aop.xml 2009-12-19 03:37:05 UTC (rev 1684)
@@ -0,0 +1,392 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE aop PUBLIC
+ "-//JBoss//DTD JBOSS AOP 1.0//EN"
+ "http://labs.jboss.com/portal/jbossaop/dtd/jboss-aop_1_0.dtd">
+
+<aop>
+ <interceptor class="org.jboss.aspects.remoting.InvokeRemoteInterceptor" scope="PER_VM"/>
+ <interceptor class="org.jboss.aspects.security.SecurityClientInterceptor" scope="PER_VM"/>
+ <interceptor class="org.jboss.aspects.tx.ClientTxPropagationInterceptor" scope="PER_VM"/>
+ <interceptor class="org.jboss.ejb3.remoting.IsLocalInterceptor" scope="PER_VM"/>
+ <interceptor class="org.jboss.aspects.remoting.ClusterChooserInterceptor" scope="PER_VM"/>
+
+ <interceptor class="org.jboss.aspects.tx.TxPropagationInterceptor" scope="PER_VM"/>
+
+ <stack name="ServiceClientInterceptors">
+ <interceptor-ref name="org.jboss.ejb3.remoting.IsLocalInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.security.SecurityClientInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.tx.ClientTxPropagationInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.remoting.InvokeRemoteInterceptor"/>
+ </stack>
+
+ <stack name="AsynchronousStatelessSessionClientInterceptors">
+ <interceptor-ref name="org.jboss.ejb3.remoting.IsLocalInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.security.SecurityClientInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.tx.ClientTxPropagationInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.remoting.InvokeRemoteInterceptor"/>
+ </stack>
+
+ <stack name="AsynchronousStatefulSessionClientInterceptors">
+ <interceptor-ref name="org.jboss.ejb3.remoting.IsLocalInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.security.SecurityClientInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.tx.ClientTxPropagationInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.remoting.InvokeRemoteInterceptor"/>
+ </stack>
+
+ <stack name="StatelessSessionClientInterceptors">
+ <interceptor-ref name="org.jboss.ejb3.remoting.IsLocalInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.security.SecurityClientInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.tx.ClientTxPropagationInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.remoting.InvokeRemoteInterceptor"/>
+ </stack>
+
+ <stack name="StatefulSessionClientInterceptors">
+ <interceptor-ref name="org.jboss.ejb3.remoting.IsLocalInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.security.SecurityClientInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.tx.ClientTxPropagationInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.remoting.InvokeRemoteInterceptor"/>
+ </stack>
+
+ <stack name="ClusteredStatelessSessionClientInterceptors">
+ <interceptor-ref name="org.jboss.ejb3.remoting.IsLocalInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.security.SecurityClientInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.tx.ClientTxPropagationInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.remoting.ClusterChooserInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.remoting.InvokeRemoteInterceptor"/>
+ </stack>
+
+ <stack name="ClusteredStatefulSessionClientInterceptors">
+ <interceptor-ref name="org.jboss.ejb3.remoting.IsLocalInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.security.SecurityClientInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.tx.ClientTxPropagationInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.remoting.ClusterChooserInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.remoting.InvokeRemoteInterceptor"/>
+ </stack>
+
+ <interceptor class="org.jboss.ejb3.asynchronous.AsynchronousInterceptor" scope="PER_CLASS"/>
+ <interceptor class="org.jboss.ejb3.ENCPropagationInterceptor" scope="PER_VM"/>
+ <interceptor name="Basic Authorization" factory="org.jboss.ejb3.security.RoleBasedAuthorizationInterceptorFactory" scope="PER_CLASS"/>
+ <interceptor name="JACC Authorization" factory="org.jboss.ejb3.security.JaccAuthorizationInterceptorFactory" scope="PER_CLASS"/>
+ <interceptor factory="org.jboss.ejb3.security.AuthenticationInterceptorFactory" scope="PER_CLASS"/>
+ <interceptor factory="org.jboss.ejb3.security.RunAsSecurityInterceptorFactory" scope="PER_CLASS"/>
+ <interceptor class="org.jboss.ejb3.entity.ExtendedPersistenceContextPropagationInterceptor" scope="PER_VM"/>
+ <interceptor class="org.jboss.ejb3.stateless.StatelessInstanceInterceptor" scope="PER_VM"/>
+ <interceptor class="org.jboss.ejb3.stateful.StatefulInstanceInterceptor" scope="PER_VM"/>
+ <interceptor class="org.jboss.ejb3.stateful.SessionSynchronizationInterceptor" scope="PER_VM"/>
+ <interceptor class="org.jboss.ejb3.service.ServiceSingletonInterceptor" scope="PER_VM"/>
+ <interceptor class="org.jboss.ejb3.cache.StatefulReplicationInterceptor" scope="PER_VM"/>
+ <interceptor factory="org.jboss.ejb3.stateful.StatefulRemoveFactory" scope="PER_CLASS_JOINPOINT"/>
+ <interceptor factory="org.jboss.ejb3.tx.TxInterceptorFactory" scope="PER_CLASS_JOINPOINT"/>
+ <interceptor factory="org.jboss.ejb3.interceptor.EJB3InterceptorsFactory" scope="PER_CLASS_JOINPOINT"/>
+ <interceptor factory="org.jboss.ejb3.remoting.ReplicantsManagerInterceptorFactory" scope="PER_CLASS"/>
+ <interceptor class="org.jboss.ejb3.AllowedOperationsInterceptor" scope="PER_VM"/>
+ <interceptor factory="org.jboss.ejb3.mdb.CurrentMessageInjectorInterceptorFactory" scope="PER_CLASS"/>
+ <interceptor class="org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor" scope="PER_VM"/>
+
+ <domain name="Stateless Bean">
+ <bind pointcut="execution(public * *->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.asynchronous.AsynchronousInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.ENCPropagationInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.security.AuthenticationInterceptorFactory"/>
+ </bind>
+ <bind pointcut="execution(public * @org.jboss.ejb3.annotation.SecurityDomain->*(..))">
+ <interceptor-ref name="Basic Authorization"/>
+ </bind>
+ <bind pointcut="execution(public * *->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.security.RunAsSecurityInterceptorFactory"/>
+ </bind>
+ <bind pointcut="execution(public * @org.jboss.ejb3.annotation.Clustered->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.remoting.ReplicantsManagerInterceptorFactory"/>
+ </bind>
+ <bind pointcut="execution(public * *->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.stateless.StatelessInstanceInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.tx.TxPropagationInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.tx.TxInterceptorFactory"/>
+ <interceptor-ref name="org.jboss.ejb3.AllowedOperationsInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.interceptor.EJB3InterceptorsFactory"/>
+ </bind>
+ <annotation expr="!class((a)org.jboss.ejb3.annotation.Pool)">
+ @org.jboss.ejb3.annotation.Pool (value="ThreadlocalPool", maxSize=30, timeout=10000)
+ </annotation>
+ <annotation expr="!class((a)org.jboss.ejb3.annotation.JndiBindingPolicy)">
+ @org.jboss.ejb3.annotation.JndiBindingPolicy (policy=org.jboss.ejb3.jndipolicy.impl.PackagingBasedJndiBindingPolicy.class)
+ </annotation>
+ </domain>
+
+ <domain name="JACC Stateless Bean">
+ <bind pointcut="execution(public * *->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.asynchronous.AsynchronousInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.ENCPropagationInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.security.AuthenticationInterceptorFactory"/>
+ </bind>
+ <bind pointcut="execution(public * @org.jboss.ejb3.annotation.SecurityDomain->*(..))">
+ <interceptor-ref name="JACC Authorization"/>
+ </bind>
+ <bind pointcut="execution(public * *->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.security.RunAsSecurityInterceptorFactory"/>
+ </bind>
+ <bind pointcut="execution(public * @org.jboss.ejb3.annotation.Clustered->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.remoting.ReplicantsManagerInterceptorFactory"/>
+ </bind>
+ <bind pointcut="execution(public * *->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.stateless.StatelessInstanceInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.tx.TxPropagationInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.tx.TxInterceptorFactory"/>
+ <interceptor-ref name="org.jboss.ejb3.AllowedOperationsInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.interceptor.EJB3InterceptorsFactory"/>
+ </bind>
+ <annotation expr="!class((a)org.jboss.ejb3.annotation.Pool)">
+ @org.jboss.ejb3.annotation.Pool (value="ThreadlocalPool", maxSize=30, timeout=10000)
+ </annotation>
+ <annotation expr="!class((a)org.jboss.ejb3.annotation.JndiBindingPolicy)">
+ @org.jboss.ejb3.annotation.JndiBindingPolicy (policy=org.jboss.ejb3.jndipolicy.impl.PackagingBasedJndiBindingPolicy.class)
+ </annotation>
+ </domain>
+
+ <domain name="Base Stateful Bean">
+ <bind pointcut="execution(public * *->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.asynchronous.AsynchronousInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.ENCPropagationInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.security.AuthenticationInterceptorFactory"/>
+ </bind>
+ <bind pointcut="execution(public * @org.jboss.ejb3.annotation.SecurityDomain->*(..))">
+ <interceptor-ref name="Basic Authorization"/>
+ </bind>
+ <bind pointcut="execution(public * *->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.security.RunAsSecurityInterceptorFactory"/>
+ </bind>
+ <bind pointcut="execution(public * @org.jboss.ejb3.annotation.Clustered->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.remoting.ReplicantsManagerInterceptorFactory"/>
+ </bind>
+ <bind pointcut="execution(public * *->@javax.ejb.Remove(..))">
+ <interceptor-ref name="org.jboss.ejb3.stateful.StatefulRemoveFactory"/>
+ </bind>
+ <bind pointcut="execution(public * *->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.stateful.StatefulInstanceInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.tx.TxPropagationInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.tx.TxInterceptorFactory"/>
+ <interceptor-ref name="org.jboss.ejb3.AllowedOperationsInterceptor"/>
+ </bind>
+ <bind pointcut="execution(public * $instanceof{javax.ejb.SessionSynchronization}->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.stateful.SessionSynchronizationInterceptor"/>
+ </bind>
+ <bind pointcut="execution(public * *->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.entity.ExtendedPersistenceContextPropagationInterceptor"/>
+ </bind>
+
+ <bind pointcut="execution(public * @org.jboss.ejb3.annotation.Clustered->*(..)) AND !execution(public * *->@javax.ejb.Remove(..))">
+ <interceptor-ref name="org.jboss.ejb3.cache.StatefulReplicationInterceptor"/>
+ </bind>
+
+ <bind pointcut="execution(public * *->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.interceptor.EJB3InterceptorsFactory"/>
+ </bind>
+
+ <annotation expr="!class((a)org.jboss.ejb3.annotation.Pool)">
+ @org.jboss.ejb3.annotation.Pool (value="ThreadlocalPool", maxSize=30, timeout=10000)
+ </annotation>
+ <annotation expr="!class((a)org.jboss.ejb3.annotation.JndiBindingPolicy)">
+ @org.jboss.ejb3.annotation.JndiBindingPolicy (policy=org.jboss.ejb3.jndipolicy.impl.PackagingBasedJndiBindingPolicy.class)
+ </annotation>
+ </domain>
+
+ <domain name="Stateful Bean" extends="Base Stateful Bean" inheritBindings="true">
+ <!-- NON Clustered cache configuration -->
+ <annotation expr="!class((a)org.jboss.ejb3.annotation.Cache) AND !class((a)org.jboss.ejb3.annotation.Clustered)">
+ @org.jboss.ejb3.annotation.Cache ("SimpleStatefulCache")
+ </annotation>
+ <annotation expr="!class((a)org.jboss.ejb3.annotation.PersistenceManager) AND !class((a)org.jboss.ejb3.annotation.Clustered)">
+ @org.jboss.ejb3.annotation.PersistenceManager ("StatefulSessionFilePersistenceManager")
+ </annotation>
+ <annotation expr="!class((a)org.jboss.ejb3.annotation.CacheConfig) AND !class((a)org.jboss.ejb3.annotation.Clustered)">
+ @org.jboss.ejb3.annotation.CacheConfig (maxSize=100000, idleTimeoutSeconds=300, removalTimeoutSeconds=0)
+ </annotation>
+
+ <!-- Clustered cache configuration -->
+ <annotation expr="!class((a)org.jboss.ejb3.annotation.Cache) AND class((a)org.jboss.ejb3.annotation.Clustered)">
+ @org.jboss.ejb3.annotation.Cache ("StatefulTreeCache")
+ </annotation>
+ <annotation expr="!class((a)org.jboss.ejb3.annotation.CacheConfig) AND class((a)org.jboss.ejb3.annotation.Clustered)">
+ @org.jboss.ejb3.annotation.CacheConfig (name="jboss.cache:service=EJB3SFSBClusteredCache", maxSize=100000, idleTimeoutSeconds=300, removalTimeoutSeconds=0)
+ </annotation>
+ </domain>
+
+ <domain name="JACC Stateful Bean">
+ <bind pointcut="execution(public * *->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.asynchronous.AsynchronousInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.ENCPropagationInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.security.AuthenticationInterceptorFactory"/>
+ </bind>
+ <bind pointcut="execution(public * @org.jboss.ejb3.annotation.SecurityDomain->*(..))">
+ <interceptor-ref name="JACC Authorization"/>
+ </bind>
+ <bind pointcut="execution(public * *->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.security.RunAsSecurityInterceptorFactory"/>
+ </bind>
+ <bind pointcut="execution(public * @org.jboss.ejb3.annotation.Clustered->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.remoting.ReplicantsManagerInterceptorFactory"/>
+ </bind>
+ <bind pointcut="execution(public * *->@javax.ejb.Remove(..))">
+ <interceptor-ref name="org.jboss.ejb3.stateful.StatefulRemoveFactory"/>
+ </bind>
+ <bind pointcut="execution(public * *->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.stateful.StatefulInstanceInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.tx.TxPropagationInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.tx.TxInterceptorFactory"/>
+ <interceptor-ref name="org.jboss.ejb3.AllowedOperationsInterceptor"/>
+ </bind>
+ <bind pointcut="execution(public * $instanceof{javax.ejb.SessionSynchronization}->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.stateful.SessionSynchronizationInterceptor"/>
+ </bind>
+ <bind pointcut="execution(public * *->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.entity.ExtendedPersistenceContextPropagationInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.interceptor.EJB3InterceptorsFactory"/>
+ </bind>
+
+ <bind pointcut="execution(public * @org.jboss.ejb3.annotation.Clustered->*(..)) AND !execution(public * *->@javax.ejb.Remove(..))">
+ <interceptor-ref name="org.jboss.ejb3.cache.StatefulReplicationInterceptor"/>
+ </bind>
+ <annotation expr="!class((a)org.jboss.ejb3.annotation.Pool)">
+ @org.jboss.ejb3.annotation.Pool (value="ThreadlocalPool", maxSize=30, timeout=10000)
+ </annotation>
+ <annotation expr="!class((a)org.jboss.ejb3.annotation.JndiBindingPolicy)">
+ @org.jboss.ejb3.annotation.JndiBindingPolicy (policy=org.jboss.ejb3.jndipolicy.impl.PackagingBasedJndiBindingPolicy.class)
+ </annotation>
+
+ <!-- NON Clustered cache configuration -->
+ <annotation expr="!class((a)org.jboss.ejb3.annotation.Cache) AND !class((a)org.jboss.ejb3.annotation.Clustered)">
+ @org.jboss.ejb3.annotation.Cache ("SimpleStatefulCache")
+ </annotation>
+ <annotation expr="!class((a)org.jboss.ejb3.annotation.PersistenceManager) AND !class((a)org.jboss.ejb3.annotation.Clustered)">
+ @org.jboss.ejb3.annotation.PersistenceManager ("StatefulSessionFilePersistenceManager")
+ </annotation>
+ <annotation expr="!class((a)org.jboss.ejb3.annotation.CacheConfig) AND !class((a)org.jboss.ejb3.annotation.Clustered)">
+ @org.jboss.ejb3.annotation.CacheConfig (maxSize=100000, idleTimeoutSeconds=300, removalTimeoutSeconds=0)
+ </annotation>
+
+ <!-- Clustered cache configuration -->
+ <annotation expr="!class((a)org.jboss.ejb3.annotation.Cache) AND class((a)org.jboss.ejb3.annotation.Clustered)">
+ @org.jboss.ejb3.annotation.Cache ("StatefulTreeCache")
+ </annotation>
+ <annotation expr="!class((a)org.jboss.ejb3.annotation.CacheConfig) AND class((a)org.jboss.ejb3.annotation.Clustered)">
+ @org.jboss.ejb3.annotation.CacheConfig (name="jboss.cache:service=EJB3SFSBClusteredCache", maxSize=100000, idleTimeoutSeconds=300, removalTimeoutSeconds=0)
+ </annotation>
+ </domain>
+
+ <domain name="Embedded Stateful Bean" extends="Base Stateful Bean" inheritBindings="true">
+ <!-- NON Clustered cache configuration -->
+ <annotation expr="!class((a)org.jboss.ejb3.annotation.Cache)">
+ @org.jboss.ejb3.annotation.Cache ("NoPassivationCache")
+ </annotation>
+ <annotation expr="!class((a)org.jboss.ejb3.annotation.JndiBindingPolicy)">
+ @org.jboss.ejb3.annotation.JndiBindingPolicy (policy=org.jboss.ejb3.jndipolicy.impl.PackagingBasedJndiBindingPolicy.class)
+ </annotation>
+
+ </domain>
+
+ <domain name="Message Driven Bean">
+ <bind pointcut="execution(public * *->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.security.AuthenticationInterceptorFactory"/>
+ <interceptor-ref name="org.jboss.ejb3.security.RunAsSecurityInterceptorFactory"/>
+ </bind>
+ <!-- TODO: Authorization? -->
+ <bind pointcut="execution(public * *->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.stateless.StatelessInstanceInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.tx.TxInterceptorFactory"/>
+ <interceptor-ref name="org.jboss.ejb3.AllowedOperationsInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.interceptor.EJB3InterceptorsFactory"/>
+ </bind>
+ <annotation expr="!class((a)org.jboss.ejb3.annotation.Pool)">
+ @org.jboss.ejb3.annotation.Pool (value="StrictMaxPool", maxSize=15, timeout=10000)
+ </annotation>
+ <annotation expr="!class((a)org.jboss.ejb3.annotation.JndiBindingPolicy)">
+ @org.jboss.ejb3.annotation.JndiBindingPolicy (policy=org.jboss.ejb3.jndipolicy.impl.PackagingBasedJndiBindingPolicy.class)
+ </annotation>
+ </domain>
+
+ <domain name="Consumer Bean">
+ <bind pointcut="execution(public * *->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.security.RunAsSecurityInterceptorFactory"/>
+ </bind>
+ <bind pointcut="execution(public * *->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.stateless.StatelessInstanceInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.tx.TxInterceptorFactory"/>
+ <interceptor-ref name="org.jboss.ejb3.AllowedOperationsInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor"/>
+ </bind>
+ <bind pointcut="execution(public * *->*(..)) AND (has(* *->@org.jboss.ejb3.annotation.CurrentMessage(..)) OR hasfield(* *->@org.jboss.ejb3.annotation.CurrentMessage))">
+ <interceptor-ref name="org.jboss.ejb3.mdb.CurrentMessageInjectorInterceptorFactory"/>
+ </bind>
+ <bind pointcut="execution(public * *->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.interceptor.EJB3InterceptorsFactory"/>
+ </bind>
+ <annotation expr="!class((a)org.jboss.ejb3.annotation.Pool)">
+ @org.jboss.ejb3.annotation.Pool (value="StrictMaxPool", maxSize=15, timeout=10000)
+ </annotation>
+ <annotation expr="!class((a)org.jboss.ejb3.annotation.JndiBindingPolicy)">
+ @org.jboss.ejb3.annotation.JndiBindingPolicy (policy=org.jboss.ejb3.jndipolicy.impl.PackagingBasedJndiBindingPolicy.class)
+ </annotation>
+ </domain>
+
+ <domain name="Service Bean">
+ <bind pointcut="execution(public * *->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.asynchronous.AsynchronousInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.ENCPropagationInterceptor"/>
+ </bind>
+ <bind pointcut="!execution(* *->create()) AND !execution(* *->start()) AND !execution(*->new(..))">
+ <interceptor-ref name="org.jboss.ejb3.security.AuthenticationInterceptorFactory"/>
+ </bind>
+ <bind pointcut="execution(public * @org.jboss.ejb3.annotation.SecurityDomain->*(..))">
+ <interceptor-ref name="Basic Authorization"/>
+ </bind>
+ <bind pointcut="execution(public * *->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.security.RunAsSecurityInterceptorFactory"/>
+ </bind>
+ <bind pointcut="execution(public * *->*(..))">
+ <interceptor-ref name="org.jboss.aspects.tx.TxPropagationInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.tx.TxInterceptorFactory"/>
+ <interceptor-ref name="org.jboss.ejb3.AllowedOperationsInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor"/>
+ </bind>
+ <bind pointcut="execution(public * *->*(..)) AND !execution(* *->create()) AND !execution(* *->start())">
+ <interceptor-ref name="org.jboss.ejb3.interceptor.EJB3InterceptorsFactory"/>
+ </bind>
+ <annotation expr="!class((a)org.jboss.ejb3.annotation.JndiBindingPolicy)">
+ @org.jboss.ejb3.annotation.JndiBindingPolicy (policy=org.jboss.ejb3.jndipolicy.impl.PackagingBasedJndiBindingPolicy.class)
+ </annotation>
+ </domain>
+
+ <domain name="JACC Service Bean">
+ <bind pointcut="execution(public * *->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.asynchronous.AsynchronousInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.ENCPropagationInterceptor"/>
+ </bind>
+ <bind pointcut="!execution(* *->create()) AND !execution(* *->start()) AND !execution(*->new(..))">
+ <interceptor-ref name="org.jboss.ejb3.security.AuthenticationInterceptorFactory"/>
+ </bind>
+ <bind pointcut="execution(public * @org.jboss.ejb3.annotation.SecurityDomain->*(..))">
+ <interceptor-ref name="Basic Authorization"/>
+ </bind>
+ <bind pointcut="execution(public * *->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.security.RunAsSecurityInterceptorFactory"/>
+ </bind>
+ <bind pointcut="execution(public * *->*(..))">
+ <interceptor-ref name="org.jboss.aspects.tx.TxPropagationInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.tx.TxInterceptorFactory"/>
+ <interceptor-ref name="org.jboss.ejb3.AllowedOperationsInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor"/>
+ </bind>
+ <bind pointcut="execution(public * *->*(..)) AND !execution(* *->create()) AND !execution(* *->start())">
+ <interceptor-ref name="org.jboss.ejb3.interceptor.EJB3InterceptorsFactory"/>
+ </bind>
+ <annotation expr="!class((a)org.jboss.ejb3.annotation.JndiBindingPolicy)">
+ @org.jboss.ejb3.annotation.JndiBindingPolicy (policy=org.jboss.ejb3.jndipolicy.impl.PackagingBasedJndiBindingPolicy.class)
+ </annotation>
+ </domain>
+
+</aop>
\ No newline at end of file
Added: branches/JCA/jboss-embedded/src/main/resources/bootstrap/deploy/hsqldb-ds.xml
===================================================================
--- branches/JCA/jboss-embedded/src/main/resources/bootstrap/deploy/hsqldb-ds.xml (rev 0)
+++ branches/JCA/jboss-embedded/src/main/resources/bootstrap/deploy/hsqldb-ds.xml 2009-12-19 03:37:05 UTC (rev 1684)
@@ -0,0 +1,108 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- The Hypersonic embedded database JCA connection factory config -->
+
+<!-- $Id: hsqldb-ds.xml 39791 2006-01-10 18:14:42Z dimitris $ -->
+
+<datasources>
+ <local-tx-datasource>
+
+ <!-- The jndi name of the DataSource, it is prefixed with java:/ -->
+ <!-- Datasources are not available outside the virtual machine -->
+ <jndi-name>DefaultDS</jndi-name>
+
+ <!-- For server mode db, allowing other processes to use hsqldb over tcp.
+ This requires the org.jboss.jdbc.HypersonicDatabase mbean.
+ <connection-url>jdbc:hsqldb:hsql://${jboss.bind.address}:1701</connection-url>
+ -->
+ <!-- For totally in-memory db, not saved when jboss stops.
+ The org.jboss.jdbc.HypersonicDatabase mbean is required for proper db shutdown
+ <connection-url>jdbc:hsqldb:.</connection-url>
+ -->
+ <!-- For in-process persistent db, saved when jboss stops.
+ The org.jboss.jdbc.HypersonicDatabase mbean is required for proper db shutdown
+ -->
+ <connection-url>jdbc:hsqldb:${jboss.server.data.dir}${/}hypersonic${/}localDB</connection-url>
+
+ <!-- The driver class -->
+ <driver-class>org.hsqldb.jdbcDriver</driver-class>
+
+ <!-- The login and password -->
+ <user-name>sa</user-name>
+ <password></password>
+
+ <!--example of how to specify class that determines if exception means connection should be destroyed-->
+ <!--exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.DummyExceptionSorter</exception-sorter-class-name-->
+
+ <!-- this will be run before a managed connection is removed from the pool for use by a client-->
+ <!--<check-valid-connection-sql>select * from something</check-valid-connection-sql> -->
+
+ <!-- The minimum connections in a pool/sub-pool. Pools are lazily constructed on first use -->
+ <min-pool-size>0</min-pool-size>
+
+ <!-- The maximum connections in a pool/sub-pool -->
+ <max-pool-size>20</max-pool-size>
+
+ <!-- The time before an unused connection is destroyed -->
+ <!-- NOTE: This is the check period. It will be destroyed somewhere between 1x and 2x this timeout after last use -->
+ <!-- TEMPORARY FIX! - Disable idle connection removal, HSQLDB has a problem with not reaping threads on closed connections -->
+ <idle-timeout-minutes>0</idle-timeout-minutes>
+
+ <!-- sql to call when connection is created
+ <new-connection-sql>some arbitrary sql</new-connection-sql>
+ -->
+
+ <!-- sql to call on an existing pooled connection when it is obtained from pool
+ <check-valid-connection-sql>some arbitrary sql</check-valid-connection-sql>
+ -->
+
+ <!-- example of how to specify a class that determines a connection is valid before it is handed out from the pool
+ <valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.DummyValidConnectionChecker</valid-connection-checker-class-name>
+ -->
+
+ <!-- Whether to check all statements are closed when the connection is returned to the pool,
+ this is a debugging feature that should be turned off in production -->
+ <track-statements/>
+
+ <!-- Use the getConnection(user, pw) for logins
+ <application-managed-security/>
+ -->
+
+ <!-- Use the security domain defined in conf/login-config.xml -->
+ <security-domain>HsqlDbRealm</security-domain>
+
+ <!-- Use the security domain defined in conf/login-config.xml or the
+ getConnection(user, pw) for logins. The security domain takes precedence.
+ <security-domain-and-application>HsqlDbRealm</security-domain-and-application>
+ -->
+
+ <!-- HSQL DB benefits from prepared statement caching -->
+ <prepared-statement-cache-size>32</prepared-statement-cache-size>
+
+ <!-- When using in-process (standalone) mode -->
+ <depends>jboss:service=Hypersonic,database=localDB</depends>
+ <!-- Uncomment when using hsqldb in server mode
+ <depends>jboss:service=Hypersonic</depends>
+ -->
+ </local-tx-datasource>
+
+ <!-- Uncomment if you want hsqldb accessed over tcp (server mode)
+ <mbean code="org.jboss.jdbc.HypersonicDatabase"
+ name="jboss:service=Hypersonic">
+ <attribute name="Port">1701</attribute>
+ <attribute name="BindAddress">${jboss.bind.address}</attribute>
+ <attribute name="Silent">true</attribute>
+ <attribute name="Database">default</attribute>
+ <attribute name="Trace">false</attribute>
+ <attribute name="No_system_exit">true</attribute>
+ </mbean>
+ -->
+
+ <!-- For hsqldb accessed from jboss only, in-process (standalone) mode -->
+ <mbean code="org.jboss.jdbc.HypersonicDatabase"
+ name="jboss:service=Hypersonic,database=localDB">
+ <attribute name="Database">localDB</attribute>
+ <attribute name="InProcessMode">true</attribute>
+ </mbean>
+
+</datasources>
Added: branches/JCA/jboss-embedded/src/main/resources/bootstrap/deploy/jboss-local-jdbc.rar/META-INF/ra.xml
===================================================================
--- branches/JCA/jboss-embedded/src/main/resources/bootstrap/deploy/jboss-local-jdbc.rar/META-INF/ra.xml (rev 0)
+++ branches/JCA/jboss-embedded/src/main/resources/bootstrap/deploy/jboss-local-jdbc.rar/META-INF/ra.xml 2009-12-19 03:37:05 UTC (rev 1684)
@@ -0,0 +1,158 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- $Id: ra.xml 62224 2007-04-10 16:23:42Z vicky.kak(a)jboss.com $ -->
+
+<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">
+
+ <description>JBoss LocalTransaction JDBC Wrapper Resource Adapter</description>
+ <display-name>JBoss LocalTransaction JDBC Wrapper</display-name>
+
+ <vendor-name>JBoss, Inc</vendor-name>
+ <eis-type>JDBC 3.0 Relational Database</eis-type>
+ <resourceadapter-version>5.0</resourceadapter-version>
+
+ <license>
+ <description>
+ JBoss, Home of Professional Open Source
+ Copyright 2005, JBoss Inc., and individual contributors as indicated
+ by the @authors tag. See the copyright.txt 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.jboss.resource.deployment.DummyResourceAdapter</resourceadapter-class>
+
+ <outbound-resourceadapter>
+ <connection-definition>
+ <managedconnectionfactory-class>org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory</managedconnectionfactory-class>
+ <config-property>
+ <description>The jdbc driver class.</description>
+ <config-property-name>DriverClass</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ </config-property>
+ <config-property>
+ <description>The jdbc connection url class.</description>
+ <config-property-name>ConnectionURL</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ </config-property>
+ <config-property>
+ <description>The jdbc connection url delimeter.</description>
+ <config-property-name>URLDelimiter</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ </config-property>
+ <config-property>
+ <description>The configurable URLSelectorStrategy class name.</description>
+ <config-property-name>UrlSelectorStrategyClassName</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ </config-property>
+ <config-property>
+ <description>The default transaction isolation of the connections.</description>
+ <config-property-name>TransactionIsolation</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ </config-property>
+ <config-property>
+ <description>The number of cached prepared statements per connection.</description>
+ <config-property-name>PreparedStatementCacheSize</config-property-name>
+ <config-property-type>java.lang.Integer</config-property-type>
+ </config-property>
+ <config-property>
+ <description>Whether to share prepared statements.</description>
+ <config-property-name>SharePreparedStatements</config-property-name>
+ <config-property-type>java.lang.Boolean</config-property-type>
+ </config-property>
+ <config-property>
+ <description>The user name to connect to the database.</description>
+ <config-property-name>UserName</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ </config-property>
+ <config-property>
+ <description>The password to connect to the database.</description>
+ <config-property-name>Password</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ </config-property>
+ <config-property>
+ <description>Connection properties for the database.</description>
+ <config-property-name>ConnectionProperties</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ </config-property>
+ <config-property>
+ <description>An SQL statement to be executed when a new connection is created as auxillary setup.</description>
+ <config-property-name>NewConnectionSQL</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ </config-property>
+ <config-property>
+ <description>An SQL statement that may be executed when a managed connection is taken out of the pool and is about to be given to a client: the purpose is to verify that the connection still works.</description>
+ <config-property-name>CheckValidConnectionSQL</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ </config-property>
+ <config-property>
+ <description>The fully qualified name of a class implementing org.jboss.resource.adapter.jdbc.ValidConnectionChecker that can determine for a particular vender db when a connection is valid.</description>
+ <config-property-name>ValidConnectionCheckerClassName</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ </config-property>
+ <config-property>
+ <description>The fully qualified name of a class implementing org.jboss.resource.adapter.jdbc.ExceptionSorter that can determine for a particular vender db which exceptions are fatal and mean a connection should be discarded.</description>
+ <config-property-name>ExceptionSorterClassName</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ </config-property>
+ <config-property>
+ <description>The fully qualified name of a class implementing org.jboss.resource.adapter.jdbc.StaleConnectionChecker that can determine for a particular vender db when a connection is stale.</description>
+ <config-property-name>StaleConnectionCheckerClassName</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ </config-property>
+ <config-property>
+ <description>Whether to track unclosed statements - false/true/nowarn</description>
+ <config-property-name>TrackStatements</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ </config-property>
+ <config-property>
+ <description>Whether to validate the connection on the ManagedConnectionFactory.matchManagedConnection method</description>
+ <config-property-name>ValidateOnMatch</config-property-name>
+ <config-property-type>java.lang.Boolean</config-property-type>
+ </config-property>
+ <config-property>
+ <description>Whether to set the query timeout based on the transaction timeout</description>
+ <config-property-name>TransactionQueryTimeout</config-property-name>
+ <config-property-type>java.lang.Boolean</config-property-type>
+ </config-property>
+ <config-property>
+ <description>A configured query timeout</description>
+ <config-property-name>QueryTimeout</config-property-name>
+ <config-property-type>java.lang.Integer</config-property-type>
+ </config-property>
+ <connectionfactory-interface>javax.sql.DataSource</connectionfactory-interface>
+ <connectionfactory-impl-class>org.jboss.resource.adapter.jdbc.WrapperDataSource</connectionfactory-impl-class>
+ <connection-interface>java.sql.Connection</connection-interface>
+ <connection-impl-class>org.jboss.resource.adapter.jdbc.WrappedConnection</connection-impl-class>
+ </connection-definition>
+ <transaction-support>LocalTransaction</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/jboss-embedded/src/main/resources/bootstrap/deploy/jboss-xa-jdbc.rar
===================================================================
(Binary files differ)
Property changes on: branches/JCA/jboss-embedded/src/main/resources/bootstrap/deploy/jboss-xa-jdbc.rar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: branches/JCA/jboss-embedded/src/main/resources/bootstrap/deploy/jms-ra.rar
===================================================================
(Binary files differ)
Property changes on: branches/JCA/jboss-embedded/src/main/resources/bootstrap/deploy/jms-ra.rar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: branches/JCA/jboss-embedded/src/main/resources/bootstrap/deploy/messaging/connection-factories-service.xml
===================================================================
--- branches/JCA/jboss-embedded/src/main/resources/bootstrap/deploy/messaging/connection-factories-service.xml (rev 0)
+++ branches/JCA/jboss-embedded/src/main/resources/bootstrap/deploy/messaging/connection-factories-service.xml 2009-12-19 03:37:05 UTC (rev 1684)
@@ -0,0 +1,149 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ Messaging Connection Factories deployment descriptor.
+
+ $Id: connection-factories-service.xml 3201 2007-10-19 10:39:50Z timfox $
+ -->
+
+<server>
+
+ <!-- The default connection factory does not support automatic failover or load balancing-
+ this is so we can maintain compatiblity with applications written for JBoss MQ which use this
+ connection factory.
+ -->
+ <mbean code="org.jboss.jms.server.connectionfactory.ConnectionFactory"
+ name="jboss.messaging.connectionfactory:service=ConnectionFactory"
+ xmbean-dd="xmdesc/ConnectionFactory-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ <depends optional-attribute-name="Connector">jboss.messaging:service=Connector,transport=bisocket</depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+
+ <attribute name="JNDIBindings">
+ <bindings>
+ <binding>/ConnectionFactory</binding>
+ <binding>/XAConnectionFactory</binding>
+ <binding>java:/ConnectionFactory</binding>
+ <binding>java:/XAConnectionFactory</binding>
+ </bindings>
+ </attribute>
+ </mbean>
+
+ <!-- A clustered connection factory that supports automatic failover and load balancing of created
+ connections.
+ This factory is not suitable to be used by MDBs.
+ -->
+ <mbean code="org.jboss.jms.server.connectionfactory.ConnectionFactory"
+ name="jboss.messaging.connectionfactory:service=ClusteredConnectionFactory"
+ xmbean-dd="xmdesc/ConnectionFactory-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ <depends optional-attribute-name="Connector">jboss.messaging:service=Connector,transport=bisocket</depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+
+ <attribute name="JNDIBindings">
+ <bindings>
+ <binding>/ClusteredConnectionFactory</binding>
+ <binding>/ClusteredXAConnectionFactory</binding>
+ <binding>java:/ClusteredConnectionFactory</binding>
+ <binding>java:/ClusteredXAConnectionFactory</binding>
+ </bindings>
+ </attribute>
+
+ <attribute name="SupportsFailover">true</attribute>
+ <attribute name="SupportsLoadBalancing">true</attribute>
+ </mbean>
+
+ <!-- A connection factory with no JNDI bindings that is used in clustering to create the connections that
+ pull messages from one node to another
+ -->
+ <mbean code="org.jboss.jms.server.connectionfactory.ConnectionFactory"
+ name="jboss.messaging.connectionfactory:service=ClusterPullConnectionFactory"
+ xmbean-dd="xmdesc/ConnectionFactory-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ <depends optional-attribute-name="Connector">jboss.messaging:service=Connector,transport=bisocket</depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+ <attribute name="SupportsFailover">false</attribute>
+ <attribute name="SupportsLoadBalancing">false</attribute>
+ </mbean>
+
+ <!-- An example connection factory with all attributes shown
+
+ <mbean code="org.jboss.jms.server.connectionfactory.ConnectionFactory"
+ name="jboss.messaging.connectionfactory:service=MyExampleConnectionFactory"
+ xmbean-dd="xmdesc/ConnectionFactory-xmbean.xml">
+
+ <constructor>
+
+ <!- - You can specify the default Client ID to use for connections created using this factory - ->
+
+ <arg type="java.lang.String" value="MyClientID"/>
+
+ </constructor>
+
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+
+ <!- - The transport to use - can be bisocket, sslbisocket or http - ->
+
+ <depends optional-attribute-name="Connector">jboss.messaging:service=Connector,transport=http</depends>
+
+ <depends>jboss.messaging:service=PostOffice</depends>
+
+ <!- - PrefetchSize determines the approximate maximum number of messages the client consumer will buffer locally - ->
+
+ <attribute name="PrefetchSize">150</attribute>
+
+ <!- - Paging params to be used for temporary queues - ->
+
+ <attribute name="DefaultTempQueueFullSize">200000</attribute>
+
+ <attribute name="DefaultTempQueuePageSizeSize">2000</attribute>
+
+ <attribute name="DefaultTempQueueDownCacheSize">2000</attribute>
+
+ <!- - The batch size to use when using the DUPS_OK_ACKNOWLEDGE acknowledgement mode - ->
+
+ <attribute name="DupsOKBatchSize">5000</attribute>
+
+ <!- - Does this connection factory support automatic failover? - ->
+
+ <attribute name="SupportsFailover">false</attribute>
+
+ <!- - Does this connection factory support automatic client side load balancing? - ->
+
+ <attribute name="SupportsLoadBalancing">false</attribute>
+
+ <!- - The class name of the factory used to create the load balancing policy to use on the client side - ->
+
+ <attribute name="LoadBalancingFactory">org.jboss.jms.client.plugin.RoundRobinLoadBalancingFactory</attribute>
+
+ <!- - Whether we should be strict TCK compliant, i.e. how we deal with foreign messages, defaults to false- ->
+
+ <attribute name="StrictTck">false</attribute>
+
+ <!- - Disable JBoss Remoting Connector sanity checks - There is rarely a good reason to set this to true - ->
+
+ <attribute name="DisableRemotingChecks">false</attribute>
+
+ <!- - The connection factory will be bound in the following places in JNDI - ->
+
+ <attribute name="JNDIBindings">
+
+ <bindings>
+
+ <binding>/acme/MyExampleConnectionFactory</binding>
+
+ <binding>/acme/MyExampleConnectionFactoryDupe</binding>
+
+ <binding>java:/xyz/CF1</binding>
+
+ <binding>java:/connectionfactories/acme/connection_factory</binding>
+
+ </bindings>
+
+ </attribute>
+
+ </mbean>
+
+ -->
+
+</server>
\ No newline at end of file
Added: branches/JCA/jboss-embedded/src/main/resources/bootstrap/deploy/messaging/destinations-service.xml
===================================================================
--- branches/JCA/jboss-embedded/src/main/resources/bootstrap/deploy/messaging/destinations-service.xml (rev 0)
+++ branches/JCA/jboss-embedded/src/main/resources/bootstrap/deploy/messaging/destinations-service.xml 2009-12-19 03:37:05 UTC (rev 1684)
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ Messaging Destinations deployment descriptor.
+
+ $Id: destinations-service.xml 64130 2007-07-18 23:21:27Z clebert.suconic(a)jboss.com $
+ -->
+
+<server>
+
+ <!--
+ The Default Dead Letter Queue. This destination is a dependency of an EJB MDB container.
+ -->
+
+ <mbean code="org.jboss.jms.server.destination.QueueService"
+ name="jboss.messaging.destination:service=Queue,name=DLQ"
+ xmbean-dd="xmdesc/Queue-xmbean.xml">
+ <annotation>@org.jboss.system.deployers.managed.ManagementObjectClass(code=org.jboss.jms.server.destination.QueueServiceMO)</annotation>
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+ </mbean>
+
+ <!--
+ The Default Expiry Queue.
+ -->
+
+ <mbean code="org.jboss.jms.server.destination.QueueService"
+ name="jboss.messaging.destination:service=Queue,name=ExpiryQueue"
+ xmbean-dd="xmdesc/Queue-xmbean.xml">
+ <annotation>@org.jboss.system.deployers.managed.ManagementObjectClass(code=org.jboss.jms.server.destination.QueueServiceMO)</annotation>
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+ </mbean>
+
+
+</server>
\ No newline at end of file
Added: branches/JCA/jboss-embedded/src/main/resources/bootstrap/deploy/messaging/hsqldb-persistence-service.xml
===================================================================
--- branches/JCA/jboss-embedded/src/main/resources/bootstrap/deploy/messaging/hsqldb-persistence-service.xml (rev 0)
+++ branches/JCA/jboss-embedded/src/main/resources/bootstrap/deploy/messaging/hsqldb-persistence-service.xml 2009-12-19 03:37:05 UTC (rev 1684)
@@ -0,0 +1,104 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ Hypersonic persistence deployment descriptor.
+
+ DO NOT USE HYPERSONIC IN PRODUCTION or in a clustered environment- Hypersonic does not have transaction isolation
+
+ $Id: hsqldb-persistence-service.xml 64152 2007-07-20 05:03:00Z clebert.suconic(a)jboss.com $
+ -->
+
+<server>
+
+ <!-- Persistence Manager MBean configuration
+ ======================================= -->
+
+ <mbean code="org.jboss.messaging.core.jmx.JDBCPersistenceManagerService"
+ name="jboss.messaging:service=PersistenceManager"
+ xmbean-dd="xmdesc/JDBCPersistenceManager-xmbean.xml">
+
+ <depends>jboss.jca:service=DataSourceBinding,name=DefaultDS</depends>
+
+ <depends optional-attribute-name="TransactionManager">jboss:service=TransactionManager</depends>
+
+ <!-- The datasource to use for the persistence manager -->
+
+ <attribute name="DataSource">java:/DefaultDS</attribute>
+
+ <!-- If true will attempt to create tables and indexes on every start-up -->
+
+ <attribute name="CreateTablesOnStartup">true</attribute>
+
+ <!-- If true then will use JDBC batch updates -->
+
+ <attribute name="UsingBatchUpdates">false</attribute>
+
+ <!-- The maximum number of parameters to include in a prepared statement -->
+
+ <attribute name="MaxParams">500</attribute>
+ </mbean>
+
+ <!-- Messaging Post Office MBean configuration
+ ========================================= -->
+
+ <mbean code="org.jboss.messaging.core.jmx.MessagingPostOfficeService"
+ name="jboss.messaging:service=PostOffice"
+ xmbean-dd="xmdesc/MessagingPostOffice-xmbean.xml">
+
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+
+ <depends>jboss.jca:service=DataSourceBinding,name=DefaultDS</depends>
+
+ <depends optional-attribute-name="TransactionManager">jboss:service=TransactionManager</depends>
+
+ <!-- The name of the post office -->
+
+ <attribute name="PostOfficeName">JMS post office</attribute>
+
+ <!-- The datasource used by the post office to access it's binding information -->
+
+ <attribute name="DataSource">java:/DefaultDS</attribute>
+
+ <!-- If true will attempt to create tables and indexes on every start-up -->
+
+ <attribute name="CreateTablesOnStartup">true</attribute>
+
+ <!-- This post office is NON CLUSTERED - do not use clustering with Hypersonic!! -->
+
+ <attribute name="Clustered">false</attribute>
+ </mbean>
+
+ <!-- Messaging JMS User Manager MBean config
+ ======================================= -->
+
+ <mbean code="org.jboss.jms.server.plugin.JDBCJMSUserManagerService"
+ name="jboss.messaging:service=JMSUserManager"
+ xmbean-dd="xmdesc/JMSUserManager-xmbean.xml">
+
+ <depends>jboss.jca:service=DataSourceBinding,name=DefaultDS</depends>
+
+ <depends optional-attribute-name="TransactionManager">jboss:service=TransactionManager</depends>
+
+ <attribute name="DataSource">java:/DefaultDS</attribute>
+
+ <attribute name="CreateTablesOnStartup">true</attribute>
+
+ <attribute name="SqlProperties"><![CDATA[
+POPULATE.TABLES.1 = INSERT INTO JBM_USER (USER_ID, PASSWD) VALUES ('guest', 'guest')
+POPULATE.TABLES.2 = INSERT INTO JBM_USER (USER_ID, PASSWD) VALUES ('j2ee', 'j2ee')
+POPULATE.TABLES.3 = INSERT INTO JBM_USER (USER_ID, PASSWD, CLIENTID) VALUES ('john', 'needle', 'DurableSubscriberExample')
+POPULATE.TABLES.4 = INSERT INTO JBM_USER (USER_ID, PASSWD) VALUES ('nobody', 'nobody')
+POPULATE.TABLES.5 = INSERT INTO JBM_USER (USER_ID, PASSWD) VALUES ('dynsub', 'dynsub')
+POPULATE.TABLES.6 = INSERT INTO JBM_ROLE (ROLE_ID, USER_ID) VALUES ('guest','guest')
+POPULATE.TABLES.7 = INSERT INTO JBM_ROLE (ROLE_ID, USER_ID) VALUES ('j2ee','guest')
+POPULATE.TABLES.8 = INSERT INTO JBM_ROLE (ROLE_ID, USER_ID) VALUES ('john','guest')
+POPULATE.TABLES.9 = INSERT INTO JBM_ROLE (ROLE_ID, USER_ID) VALUES ('subscriber','john')
+POPULATE.TABLES.10 = INSERT INTO JBM_ROLE (ROLE_ID, USER_ID) VALUES ('publisher','john')
+POPULATE.TABLES.11 = INSERT INTO JBM_ROLE (ROLE_ID, USER_ID) VALUES ('publisher','dynsub')
+POPULATE.TABLES.12 = INSERT INTO JBM_ROLE (ROLE_ID, USER_ID) VALUES ('durpublisher','john')
+POPULATE.TABLES.13 = INSERT INTO JBM_ROLE (ROLE_ID, USER_ID) VALUES ('durpublisher','dynsub')
+POPULATE.TABLES.14 = INSERT INTO JBM_ROLE (ROLE_ID, USER_ID) VALUES ('noacc','nobody')
+ ]]></attribute>
+ </mbean>
+
+</server>
\ No newline at end of file
Added: branches/JCA/jboss-embedded/src/main/resources/bootstrap/deploy/messaging/jms-ds.xml
===================================================================
--- branches/JCA/jboss-embedded/src/main/resources/bootstrap/deploy/messaging/jms-ds.xml (rev 0)
+++ branches/JCA/jboss-embedded/src/main/resources/bootstrap/deploy/messaging/jms-ds.xml 2009-12-19 03:37:05 UTC (rev 1684)
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<connection-factories>
+
+ <!-- ==================================================================== -->
+ <!-- JMS Stuff -->
+ <!-- ==================================================================== -->
+
+ <!--
+ The JMS provider loader. Currently pointing to a non-clustered ConnectionFactory. Need to
+ be replaced with a clustered non-load-balanced ConnectionFactory when it becomes available.
+ See http://jira.jboss.org/jira/browse/JBMESSAGING-843.
+ -->
+ <mbean code="org.jboss.jms.jndi.JMSProviderLoader"
+ name="jboss.messaging:service=JMSProviderLoader,name=JMSProvider">
+ <attribute name="ProviderName">DefaultJMSProvider</attribute>
+ <attribute name="ProviderAdapterClass">org.jboss.jms.jndi.JNDIProviderAdapter</attribute>
+ <attribute name="FactoryRef">java:/XAConnectionFactory</attribute>
+ <attribute name="QueueFactoryRef">java:/XAConnectionFactory</attribute>
+ <attribute name="TopicFactoryRef">java:/XAConnectionFactory</attribute>
+ </mbean>
+
+ <!-- JMS XA Resource adapter, use this to get transacted JMS in beans -->
+ <tx-connection-factory>
+ <jndi-name>JmsXA</jndi-name>
+ <xa-transaction/>
+ <rar-name>jms-ra.rar</rar-name>
+ <connection-definition>org.jboss.resource.adapter.jms.JmsConnectionFactory</connection-definition>
+ <config-property name="SessionDefaultType" type="java.lang.String">javax.jms.Topic</config-property>
+ <config-property name="JmsProviderAdapterJNDI" type="java.lang.String">java:/DefaultJMSProvider</config-property>
+ <max-pool-size>20</max-pool-size>
+ <security-domain-and-application>JmsXARealm</security-domain-and-application>
+ <depends>jboss.messaging:service=ServerPeer</depends>
+ </tx-connection-factory>
+
+</connection-factories>
Added: branches/JCA/jboss-embedded/src/main/resources/bootstrap/deploy/messaging/legacy-service.xml
===================================================================
--- branches/JCA/jboss-embedded/src/main/resources/bootstrap/deploy/messaging/legacy-service.xml (rev 0)
+++ branches/JCA/jboss-embedded/src/main/resources/bootstrap/deploy/messaging/legacy-service.xml 2009-12-19 03:37:05 UTC (rev 1684)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Messaging Destinations deployment descriptor.
+
+ $Id: destinations-service.xml 927 2006-05-03 01:51:14Z ovidiu $
+-->
+
+<server>
+ <mbean code="org.jboss.mq.server.jmx.DummyDestMgr"
+ name="jboss.mq:service=DestinationManager">
+ <depends>jboss.messaging:service=ServerPeer</depends>
+ </mbean>
+ <mbean code="org.jboss.mq.server.jmx.DummySecurityMgr"
+ name="jboss.mq:service=SecurityManager" />
+
+</server>
Added: branches/JCA/jboss-embedded/src/main/resources/bootstrap/deploy/messaging/messaging-service.xml
===================================================================
--- branches/JCA/jboss-embedded/src/main/resources/bootstrap/deploy/messaging/messaging-service.xml (rev 0)
+++ branches/JCA/jboss-embedded/src/main/resources/bootstrap/deploy/messaging/messaging-service.xml 2009-12-19 03:37:05 UTC (rev 1684)
@@ -0,0 +1,114 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ The JBoss Messaging service deployment descriptor.
+
+ $Id: messaging-service.xml 3204 2007-10-19 12:42:17Z timfox $
+ -->
+
+<server>
+
+ <!-- ServerPeer MBean configuration
+ ============================== -->
+
+ <mbean code="org.jboss.jms.server.ServerPeer"
+ name="jboss.messaging:service=ServerPeer"
+ xmbean-dd="xmdesc/ServerPeer-xmbean.xml">
+
+ <!-- The unique id of the server peer - in a cluster each node MUST have a unique value - must be an integer -->
+
+ <attribute name="ServerPeerID">0</attribute>
+
+ <!-- The default JNDI context to use for queues when they are deployed without specifying one -->
+
+ <attribute name="DefaultQueueJNDIContext">/queue</attribute>
+
+ <!-- The default JNDI context to use for topics when they are deployed without specifying one -->
+
+ <attribute name="DefaultTopicJNDIContext">/topic</attribute>
+
+ <attribute name="PostOffice">jboss.messaging:service=PostOffice</attribute>
+
+ <!-- The JAAS security domain to use for JBoss Messaging -->
+
+ <attribute name="SecurityDomain">java:/jaas/messaging</attribute>
+
+ <!-- The default security configuration to apply to destinations - this can be overridden on a per destination basis -->
+
+ <attribute name="DefaultSecurityConfig">
+ <security>
+ <role name="Administrator" read="true" write="true" create="true"/>
+ <role name="Manager" read="true" write="true" create="true"/>
+ <role name="guest" read="true" write="true" create="true"/>
+ </security>
+ </attribute>
+
+ <!-- The default Dead Letter Queue (DLQ) to use for destinations.
+ This can be overridden on a per destinatin basis -->
+
+ <attribute name="DefaultDLQ">jboss.messaging.destination:service=Queue,name=DLQ</attribute>
+
+ <!-- The default maximum number of times to attempt delivery of a message before sending to the DLQ (if configured).
+ This can be overridden on a per destinatin basis -->
+
+ <attribute name="DefaultMaxDeliveryAttempts">10</attribute>
+
+ <!-- The default Expiry Queue to use for destinations. This can be overridden on a per destinatin basis -->
+
+ <attribute name="DefaultExpiryQueue">jboss.messaging.destination:service=Queue,name=ExpiryQueue</attribute>
+
+ <!-- The default redelivery delay to impose. This can be overridden on a per destination basis -->
+
+ <attribute name="DefaultRedeliveryDelay">0</attribute>
+
+ <!-- The periodicity of the message counter manager enquiring on queues for statistics -->
+
+ <attribute name="MessageCounterSamplePeriod">5000</attribute>
+
+ <!-- The maximum amount of time for a client to wait for failover to start on the server side after
+ it has detected failure -->
+
+ <attribute name="FailoverStartTimeout">60000</attribute>
+
+ <!-- The maximum amount of time for a client to wait for failover to complete on the server side after
+ it has detected failure -->
+
+ <attribute name="FailoverCompleteTimeout">300000</attribute>
+
+ <attribute name="StrictTck">false</attribute>
+
+ <!-- The maximum number of days results to maintain in the message counter history -->
+
+ <attribute name="DefaultMessageCounterHistoryDayLimit">-1</attribute>
+
+ <!-- The name of the connection factory to use for creating connections between nodes to pull messages -->
+
+ <attribute name="ClusterPullConnectionFactoryName">jboss.messaging.connectionfactory:service=ClusterPullConnectionFactory</attribute>
+
+ <!-- Use XA when pulling persistent messages from a remote node to this one. -->
+
+ <attribute name="UseXAForMessagePull">false</attribute>
+
+ <!-- When redistributing messages in the cluster. Do we need to preserve the order of messages received
+ by a particular consumer from a particular producer? -->
+
+ <attribute name="DefaultPreserveOrdering">false</attribute>
+
+ <!-- Max. time to hold previously delivered messages back waiting for clients to reconnect after failover -->
+
+ <attribute name="RecoverDeliveriesTimeout">300000</attribute>
+
+ <!-- The password used by the message sucker connections to create connections.
+ THIS SHOULD ALWAYS BE CHANGED AT INSTALL TIME TO SECURE SYSTEM
+ <attribute name="SuckerPassword"></attribute>
+ -->
+
+ <depends optional-attribute-name="PersistenceManager">jboss.messaging:service=PersistenceManager</depends>
+
+ <depends optional-attribute-name="JMSUserManager">jboss.messaging:service=JMSUserManager</depends>
+
+ <depends>jboss.messaging:service=Connector,transport=bisocket</depends>
+
+ </mbean>
+
+</server>
Added: branches/JCA/jboss-embedded/src/main/resources/bootstrap/deploy/messaging/remoting-service.xml
===================================================================
--- branches/JCA/jboss-embedded/src/main/resources/bootstrap/deploy/messaging/remoting-service.xml (rev 0)
+++ branches/JCA/jboss-embedded/src/main/resources/bootstrap/deploy/messaging/remoting-service.xml 2009-12-19 03:37:05 UTC (rev 1684)
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ Standard bisocket-based Remoting service deployment descriptor.
+
+ $Id: remoting-bisocket-service.xml 3237 2007-10-21 15:27:51Z timfox $
+ -->
+
+<server>
+
+ <!-- Standard bisocket connector - the bisocket transport only opens connection from client->server
+ so can be used with firewalls where only outgoing connections are allowed.
+ For examples of HTTP and SSL transports see docs/examples -->
+ <mbean code="org.jboss.remoting.transport.Connector"
+ name="jboss.messaging:service=Connector,transport=bisocket"
+ display-name="Bisocket Transport Connector">
+ <attribute name="Configuration">
+ <config>
+ <invoker transport="bisocket">
+
+ <!-- There should be no reason to change these parameters - warning!
+ Changing them may stop JBoss Messaging working correctly -->
+ <attribute name="marshaller" isParam="true">org.jboss.jms.wireformat.JMSWireFormat</attribute>
+ <attribute name="unmarshaller" isParam="true">org.jboss.jms.wireformat.JMSWireFormat</attribute>
+ <attribute name="dataType" isParam="true">jms</attribute>
+ <attribute name="socket.check_connection" isParam="true">false</attribute>
+ <attribute name="timeout" isParam="true">0</attribute>
+ <attribute name="serverBindAddress">${jboss.bind.address}</attribute>
+ <attribute name="serverBindPort">4457</attribute>
+ <attribute name="clientSocketClass" isParam="true">org.jboss.jms.client.remoting.ClientSocketWrapper</attribute>
+ <attribute name="serverSocketClass">org.jboss.jms.server.remoting.ServerSocketWrapper</attribute>
+ <attribute name="numberOfCallRetries" isParam="true">1</attribute>
+ <attribute name="pingFrequency" isParam="true">214748364</attribute>
+ <attribute name="pingWindowFactor" isParam="true">10</attribute>
+ <attribute name="onewayThreadPool">org.jboss.jms.server.remoting.DirectThreadPool</attribute>
+ <!-- End immutable parameters -->
+
+ <!-- Periodicity of client pings. Server window by default is twice this figure -->
+ <attribute name="clientLeasePeriod" isParam="true">10000</attribute>
+
+ <!-- Number of seconds to wait for a connection in the client pool to become free -->
+ <attribute name="numberOfRetries" isParam="true">10</attribute>
+
+ <!-- Max Number of connections in client pool. This should be significantly higher than
+ the max number of sessions/consumers you expect -->
+ <attribute name="clientMaxPoolSize" isParam="true">200</attribute>
+
+ <!-- Use these parameters to specify values for binding and connecting control connections to
+ work with your firewall/NAT configuration
+ <attribute name="secondaryBindPort">xyz</attribute>
+ <attribute name="secondaryConnectPort">abc</attribute>
+ -->
+
+ </invoker>
+ <handlers>
+ <handler subsystem="JMS">org.jboss.jms.server.remoting.JMSServerInvocationHandler</handler>
+ </handlers>
+ </config>
+ </attribute>
+ </mbean>
+
+</server>
Added: branches/JCA/jboss-embedded/src/main/resources/bootstrap/deploy/remoting-service.xml
===================================================================
--- branches/JCA/jboss-embedded/src/main/resources/bootstrap/deploy/remoting-service.xml (rev 0)
+++ branches/JCA/jboss-embedded/src/main/resources/bootstrap/deploy/remoting-service.xml 2009-12-19 03:37:05 UTC (rev 1684)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Connector for both EJB3 and JNDI
+-->
+<server>
+ <mbean code="org.jboss.remoting.transport.Connector"
+ name="jboss.remoting:type=Connector,name=DefaultEjb3Connector,handler=ejb3">
+ <attribute name="InvokerLocator">socket://${jboss.bind.address}:3873</attribute>
+ <attribute name="Configuration">
+ <handlers>
+ <handler subsystem="AOP">org.jboss.aspects.remoting.AOPRemotingInvocationHandler</handler>
+ </handlers>
+ </attribute>
+ </mbean>
+</server>
\ No newline at end of file
Added: branches/JCA/jboss-embedded/src/main/resources/bootstrap/deployers/aspect-deployer-beans.xml
===================================================================
--- branches/JCA/jboss-embedded/src/main/resources/bootstrap/deployers/aspect-deployer-beans.xml (rev 0)
+++ branches/JCA/jboss-embedded/src/main/resources/bootstrap/deployers/aspect-deployer-beans.xml 2009-12-19 03:37:05 UTC (rev 1684)
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ Aspect Deployer
+-->
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+ <bean name="AOPJBossIntegration" class="org.jboss.aop.asintegration.embedded.JBossEmbeddedUCLIntegration"/>
+
+ <!--
+ Valid values for the AspectManager bean for use with enableTransformer=true are:
+ * org.jboss.aop.deployers.AspectManagerJDK5 - works with the -javaagent:pluggable-instrumentor.jar switch
+ * org.jboss.aop.deployers.AspectManagerJRockit - works with JRockit and the -Xmanagement:class=org.jboss.aop.hook.JRockitPluggableClassPreProcessor switch
+ -->
+ <bean name="AspectManager" class="org.jboss.aop.deployers.AspectManagerJDK5">
+ <constructor>
+ <parameter><![CDATA[
+ <aop>
+ </aop>]]>
+ </parameter>
+ </constructor>
+
+ <property name="jbossIntegration"><inject bean="AOPJBossIntegration"/></property>
+
+ <property name="enableLoadtimeWeaving">false</property>
+ <!-- only relevant when EnableLoadtimeWeaving is true.
+ When transformer is on, every loaded class gets
+ transformed. If AOP can't find the class, then it
+ throws an exception. Sometimes, classes may not have
+ all the classes they reference. So, the Suppressing
+ is needed. (i.e. Jboss cache in the default configuration -->
+ <property name="suppressTransformationErrors">true</property>
+ <property name="prune">true</property>
+ <property name="include">org.jboss.test., org.jboss.injbossaop.</property>
+ <property name="exclude">org.jboss.</property>
+ <!-- This avoids instrumentation of hibernate cglib enhanced proxies
+ <property name="ignore">*$$EnhancerByCGLIB$$*</property> -->
+ <property name="optimized">true</property>
+ <property name="verbose">false</property>
+ <!--
+ Available choices for this attribute are:
+ org.jboss.aop.instrument.ClassicInstrumentor (default)
+ org.jboss.aop.instrument.GeneratedAdvisorInstrumentor
+ <property name="instrumentor">org.jboss.aop.instrument.ClassicInstrumentor</property>
+ -->
+ </bean>
+
+ <!-- Aspect Deployment -->
+ <bean name="AspectDeployer" class="org.jboss.aop.deployers.AspectDeployer">
+ <property name="type">aop</property>
+ <property name="aspectManager"><inject bean="AspectManager" property="aspectManager"/></property>
+ </bean>
+
+</deployment>
Added: branches/JCA/jboss-embedded/src/main/resources/bootstrap/deployers/ejb-deployer-beans.xml
===================================================================
--- branches/JCA/jboss-embedded/src/main/resources/bootstrap/deployers/ejb-deployer-beans.xml (rev 0)
+++ branches/JCA/jboss-embedded/src/main/resources/bootstrap/deployers/ejb-deployer-beans.xml 2009-12-19 03:37:05 UTC (rev 1684)
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ EJB 2.x Deployer
+-->
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+ <!-- ejb-jar.xml parsing deployer -->
+ <bean name="Ejb2ParsingDeployer" class="org.jboss.deployment.EjbParsingDeployer">
+ <property name="type">ejb2x</property>
+ <property name="useSchemaValidation">false</property>
+ <property name="relativeOrder">3000</property>
+ </bean>
+ <bean name="JBossEjb2ParsingDeployer" class="org.jboss.deployment.JBossEjbParsingDeployer">
+ <property name="type">ejb2x</property>
+ <property name="relativeOrder">3001</property>
+ <property name="useSchemaValidation">false</property>
+ <property name="ignoreMissingStandardJBossXml">true</property>
+ <!-- Can be used to override the default location of the standardjboss.xml -->
+ <!-- ><property name="standardJBossXmlPath">${jboss.server.config.url}/standardjboss.xml</property>-->
+ </bean>
+
+ <bean name="EJB2xDeployer" class="org.jboss.ejb.deployers.EjbDeployer">
+ <!-- The EJBDeployer needs the JTA transaction manager service -->
+ <property name="transactionManagerServiceName">jboss:service=TransactionManager</property>
+ <!-- The dynamic class loading simple web server -->
+ <property name="webServiceName">jboss:service=WebService</property>
+ <!-- The CachedConnectionManager service used by the CachedConnectionInterceptor -->
+ <property name="cachedConnectionManagerName">jboss.jca:service=CachedConnectionManager</property>
+ <!-- The ejb timer service -->
+ <property name="timerServiceName">jboss.ejb:service=EJBTimerService</property>
+ <!-- A flag indicating if the ejb components should have in VM call
+ optimization disabled.
+ -->
+ <property name="callByValue">false</property>
+
+ <!-- Specify an unauthenticated identity -->
+ <property name="unauthenticatedIdentity">anonymous</property>
+
+ <!-- Specify a SecurityManagement Wrapper -->
+ <property name="securityManagement">
+ <inject bean="JNDIBasedSecurityManagement"/>
+ </property>
+ <!-- Specify a SecurityContext FQN class name -->
+ <property name="securityContextClassName">org.jboss.security.plugins.JBossSecurityContext</property>
+
+ <!-- Specify a SecurityDomain as fallback -->
+ <property name="defaultSecurityDomain">jboss-ejb-policy</property>
+
+ <depends>SecurityDeployer</depends>
+ </bean>
+
+ <bean name="MergedJBossMetaDataDeployer" class="org.jboss.ejb.deployers.MergedJBossMetaDataDeployer">
+ </bean>
+ <bean name="StandardJBossMetaDataDeployer" class="org.jboss.ejb.deployers.StandardJBossMetaDataDeployer">
+ </bean>
+</deployment>
Added: branches/JCA/jboss-embedded/src/main/resources/bootstrap/deployers/ejb3-deployers-beans.xml
===================================================================
--- branches/JCA/jboss-embedded/src/main/resources/bootstrap/deployers/ejb3-deployers-beans.xml (rev 0)
+++ branches/JCA/jboss-embedded/src/main/resources/bootstrap/deployers/ejb3-deployers-beans.xml 2009-12-19 03:37:05 UTC (rev 1684)
@@ -0,0 +1,259 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ JCA Deployers
+-->
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+ <!-- TODO this should be removed later on when ENC gets changed -->
+ <bean name="java:comp/Initializer" class="org.jboss.ejb3.embedded.JavaCompInitializer"/>
+ <bean name="DefaultPersistenceProperties" class="org.jboss.ejb3.DefaultPersistenceProperties"/>
+
+ <bean name="Ejb3Deployer" class="org.jboss.ejb3.deployers.Ejb3Deployer">
+ <property name="type">ejb3x</property>
+ <property name="kernel"><inject bean="jboss.kernel:service=Kernel"/></property>
+ <property name="mbeanServer"><inject bean="JMXKernel" property="mbeanServer"/></property>
+ <property name="defaultPersistenceProperties"><inject bean="DefaultPersistenceProperties" property="properties"/></property>
+ <property name="cacheFactoryRegistry"><inject bean="EJB3CacheFactoryRegistry" /></property>
+ <property name="poolFactoryRegistry"><inject bean="EJB3PoolFactoryRegistry" /></property>
+ <property name="remoteProxyFactoryRegistry"><inject bean="EJB3RemoteProxyFactoryRegistry" /></property>
+ <property name="persistenceManagerFactoryRegistry"><inject bean="EJB3PersistenceManagerFactoryRegistry" /></property>
+
+ <!--
+
+ Configure the deployer to optionally require a deployment
+ descriptor for deployable units. By turning this switch to "true",
+ "META-INF/jboss.xml" or the EJB3 Deployment Descriptor "META-INF/ejb-jar.xml"
+ will be required for deployment, enabling a performance increace in deployment by
+ not scanning for annotations in non-deployable EJB3 JARs.
+
+ Default for this value is "false".
+
+ -->
+ <property name="deploymentDescriptorRequired">false</property>
+
+ <property name="ignoredJarsSet">
+ <set elementClass="java.lang.String">
+ <value>snmp-adaptor.jar</value>
+ <value>otherimages.jar</value>
+ <value>applet.jar</value>
+ <value>jcommon.jar</value>
+ <value>console-mgr-classes.jar</value>
+ <value>jfreechart.jar</value>
+ <value>juddi-service.jar</value>
+ <value>wsdl4j.jar</value>
+ <value>commons-collections.jar</value>
+ <value>commons-pool.jar</value>
+ <value>juddi.jar</value>
+ <value>commons-discovery.jar</value>
+ <value>uddi4j.jar</value>
+ <value>axis.jar</value>
+ <value>commons-dbcp.jar</value>
+ <value>jboss-juddiaxis.jar</value>
+ <value>trove.jar</value>
+ <value>javassist.jar</value>
+ <value>jboss-aop-jdk50.jar</value>
+ <value>jboss-aspect-library-jdk50.jar</value>
+ <value>ejb3-persistence.jar</value>
+ <value>commons-validator-1.1.3.jar</value>
+ <value>commons-collections.jar</value>
+ <value>commons-fileupload.jar</value>
+ <value>commons-pool.jar</value>
+ <value>hibernate-entitymanager.jar</value>
+ <value>jboss-ejb3x.jar</value>
+ <value>commons-digester-1.6.jar</value>
+ <value>cglib-2.1.1.jar</value>
+ <value>commons-discovery.jar</value>
+ <value>jboss-annotations-ejb3.jar</value>
+ <value>jaxen-1.1-beta-4.jar</value>
+ <value>hibernate-annotations.jar</value>
+ <value>commons-httpclient.jar</value>
+ <value>commons-logging.jar</value>
+ <value>commons-vfs.jar</value>
+ <value>hibernate3.jar</value>
+ <value>commons-logging-api.jar</value>
+ <value>asm.jar</value>
+ <value>asm-attrs.jar</value>
+ <value>commons-lang-2.0.jar</value>
+ <value>commons-beanutils.jar</value>
+ <value>jboss-ejb3.jar</value>
+ <value>dom4j.jar</value>
+ <value>commons-codec-1.2.jar</value>
+ <value>wsdl4j.jar</value>
+ <value>xmlsec.jar</value>
+ <value>jbossws.jar</value>
+ <value>jboss-bean-deployer.jar</value>
+ <value>jboss-microcontainer.jar</value>
+ <value>jboss-dependency.jar</value>
+ <value>jboss-container.jar</value>
+ <value>tomcat-coyote.jar</value>
+ <value>commons-collections.jar</value>
+ <value>myfaces.jar</value>
+ <value>jstl.jar</value>
+ <value>commons-digester-1.6.jar</value>
+ <value>myfaces-impl.jar</value>
+ <value>commons-beanutils.jar</value>
+ <value>myfaces-jsf-api.jar</value>
+ <value>commons-codec-1.2.jar</value>
+ <value>catalina-optional.jar</value>
+ <value>tomcat-util.jar</value>
+ <value>jasper-compiler.jar</value>
+ <value>commons-el.jar</value>
+ <value>jasper-compiler-jdt.jar</value>
+ <value>tomcat-http.jar</value>
+ <value>catalina-manager.jar</value>
+ <value>jasper-runtime.jar</value>
+ <value>tomcat55-service.jar</value>
+ <value>servlets-invoker.jar</value>
+ <value>catalina.jar</value>
+ <value>naming-resources.jar</value>
+ <value>servlets-default.jar</value>
+ <value>tomcat-ajp.jar</value>
+ <value>commons-modeler.jar</value>
+ <value>tomcat-apr.jar</value>
+ <value>servlets-webdav.jar</value>
+ </set>
+ </property>
+ <depends>AspectLibrary</depends>
+ </bean>
+ <bean name="EJBStage2Deployer" class="org.jboss.ejb3.deployers.EJBStage2Deployer">
+ <depends>AspectLibrary</depends>
+ </bean>
+
+ <bean name="AppClientParsingDeployer" class="org.jboss.ejb3.deployers.AppClientParsingDeployer">
+ <property name="type">car</property>
+ <!-- TODO: check depends -->
+ <depends>AspectLibrary</depends>
+ </bean>
+
+ <bean name="JBossClientParsingDeployer" class="org.jboss.ejb3.deployers.JBossClientParsingDeployer">
+ <property name="type">car</property>
+ <depends>AppClientParsingDeployer</depends>
+ </bean>
+
+ <bean name="AppClientScanningDeployer" class="org.jboss.ejb3.deployers.AppClientScanningDeployer">
+ <depends>JBossClientParsingDeployer</depends>
+ </bean>
+
+ <bean name="Ejb3ClientDeployer" class="org.jboss.ejb3.deployers.Ejb3ClientDeployer">
+ <property name="type">car</property>
+ <property name="kernel"><inject bean="jboss.kernel:service=Kernel"/></property>
+ <property name="mbeanServer"><inject bean="JMXKernel" property="mbeanServer"/></property>
+ <!-- TODO: check depends -->
+ <depends>AspectLibrary</depends>
+ <depends>AppClientScanningDeployer</depends>
+ </bean>
+
+ <!-- EJB3 Cache Factory Registry -->
+ <bean name="EJB3CacheFactoryRegistry" class="org.jboss.ejb3.cache.CacheFactoryRegistry">
+ <property name="factories">
+ <!-- Define each of the registered factories -->
+ <map class="java.util.HashMap" keyClass="java.lang.String"
+ valueClass="java.lang.Class">
+ <!-- NoPassivationCache -->
+ <entry>
+ <key>NoPassivationCache</key>
+ <value>org.jboss.ejb3.cache.NoPassivationCacheFactory</value>
+ </entry>
+ <!-- SimpleStatefulCache -->
+ <entry>
+ <key>SimpleStatefulCache</key>
+ <value>org.jboss.ejb3.cache.simple.SimpleStatefulCacheFactory</value>
+ </entry>
+ <!-- StatefulTreeCache -->
+ <entry>
+ <key>StatefulTreeCache</key>
+ <value>org.jboss.ejb3.cache.tree.StatefulTreeCacheFactory</value>
+ </entry>
+ </map>
+ </property>
+ </bean>
+
+ <!-- EJB3 Pool Factory Registry -->
+ <bean name="EJB3PoolFactoryRegistry" class="org.jboss.ejb3.pool.PoolFactoryRegistry">
+ <property name="factories">
+ <!-- Define each of the registered factories -->
+ <map class="java.util.HashMap" keyClass="java.lang.String"
+ valueClass="java.lang.Class">
+ <!-- ThreadlocalPool -->
+ <entry>
+ <key>ThreadlocalPool</key>
+ <value>org.jboss.ejb3.pool.ThreadlocalPoolFactory</value>
+ </entry>
+ <!-- StrictMaxPool -->
+ <entry>
+ <key>StrictMaxPool</key>
+ <value>org.jboss.ejb3.pool.StrictMaxPoolFactory</value>
+ </entry>
+ </map>
+ </property>
+ </bean>
+
+ <!-- Remoting Proxy Factory Registry -->
+ <bean name="EJB3RemoteProxyFactoryRegistry" class="org.jboss.ejb3.remoting.RemoteProxyFactoryRegistry">
+ <property name="factories">
+ <!-- Define each of the registered factories -->
+ <map class="java.util.HashMap" keyClass="java.lang.String"
+ valueClass="java.lang.Class">
+ <!-- RemoteProxyFactory -->
+ <entry>
+ <key>RemoteProxyFactory</key>
+ <value>org.jboss.ejb3.remoting.RemoteProxyFactory</value>
+ </entry>
+ <!-- IORFactory -->
+ <entry>
+ <key>IORFactory</key>
+ <value>org.jboss.ejb3.iiop.IORFactory</value>
+ </entry>
+ <!-- ServiceRemoteProxyFactory -->
+ <entry>
+ <key>ServiceRemoteProxyFactory</key>
+ <value>org.jboss.ejb3.service.ServiceRemoteProxyFactory</value>
+ </entry>
+ <!-- StatefulClusterProxyFactory -->
+ <!-- <entry>
+ <key>StatefulClusterProxyFactory</key>
+ <value>org.jboss.ejb3.stateful.StatefulClusterProxyFactory</value>
+ </entry>-->
+ <!-- StatefulRemoteProxyFactory -->
+ <entry>
+ <key>StatefulRemoteProxyFactory</key>
+ <value>org.jboss.ejb3.stateful.StatefulRemoteProxyFactory</value>
+ </entry>
+ <!-- StatelessClusterProxyFactory -->
+ <!-- <entry>
+ <key>StatelessClusterProxyFactory</key>
+ <value>org.jboss.ejb3.stateless.StatelessClusterProxyFactory</value>
+ </entry>-->
+ <!-- StatelessRemoteProxyFactory -->
+ <entry>
+ <key>StatelessRemoteProxyFactory</key>
+ <value>org.jboss.ejb3.stateless.StatelessRemoteProxyFactory</value>
+ </entry>
+ </map>
+ </property>
+ </bean>
+
+ <!-- EJB3 Persistence Manager Factory Registry -->
+ <bean name="EJB3PersistenceManagerFactoryRegistry" class="org.jboss.ejb3.cache.persistence.PersistenceManagerFactoryRegistry">
+ <property name="factories">
+ <!-- Define each of the registered factories -->
+ <map class="java.util.HashMap" keyClass="java.lang.String"
+ valueClass="java.lang.Class">
+ <!-- StatefulSessionFilePersistenceManager -->
+ <entry>
+ <key>StatefulSessionFilePersistenceManager</key>
+ <value>org.jboss.ejb3.cache.simple.StatefulSessionFilePersistenceManagerFactory</value>
+ </entry>
+ </map>
+ </property>
+ </bean>
+
+ <bean name="JNDIKernelRegistryPlugin" class="org.jboss.ejb3.kernel.JNDIKernelRegistryPlugin"/>
+
+ <!-- Persistence Unit deployers -->
+ <bean name="PersistenceUnitParsingDeployer" class="org.jboss.ejb3.deployers.PersistenceUnitParsingDeployer">
+ <property name="type">car</property>
+ </bean>
+
+</deployment>
Added: branches/JCA/jboss-embedded/src/main/resources/bootstrap/deployers/jboss-aspect-library-beans.xml
===================================================================
--- branches/JCA/jboss-embedded/src/main/resources/bootstrap/deployers/jboss-aspect-library-beans.xml (rev 0)
+++ branches/JCA/jboss-embedded/src/main/resources/bootstrap/deployers/jboss-aspect-library-beans.xml 2009-12-19 03:37:05 UTC (rev 1684)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ Aspect Deployer
+-->
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+ <!-- Aspect Library -->
+ <bean name="AspectLibrary" class="org.jboss.aop.deployers.JBossAspectLibrary">
+ <property name="aspectManager"><inject bean="AspectManager"/></property>
+ </bean>
+
+ <!-- Add the JMX -->
+ <aop:lifecycle-configure xmlns:aop="urn:jboss:aop-beans:1.0"
+ name="JMXAdvice"
+ class="org.jboss.aop.microcontainer.aspects.jmx.JMXLifecycleCallback"
+ classes="@org.jboss.aop.microcontainer.aspects.jmx.JMX"
+ manager-bean="AspectManager"
+ manager-property="aspectManager">
+ <property name="mbeanServer"><inject bean="JMXKernel" property="mbeanServer"/></property>
+ </aop:lifecycle-configure>
+
+</deployment>
Added: branches/JCA/jboss-embedded/src/main/resources/bootstrap/deployers/jca-deployers-beans.xml
===================================================================
--- branches/JCA/jboss-embedded/src/main/resources/bootstrap/deployers/jca-deployers-beans.xml (rev 0)
+++ branches/JCA/jboss-embedded/src/main/resources/bootstrap/deployers/jca-deployers-beans.xml 2009-12-19 03:37:05 UTC (rev 1684)
@@ -0,0 +1,121 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ JCA Deployers
+ $Id: jca-deployers-beans.xml 68282 2007-12-14 13:43:52Z alex.loubyansky(a)jboss.com $
+-->
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+ <bean name="JCAMetaDataRepository" class="org.jboss.resource.metadata.repository.DefaultJCAMetaDataRepository"/>
+
+ <!-- RAR Deployment -->
+ <bean name="RARParserDeployer" class="org.jboss.resource.deployers.RARParserDeployer">
+ <property name="metaDataRepository"><inject bean="JCAMetaDataRepository"/></property>
+ <property name="type">rar</property>
+ </bean>
+
+ <bean name="RARDeployer" class="org.jboss.resource.deployers.RARDeployer">
+ <property name="workManagerName">jboss.jca:service=WorkManager</property>
+ <property name="XATerminatorName">jboss:service=TransactionManager</property>
+ <property name="type">rar</property>
+ </bean>
+
+
+
+ <!-- ConnectionFactory Deployment - ->
+
+ <bean name="ConnectionFactoryDeployer" class="org.jboss.system.deployers.ServiceXSLDeployer">
+ <property name="suffix">-ds.xml</property>
+ <property name="XSLPath">stylesheets/ConnectionFactoryTemplate.xsl</property>
+ <property name="type">jca-ds</property>
+ </bean>
+
+ -->
+
+ <bean name="MCFBuilder" class="org.jboss.resource.deployers.builder.ManagedConnectionFactoryBuilder">
+ <property name="metaDataRepository"><inject bean="JCAMetaDataRepository"/></property>
+ </bean>
+
+ <bean name="PoolBuilder" class="org.jboss.resource.deployers.builder.ManagedConnectionPoolBuilder"/>
+ <bean name="ConnectionManagerBuilder" class="org.jboss.resource.deployers.builder.ConnectionManagerBuilder"/>
+ <bean name="ConnectionFactoryBindingBuilder" class="org.jboss.resource.deployers.builder.ConnectionFactoryBindingBuilder"/>
+ <bean name="MetaDataTypeMappingBuilder" class="org.jboss.resource.deployers.builder.MetaDataTypeMappingBuilder"/>
+
+ <bean name="ManagedConnectionFactoryParserDeployer" class="org.jboss.resource.deployers.ManagedConnectionFactoryParserDeployer">
+ <property name="repository"><inject bean="JCAMetaDataRepository"></inject></property>
+ <property name="suffix">-ds.xml</property>
+ <property name="type">jca-ds</property>
+ </bean>
+
+ <bean name="ManagedConnectionFactoryDeployer" class="org.jboss.resource.deployers.ManagedConnectionFactoryDeployer">
+ <property name="repository"><inject bean="JCAMetaDataRepository"></inject></property>
+ <property name="builders">
+ <list>
+ <inject bean="MCFBuilder"/>
+ <inject bean="PoolBuilder"/>
+ <inject bean="ConnectionManagerBuilder"/>
+ <inject bean="ConnectionFactoryBindingBuilder"/>
+ <inject bean="MetaDataTypeMappingBuilder"/>
+ </list>
+ </property>
+ <property name="type">jca-ds</property>
+ </bean>
+
+ <!-- The template for creating a datasource -->
+ <bean name="LocalTxDataSourceTemplate" class="org.jboss.resource.deployers.management.DsDataSourceTemplate">
+ <property name="info"><inject bean="LocalTxDataSourceTemplateInfo"/></property>
+ </bean>
+ <bean name="LocalTxDataSourceTemplateInfo"
+ class="org.jboss.resource.deployers.management.DsDataSourceTemplateInfo">
+ <constructor>
+ <parameter>LocalTxDataSourceTemplate</parameter>
+ <parameter>A template for datasource *-ds.xml deployments</parameter>
+ <parameter>local-tx-datasource</parameter>
+ </constructor>
+ </bean>
+ <bean name="XADataSourceTemplate" class="org.jboss.resource.deployers.management.DsDataSourceTemplate">
+ <property name="info"><inject bean="XADataSourceTemplateInfo"/></property>
+ </bean>
+ <bean name="XADataSourceTemplateInfo"
+ class="org.jboss.resource.deployers.management.DsDataSourceTemplateInfo">
+ <constructor>
+ <parameter>XADataSourceTemplate</parameter>
+ <parameter>A template for xa-datasource *-ds.xml deployments</parameter>
+ <parameter>xa-datasource</parameter>
+ </constructor>
+ </bean>
+ <bean name="NoTxDataSourceTemplate" class="org.jboss.resource.deployers.management.DsDataSourceTemplate">
+ <property name="info"><inject bean="NoTxDataSourceTemplateInfo"/></property>
+ </bean>
+ <bean name="NoTxDataSourceTemplateInfo"
+ class="org.jboss.resource.deployers.management.DsDataSourceTemplateInfo">
+ <constructor>
+ <parameter>NoTxDataSourceTemplate</parameter>
+ <parameter>A template for no-tx-datasource *-ds.xml deployments</parameter>
+ <parameter>no-tx-datasource</parameter>
+ </constructor>
+ </bean>
+ <bean name="TxConnectionFactoryTemplate" class="org.jboss.resource.deployers.management.DsDataSourceTemplate">
+ <property name="info"><inject bean="TxConnectionFactoryTemplateInfo"/></property>
+ </bean>
+ <bean name="TxConnectionFactoryTemplateInfo"
+ class="org.jboss.resource.deployers.management.DsDataSourceTemplateInfo">
+ <constructor>
+ <parameter>TxConnectionFactoryTemplate</parameter>
+ <parameter>A template for tx-connection-factory *-ds.xml deployments</parameter>
+ <parameter>tx-connection-factory</parameter>
+ </constructor>
+ </bean>
+ <bean name="NoTxConnectionFactoryTemplate" class="org.jboss.resource.deployers.management.DsDataSourceTemplate">
+ <property name="info"><inject bean="NoTxConnectionFactoryTemplateInfo"/></property>
+ </bean>
+ <bean name="NoTxConnectionFactoryTemplateInfo"
+ class="org.jboss.resource.deployers.management.DsDataSourceTemplateInfo">
+ <constructor>
+ <parameter>NoTxConnectionFactoryTemplate</parameter>
+ <parameter>A template for no-tx-connection-factory *-ds.xml deployments</parameter>
+ <parameter>no-tx-connection-factory</parameter>
+ </constructor>
+ </bean>
+
+</deployment>
Added: branches/JCA/jboss-embedded/src/main/resources/bootstrap/deployers/metadata-beans.xml
===================================================================
--- branches/JCA/jboss-embedded/src/main/resources/bootstrap/deployers/metadata-beans.xml (rev 0)
+++ branches/JCA/jboss-embedded/src/main/resources/bootstrap/deployers/metadata-beans.xml 2009-12-19 03:37:05 UTC (rev 1684)
@@ -0,0 +1,237 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ MetaData configuration
+ $Id: metadata-beans.xml 67929 2007-12-05 07:55:38Z scott.stark(a)jboss.org $
+-->
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+ <!-- The reference metdata resolving deployer
+ -->
+ <bean name="ReferenceMetaDataResolverDeployer"
+ class="org.jboss.deployment.ReferenceMetaDataResolverDeployer">
+ </bean>
+ <bean name="AnnotationMetaDataDeployer"
+ class="org.jboss.deployment.AnnotationMetaDataDeployer">
+ <property name="metaDataCompleteIsDefault">true</property>
+ </bean>
+
+ <!-- The schema location to JBossXB binding class mappings. We specify the dtd/xsd name
+ of the schema as the location to work with legacy dtd as well as namespace based
+ documents.
+ -->
+ <bean name="SchemaResolverConfig"
+ class="org.jboss.xb.binding.sunday.unmarshalling.SchemaResolverConfig">
+
+ <!-- schemaLocation to JBossXBuilder binding classes -->
+ <property name="bindingClassesByLocations">
+ <map keyClass="java.lang.String" valueClass="java.lang.String">
+ <!-- EarMetaData -->
+ <entry>
+ <key>application</key>
+ <value>org.jboss.metadata.ear.spec.Ear14MetaData</value>
+ </entry>
+ <entry>
+ <key>application_1_2.dtd</key>
+ <value>org.jboss.metadata.ear.spec.Ear13DTDMetaData</value>
+ </entry>
+ <entry>
+ <key>application_1_3.dtd</key>
+ <value>org.jboss.metadata.ear.spec.Ear13DTDMetaData</value>
+ </entry>
+ <entry>
+ <key>application_1_4.xsd</key>
+ <value>org.jboss.metadata.ear.spec.Ear14MetaData</value>
+ </entry>
+ <entry>
+ <key>application_5.xsd</key>
+ <value>org.jboss.metadata.ear.spec.Ear50MetaData</value>
+ </entry>
+ <!-- JBossAppMetaData -->
+ <entry>
+ <key>jboss-app</key>
+ <value>org.jboss.metadata.ear.jboss.JBoss50DTDAppMetaData</value>
+ </entry>
+ <entry>
+ <key>jboss-app_3_0.dtd</key>
+ <value>org.jboss.metadata.ear.jboss.JBoss50DTDAppMetaData</value>
+ </entry>
+ <entry>
+ <key>jboss-app_3_2.dtd</key>
+ <value>org.jboss.metadata.ear.jboss.JBoss50DTDAppMetaData</value>
+ </entry>
+ <entry>
+ <key>jboss-app_4_0.dtd</key>
+ <value>org.jboss.metadata.ear.jboss.JBoss50DTDAppMetaData</value>
+ </entry>
+ <entry>
+ <key>jboss-app_4_2.dtd</key>
+ <value>org.jboss.metadata.ear.jboss.JBoss50DTDAppMetaData</value>
+ </entry>
+ <entry>
+ <key>jboss-app_5_0.dtd</key>
+ <value>org.jboss.metadata.ear.jboss.JBoss50DTDAppMetaData</value>
+ </entry>
+ <entry>
+ <key>jboss-app_5_0.xsd</key>
+ <value>org.jboss.metadata.ear.jboss.JBoss50AppMetaData</value>
+ </entry>
+
+ <!-- ApplicationClientMetaData -->
+ <entry>
+ <key>application-client</key>
+ <value>org.jboss.metadata.client.spec.ApplicationClient14DTDMetaData</value>
+ </entry>
+ <entry>
+ <key>application-client_1_2.dtd</key>
+ <value>org.jboss.metadata.client.spec.ApplicationClient14DTDMetaData</value>
+ </entry>
+ <entry>
+ <key>application-client_1_3.dtd</key>
+ <value>org.jboss.metadata.client.spec.ApplicationClient14DTDMetaData</value>
+ </entry>
+ <entry>
+ <key>application-client_1_4.xsd</key>
+ <value>org.jboss.metadata.client.spec.ApplicationClient14MetaData</value>
+ </entry>
+ <entry>
+ <key>application-client_5.xsd</key>
+ <value>org.jboss.metadata.client.spec.ApplicationClient5MetaData</value>
+ </entry>
+ <!-- ApplicationClientMetaData -->
+ <entry>
+ <key>jboss-client</key>
+ <value>org.jboss.metadata.client.jboss.JBossClient5DTDMetaData</value>
+ </entry>
+ <entry>
+ <key>jboss-client_3_0.dtd</key>
+ <value>org.jboss.metadata.client.jboss.JBossClient5DTDMetaData</value>
+ </entry>
+ <entry>
+ <key>jboss-client_3_2.dtd</key>
+ <value>org.jboss.metadata.client.jboss.JBossClient5DTDMetaData</value>
+ </entry>
+ <entry>
+ <key>jboss-client_4_0.dtd</key>
+ <value>org.jboss.metadata.client.jboss.JBossClient5DTDMetaData</value>
+ </entry>
+ <entry>
+ <key>jboss-client_4_2.dtd</key>
+ <value>org.jboss.metadata.client.jboss.JBossClient5DTDMetaData</value>
+ </entry>
+ <entry>
+ <key>jboss-client_5_0.dtd</key>
+ <value>org.jboss.metadata.client.jboss.JBossClient5DTDMetaData</value>
+ </entry>
+ <entry>
+ <key>jboss-client_5_0.xsd</key>
+ <value>org.jboss.metadata.client.jboss.JBossClient5MetaData</value>
+ </entry>
+
+ <!-- EjbJarMetaData -->
+ <entry>
+ <key>ejb-jar</key>
+ <value>org.jboss.metadata.ejb.spec.EjbJar20MetaData</value>
+ </entry>
+ <entry>
+ <key>ejb-jar_1_1.dtd</key>
+ <value>org.jboss.metadata.ejb.spec.EjbJar1xMetaData</value>
+ </entry>
+ <entry>
+ <key>ejb-jar_2_0.dtd</key>
+ <value>org.jboss.metadata.ejb.spec.EjbJar20MetaData</value>
+ </entry>
+ <entry>
+ <key>ejb-jar_2_1.xsd</key>
+ <value>org.jboss.metadata.ejb.spec.EjbJar21MetaData</value>
+ </entry>
+ <entry>
+ <key>ejb-jar_3_0.xsd</key>
+ <value>org.jboss.metadata.ejb.spec.EjbJar30MetaData</value>
+ </entry>
+
+ <!-- JBossMetaData -->
+ <entry>
+ <key>jboss</key>
+ <value>org.jboss.metadata.ejb.jboss.JBoss50DTDMetaData</value>
+ </entry>
+ <entry>
+ <key>jboss_3_0.dtd</key>
+ <value>org.jboss.metadata.ejb.jboss.JBoss50DTDMetaData</value>
+ </entry>
+ <entry>
+ <key>jboss_3_2.dtd</key>
+ <value>org.jboss.metadata.ejb.jboss.JBoss50DTDMetaData</value>
+ </entry>
+ <entry>
+ <key>jboss_4_0.dtd</key>
+ <value>org.jboss.metadata.ejb.jboss.JBoss50DTDMetaData</value>
+ </entry>
+ <entry>
+ <key>jboss_4_2.dtd</key>
+ <value>org.jboss.metadata.ejb.jboss.JBoss50DTDMetaData</value>
+ </entry>
+ <entry>
+ <key>jboss_5_0.dtd</key>
+ <value>org.jboss.metadata.ejb.jboss.JBoss50DTDMetaData</value>
+ </entry>
+ <entry>
+ <key>jboss_5_0.xsd</key>
+ <value>org.jboss.metadata.ejb.jboss.JBoss50MetaData</value>
+ </entry>
+
+ <!-- WebMetaData -->
+ <entry>
+ <key>web-app</key>
+ <value>org.jboss.metadata.web.spec.Web23MetaData</value>
+ </entry>
+ <entry>
+ <key>web-app_2_2.dtd</key>
+ <value>org.jboss.metadata.web.spec.Web23MetaData</value>
+ </entry>
+ <entry>
+ <key>web-app_2_3.dtd</key>
+ <value>org.jboss.metadata.web.spec.Web23MetaData</value>
+ </entry>
+ <entry>
+ <key>web-app_2_4.xsd</key>
+ <value>org.jboss.metadata.web.spec.Web24MetaData</value>
+ </entry>
+ <entry>
+ <key>web-app_2_5.xsd</key>
+ <value>org.jboss.metadata.web.spec.Web25MetaData</value>
+ </entry>
+ <!-- JBossWebMetaData -->
+ <entry>
+ <key>jboss-web</key>
+ <value>org.jboss.metadata.web.jboss.JBoss50DTDWebMetaData</value>
+ </entry>
+ <entry>
+ <key>jboss-web_3_0.dtd</key>
+ <value>org.jboss.metadata.web.jboss.JBoss50DTDWebMetaData</value>
+ </entry>
+ <entry>
+ <key>jboss-web_3_2.dtd</key>
+ <value>org.jboss.metadata.web.jboss.JBoss50DTDWebMetaData</value>
+ </entry>
+ <entry>
+ <key>jboss-web_4_0.dtd</key>
+ <value>org.jboss.metadata.web.jboss.JBoss50DTDWebMetaData</value>
+ </entry>
+ <entry>
+ <key>jboss-web_4_2.dtd</key>
+ <value>org.jboss.metadata.web.jboss.JBoss50DTDWebMetaData</value>
+ </entry>
+ <entry>
+ <key>jboss-web_5_0.dtd</key>
+ <value>org.jboss.metadata.web.jboss.JBoss50DTDWebMetaData</value>
+ </entry>
+ <entry>
+ <key>jboss-web_5_0.xsd</key>
+ <value>org.jboss.metadata.web.jboss.JBoss50WebMetaData</value>
+ </entry>
+ </map>
+ </property>
+ </bean>
+
+</deployment>
Added: branches/JCA/jboss-embedded/src/main/resources/bootstrap/deployers/security-deployer-beans.xml
===================================================================
--- branches/JCA/jboss-embedded/src/main/resources/bootstrap/deployers/security-deployer-beans.xml (rev 0)
+++ branches/JCA/jboss-embedded/src/main/resources/bootstrap/deployers/security-deployer-beans.xml 2009-12-19 03:37:05 UTC (rev 1684)
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ Security Deployer
+-->
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+ <bean name="SecurityDeployer" class="org.jboss.deployment.security.SecurityDeployer">
+ <property name="type">security</property>
+ <property name="ignoreSuffixes">
+ <set elementClass="java.lang.String">
+ <value>xml</value>
+ <value>beans</value>
+ <value>deployer</value>
+ <value>rar</value>
+ <value>properties</value>
+ </set>
+ </property>
+ </bean>
+
+ <!-- JNDI Object Factory to establish SecurityDomainContext objects -->
+ <bean name="SecurityDomainObjectFactory" class="org.jboss.security.integration.SecurityDomainObjectFactory" />
+
+ <!-- JNDI Context legacy establishment of java:/jaas/securityDomain -->
+ <bean name="JBossSecurityJNDIContextEstablishment" class="org.jboss.security.integration.JNDIContextEstablishment"/>
+
+ <!-- JNDI Based Security Management -->
+ <bean name="JNDIBasedSecurityManagement" class="org.jboss.security.integration.JNDIBasedSecurityManagement">
+ </bean>
+
+</deployment>
Added: branches/JCA/jboss-embedded/src/main/resources/bootstrap/jndi.properties
===================================================================
--- branches/JCA/jboss-embedded/src/main/resources/bootstrap/jndi.properties (rev 0)
+++ branches/JCA/jboss-embedded/src/main/resources/bootstrap/jndi.properties 2009-12-19 03:37:05 UTC (rev 1684)
@@ -0,0 +1,4 @@
+# DO NOT EDIT THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING
+#
+java.naming.factory.initial=org.jboss.naming.JBossRemotingContextFactory
+java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
Added: branches/JCA/jboss-embedded/src/main/resources/bootstrap/log4j.xml
===================================================================
--- branches/JCA/jboss-embedded/src/main/resources/bootstrap/log4j.xml (rev 0)
+++ branches/JCA/jboss-embedded/src/main/resources/bootstrap/log4j.xml 2009-12-19 03:37:05 UTC (rev 1684)
@@ -0,0 +1,109 @@
+<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
+
+ <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+ <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+ <param name="Target" value="System.out"/>
+ <layout class="org.apache.log4j.PatternLayout">
+ <!-- The default pattern: Date Priority [Category] Message\n -->
+ <param name="ConversionPattern" value="%-5p [%c{6}] %m%n"/>
+ </layout>
+ </appender>
+
+ <!-- ############### Embedded JBoss AS ################# -->
+ <category name="org.jboss">
+ <priority value="INFO"/>
+ </category>
+ <category name="com.arjuna">
+ <priority value="ERROR"/>
+ </category>
+
+ <!-- EMB-6, JMS activation throws an error due to deployment ordering, but as there is a timeout
+ and retry the tests pass. Hide the error message -->
+ <category name="jboss.resource.adapter.jms.inflow.JmsActivation">
+ <priority value="ERROR"/>
+ </category>
+
+ <!-- ############### Hibernate logging ################# -->
+
+ <category name="org.hibernate">
+ <priority value="INFO"/>
+ </category>
+
+ <!--
+ <category name="org.hibernate.SQL">
+ <priority value="TRACE"/>
+ </category>
+ <category name="org.hibernate.type">
+ <priority value="TRACE"/>
+ </category>
+ <category name="org.hibernate.loader">
+ <priority value="TRACE"/>
+ </category>
+ <category name="org.hibernate.cache">
+ <priority value="TRACE"/>
+ </category>
+ -->
+
+ <!-- ############### Seam logging ################### -->
+ <category name="org.jboss.seam">
+ <priority value="WARN"/>
+ </category>
+
+
+
+ <!-- These things are too noisy
+ <category name="org.jboss.seam.jsf.SeamVariableResolver">
+ <priority value="INFO"/>
+ </category>
+ <category name="org.jboss.seam.contexts.Contexts">
+ <priority value="INFO"/>
+ </category>
+ <category name="org.jboss.seam.Component">
+ <priority value="INFO"/>
+ </category>
+ <category name="org.jboss.seam.deployment.Scanner">
+ <priority value="INFO"/>
+ </category>
+ <category name="org.jboss.seam.util.Naming">
+ <priority value="INFO"/>
+ </category>
+ <category name="org.jboss.seam.debug.hot">
+ <priority value="INFO"/>
+ </category>
+ <category name="org.jboss.seam.core.Events">
+ <priority value="INFO"/>
+ </category>
+ -->
+
+ <!-- Debugging conversations and persistence contexts
+ <category name="org.jboss.seam.core.Manager">
+ <priority value="DEBUG"/>
+ </category>
+ <category name="org.jboss.seam.core.ManagedPersistenceContext">
+ <priority value="DEBUG"/>
+ </category>
+ <category name="org.jboss.seam.jsf.AbstractSeamPhaseListener">
+ <priority value="DEBUG"/>
+ </category>
+ <category name="org.jboss.seam.interceptors.ConversationInterceptor">
+ <priority value="DEBUG"/>
+ </category>
+ <category name="org.jboss.seam.contexts.Lifecycle">
+ <priority value="DEBUG"/>
+ </category>
+ <category name="org.hibernate.impl.SessionImpl">
+ <priority value="DEBUG"/>
+ </category>
+ <category name="org.hibernate.event.def.AbstractFlushingEventListener">
+ <priority value="DEBUG"/>
+ </category>
+ -->
+
+ <root>
+ <priority value="INFO"/>
+ <appender-ref ref="CONSOLE"/>
+ </root>
+
+</log4j:configuration>
Added: branches/JCA/jboss-embedded/src/main/resources/bootstrap/stylesheets/NoJRMPConnectionFactoryTemplate.xsl
===================================================================
--- branches/JCA/jboss-embedded/src/main/resources/bootstrap/stylesheets/NoJRMPConnectionFactoryTemplate.xsl (rev 0)
+++ branches/JCA/jboss-embedded/src/main/resources/bootstrap/stylesheets/NoJRMPConnectionFactoryTemplate.xsl 2009-12-19 03:37:05 UTC (rev 1684)
@@ -0,0 +1,790 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+
+ <xsl:output method="xml" indent="yes"/>
+
+ <!--top level template converts to top level "server" tag-->
+ <xsl:template match="datasources|connection-factories"><!--|server|service"-->
+
+ <server>
+
+ <xsl:apply-templates/>
+
+ </server>
+
+ </xsl:template>
+
+
+ <!-- template for generic resource adapters supporting transactions -->
+ <xsl:template match="tx-connection-factory">
+
+ <mbean code="org.jboss.resource.connectionmanager.TxConnectionManager"
+ name="jboss.jca:service=TxCM,name={jndi-name}"
+ display-name="ConnectionManager for ConnectionFactory {jndi-name}">
+
+ <xsl:choose>
+ <xsl:when test="(xa-transaction) and (track-connection-by-tx)">
+ <attribute name="TrackConnectionByTx">true</attribute>
+ <attribute name="LocalTransactions">false</attribute>
+ </xsl:when>
+ <xsl:when test="(xa-transaction)">
+ <attribute name="TrackConnectionByTx">false</attribute>
+ <attribute name="LocalTransactions">false</attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <attribute name="TrackConnectionByTx">true</attribute>
+ <attribute name="LocalTransactions">true</attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+
+ <xsl:choose>
+ <xsl:when test="wrap-xa-resource">
+ <attribute name="WrapXAResource"><xsl:value-of select="normalize-space(wrap-xa-resource)"/></attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <attribute name="WrapXAResource">false</attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+
+ <xsl:choose>
+ <xsl:when test="pad-xid">
+ <attribute name="PadXid"><xsl:value-of select="normalize-space(pad-xid)"/></attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <attribute name="PadXid">false</attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+
+ <xsl:if test="isSameRM-override-value">
+ <config-property name="IsSameRMOverrideValue" type="java.lang.Boolean"><xsl:value-of select="normalize-space(isSameRM-override-value)"/></config-property>
+ </xsl:if>
+
+ <xsl:if test="xa-resource-timeout">
+ <attribute name="XAResourceTransactionTimeout"><xsl:value-of select="normalize-space(xa-resource-timeout)"/></attribute>
+ </xsl:if>
+
+ <xsl:call-template name="pool">
+ <xsl:with-param name="mcf-template">generic-mcf</xsl:with-param>
+ </xsl:call-template>
+ <xsl:call-template name="cm-common"/>
+ <xsl:call-template name="tx-manager"/>
+
+ </mbean>
+ <xsl:call-template name="cf-binding">
+ <xsl:with-param name="cm-name">jboss.jca:service=TxCM</xsl:with-param>
+ </xsl:call-template>
+
+ <xsl:call-template name="type-mapping">
+ <xsl:with-param name="datasource" select="."/>
+ </xsl:call-template>
+ </xsl:template>
+
+
+ <!--template for generic resource adapters that do not support transactions-->
+ <xsl:template match="no-tx-connection-factory">
+
+ <mbean code="org.jboss.resource.connectionmanager.NoTxConnectionManager"
+ name="jboss.jca:service=NoTxCM,name={jndi-name}"
+ display-name="ConnectionManager for ConnectionFactory {jndi-name}">
+
+ <xsl:call-template name="pool">
+ <xsl:with-param name="mcf-template">generic-mcf</xsl:with-param>
+ </xsl:call-template>
+ <xsl:call-template name="cm-common"/>
+ </mbean>
+ <xsl:call-template name="cf-binding">
+ <xsl:with-param name="cm-name">jboss.jca:service=NoTxCM</xsl:with-param>
+ </xsl:call-template>
+
+ <xsl:call-template name="type-mapping">
+ <xsl:with-param name="datasource" select="."/>
+ </xsl:call-template>
+ </xsl:template>
+
+
+ <!-- Template for our jca-jdbc non-XADatasource (local) wrapper, using local transactions. -->
+ <xsl:template match="local-tx-datasource">
+
+ <mbean code="org.jboss.resource.connectionmanager.TxConnectionManager"
+ name="jboss.jca:service=LocalTxCM,name={jndi-name}"
+ display-name="ConnectionManager for DataSource {jndi-name}">
+
+ <attribute name="TrackConnectionByTx">true</attribute>
+ <attribute name="LocalTransactions">true</attribute>
+
+ <xsl:call-template name="pool">
+ <xsl:with-param name="mcf-template">local-wrapper</xsl:with-param>
+ </xsl:call-template>
+ <xsl:call-template name="cm-common"/>
+ <xsl:call-template name="tx-manager"/>
+
+ </mbean>
+ <xsl:call-template name="cf-binding">
+ <xsl:with-param name="cm-name">jboss.jca:service=LocalTxCM</xsl:with-param>
+ </xsl:call-template>
+
+ <xsl:call-template name="type-mapping">
+ <xsl:with-param name="datasource" select="."/>
+ </xsl:call-template>
+ </xsl:template>
+
+ <!-- Template for our jca-jdbc non-XADatasource (local) wrapper, using no transactions. -->
+ <xsl:template match="no-tx-datasource">
+
+ <mbean code="org.jboss.resource.connectionmanager.NoTxConnectionManager"
+ name="jboss.jca:service=NoTxCM,name={jndi-name}"
+ display-name="ConnectionManager for DataSource {jndi-name}">
+
+ <xsl:call-template name="pool">
+ <xsl:with-param name="mcf-template">local-wrapper</xsl:with-param>
+ </xsl:call-template>
+ <xsl:call-template name="cm-common"/>
+ </mbean>
+ <xsl:call-template name="cf-binding">
+ <xsl:with-param name="cm-name">jboss.jca:service=NoTxCM</xsl:with-param>
+ </xsl:call-template>
+
+ <xsl:call-template name="type-mapping">
+ <xsl:with-param name="datasource" select="."/>
+ </xsl:call-template>
+ </xsl:template>
+
+ <!-- Template for our jca-jdbc XADatasource wrapper. -->
+ <xsl:template match="xa-datasource">
+
+ <mbean code="org.jboss.resource.connectionmanager.TxConnectionManager"
+ name="jboss.jca:service=XATxCM,name={jndi-name}"
+ display-name="ConnectionManager for DataSource {jndi-name}">
+
+ <xsl:choose>
+ <xsl:when test="track-connection-by-tx">
+ <attribute name="TrackConnectionByTx">true</attribute>
+ <attribute name="LocalTransactions">false</attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <attribute name="TrackConnectionByTx">false</attribute>
+ <attribute name="LocalTransactions">false</attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+
+ <xsl:if test="isSameRM-override-value">
+ <config-property name="IsSameRMOverrideValue" type="java.lang.Boolean"><xsl:value-of select="normalize-space(isSameRM-override-value)"/></config-property>
+ </xsl:if>
+
+ <xsl:choose>
+ <xsl:when test="wrap-xa-resource">
+ <attribute name="WrapXAResource"><xsl:value-of select="normalize-space(wrap-xa-resource)"/></attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <attribute name="WrapXAResource">false</attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+
+ <xsl:choose>
+ <xsl:when test="pad-xid">
+ <attribute name="PadXid"><xsl:value-of select="normalize-space(pad-xid)"/></attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <attribute name="PadXid">false</attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+
+
+ <xsl:if test="xa-resource-timeout">
+ <attribute name="XAResourceTransactionTimeout"><xsl:value-of select="normalize-space(xa-resource-timeout)"/></attribute>
+ </xsl:if>
+
+ <xsl:call-template name="pool">
+ <xsl:with-param name="mcf-template">xa-wrapper</xsl:with-param>
+ </xsl:call-template>
+ <xsl:call-template name="cm-common"/>
+ <xsl:call-template name="tx-manager"/>
+
+ </mbean>
+ <xsl:call-template name="cf-binding">
+ <xsl:with-param name="cm-name">jboss.jca:service=XATxCM</xsl:with-param>
+ </xsl:call-template>
+
+ <xsl:call-template name="type-mapping">
+ <xsl:with-param name="datasource" select="."/>
+ </xsl:call-template>
+ </xsl:template>
+
+ <!-- template to generate a property file format from a set of -->
+ <!-- <xa-datasource-property name="blah">blah-value</xa-datasource-property> -->
+ <!-- or -->
+ <!-- <connection-property name="foo">bar</connection-property> -->
+ <!-- tags. The newline in the xsl:text element is crucial! -->
+ <!-- this makes a property file format, not the ; delimited format-->
+ <xsl:template match="xa-datasource-property|connection-property">
+ <xsl:value-of select="@name"/>=<xsl:value-of select="normalize-space(.)"/><xsl:text>
+</xsl:text>
+ </xsl:template>
+
+ <!-- template to generate the ManagedConnectionFactory mbean for a generic jca adapter -->
+ <xsl:template name="generic-mcf">
+ <depends optional-attribute-name="ManagedConnectionFactoryName">
+ <!--embedded mbean-->
+ <mbean code="org.jboss.resource.connectionmanager.RARDeployment" name="jboss.jca:service=ManagedConnectionFactory,name={jndi-name}" display-name="ManagedConnectionFactory for ConnectionFactory {jndi-name}">
+
+ <xsl:apply-templates select="depends" mode="anonymous"/>
+ <attribute name="ManagedConnectionFactoryProperties">
+ <properties>
+
+ <!--we need the other standard properties here-->
+ <xsl:if test="user-name">
+ <config-property name="UserName" type="java.lang.String"><xsl:value-of select="normalize-space(user-name)"/></config-property>
+ </xsl:if>
+ <xsl:if test="password">
+ <config-property name="Password" type="java.lang.String"><xsl:value-of select="normalize-space(password)"/></config-property>
+ </xsl:if>
+ <xsl:apply-templates select="config-property"/>
+ </properties>
+ </attribute>
+
+ <attribute name="RARName"><xsl:value-of select="rar-name"/></attribute>
+ <attribute name="ConnectionDefinition"><xsl:value-of select="connection-definition"/></attribute>
+
+ <depends optional-attribute-name="OldRarDeployment">jboss.jca:service=RARDeployment,name='<xsl:value-of select="rar-name"/>'</depends>
+
+ </mbean>
+ </depends>
+ </xsl:template>
+
+ <!-- template to copy config-property elements. This actually does a literal copy -->
+ <!-- Please keep this for consistency with the jb4 version which does not do a literal copy -->
+ <xsl:template match="config-property">
+ <config-property name="{@name}" type="{@type}"><xsl:apply-templates/></config-property>
+ </xsl:template>
+
+ <!-- template to generate the ManagedConnectionFactory mbean for our jca-jdbc local wrapper -->
+ <xsl:template name="local-wrapper">
+
+ <depends optional-attribute-name="ManagedConnectionFactoryName">
+ <!--embedded mbean-->
+ <mbean code="org.jboss.resource.connectionmanager.RARDeployment" name="jboss.jca:service=ManagedConnectionFactory,name={jndi-name}" display-name="ManagedConnectionFactory for DataSource {jndi-name}">
+
+ <xsl:apply-templates select="depends" mode="anonymous"/>
+
+ <depends optional-attribute-name="OldRarDeployment">jboss.jca:service=RARDeployment,name='jboss-local-jdbc.rar'</depends>
+ <attribute name="RARName"><xsl:value-of select="jboss-local-jdbc.rar"/></attribute>
+ <attribute name="ConnectionDefinition">javax.sql.DataSource</attribute>
+
+ <attribute name="ManagedConnectionFactoryProperties">
+ <properties>
+ <config-property name="ConnectionURL" type="java.lang.String"><xsl:value-of select="normalize-space(connection-url)"/></config-property>
+ <config-property name="DriverClass" type="java.lang.String"><xsl:value-of select="normalize-space(driver-class)"/></config-property>
+
+ <xsl:call-template name="wrapper-common-properties"/>
+ <xsl:if test="connection-property">
+ <config-property name="ConnectionProperties" type="java.lang.String">
+ <xsl:apply-templates select="connection-property"/>
+ </config-property>
+ </xsl:if>
+
+ </properties>
+ </attribute>
+ </mbean>
+ </depends>
+ </xsl:template>
+
+ <xsl:template name="xa-wrapper">
+ <depends optional-attribute-name="ManagedConnectionFactoryName">
+ <!--embedded mbean-->
+ <mbean code="org.jboss.resource.connectionmanager.RARDeployment"
+ name="jboss.jca:service=ManagedConnectionFactory,name={jndi-name}"
+ displayname="ManagedConnectionFactory for DataSource {jndi-name}">
+
+ <xsl:apply-templates select="depends" mode="anonymous"/>
+
+ <depends optional-attribute-name="OldRarDeployment">jboss.jca:service=RARDeployment,name='jboss-xa-jdbc.rar'</depends>
+ <attribute name="RARName"><xsl:value-of select="jboss-xa-jdbc.rar"/></attribute>
+ <attribute name="ConnectionDefinition">javax.sql.DataSource</attribute>
+
+ <attribute name="ManagedConnectionFactoryProperties">
+ <properties>
+ <config-property name="XADataSourceClass" type="java.lang.String"><xsl:value-of select="normalize-space(xa-datasource-class)"/></config-property>
+
+ <config-property name="XADataSourceProperties" type="java.lang.String">
+ <xsl:apply-templates select="xa-datasource-property"/>
+ </config-property>
+
+ <!-- remove for new XA handling
+ <xsl:if test="isSameRM-override-value">
+ <config-property name="IsSameRMOverrideValue" type="java.lang.Boolean"><xsl:value-of select="normalize-space(isSameRM-override-value)"/></config-property>
+ </xsl:if>
+ -->
+ <xsl:call-template name="wrapper-common-properties"/>
+
+ </properties>
+ </attribute>
+ </mbean>
+ </depends>
+ </xsl:template>
+
+ <!-- template for the ManagedConnectionFactory properties shared between our local and xa wrappers -->
+ <xsl:template name="wrapper-common-properties">
+
+ <xsl:if test="transaction-isolation">
+ <config-property name="TransactionIsolation" type="java.lang.String"><xsl:value-of select="normalize-space(transaction-isolation)"/></config-property>
+ </xsl:if>
+ <xsl:if test="user-name">
+ <config-property name="UserName" type="java.lang.String"><xsl:value-of select="normalize-space(user-name)"/></config-property>
+ </xsl:if>
+ <xsl:if test="password">
+ <config-property name="Password" type="java.lang.String"><xsl:value-of select="normalize-space(password)"/></config-property>
+ </xsl:if>
+ <xsl:if test="new-connection-sql">
+ <config-property name="NewConnectionSQL" type="java.lang.String"><xsl:value-of select="normalize-space(new-connection-sql)"/></config-property>
+ </xsl:if>
+ <xsl:if test="check-valid-connection-sql">
+ <config-property name="CheckValidConnectionSQL" type="java.lang.String"><xsl:value-of select="normalize-space(check-valid-connection-sql)"/></config-property>
+ </xsl:if>
+ <xsl:if test="valid-connection-checker-class-name">
+ <config-property name="ValidConnectionCheckerClassName" type="java.lang.String"><xsl:value-of select="normalize-space(valid-connection-checker-class-name)"/></config-property>
+ </xsl:if>
+ <xsl:if test="exception-sorter-class-name">
+ <config-property name="ExceptionSorterClassName" type="java.lang.String"><xsl:value-of select="normalize-space(exception-sorter-class-name)"/></config-property>
+ </xsl:if>
+ <xsl:if test="stale-connection-checker-class-name">
+ <config-property name="StaleConnectionCheckerClassName" type="java.lang.String"><xsl:value-of select="normalize-space(stale-connection-checker-class-name)"/></config-property>
+ </xsl:if>
+ <xsl:if test="track-statements">
+ <config-property name="TrackStatements" type="java.lang.String"><xsl:value-of select="normalize-space(track-statements)"/></config-property>
+ </xsl:if>
+ <xsl:if test="prepared-statement-cache-size">
+ <config-property name="PreparedStatementCacheSize" type="int"><xsl:value-of select="normalize-space(prepared-statement-cache-size)"/></config-property>
+ </xsl:if>
+ <xsl:if test="share-prepared-statements">
+ <config-property name="SharePreparedStatements" type="boolean"><xsl:value-of select="normalize-space(share-prepared-statements)"/></config-property>
+ </xsl:if>
+ <xsl:if test="set-tx-query-timeout">
+ <config-property name="TransactionQueryTimeout" type="boolean">true</config-property>
+ </xsl:if>
+ <xsl:if test="query-timeout">
+ <config-property name="QueryTimeout" type="int"><xsl:value-of select="normalize-space(query-timeout)"/></config-property>
+ </xsl:if>
+ <xsl:if test="url-delimeter">
+ <config-property name="URLDelimeter" type="java.lang.String"><xsl:value-of select="normalize-space(url-delimeter)"/></config-property>
+ </xsl:if>
+ <!-- new matching/background validation-->
+ <xsl:choose>
+ <xsl:when test="validate-on-match">
+ <config-property name="ValidateOnMatch" type="boolean"><xsl:value-of select="normalize-space(validate-on-match)"/></config-property>
+ </xsl:when>
+ <xsl:otherwise>
+ <config-property name="ValidateOnMatch" type="boolean">true</config-property>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!-- template to generate the pool mbean -->
+ <xsl:template name="pool">
+ <xsl:param name="mcf-template">generic-mcf</xsl:param>
+ <depends optional-attribute-name="ManagedConnectionPool">
+
+ <!--embedded mbean-->
+ <mbean code="org.jboss.resource.connectionmanager.JBossManagedConnectionPool" name="jboss.jca:service=ManagedConnectionPool,name={jndi-name}" display-name="Connection Pool for DataSource {jndi-name}">
+ <xsl:choose>
+ <xsl:when test="$mcf-template='generic-mcf'">
+ <xsl:call-template name="generic-mcf"/>
+ </xsl:when>
+ <xsl:when test="$mcf-template='local-wrapper'">
+ <xsl:call-template name="local-wrapper"/>
+ </xsl:when>
+ <xsl:when test="$mcf-template='ha-local-wrapper'">
+ <xsl:call-template name="ha-local-wrapper"/>
+ </xsl:when>
+ <xsl:when test="$mcf-template='ha-xa-wrapper'">
+ <xsl:call-template name="ha-xa-wrapper"/>
+ </xsl:when>
+ <xsl:when test="$mcf-template='xa-wrapper'">
+ <xsl:call-template name="xa-wrapper"/>
+ </xsl:when>
+ </xsl:choose>
+
+ <attribute name="PoolJndiName"><xsl:value-of select="jndi-name"/></attribute>
+
+ <xsl:choose>
+ <xsl:when test="min-pool-size">
+ <attribute name="MinSize"><xsl:value-of select="min-pool-size"/></attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <attribute name="MinSize">0</attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:choose>
+ <xsl:when test="max-pool-size">
+ <attribute name="MaxSize"><xsl:value-of select="max-pool-size"/></attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <attribute name="MaxSize">20</attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:choose>
+ <xsl:when test="blocking-timeout-millis">
+ <attribute name="BlockingTimeoutMillis"><xsl:value-of select="blocking-timeout-millis"/></attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <attribute name="BlockingTimeoutMillis">30000</attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:choose>
+ <xsl:when test="idle-timeout-minutes">
+ <attribute name="IdleTimeoutMinutes"><xsl:value-of select="idle-timeout-minutes"/></attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <attribute name="IdleTimeoutMinutes">15</attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <!-- background validation -->
+ <xsl:choose>
+ <xsl:when test="background-validation">
+ <attribute name="BackGroundValidation"><xsl:value-of select="background-validation"/></attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <attribute name="BackGroundValidation">False</attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:choose>
+ <xsl:when test="background-validation-minutes">
+ <attribute name="BackGroundValidationMinutes"><xsl:value-of select="background-validation-minutes"/></attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <attribute name="BackGroundValidationMinutes">10</attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:choose>
+ <xsl:when test="prefill">
+ <attribute name="PreFill"><xsl:value-of select="prefill"/></attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <attribute name="PreFill">False</attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:choose>
+ <xsl:when test="strict-min">
+ <attribute name="StrictMin"><xsl:value-of select="strict-min"/></attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <attribute name="StrictMin">False</attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+
+
+ <xsl:choose>
+ <xsl:when test="statistics-formatter">
+ <attribute name="StatisticsFormatter"><xsl:value-of select="statistics-formatter"/></attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <attribute name="StatisticsFormatter">org.jboss.resource.statistic.pool.JBossDefaultSubPoolStatisticFormatter</attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+
+ <!--
+ criteria indicates if Subject (from security domain) or app supplied
+ parameters (such as from getConnection(user, pw)) are used to distinguish
+ connections in the pool. Choices are
+ ByContainerAndApplication (use both),
+ ByContainer (use Subject),
+ ByApplication (use app supplied params only),
+ ByNothing (all connections are equivalent, usually if adapter supports
+ reauthentication)-->
+ <attribute name="Criteria">
+ <xsl:choose>
+ <xsl:when test="application-managed-security">ByApplication</xsl:when>
+ <xsl:when test="security-domain-and-application">ByContainerAndApplication</xsl:when>
+ <xsl:when test="security-domain">ByContainer</xsl:when>
+ <xsl:otherwise>ByNothing</xsl:otherwise>
+ </xsl:choose>
+ </attribute>
+ <xsl:choose>
+ <xsl:when test="no-tx-separate-pools">
+ <attribute name="NoTxSeparatePools">true</attribute>
+ </xsl:when>
+ </xsl:choose>
+ </mbean>
+ </depends>
+ </xsl:template>
+
+
+ <!-- template for ConnectionManager attributes shared among all ConnectionManagers.-->
+ <xsl:template name="cm-common">
+
+ <attribute name="JndiName"><xsl:value-of select="jndi-name"/></attribute>
+ <depends optional-attribute-name="CachedConnectionManager">jboss.jca:service=CachedConnectionManager</depends>
+
+ <xsl:if test="security-domain|security-domain-and-application">
+ <attribute name="SecurityDomainJndiName"><xsl:value-of select="security-domain|security-domain-and-application"/></attribute>
+ <depends optional-attribute-name="JaasSecurityManagerService">jboss.security:service=JaasSecurityManager</depends>
+ </xsl:if>
+
+ </xsl:template>
+
+ <!-- Datasource binding -->
+ <xsl:template name="ds-binding">
+ <xsl:param name="cm-name"></xsl:param>
+
+ <mbean code="org.jboss.resource.adapter.jdbc.remote.WrapperDataSourceService"
+ name="jboss.jca:service=DataSourceBinding,name={jndi-name}"
+ display-name="Binding for DataSource {jndi-name}">
+ <attribute name="JndiName"><xsl:value-of select="jndi-name"/></attribute>
+ <!--
+ <xsl:choose>
+ <xsl:when test="use-java-context">
+ <xsl:call-template name="use-java-context">
+ <xsl:with-param name="use-java"><xsl:value-of select="use-java-context"/></xsl:with-param>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <attribute name="UseJavaContext">true</attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ -->
+ <xsl:choose>
+ <xsl:when test="use-java-context">
+ <attribute name="UseJavaContext"><xsl:value-of select="use-java-context"/></attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <attribute name="UseJavaContext">true</attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <depends optional-attribute-name="ConnectionManager">
+ <xsl:value-of select="$cm-name"/>,name=<xsl:value-of select="jndi-name"/>
+ </depends>
+ <xsl:choose>
+ <xsl:when test="jmx-invoker-name">
+ <depends optional-attribute-name="JMXInvokerName"><xsl:value-of select="jmx-invoker-name"/></depends>
+ </xsl:when>
+ <xsl:otherwise>
+ <depends optional-attribute-name="JMXInvokerName">jboss:service=invoker,type=jrmp</depends>
+ </xsl:otherwise>
+ </xsl:choose>
+
+ </mbean>
+ </xsl:template>
+
+ <xsl:template name="use-java-context">
+ <xsl:param name="use-java" />
+ <attribute name="UseJavaContext"><xsl:value-of select="$use-java"/></attribute>
+ <!-- Only assign the JMXInvokerName attribute and dependency if use-java-context is false -->
+ <xsl:if test="$use-java = 'false'">
+ <xsl:choose>
+ <xsl:when test="jmx-invoker-name">
+ <depends optional-attribute-name="JMXInvokerName"><xsl:value-of select="jmx-invoker-name"/></depends>
+ </xsl:when>
+ <xsl:otherwise>
+ <depends optional-attribute-name="JMXInvokerName">jboss:service=invoker,type=jrmp</depends>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ </xsl:template>
+
+ <!-- Connection factory binding -->
+ <xsl:template name="cf-binding">
+ <xsl:param name="cm-name"></xsl:param>
+
+ <mbean code="org.jboss.resource.connectionmanager.ConnectionFactoryBindingService"
+ name="jboss.jca:service=DataSourceBinding,name={jndi-name}"
+ display-name="Binding for ConnectionFactory {jndi-name}">
+ <attribute name="JndiName"><xsl:value-of select="jndi-name"/></attribute>
+ <xsl:choose>
+ <xsl:when test="use-java-context">
+ <attribute name="UseJavaContext"><xsl:value-of select="use-java-context"/></attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <attribute name="UseJavaContext">true</attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <depends optional-attribute-name="ConnectionManager">
+ <xsl:value-of select="$cm-name"/>,name=<xsl:value-of select="jndi-name"/>
+ </depends>
+ </mbean>
+ </xsl:template>
+
+ <xsl:template name="tx-manager">
+ <depends optional-attribute-name="TransactionManagerService">jboss:service=TransactionManager</depends>
+ </xsl:template>
+
+ <xsl:template name="type-mapping">
+ <xsl:param name="datasource"/>
+
+ <xsl:if test="$datasource/metadata or $datasource/type-mapping">
+ <xsl:element name="mbean">
+ <xsl:attribute name="code">org.jboss.ejb.plugins.cmp.jdbc.metadata.DataSourceMetaData</xsl:attribute>
+ <xsl:attribute name="name">
+ <xsl:text>jboss.jdbc:service=metadata,datasource=</xsl:text>
+ <xsl:value-of select="$datasource/jndi-name"/>
+ </xsl:attribute>
+
+ <xsl:element name="depends">
+ <xsl:attribute name="optional-attribute-name">MetadataLibrary</xsl:attribute>
+ <xsl:text>jboss.jdbc:service=metadata</xsl:text>
+ </xsl:element>
+
+ <xsl:if test="$datasource/type-mapping">
+ <xsl:element name="attribute">
+ <xsl:attribute name="name">TypeMapping</xsl:attribute>
+ <xsl:value-of select="$datasource/type-mapping"/>
+ </xsl:element>
+ </xsl:if>
+
+ <!-- DEPRECATED in favor of type-mapping -->
+ <xsl:if test="$datasource/metadata">
+ <xsl:element name="attribute">
+ <xsl:attribute name="name">TypeMapping</xsl:attribute>
+ <xsl:value-of select="$datasource/metadata/type-mapping"/>
+ </xsl:element>
+ </xsl:if>
+ </xsl:element>
+ </xsl:if>
+ </xsl:template>
+
+ <!-- template to copy any anonymous depends elements inside a cf/ds configuration element -->
+ <xsl:template match="depends" mode="anonymous">
+ <depends><xsl:value-of select="."/></depends>
+ </xsl:template>
+
+ <!-- template to copy all other elements literally, mbeans for instance-->
+ <xsl:template match="*|@*|text()">
+ <xsl:copy>
+ <xsl:apply-templates select="*|@*|text()"/>
+ </xsl:copy>
+ </xsl:template>
+
+ <!--
+ | new experimental ha stuff
+ -->
+
+ <xsl:template match="ha-local-tx-datasource">
+
+ <mbean code="org.jboss.resource.connectionmanager.TxConnectionManager"
+ name="jboss.jca:service=LocalTxCM,name={jndi-name}"
+ display-name="ConnectionManager for DataSource {jndi-name}">
+
+ <attribute name="TrackConnectionByTx">true</attribute>
+ <attribute name="LocalTransactions">true</attribute>
+
+ <xsl:call-template name="pool">
+ <xsl:with-param name="mcf-template">ha-local-wrapper</xsl:with-param>
+ </xsl:call-template>
+ <xsl:call-template name="cm-common"/>
+ <xsl:call-template name="tx-manager"/>
+
+ </mbean>
+ <xsl:call-template name="ds-binding">
+ <xsl:with-param name="cm-name">jboss.jca:service=LocalTxCM</xsl:with-param>
+ </xsl:call-template>
+
+ <xsl:call-template name="type-mapping">
+ <xsl:with-param name="datasource" select="."/>
+ </xsl:call-template>
+ </xsl:template>
+
+ <!-- template to generate the ManagedConnectionFactory mbean for our jca-jdbc local wrapper -->
+ <xsl:template name="ha-local-wrapper">
+
+ <depends optional-attribute-name="ManagedConnectionFactoryName">
+ <!--embedded mbean-->
+ <mbean code="org.jboss.resource.connectionmanager.RARDeployment" name="jboss.jca:service=ManagedConnectionFactory,name={jndi-name}" display-name="ManagedConnectionFactory for DataSource {jndi-name}">
+
+ <xsl:apply-templates select="depends" mode="anonymous"/>
+
+ <depends optional-attribute-name="OldRarDeployment">jboss.jca:service=RARDeployment,name='jboss-ha-local-jdbc.rar'</depends>
+ <attribute name="RARName"><xsl:value-of select="jboss-ha-local-jdbc.rar"/></attribute>
+ <attribute name="ConnectionDefinition">javax.sql.DataSource</attribute>
+
+ <attribute name="ManagedConnectionFactoryProperties">
+ <properties>
+ <config-property name="ConnectionURL" type="java.lang.String"><xsl:value-of select="normalize-space(connection-url)"/></config-property>
+ <config-property name="DriverClass" type="java.lang.String"><xsl:value-of select="normalize-space(driver-class)"/></config-property>
+
+ <xsl:call-template name="wrapper-common-properties"/>
+ <xsl:if test="connection-property">
+ <config-property name="ConnectionProperties" type="java.lang.String">
+ <xsl:apply-templates select="connection-property"/>
+ </config-property>
+ </xsl:if>
+
+ </properties>
+ </attribute>
+ </mbean>
+ </depends>
+ </xsl:template>
+
+ <xsl:template match="ha-xa-datasource">
+
+ <mbean code="org.jboss.resource.connectionmanager.TxConnectionManager"
+ name="jboss.jca:service=XATxCM,name={jndi-name}"
+ display-name="ConnectionManager for DataSource {jndi-name}">
+
+ <xsl:choose>
+ <xsl:when test="track-connection-by-tx">
+ <attribute name="TrackConnectionByTx">true</attribute>
+ <attribute name="LocalTransactions">false</attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <attribute name="TrackConnectionByTx">false</attribute>
+ <attribute name="LocalTransactions">false</attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+
+ <xsl:if test="xa-resource-timeout">
+ <attribute name="XAResourceTransactionTimeout"><xsl:value-of select="normalize-space(xa-resource-timeout)"/></attribute>
+ </xsl:if>
+
+ <xsl:call-template name="pool">
+ <xsl:with-param name="mcf-template">ha-xa-wrapper</xsl:with-param>
+ </xsl:call-template>
+ <xsl:call-template name="cm-common"/>
+ <xsl:call-template name="tx-manager"/>
+
+ </mbean>
+ <xsl:call-template name="ds-binding">
+ <xsl:with-param name="cm-name">jboss.jca:service=XATxCM</xsl:with-param>
+ </xsl:call-template>
+
+ <xsl:call-template name="type-mapping">
+ <xsl:with-param name="datasource" select="."/>
+ </xsl:call-template>
+ </xsl:template>
+
+ <xsl:template name="ha-xa-wrapper">
+ <depends optional-attribute-name="ManagedConnectionFactoryName">
+ <!--embedded mbean-->
+ <mbean code="org.jboss.resource.connectionmanager.RARDeployment"
+ name="jboss.jca:service=ManagedConnectionFactory,name={jndi-name}"
+ displayname="ManagedConnectionFactory for DataSource {jndi-name}">
+
+ <xsl:apply-templates select="depends" mode="anonymous"/>
+
+ <depends optional-attribute-name="OldRarDeployment">jboss.jca:service=RARDeployment,name='jboss-ha-xa-jdbc.rar'</depends>
+ <attribute name="RARName"><xsl:value-of select="jboss-ha-xa-jdbc.rar"/></attribute>
+ <attribute name="ConnectionDefinition">javax.sql.DataSource</attribute>
+
+ <attribute name="ManagedConnectionFactoryProperties">
+ <properties>
+ <config-property name="XADataSourceClass" type="java.lang.String"><xsl:value-of select="normalize-space(xa-datasource-class)"/></config-property>
+
+ <config-property name="XADataSourceProperties" type="java.lang.String">
+ <xsl:apply-templates select="xa-datasource-property"/>
+ </config-property>
+
+ <xsl:if test="isSameRM-override-value">
+ <config-property name="IsSameRMOverrideValue" type="java.lang.Boolean"><xsl:value-of select="normalize-space(isSameRM-override-value)"/></config-property>
+ </xsl:if>
+
+ <xsl:if test="url-property">
+ <config-property name="URLProperty" type="java.lang.String"><xsl:value-of select="normalize-space(url-property)"/></config-property>
+ </xsl:if>
+
+ <xsl:call-template name="wrapper-common-properties"/>
+
+ </properties>
+ </attribute>
+ </mbean>
+ </depends>
+ </xsl:template>
+
+</xsl:stylesheet>
Added: branches/JCA/jboss-embedded/src/main/resources/readme.txt
===================================================================
--- branches/JCA/jboss-embedded/src/main/resources/readme.txt (rev 0)
+++ branches/JCA/jboss-embedded/src/main/resources/readme.txt 2009-12-19 03:37:05 UTC (rev 1684)
@@ -0,0 +1 @@
+This Bootstrap is from BETA3-SP10 of EmbeddedJBoss.
15 years
teiid SVN: r1683 - trunk/test-integration/db/src/main/resources/datasources.
by teiid-commits@lists.jboss.org
Author: vhalbert(a)redhat.com
Date: 2009-12-18 17:00:20 -0500 (Fri, 18 Dec 2009)
New Revision: 1683
Modified:
trunk/test-integration/db/src/main/resources/datasources/readme.txt
Log:
Teiid 781 - updated information on how to setup a datasource
Modified: trunk/test-integration/db/src/main/resources/datasources/readme.txt
===================================================================
--- trunk/test-integration/db/src/main/resources/datasources/readme.txt 2009-12-18 20:51:39 UTC (rev 1682)
+++ trunk/test-integration/db/src/main/resources/datasources/readme.txt 2009-12-18 22:00:20 UTC (rev 1683)
@@ -1 +1,8 @@
-These datasources are used for product testing
\ No newline at end of file
+The datasources is the location the testing framework will look, by default, to find the datasources to use for testing.
+
+Each datasource in use will have its own directory. Within, that directory, will reside a connection.properties file that
+the process will look for. The current directories contain an example properties file that can be used. Rename the file
+to connection.properties and update the properties.
+
+NOTE: 2 Datasource directories, each containing a connection.properties file, are required in order to run the integration tests.
+ Each data source can be pointing to the same database instance, but the schemas must be different.
15 years
teiid SVN: r1682 - trunk/test-integration/db/src/main/java/org/teiid/test/framework.
by teiid-commits@lists.jboss.org
Author: vhalbert(a)redhat.com
Date: 2009-12-18 15:51:39 -0500 (Fri, 18 Dec 2009)
New Revision: 1682
Modified:
trunk/test-integration/db/src/main/java/org/teiid/test/framework/TransactionContainer.java
Log:
Teiid 781 - removed this exception logic check because its normally handled after all stages complete.
Modified: trunk/test-integration/db/src/main/java/org/teiid/test/framework/TransactionContainer.java
===================================================================
--- trunk/test-integration/db/src/main/java/org/teiid/test/framework/TransactionContainer.java 2009-12-18 15:04:27 UTC (rev 1681)
+++ trunk/test-integration/db/src/main/java/org/teiid/test/framework/TransactionContainer.java 2009-12-18 20:51:39 UTC (rev 1682)
@@ -90,15 +90,6 @@
}
}
- if (test.exceptionExpected() && !test.exceptionOccurred()) {
- TransactionRuntimeException t = new TransactionRuntimeException(
- "Expected exception, but one did not occur for test: "
- + this.getClass().getName() + "."
- + test.getTestName());
- test.setApplicationException(t);
- }
-
-
debug(" test.after");
test.after();
15 years
teiid SVN: r1681 - trunk/test-integration/db.
by teiid-commits@lists.jboss.org
Author: vhalbert(a)redhat.com
Date: 2009-12-18 10:04:27 -0500 (Fri, 18 Dec 2009)
New Revision: 1681
Modified:
trunk/test-integration/db/howto
trunk/test-integration/db/pom.xml
Log:
Teiid 781 - fixed pom
Modified: trunk/test-integration/db/howto
===================================================================
--- trunk/test-integration/db/howto 2009-12-17 18:59:48 UTC (rev 1680)
+++ trunk/test-integration/db/howto 2009-12-18 15:04:27 UTC (rev 1681)
@@ -70,7 +70,7 @@
Example:
- mvn -Ddatasource=oracle -Psingledatasource
+ mvn pre-integration-test -Ddatasource=oracle -Psingledatasource
==========================================
Executing the db integration tests
Modified: trunk/test-integration/db/pom.xml
===================================================================
--- trunk/test-integration/db/pom.xml 2009-12-17 18:59:48 UTC (rev 1680)
+++ trunk/test-integration/db/pom.xml 2009-12-18 15:04:27 UTC (rev 1681)
@@ -237,12 +237,6 @@
</dependencies>
-
-
-
- <profiles>
- <profile>
- <id>runalltests</id>
<build>
<plugins>
<!-- Specify the compiler options and settings -->
@@ -256,6 +250,15 @@
<showWarnings>false</showWarnings>
</configuration>
</plugin>
+ </plugins>
+ </build>
+
+
+ <profiles>
+ <profile>
+ <id>runalltests</id>
+ <build>
+ <plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
@@ -323,17 +326,6 @@
<build>
<plugins>
- <!-- Specify the compiler options and settings -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>1.6</source>
- <target>1.6</target>
- <showDeprecation>false</showDeprecation>
- <showWarnings>false</showWarnings>
- </configuration>
- </plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
@@ -486,16 +478,7 @@
</activation>
<build>
<plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>1.6</source>
- <target>1.6</target>
- <showDeprecation>false</showDeprecation>
- <showWarnings>false</showWarnings>
- </configuration>
- </plugin>
+
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
@@ -543,22 +526,14 @@
<profile>
<id>assemble</id>
<!-- assemble will compile, but not run the tests prior to assemblying the kit -->
- <activation>
- <activeByDefault>true</activeByDefault>
+ <activation>
+ <property>
+ <name>qe.artifacts</name>
+ </property>
</activation>
<build>
<plugins>
- <!-- Specify the compiler options and settings -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>1.6</source>
- <target>1.6</target>
- <showDeprecation>false</showDeprecation>
- <showWarnings>false</showWarnings>
- </configuration>
- </plugin>
+
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
@@ -566,9 +541,10 @@
<skip>true</skip>
</configuration>
</plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-antrun-plugin</artifactId>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
<dependencies>
<dependency>
<groupId>org.apache.ant</groupId>
@@ -576,26 +552,56 @@
<version>${apache.ant.version}</version>
</dependency>
</dependencies>
-
- <executions>
- <execution>
- <!-- assemble all the console artifacts that make up the console kit -->
- <id>assemble-artifacts</id>
- <phase>package</phase>
- <configuration>
- <tasks>
- <property name="product.version" value="${project.version}" />
- <!-- location to assemble the console artifacts -->
- <property name="relative.artifact.dir" value="target/distribution/artifacts/teiid-ctc-test-client-${project.version}"></property>
- <ant antfile="src/assembly/assemble-ctc-client.xml"/>
- </tasks>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
+ <executions>
+ <execution>
+ <!-- zip up the qe artificats -->
+
+ <id>assembly-qe-artifacxts</id>
+ <phase>package</phase>
+ <configuration>
+ <tasks>
+ <zip destfile="target/qe_artifacts.zip">
+ <zipfileset dir="${qe.artifacts}" prefix="qe_artifacts" />
+ </zip>
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <version>2.2-beta-2</version>
+ <configuration>
+ <descriptors>
+ <descriptor>src/assembly/binaries.xml</descriptor>
+ </descriptors>
+ <outputDirectory>target/distribution</outputDirectory>
+ <workDirectory>target/assembly/work</workDirectory>
+
+ <systemProperties>
+ <property>
+ <name>qe.artifacts.file</name>
+ <value>target/qe_artifacts.zip</value>
+ </property>
+ </systemProperties>
+
+ </configuration>
+ <executions>
+
+ <execution>
+ <id>make-assembly</id>
+ <phase>package</phase>
+ <goals>
+ <goal>attached</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
</plugins>
</build>
</profile>
15 years