teiid SVN: r1013 - trunk/engine/src/main/java/org/teiid/dqp/internal/process.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2009-05-30 09:02:35 -0400 (Sat, 30 May 2009)
New Revision: 1013
Modified:
trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java
Log:
TEIID-635 preventing the last embedded worker from seeing a stopped cache
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java 2009-05-29 21:23:05 UTC (rev 1012)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java 2009-05-30 13:02:35 UTC (rev 1013)
@@ -32,6 +32,7 @@
import java.util.Map;
import java.util.Properties;
import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.TimeUnit;
import javax.transaction.InvalidTransactionException;
import javax.transaction.SystemException;
@@ -168,6 +169,10 @@
@Override
public void stop() throws ApplicationLifecycleException {
processWorkerPool.shutdown();
+ try {
+ processWorkerPool.awaitTermination(10, TimeUnit.SECONDS);
+ } catch (InterruptedException e) {
+ }
contextCache.shutdown();
super.stop();
}
15 years, 6 months
teiid SVN: r1012 - in trunk/engine/src: test/java/com/metamatrix/query/processor/relational and 1 other directory.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2009-05-29 17:23:05 -0400 (Fri, 29 May 2009)
New Revision: 1012
Modified:
trunk/engine/src/main/java/com/metamatrix/query/processor/relational/GroupingNode.java
trunk/engine/src/test/java/com/metamatrix/query/processor/relational/TestGroupingNode.java
Log:
TEIID-636 fix for dup removal performed by a grouping node.
Modified: trunk/engine/src/main/java/com/metamatrix/query/processor/relational/GroupingNode.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/processor/relational/GroupingNode.java 2009-05-29 19:53:46 UTC (rev 1011)
+++ trunk/engine/src/main/java/com/metamatrix/query/processor/relational/GroupingNode.java 2009-05-29 21:23:05 UTC (rev 1012)
@@ -320,6 +320,7 @@
private void sortPhase() throws BlockedException, MetaMatrixComponentException, MetaMatrixProcessingException {
this.sortedID = this.sortUtility.sort();
+ this.rowCount = this.getBufferManager().getFinalRowCount(this.sortedID);
this.phase = GROUP;
}
Modified: trunk/engine/src/test/java/com/metamatrix/query/processor/relational/TestGroupingNode.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/query/processor/relational/TestGroupingNode.java 2009-05-29 19:53:46 UTC (rev 1011)
+++ trunk/engine/src/test/java/com/metamatrix/query/processor/relational/TestGroupingNode.java 2009-05-29 21:23:05 UTC (rev 1012)
@@ -178,20 +178,7 @@
public void test2() throws Exception {
BufferManager mgr = BufferManagerFactory.getStandaloneBufferManager();
- // Set up
- GroupingNode node = new GroupingNode(1);
- List outputElements = new ArrayList();
- ElementSymbol col1 = new ElementSymbol("col1"); //$NON-NLS-1$
- col1.setType(Integer.class);
- ElementSymbol col2 = new ElementSymbol("col2"); //$NON-NLS-1$
- col2.setType(Integer.class);
- outputElements.add(col1);
- outputElements.add(new AggregateSymbol("countDist", "COUNT", true, col2)); //$NON-NLS-1$ //$NON-NLS-2$
- node.setElements(outputElements);
-
- List groupingElements = new ArrayList();
- groupingElements.add(new ElementSymbol("col1")); //$NON-NLS-1$
- node.setGroupingElements(groupingElements);
+ GroupingNode node = getExampleGroupingNode();
CommandContext context = new CommandContext("pid", "test", null, null, null); //$NON-NLS-1$ //$NON-NLS-2$
node.initialize(context, mgr, null);
@@ -214,20 +201,7 @@
BufferManager mgr = BufferManagerFactory.getStandaloneBufferManager();
((BufferManagerImpl)mgr).getConfig().setProcessorBatchSize(5);
- // Set up
- GroupingNode node = new GroupingNode(1);
- List outputElements = new ArrayList();
- ElementSymbol col1 = new ElementSymbol("col1"); //$NON-NLS-1$
- col1.setType(Integer.class);
- ElementSymbol col2 = new ElementSymbol("col2"); //$NON-NLS-1$
- col2.setType(Integer.class);
- outputElements.add(col1);
- outputElements.add(new AggregateSymbol("countDist", "COUNT", true, col2)); //$NON-NLS-1$ //$NON-NLS-2$
- node.setElements(outputElements);
-
- List groupingElements = new ArrayList();
- groupingElements.add(new ElementSymbol("col1")); //$NON-NLS-1$
- node.setGroupingElements(groupingElements);
+ GroupingNode node = getExampleGroupingNode();
CommandContext context = new CommandContext("pid", "test", null, null, null); //$NON-NLS-1$ //$NON-NLS-2$
node.initialize(context, mgr, null);
@@ -431,4 +405,44 @@
public void testLookupFunctionMultipleBatches() throws Exception {
helpTestLookupFunctionInAggregate(3);
}
+
+ public void testDupSort() throws Exception {
+ BufferManager mgr = BufferManagerFactory.getStandaloneBufferManager();
+
+ GroupingNode node = getExampleGroupingNode();
+ node.setRemoveDuplicates(true);
+ CommandContext context = new CommandContext("pid", "test", null, null, null); //$NON-NLS-1$ //$NON-NLS-2$
+ node.initialize(context, mgr, null);
+
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { null, new Integer(1) }),
+ Arrays.asList(new Object[] { new Integer(0), new Integer(1) }),
+ Arrays.asList(new Object[] { new Integer(1), new Integer(1) }),
+ Arrays.asList(new Object[] { new Integer(2), new Integer(2) }),
+ Arrays.asList(new Object[] { new Integer(3), new Integer(1) }),
+ Arrays.asList(new Object[] { new Integer(4), new Integer(2) }),
+ Arrays.asList(new Object[] { new Integer(5), new Integer(1) }),
+ Arrays.asList(new Object[] { new Integer(6), new Integer(2) })
+ };
+
+ helpProcess(mgr, node, context, expected);
+ }
+
+ private GroupingNode getExampleGroupingNode() {
+ GroupingNode node = new GroupingNode(1);
+ List outputElements = new ArrayList();
+ ElementSymbol col1 = new ElementSymbol("col1"); //$NON-NLS-1$
+ col1.setType(Integer.class);
+ ElementSymbol col2 = new ElementSymbol("col2"); //$NON-NLS-1$
+ col2.setType(Integer.class);
+ outputElements.add(col1);
+ outputElements.add(new AggregateSymbol("countDist", "COUNT", true, col2)); //$NON-NLS-1$ //$NON-NLS-2$
+ node.setElements(outputElements);
+
+ List groupingElements = new ArrayList();
+ groupingElements.add(new ElementSymbol("col1")); //$NON-NLS-1$
+ node.setGroupingElements(groupingElements);
+ return node;
+ }
+
}
15 years, 6 months
teiid SVN: r1011 - trunk/build/assembly/embedded.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2009-05-29 15:53:46 -0400 (Fri, 29 May 2009)
New Revision: 1011
Modified:
trunk/build/assembly/embedded/embedded-dependencies.xml
trunk/build/assembly/embedded/embedded-dist.xml
Log:
TEIID-416 adding the dialect jar to the kit.
Modified: trunk/build/assembly/embedded/embedded-dependencies.xml
===================================================================
--- trunk/build/assembly/embedded/embedded-dependencies.xml 2009-05-29 19:52:05 UTC (rev 1010)
+++ trunk/build/assembly/embedded/embedded-dependencies.xml 2009-05-29 19:53:46 UTC (rev 1011)
@@ -45,6 +45,15 @@
</binaries>
</moduleSet>
+ <moduleSet>
+ <includes>
+ <include>org.jboss.teiid:teiid-hibernate-dialect</include>
+ </includes>
+ <binaries>
+ <includeDependencies>false</includeDependencies>
+ <unpack>false</unpack>
+ </binaries>
+ </moduleSet>
</moduleSets>
</assembly>
\ No newline at end of file
Modified: trunk/build/assembly/embedded/embedded-dist.xml
===================================================================
--- trunk/build/assembly/embedded/embedded-dist.xml 2009-05-29 19:52:05 UTC (rev 1010)
+++ trunk/build/assembly/embedded/embedded-dist.xml 2009-05-29 19:53:46 UTC (rev 1011)
@@ -27,6 +27,7 @@
</includes>
<excludes>
<exclude>teiid-txn-jbossts-${version}.jar</exclude>
+ <exclude>teiid-hibernate-dialect-${version}.jar</exclude>
</excludes>
<outputDirectory>lib</outputDirectory>
</fileSet>
@@ -34,6 +35,14 @@
<fileSet>
<directory>target/distribution/teiid-${version}-embedded-dependencies.dir</directory>
<includes>
+ <include>teiid-hibernate-dialect-${version}.jar</include>
+ </includes>
+ <outputDirectory>hibernate</outputDirectory>
+ </fileSet>
+
+ <fileSet>
+ <directory>target/distribution/teiid-${version}-embedded-dependencies.dir</directory>
+ <includes>
<include>teiid-txn-jbossts-${version}.jar</include>
</includes>
<outputDirectory>lib/patches</outputDirectory>
15 years, 6 months
teiid SVN: r1010 - trunk/test-integration.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2009-05-29 15:52:05 -0400 (Fri, 29 May 2009)
New Revision: 1010
Removed:
trunk/test-integration/teiid/
Log:
TEIID-634 preventing missing message key using empty password.
15 years, 6 months
teiid SVN: r1009 - in trunk: console/src/main/java/com/metamatrix/console/connections and 1 other directory.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2009-05-29 15:52:03 -0400 (Fri, 29 May 2009)
New Revision: 1009
Modified:
trunk/client/src/main/java/com/metamatrix/common/comm/platform/client/ServerAdminFactory.java
trunk/console/src/main/java/com/metamatrix/console/connections/ConnectionInfo.java
Log:
TEIID-634 preventing missing message key using empty password.
Modified: trunk/client/src/main/java/com/metamatrix/common/comm/platform/client/ServerAdminFactory.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/common/comm/platform/client/ServerAdminFactory.java 2009-05-29 02:26:41 UTC (rev 1008)
+++ trunk/client/src/main/java/com/metamatrix/common/comm/platform/client/ServerAdminFactory.java 2009-05-29 19:52:03 UTC (rev 1009)
@@ -202,14 +202,13 @@
if (userName == null || userName.trim().length() == 0) {
throw new IllegalArgumentException(AdminPlugin.Util.getString("ERR.014.001.0099")); //$NON-NLS-1$
}
- if (password == null || password.length == 0) {
- throw new IllegalArgumentException(AdminPlugin.Util.getString("ERR.014.001.00100")); //$NON-NLS-1$
- }
final Properties p = new Properties();
p.setProperty(MMURL.CONNECTION.APP_NAME, applicationName);
p.setProperty(MMURL.CONNECTION.USER_NAME, userName);
- p.setProperty(MMURL.CONNECTION.PASSWORD, new String(password));
+ if (password != null) {
+ p.setProperty(MMURL.CONNECTION.PASSWORD, new String(password));
+ }
p.setProperty(MMURL.CONNECTION.SERVER_URL, serverURL);
return createAdmin(p);
}
Modified: trunk/console/src/main/java/com/metamatrix/console/connections/ConnectionInfo.java
===================================================================
--- trunk/console/src/main/java/com/metamatrix/console/connections/ConnectionInfo.java 2009-05-29 02:26:41 UTC (rev 1008)
+++ trunk/console/src/main/java/com/metamatrix/console/connections/ConnectionInfo.java 2009-05-29 19:52:03 UTC (rev 1009)
@@ -239,13 +239,12 @@
if (user == null || user.trim().length() == 0) {
throw new IllegalArgumentException(AdminPlugin.Util.getString(AdminMessages.ADMIN_0099));
}
- if (password == null || password.length == 0) {
- throw new IllegalArgumentException(AdminPlugin.Util.getString(AdminMessages.ADMIN_0100));
- }
Properties properties = new Properties();
properties.setProperty(MMURL.CONNECTION.USER_NAME, user);
- properties.setProperty(MMURL.CONNECTION.PASSWORD, new String(password));
+ if (password != null) {
+ properties.setProperty(MMURL.CONNECTION.PASSWORD, new String(password));
+ }
properties.setProperty(MMURL.CONNECTION.APP_NAME, applicationName);
properties.setProperty(MMURL.CONNECTION.SERVER_URL, mmurl.getAppServerURL());
connection = SocketServerConnectionFactory.getInstance().createConnection(properties);
15 years, 6 months
teiid SVN: r1008 - in trunk/connectors/connector-xml/src: test/resources/documents and 1 other directories.
by teiid-commits@lists.jboss.org
Author: jdoyle
Date: 2009-05-28 22:26:41 -0400 (Thu, 28 May 2009)
New Revision: 1008
Added:
trunk/connectors/connector-xml/src/test/resources/documents/File/
trunk/connectors/connector-xml/src/test/resources/documents/File/.project
trunk/connectors/connector-xml/src/test/resources/documents/File/po_list.xmi
trunk/connectors/connector-xml/src/test/resources/documents/File/purchaseOrder.xmi
trunk/connectors/connector-xml/src/test/resources/documents/File/purchase_orders.vdb
Modified:
trunk/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/soap/SOAPExecutor.java
Log:
Resolving missing import and adding test resources.
Modified: trunk/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/soap/SOAPExecutor.java
===================================================================
--- trunk/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/soap/SOAPExecutor.java 2009-05-28 19:37:45 UTC (rev 1007)
+++ trunk/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/soap/SOAPExecutor.java 2009-05-29 02:26:41 UTC (rev 1008)
@@ -42,8 +42,6 @@
import javax.xml.ws.Service;
import javax.xml.ws.soap.SOAPBinding;
-import net.sf.saxon.dom.DOMNodeList;
-
import org.jdom.Document;
import org.jdom.Element;
import org.jdom.output.DOMOutputter;
@@ -151,9 +149,7 @@
requestNodes = dummyNode.getChildNodes().item(0).getChildNodes();
} else {
org.w3c.dom.Document document = domOutputter.output(doc);
- List singleNode = new ArrayList();
- singleNode.add(document.getFirstChild());
- requestNodes = new DOMNodeList(singleNode);
+ requestNodes = document.getChildNodes();
}
} catch (Exception e) {
throw new ConnectorException(e);
Added: trunk/connectors/connector-xml/src/test/resources/documents/File/.project
===================================================================
--- trunk/connectors/connector-xml/src/test/resources/documents/File/.project (rev 0)
+++ trunk/connectors/connector-xml/src/test/resources/documents/File/.project 2009-05-29 02:26:41 UTC (rev 1008)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>PurchaseOrder</name>
+ <comment>MetaMatrix Enterprise Designer, version 5.5</comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>com.metamatrix.modeler.core.modelBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>com.metamatrix.modeler.core.modelNature</nature>
+ </natures>
+</projectDescription>
Added: trunk/connectors/connector-xml/src/test/resources/documents/File/po_list.xmi
===================================================================
--- trunk/connectors/connector-xml/src/test/resources/documents/File/po_list.xmi (rev 0)
+++ trunk/connectors/connector-xml/src/test/resources/documents/File/po_list.xmi 2009-05-29 02:26:41 UTC (rev 1008)
@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="ASCII"?>
+<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:diagram="http://www.metamatrix.com/metamodels/Diagram" xmlns:jdbc="http://www.metamatrix.com/metamodels/JDBC" xmlns:mmcore="http://www.metamatrix.com/metamodels/Core" xmlns:relational="http://www.metamatrix.com/metamodels/Relational">
+ <mmcore:ModelAnnotation xmi:uuid="mmuuid:94231cc0-4a54-111b-bb0a-ea1884adcb79" primaryMetamodelUri="http://www.metamatrix.com/metamodels/Relational" modelType="PHYSICAL" ProducerName="MetaMatrix" ProducerVersion="5.5">
+ <modelImports xmi:uuid="mmuuid:9aa25200-4a54-111b-bb0a-ea1884adcb79" name="XMLFileConnectorExtensions" modelLocation="../XMLExtensionsProject/XMLFileConnectorExtensions.xmi" uuid="mmuuid:61d94280-b86d-1ffe-bb3d-c715e2d4aaf4" modelType="EXTENSION" primaryMetamodelUri="http://www.metamatrix.com/metamodels/Extension"/>
+ <modelImports xmi:uuid="mmuuid:9a748b40-4a54-111b-bb0a-ea1884adcb79" name="XMLSchema" modelLocation="http://www.w3.org/2001/XMLSchema" modelType="TYPE" primaryMetamodelUri="http://www.eclipse.org/xsd/2002/XSD"/>
+ <extensionPackage href="../XMLExtensionsProject/XMLFileConnectorExtensions.xmi#mmuuid/61d94286-b86d-1ffe-bb3d-c715e2d4aaf4"/>
+ </mmcore:ModelAnnotation>
+ <mmcore:AnnotationContainer xmi:uuid="mmuuid:97e46a82-4a54-111b-bb0a-ea1884adcb79">
+ <annotations xmi:uuid="mmuuid:97e46a83-4a54-111b-bb0a-ea1884adcb79" annotatedObject="mmuuid/97e46a80-4a54-111b-bb0a-ea1884adcb79">
+ <tags xmi:uuid="mmuuid:97e46a84-4a54-111b-bb0a-ea1884adcb79" key="NamespacePrefixes" value="xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:po='http://www.example.com/PO1'"/>
+ </annotations>
+ <annotations xmi:uuid="mmuuid:9802ef08-4a54-111b-bb0a-ea1884adcb79" annotatedObject="mmuuid/9802ef06-4a54-111b-bb0a-ea1884adcb79">
+ <tags xmi:uuid="mmuuid:9802ef09-4a54-111b-bb0a-ea1884adcb79" key="NamespacePrefixes" value="xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:po='http://www.example.com/PO1'"/>
+ </annotations>
+ <annotations xmi:uuid="mmuuid:983ff805-4a54-111b-bb0a-ea1884adcb79" annotatedObject="mmuuid/983ff803-4a54-111b-bb0a-ea1884adcb79">
+ <tags xmi:uuid="mmuuid:983ff806-4a54-111b-bb0a-ea1884adcb79" key="NamespacePrefixes" value="xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:po='http://www.example.com/PO1'"/>
+ </annotations>
+ </mmcore:AnnotationContainer>
+ <relational:BaseTable xmi:uuid="mmuuid:97e46a80-4a54-111b-bb0a-ea1884adcb79" name="item" nameInSource="((((/po:purchaseOrder) | (/po:purchaseOrders/order))/items) | (/po:purchaseOrder/items) | (/po:purchaseOrders/order/items))/item">
+ <columns xmi:uuid="mmuuid:97f3acc0-4a54-111b-bb0a-ea1884adcb79" name="mmid" nameInSource="@com.metamatrix.xml.xpathpart" nativeType="java.lang.String" length="255" nullable="NULLABLE_UNKNOWN" defaultValue="" uniqueKeys="mmuuid/9802ef05-4a54-111b-bb0a-ea1884adcb79">
+ <type href="http://www.w3.org/2001/XMLSchema#string"/>
+ </columns>
+ <columns xmi:uuid="mmuuid:97f3acc1-4a54-111b-bb0a-ea1884adcb79" name="partNum" nameInSource="@partNum" nativeType="java.lang.String" length="255" nullable="NULLABLE_UNKNOWN" defaultValue="">
+ <type href="http://www.w3.org/2001/XMLSchema#string"/>
+ </columns>
+ <columns xmi:uuid="mmuuid:97f3acc2-4a54-111b-bb0a-ea1884adcb79" name="productName" nameInSource="productName/text()" nativeType="java.lang.String" length="255" nullable="NULLABLE_UNKNOWN" defaultValue="">
+ <type href="http://www.w3.org/2001/XMLSchema#string"/>
+ </columns>
+ <columns xmi:uuid="mmuuid:9802ef00-4a54-111b-bb0a-ea1884adcb79" name="quantity" nameInSource="quantity/text()" nativeType="java.lang.String" length="20" nullable="NULLABLE_UNKNOWN" defaultValue="">
+ <type href="http://www.w3.org/2001/XMLSchema#string"/>
+ </columns>
+ <columns xmi:uuid="mmuuid:9802ef01-4a54-111b-bb0a-ea1884adcb79" name="USPrice" nameInSource="USPrice/text()" nativeType="java.lang.String" length="20" nullable="NULLABLE_UNKNOWN" defaultValue="">
+ <type href="http://www.w3.org/2001/XMLSchema#string"/>
+ </columns>
+ <columns xmi:uuid="mmuuid:9802ef02-4a54-111b-bb0a-ea1884adcb79" name="comment" nameInSource="po:comment/text()" nativeType="java.lang.String" length="255" nullable="NULLABLE_UNKNOWN" defaultValue="">
+ <type href="http://www.w3.org/2001/XMLSchema#string"/>
+ </columns>
+ <columns xmi:uuid="mmuuid:9802ef03-4a54-111b-bb0a-ea1884adcb79" name="shipDate" nameInSource="shipDate/text()" nativeType="java.lang.String" length="255" nullable="NULLABLE_UNKNOWN" defaultValue="">
+ <type href="http://www.w3.org/2001/XMLSchema#string"/>
+ </columns>
+ <columns xmi:uuid="mmuuid:9802ef04-4a54-111b-bb0a-ea1884adcb79" name="order_mmid" nameInSource="../../(a)com.metamatrix.xml.xpathpart" nativeType="java.lang.String" length="255" nullable="NULLABLE_UNKNOWN" defaultValue="" foreignKeys="mmuuid/984f3a42-4a54-111b-bb0a-ea1884adcb79">
+ <type href="http://www.w3.org/2001/XMLSchema#string"/>
+ </columns>
+ <foreignKeys xmi:uuid="mmuuid:984f3a42-4a54-111b-bb0a-ea1884adcb79" name="fk_item_order" nameInSource="fk_/po:purchaseOrders/order/items/item_/po:purchaseOrders/order" foreignKeyMultiplicity="UNSPECIFIED" primaryKeyMultiplicity="UNSPECIFIED" columns="mmuuid/9802ef04-4a54-111b-bb0a-ea1884adcb79" uniqueKey="mmuuid/983ff802-4a54-111b-bb0a-ea1884adcb79"/>
+ <primaryKey xmi:uuid="mmuuid:9802ef05-4a54-111b-bb0a-ea1884adcb79" name="pkitem" nameInSource="pk_((((/po:purchaseOrder) | (/po:purchaseOrders/order))/items) | (/po:purchaseOrder/items) | (/po:purchaseOrders/order/items))/item" columns="mmuuid/97f3acc0-4a54-111b-bb0a-ea1884adcb79"/>
+ </relational:BaseTable>
+ <relational:BaseTable xmi:uuid="mmuuid:9802ef06-4a54-111b-bb0a-ea1884adcb79" name="order" nameInSource="/po:purchaseOrders/order">
+ <columns xmi:uuid="mmuuid:98217380-4a54-111b-bb0a-ea1884adcb79" name="purchaseOrders_mmid" nameInSource="../(a)com.metamatrix.xml.xpathpart" nativeType="java.lang.String" length="255" nullable="NULLABLE_UNKNOWN" defaultValue="" foreignKeys="mmuuid/984f3a43-4a54-111b-bb0a-ea1884adcb79">
+ <type href="http://www.w3.org/2001/XMLSchema#string"/>
+ </columns>
+ <columns xmi:uuid="mmuuid:98217381-4a54-111b-bb0a-ea1884adcb79" name="mmid" nameInSource="@com.metamatrix.xml.xpathpart" nativeType="java.lang.String" length="255" nullable="NULLABLE_UNKNOWN" defaultValue="" uniqueKeys="mmuuid/983ff802-4a54-111b-bb0a-ea1884adcb79">
+ <type href="http://www.w3.org/2001/XMLSchema#string"/>
+ </columns>
+ <columns xmi:uuid="mmuuid:98217382-4a54-111b-bb0a-ea1884adcb79" name="orderDate" nameInSource="@orderDate" nativeType="java.lang.String" length="255" nullable="NULLABLE_UNKNOWN" defaultValue="">
+ <type href="http://www.w3.org/2001/XMLSchema#string"/>
+ </columns>
+ <columns xmi:uuid="mmuuid:9830b5c0-4a54-111b-bb0a-ea1884adcb79" name="shipTo_country" nameInSource="shipTo/@country" nativeType="java.lang.String" length="255" nullable="NULLABLE_UNKNOWN" defaultValue="">
+ <type href="http://www.w3.org/2001/XMLSchema#string"/>
+ </columns>
+ <columns xmi:uuid="mmuuid:9830b5c1-4a54-111b-bb0a-ea1884adcb79" name="shipTo_name" nameInSource="shipTo/name/text()" nativeType="java.lang.String" length="255" nullable="NULLABLE_UNKNOWN" defaultValue="">
+ <type href="http://www.w3.org/2001/XMLSchema#string"/>
+ </columns>
+ <columns xmi:uuid="mmuuid:9830b5c2-4a54-111b-bb0a-ea1884adcb79" name="shipTo_street" nameInSource="shipTo/street/text()" nativeType="java.lang.String" length="255" nullable="NULLABLE_UNKNOWN" defaultValue="">
+ <type href="http://www.w3.org/2001/XMLSchema#string"/>
+ </columns>
+ <columns xmi:uuid="mmuuid:9830b5c3-4a54-111b-bb0a-ea1884adcb79" name="shipTo_city" nameInSource="shipTo/city/text()" nativeType="java.lang.String" length="255" nullable="NULLABLE_UNKNOWN" defaultValue="">
+ <type href="http://www.w3.org/2001/XMLSchema#string"/>
+ </columns>
+ <columns xmi:uuid="mmuuid:9830b5c4-4a54-111b-bb0a-ea1884adcb79" name="shipTo_state" nameInSource="shipTo/state/text()" nativeType="java.lang.String" length="255" nullable="NULLABLE_UNKNOWN" defaultValue="">
+ <type href="http://www.w3.org/2001/XMLSchema#string"/>
+ </columns>
+ <columns xmi:uuid="mmuuid:9830b5c5-4a54-111b-bb0a-ea1884adcb79" name="shipTo_zip" nameInSource="shipTo/zip/text()" nativeType="java.lang.String" length="20" nullable="NULLABLE_UNKNOWN" defaultValue="">
+ <type href="http://www.w3.org/2001/XMLSchema#string"/>
+ </columns>
+ <columns xmi:uuid="mmuuid:9830b5c6-4a54-111b-bb0a-ea1884adcb79" name="billTo_country" nameInSource="billTo/@country" nativeType="java.lang.String" length="255" nullable="NULLABLE_UNKNOWN" defaultValue="">
+ <type href="http://www.w3.org/2001/XMLSchema#string"/>
+ </columns>
+ <columns xmi:uuid="mmuuid:9830b5c7-4a54-111b-bb0a-ea1884adcb79" name="billTo_name" nameInSource="billTo/name/text()" nativeType="java.lang.String" length="255" nullable="NULLABLE_UNKNOWN" defaultValue="">
+ <type href="http://www.w3.org/2001/XMLSchema#string"/>
+ </columns>
+ <columns xmi:uuid="mmuuid:9830b5c8-4a54-111b-bb0a-ea1884adcb79" name="billTo_street" nameInSource="billTo/street/text()" nativeType="java.lang.String" length="255" nullable="NULLABLE_UNKNOWN" defaultValue="">
+ <type href="http://www.w3.org/2001/XMLSchema#string"/>
+ </columns>
+ <columns xmi:uuid="mmuuid:9830b5c9-4a54-111b-bb0a-ea1884adcb79" name="billTo_city" nameInSource="billTo/city/text()" nativeType="java.lang.String" length="255" nullable="NULLABLE_UNKNOWN" defaultValue="">
+ <type href="http://www.w3.org/2001/XMLSchema#string"/>
+ </columns>
+ <columns xmi:uuid="mmuuid:9830b5ca-4a54-111b-bb0a-ea1884adcb79" name="billTo_state" nameInSource="billTo/state/text()" nativeType="java.lang.String" length="255" nullable="NULLABLE_UNKNOWN" defaultValue="">
+ <type href="http://www.w3.org/2001/XMLSchema#string"/>
+ </columns>
+ <columns xmi:uuid="mmuuid:983ff800-4a54-111b-bb0a-ea1884adcb79" name="billTo_zip" nameInSource="billTo/zip/text()" nativeType="java.lang.String" length="20" nullable="NULLABLE_UNKNOWN" defaultValue="">
+ <type href="http://www.w3.org/2001/XMLSchema#string"/>
+ </columns>
+ <columns xmi:uuid="mmuuid:983ff801-4a54-111b-bb0a-ea1884adcb79" name="comment" nameInSource="po:comment/text()" nativeType="java.lang.String" length="255" nullable="NULLABLE_UNKNOWN" defaultValue="">
+ <type href="http://www.w3.org/2001/XMLSchema#string"/>
+ </columns>
+ <foreignKeys xmi:uuid="mmuuid:984f3a43-4a54-111b-bb0a-ea1884adcb79" name="fk_order_purchaseOrders" foreignKeyMultiplicity="UNSPECIFIED" primaryKeyMultiplicity="UNSPECIFIED" columns="mmuuid/98217380-4a54-111b-bb0a-ea1884adcb79" uniqueKey="mmuuid/984f3a41-4a54-111b-bb0a-ea1884adcb79"/>
+ <primaryKey xmi:uuid="mmuuid:983ff802-4a54-111b-bb0a-ea1884adcb79" name="pkorder" nameInSource="pk_/po:purchaseOrders/order" columns="mmuuid/98217381-4a54-111b-bb0a-ea1884adcb79" foreignKeys="mmuuid/984f3a42-4a54-111b-bb0a-ea1884adcb79"/>
+ </relational:BaseTable>
+ <relational:BaseTable xmi:uuid="mmuuid:983ff803-4a54-111b-bb0a-ea1884adcb79" name="purchaseOrders" nameInSource="/po:purchaseOrders">
+ <columns xmi:uuid="mmuuid:984f3a40-4a54-111b-bb0a-ea1884adcb79" name="mmid" nameInSource="@com.metamatrix.xml.xpathpart" nativeType="java.lang.String" length="255" nullable="NULLABLE_UNKNOWN" defaultValue="" uniqueKeys="mmuuid/984f3a41-4a54-111b-bb0a-ea1884adcb79">
+ <type href="http://www.w3.org/2001/XMLSchema#string"/>
+ </columns>
+ <primaryKey xmi:uuid="mmuuid:984f3a41-4a54-111b-bb0a-ea1884adcb79" name="pkpurchaseOrders" nameInSource="pk_/po:purchaseOrders" columns="mmuuid/984f3a40-4a54-111b-bb0a-ea1884adcb79" foreignKeys="mmuuid/984f3a43-4a54-111b-bb0a-ea1884adcb79"/>
+ </relational:BaseTable>
+ <jdbc:JdbcSource xmi:uuid="mmuuid:50f37689-4a4e-111b-bb0a-ea1884adcb79" driverName="com.metamatrix.modeler.modelgenerator.xml.wizards.jdbc.XmlImporterJdbcDriver" driverClass="com.metamatrix.modeler.modelgenerator.xml.wizards.jdbc.XmlImporterJdbcDriver" username="" url="xsd:file:/NotBackedUp/jdoyle/workspaces/XML.tests/po.xsd">
+ <importSettings xmi:uuid="mmuuid:50f3768a-4a4e-111b-bb0a-ea1884adcb79" createCatalogsInModel="false" includeApproximateIndexes="false">
+ <includedCatalogPaths>/Global</includedCatalogPaths>
+ <includedCatalogPaths>/http___www_example_com_PO1</includedCatalogPaths>
+ <includedTableTypes>ELEMENT</includedTableTypes>
+ <includedTableTypes>RELATIONSHIP</includedTableTypes>
+ </importSettings>
+ </jdbc:JdbcSource>
+ <diagram:DiagramContainer xmi:uuid="mmuuid:b841f040-4a54-111b-bb0a-ea1884adcb79">
+ <diagram xmi:uuid="mmuuid:b8513280-4a54-111b-bb0a-ea1884adcb79" type="packageDiagramType" target="mmuuid/94231cc0-4a54-111b-bb0a-ea1884adcb79">
+ <diagramEntity xmi:uuid="mmuuid:c254ac80-4a54-111b-bb0a-ea1884adcb79" modelObject="mmuuid/97e46a80-4a54-111b-bb0a-ea1884adcb79" xPosition="348" yPosition="235"/>
+ <diagramEntity xmi:uuid="mmuuid:c263eec0-4a54-111b-bb0a-ea1884adcb79" modelObject="mmuuid/9802ef06-4a54-111b-bb0a-ea1884adcb79" xPosition="30" yPosition="36"/>
+ <diagramEntity xmi:uuid="mmuuid:c263eec1-4a54-111b-bb0a-ea1884adcb79" modelObject="mmuuid/983ff803-4a54-111b-bb0a-ea1884adcb79" xPosition="356" yPosition="30"/>
+ </diagram>
+ </diagram:DiagramContainer>
+</xmi:XMI>
Added: trunk/connectors/connector-xml/src/test/resources/documents/File/purchaseOrder.xmi
===================================================================
--- trunk/connectors/connector-xml/src/test/resources/documents/File/purchaseOrder.xmi (rev 0)
+++ trunk/connectors/connector-xml/src/test/resources/documents/File/purchaseOrder.xmi 2009-05-29 02:26:41 UTC (rev 1008)
@@ -0,0 +1,105 @@
+<?xml version="1.0" encoding="ASCII"?>
+<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:diagram="http://www.metamatrix.com/metamodels/Diagram" xmlns:jdbc="http://www.metamatrix.com/metamodels/JDBC" xmlns:mmcore="http://www.metamatrix.com/metamodels/Core" xmlns:relational="http://www.metamatrix.com/metamodels/Relational">
+ <mmcore:ModelAnnotation xmi:uuid="mmuuid:25983900-54a6-111b-9708-f3d85bed2dda" primaryMetamodelUri="http://www.metamatrix.com/metamodels/Relational" modelType="PHYSICAL" ProducerName="MetaMatrix" ProducerVersion="5.5">
+ <modelImports xmi:uuid="mmuuid:36d20340-54a6-111b-9708-f3d85bed2dda" name="XMLFileConnectorExtensions" modelLocation="../XMLExtensionsProject/XMLFileConnectorExtensions.xmi" uuid="mmuuid:61d94280-b86d-1ffe-bb3d-c715e2d4aaf4" modelType="EXTENSION" primaryMetamodelUri="http://www.metamatrix.com/metamodels/Extension"/>
+ <modelImports xmi:uuid="mmuuid:35dddf40-54a6-111b-9708-f3d85bed2dda" name="XMLSchema" modelLocation="http://www.w3.org/2001/XMLSchema" modelType="TYPE" primaryMetamodelUri="http://www.eclipse.org/xsd/2002/XSD"/>
+ <extensionPackage href="../XMLExtensionsProject/XMLFileConnectorExtensions.xmi#mmuuid/61d94286-b86d-1ffe-bb3d-c715e2d4aaf4"/>
+ </mmcore:ModelAnnotation>
+ <mmcore:AnnotationContainer xmi:uuid="mmuuid:2b9d5c41-54a6-111b-9708-f3d85bed2dda">
+ <annotations xmi:uuid="mmuuid:2b9d5c42-54a6-111b-9708-f3d85bed2dda" annotatedObject="mmuuid/2b7ed7c0-54a6-111b-9708-f3d85bed2dda">
+ <tags xmi:uuid="mmuuid:2bac9e80-54a6-111b-9708-f3d85bed2dda" key="NamespacePrefixes" value="xmlns:xsd='http://www.w3.org/2001/XMLSchema'"/>
+ </annotations>
+ <annotations xmi:uuid="mmuuid:2cce8942-54a6-111b-9708-f3d85bed2dda" annotatedObject="mmuuid/2cce8940-54a6-111b-9708-f3d85bed2dda">
+ <tags xmi:uuid="mmuuid:2cce8943-54a6-111b-9708-f3d85bed2dda" key="NamespacePrefixes" value="xmlns:xsd='http://www.w3.org/2001/XMLSchema'"/>
+ </annotations>
+ </mmcore:AnnotationContainer>
+ <relational:BaseTable xmi:uuid="mmuuid:2b7ed7c0-54a6-111b-9708-f3d85bed2dda" name="purchaseOrder" nameInSource="/purchaseOrder">
+ <columns xmi:uuid="mmuuid:2c547740-54a6-111b-9708-f3d85bed2dda" name="mmid" nameInSource="@com.metamatrix.xml.xpathpart" nativeType="java.lang.String" length="255" nullable="NULLABLE_UNKNOWN" defaultValue="" uniqueKeys="mmuuid/2c918040-54a6-111b-9708-f3d85bed2dda">
+ <type href="http://www.w3.org/2001/XMLSchema#string"/>
+ </columns>
+ <columns xmi:uuid="mmuuid:2c72fbc0-54a6-111b-9708-f3d85bed2dda" name="orderDate" nameInSource="@orderDate" nativeType="java.lang.String" length="255" nullable="NULLABLE_UNKNOWN" defaultValue="">
+ <type href="http://www.w3.org/2001/XMLSchema#string"/>
+ </columns>
+ <columns xmi:uuid="mmuuid:2c72fbc1-54a6-111b-9708-f3d85bed2dda" name="shipTo_country" nameInSource="shipTo/@country" nativeType="java.lang.String" length="255" nullable="NULLABLE_UNKNOWN" defaultValue="">
+ <type href="http://www.w3.org/2001/XMLSchema#string"/>
+ </columns>
+ <columns xmi:uuid="mmuuid:2c72fbc2-54a6-111b-9708-f3d85bed2dda" name="shipTo_name" nameInSource="shipTo/name/text()" nativeType="java.lang.String" length="255" nullable="NULLABLE_UNKNOWN" defaultValue="">
+ <type href="http://www.w3.org/2001/XMLSchema#string"/>
+ </columns>
+ <columns xmi:uuid="mmuuid:2c72fbc3-54a6-111b-9708-f3d85bed2dda" name="shipTo_street" nameInSource="shipTo/street/text()" nativeType="java.lang.String" length="255" nullable="NULLABLE_UNKNOWN" defaultValue="">
+ <type href="http://www.w3.org/2001/XMLSchema#string"/>
+ </columns>
+ <columns xmi:uuid="mmuuid:2c823e00-54a6-111b-9708-f3d85bed2dda" name="shipTo_city" nameInSource="shipTo/city/text()" nativeType="java.lang.String" length="255" nullable="NULLABLE_UNKNOWN" defaultValue="">
+ <type href="http://www.w3.org/2001/XMLSchema#string"/>
+ </columns>
+ <columns xmi:uuid="mmuuid:2c823e01-54a6-111b-9708-f3d85bed2dda" name="shipTo_state" nameInSource="shipTo/state/text()" nativeType="java.lang.String" length="255" nullable="NULLABLE_UNKNOWN" defaultValue="">
+ <type href="http://www.w3.org/2001/XMLSchema#string"/>
+ </columns>
+ <columns xmi:uuid="mmuuid:2c823e02-54a6-111b-9708-f3d85bed2dda" name="shipTo_zip" nameInSource="shipTo/zip/text()" nativeType="java.lang.String" length="20" nullable="NULLABLE_UNKNOWN" defaultValue="">
+ <type href="http://www.w3.org/2001/XMLSchema#string"/>
+ </columns>
+ <columns xmi:uuid="mmuuid:2c823e03-54a6-111b-9708-f3d85bed2dda" name="billTo_country" nameInSource="billTo/@country" nativeType="java.lang.String" length="255" nullable="NULLABLE_UNKNOWN" defaultValue="">
+ <type href="http://www.w3.org/2001/XMLSchema#string"/>
+ </columns>
+ <columns xmi:uuid="mmuuid:2c823e04-54a6-111b-9708-f3d85bed2dda" name="billTo_name" nameInSource="billTo/name/text()" nativeType="java.lang.String" length="255" nullable="NULLABLE_UNKNOWN" defaultValue="">
+ <type href="http://www.w3.org/2001/XMLSchema#string"/>
+ </columns>
+ <columns xmi:uuid="mmuuid:2c823e05-54a6-111b-9708-f3d85bed2dda" name="billTo_street" nameInSource="billTo/street/text()" nativeType="java.lang.String" length="255" nullable="NULLABLE_UNKNOWN" defaultValue="">
+ <type href="http://www.w3.org/2001/XMLSchema#string"/>
+ </columns>
+ <columns xmi:uuid="mmuuid:2c823e06-54a6-111b-9708-f3d85bed2dda" name="billTo_city" nameInSource="billTo/city/text()" nativeType="java.lang.String" length="255" nullable="NULLABLE_UNKNOWN" defaultValue="">
+ <type href="http://www.w3.org/2001/XMLSchema#string"/>
+ </columns>
+ <columns xmi:uuid="mmuuid:2c823e07-54a6-111b-9708-f3d85bed2dda" name="billTo_state" nameInSource="billTo/state/text()" nativeType="java.lang.String" length="255" nullable="NULLABLE_UNKNOWN" defaultValue="">
+ <type href="http://www.w3.org/2001/XMLSchema#string"/>
+ </columns>
+ <columns xmi:uuid="mmuuid:2c823e08-54a6-111b-9708-f3d85bed2dda" name="billTo_zip" nameInSource="billTo/zip/text()" nativeType="java.lang.String" length="20" nullable="NULLABLE_UNKNOWN" defaultValue="">
+ <type href="http://www.w3.org/2001/XMLSchema#string"/>
+ </columns>
+ <columns xmi:uuid="mmuuid:2c823e09-54a6-111b-9708-f3d85bed2dda" name="comment" nameInSource="comment/text()" nativeType="java.lang.String" length="255" nullable="NULLABLE_UNKNOWN" defaultValue="">
+ <type href="http://www.w3.org/2001/XMLSchema#string"/>
+ </columns>
+ <primaryKey xmi:uuid="mmuuid:2c918040-54a6-111b-9708-f3d85bed2dda" name="pkpurchaseOrder" nameInSource="pk_/purchaseOrder" columns="mmuuid/2c547740-54a6-111b-9708-f3d85bed2dda" foreignKeys="mmuuid/2d57dd80-54a6-111b-9708-f3d85bed2dda"/>
+ </relational:BaseTable>
+ <relational:BaseTable xmi:uuid="mmuuid:2cce8940-54a6-111b-9708-f3d85bed2dda" name="item" nameInSource="/purchaseOrder/items/item">
+ <columns xmi:uuid="mmuuid:2cddcb80-54a6-111b-9708-f3d85bed2dda" name="purchaseOrder_mmid" nameInSource="../../(a)com.metamatrix.xml.xpathpart" nativeType="java.lang.String" length="255" nullable="NULLABLE_UNKNOWN" defaultValue="" foreignKeys="mmuuid/2d57dd80-54a6-111b-9708-f3d85bed2dda">
+ <type href="http://www.w3.org/2001/XMLSchema#string"/>
+ </columns>
+ <columns xmi:uuid="mmuuid:2cddcb81-54a6-111b-9708-f3d85bed2dda" name="mmid" nameInSource="@com.metamatrix.xml.xpathpart" nativeType="java.lang.String" length="255" nullable="NULLABLE_UNKNOWN" defaultValue="" uniqueKeys="mmuuid/2cddcb88-54a6-111b-9708-f3d85bed2dda">
+ <type href="http://www.w3.org/2001/XMLSchema#string"/>
+ </columns>
+ <columns xmi:uuid="mmuuid:2cddcb82-54a6-111b-9708-f3d85bed2dda" name="partNum" nameInSource="@partNum" nativeType="java.lang.String" length="255" nullable="NULLABLE_UNKNOWN" defaultValue="">
+ <type href="http://www.w3.org/2001/XMLSchema#string"/>
+ </columns>
+ <columns xmi:uuid="mmuuid:2cddcb83-54a6-111b-9708-f3d85bed2dda" name="productName" nameInSource="productName/text()" nativeType="java.lang.String" length="255" nullable="NULLABLE_UNKNOWN" defaultValue="">
+ <type href="http://www.w3.org/2001/XMLSchema#string"/>
+ </columns>
+ <columns xmi:uuid="mmuuid:2cddcb84-54a6-111b-9708-f3d85bed2dda" name="quantity" nameInSource="quantity/text()" nativeType="java.lang.String" length="20" nullable="NULLABLE_UNKNOWN" defaultValue="">
+ <type href="http://www.w3.org/2001/XMLSchema#string"/>
+ </columns>
+ <columns xmi:uuid="mmuuid:2cddcb85-54a6-111b-9708-f3d85bed2dda" name="USPrice" nameInSource="USPrice/text()" nativeType="java.lang.String" length="20" nullable="NULLABLE_UNKNOWN" defaultValue="">
+ <type href="http://www.w3.org/2001/XMLSchema#string"/>
+ </columns>
+ <columns xmi:uuid="mmuuid:2cddcb86-54a6-111b-9708-f3d85bed2dda" name="comment" nameInSource="comment/text()" nativeType="java.lang.String" length="255" nullable="NULLABLE_UNKNOWN" defaultValue="">
+ <type href="http://www.w3.org/2001/XMLSchema#string"/>
+ </columns>
+ <columns xmi:uuid="mmuuid:2cddcb87-54a6-111b-9708-f3d85bed2dda" name="shipDate" nameInSource="shipDate/text()" nativeType="java.lang.String" length="255" nullable="NULLABLE_UNKNOWN" defaultValue="">
+ <type href="http://www.w3.org/2001/XMLSchema#string"/>
+ </columns>
+ <foreignKeys xmi:uuid="mmuuid:2d57dd80-54a6-111b-9708-f3d85bed2dda" name="fk_item_purchaseOrder" nameInSource="fk_/purchaseOrder/items/item_/purchaseOrder" foreignKeyMultiplicity="UNSPECIFIED" primaryKeyMultiplicity="UNSPECIFIED" columns="mmuuid/2cddcb80-54a6-111b-9708-f3d85bed2dda" uniqueKey="mmuuid/2c918040-54a6-111b-9708-f3d85bed2dda"/>
+ <primaryKey xmi:uuid="mmuuid:2cddcb88-54a6-111b-9708-f3d85bed2dda" name="pkitem" nameInSource="pk_/purchaseOrder/items/item" columns="mmuuid/2cddcb81-54a6-111b-9708-f3d85bed2dda"/>
+ </relational:BaseTable>
+ <jdbc:JdbcSource xmi:uuid="mmuuid:2ff54189-54a2-111b-9708-f3d85bed2dda" driverName="com.metamatrix.modeler.modelgenerator.xml.wizards.jdbc.XmlImporterJdbcDriver" driverClass="com.metamatrix.modeler.modelgenerator.xml.wizards.jdbc.XmlImporterJdbcDriver" username="" url="xsd:file:/NotBackedUp/jdoyle/workspaces/XML.tests/po_orig.xsd">
+ <importSettings xmi:uuid="mmuuid:2ff5418a-54a2-111b-9708-f3d85bed2dda" createCatalogsInModel="false" includeApproximateIndexes="false">
+ <includedCatalogPaths>/Global</includedCatalogPaths>
+ <includedTableTypes>ELEMENT</includedTableTypes>
+ <includedTableTypes>RELATIONSHIP</includedTableTypes>
+ </importSettings>
+ </jdbc:JdbcSource>
+ <diagram:DiagramContainer xmi:uuid="mmuuid:4a9bee40-54a6-111b-9708-f3d85bed2dda">
+ <diagram xmi:uuid="mmuuid:4a9bee41-54a6-111b-9708-f3d85bed2dda" type="packageDiagramType" target="mmuuid/25983900-54a6-111b-9708-f3d85bed2dda">
+ <diagramEntity xmi:uuid="mmuuid:4b624b80-54a6-111b-9708-f3d85bed2dda" modelObject="mmuuid/2b7ed7c0-54a6-111b-9708-f3d85bed2dda" xPosition="343" yPosition="30"/>
+ <diagramEntity xmi:uuid="mmuuid:4b901240-54a6-111b-9708-f3d85bed2dda" modelObject="mmuuid/2cce8940-54a6-111b-9708-f3d85bed2dda" xPosition="30" yPosition="78"/>
+ </diagram>
+ </diagram:DiagramContainer>
+</xmi:XMI>
Added: trunk/connectors/connector-xml/src/test/resources/documents/File/purchase_orders.vdb
===================================================================
(Binary files differ)
Property changes on: trunk/connectors/connector-xml/src/test/resources/documents/File/purchase_orders.vdb
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
15 years, 6 months
teiid SVN: r1007 - trunk/connectors/connector-xml-common.
by teiid-commits@lists.jboss.org
Author: jdoyle
Date: 2009-05-28 15:37:45 -0400 (Thu, 28 May 2009)
New Revision: 1007
Modified:
trunk/connectors/connector-xml-common/pom.xml
Log:
Removing JBoss cache dependency.
Modified: trunk/connectors/connector-xml-common/pom.xml
===================================================================
--- trunk/connectors/connector-xml-common/pom.xml 2009-05-28 19:37:02 UTC (rev 1006)
+++ trunk/connectors/connector-xml-common/pom.xml 2009-05-28 19:37:45 UTC (rev 1007)
@@ -116,10 +116,6 @@
<version>1.2</version>
</dependency>
<dependency>
- <groupId>org.jboss.cache</groupId>
- <artifactId>jbosscache-core</artifactId>
- </dependency>
- <dependency>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty</artifactId>
<version>6.1.9</version>
15 years, 6 months
teiid SVN: r1005 - trunk/connectors/connector-xml-common.
by teiid-commits@lists.jboss.org
Author: jdoyle
Date: 2009-05-28 14:36:02 -0400 (Thu, 28 May 2009)
New Revision: 1005
Modified:
trunk/connectors/connector-xml-common/pom.xml
Log:
Adding new dependencies for xml connector.
Modified: trunk/connectors/connector-xml-common/pom.xml
===================================================================
--- trunk/connectors/connector-xml-common/pom.xml 2009-05-28 18:02:02 UTC (rev 1004)
+++ trunk/connectors/connector-xml-common/pom.xml 2009-05-28 18:36:02 UTC (rev 1005)
@@ -110,6 +110,31 @@
<version>2.7.0</version>
<scope>runtime</scope>
</dependency>
+ <dependency>
+ <groupId>xom</groupId>
+ <artifactId>xom</artifactId>
+ <version>1.2</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.cache</groupId>
+ <artifactId>jbosscache-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>jetty</artifactId>
+ <version>6.1.9</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf</artifactId>
+ <version>2.2</version>
+ <type>pom</type>
+ </dependency>
+ <dependency>
+ <groupId>nux</groupId>
+ <artifactId>nux</artifactId>
+ <version>1.6</version>
+ </dependency>
</dependencies>
<!-- bundles all its dependencies in a single zip file -->
15 years, 6 months
teiid SVN: r1003 - in trunk: client/src/main/java/com/metamatrix/dqp/embedded and 16 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2009-05-28 07:04:30 -0400 (Thu, 28 May 2009)
New Revision: 1003
Added:
trunk/client/src/main/java/com/metamatrix/dqp/embedded/
trunk/client/src/main/java/com/metamatrix/dqp/embedded/DQPEmbeddedProperties.java
trunk/engine/src/main/java/com/metamatrix/common/application/ServiceLoader.java
Removed:
trunk/embedded/src/main/java/com/metamatrix/dqp/embedded/DQPEmbeddedProperties.java
Modified:
trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/EmbeddedConnectionFactory.java
trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/EmbeddedDataSource.java
trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/EmbeddedDriver.java
trunk/common-core/src/main/java/com/metamatrix/common/classloader/PostDelegatingClassLoader.java
trunk/common-core/src/main/java/com/metamatrix/common/util/PropertiesUtils.java
trunk/connectors/connector-jdbc/src/main/resources/connector-jdbc.xml
trunk/embedded/src/main/java/com/metamatrix/dqp/embedded/EmbeddedConfigSource.java
trunk/embedded/src/main/java/com/metamatrix/dqp/embedded/services/EmbeddedConfigurationService.java
trunk/embedded/src/main/java/com/metamatrix/dqp/embedded/services/EmbeddedTransactionService.java
trunk/embedded/src/main/java/com/metamatrix/jdbc/CacheProvider.java
trunk/embedded/src/main/java/com/metamatrix/jdbc/EmbeddedConnectionFactoryImpl.java
trunk/embedded/src/main/java/com/metamatrix/jdbc/EmbeddedGuiceModule.java
trunk/embedded/src/main/java/com/metamatrix/jdbc/LogListernerProvider.java
trunk/embedded/src/test/java/com/metamatrix/dqp/embedded/EmbeddedTestUtil.java
trunk/embedded/src/test/java/com/metamatrix/dqp/embedded/TestEmbeddedConfigSource.java
trunk/embedded/src/test/java/com/metamatrix/dqp/embedded/services/TestEmbeddedConfigurationService.java
trunk/embedded/src/test/java/com/metamatrix/dqp/embedded/services/TestEmbeddedDataService.java
trunk/embedded/src/test/java/com/metamatrix/dqp/embedded/services/TestEmbeddedVDBService.java
trunk/embedded/src/test/java/com/metamatrix/dqp/service/buffer/TestLocalBufferService.java
trunk/embedded/src/test/java/com/metamatrix/jdbc/TestEmbeddedDriver.java
trunk/engine/src/main/java/com/metamatrix/common/application/Application.java
trunk/engine/src/main/java/com/metamatrix/dqp/service/TransactionService.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/Request.java
trunk/server/src/main/java/com/metamatrix/server/CacheProvider.java
trunk/txn-jbossts/src/main/java/com/metamatrix/xa/arjuna/ArjunaTransactionProvider.java
Log:
TEIID-590 TEIID-632 fixes to embedded to make integration easier
Copied: trunk/client/src/main/java/com/metamatrix/dqp/embedded/DQPEmbeddedProperties.java (from rev 1000, trunk/embedded/src/main/java/com/metamatrix/dqp/embedded/DQPEmbeddedProperties.java)
===================================================================
--- trunk/client/src/main/java/com/metamatrix/dqp/embedded/DQPEmbeddedProperties.java (rev 0)
+++ trunk/client/src/main/java/com/metamatrix/dqp/embedded/DQPEmbeddedProperties.java 2009-05-28 11:04:30 UTC (rev 1003)
@@ -0,0 +1,91 @@
+/*
+ * 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.dqp.embedded;
+
+/**
+ */
+public interface DQPEmbeddedProperties {
+
+ public static final String DQP_LOGFILE = "dqp.logFile"; //$NON-NLS-1$
+ public static final String DQP_LOGLEVEL = "dqp.logLevel"; //$NON-NLS-1$
+ public static final String DQP_EXTENSIONS = "dqp.extensions"; //$NON-NLS-1$
+ public static final String DQP_CONFIGFILE = "dqp.configFile"; //$NON-NLS-1$
+ public static final String DQP_METADATA_SYSTEMURL = "dqp.metadata.systemURL"; //$NON-NLS-1$
+ public static final String VDB_DEFINITION = "vdb.definition"; //$NON-NLS-1$
+ public static final String USER_DEFINED_FUNCTIONS = "dqp.userDefinedFunctionsFile"; //$NON-NLS-1$
+ public static final String COMMON_EXTENSION_CLASPATH = "dqp.extension.CommonClasspath"; //$NON-NLS-1$
+ public static final String DQP_KEYSTORE = "dqp.keystore"; //$NON-NLS-1$
+ public static final String DQP_IDENTITY = "dqp.identity"; //$NON-NLS-1$
+ public static final String DQP_TMPDIR = "mm.io.tmpdir"; //$NON-NLS-1$
+
+ public interface BufferService {
+ /**
+ * Property prefix for DQP Buffer Service properties.
+ */
+ public static final String BUFFER_PREFIX = "dqp.buffer"; //$NON-NLS-1$
+
+ /**
+ * Determines whether buffer management should be all-memory (if false)
+ * or mixed memory and disk access (if true). Default value is false.
+ */
+ public static final String DQP_BUFFER_USEDISK = BUFFER_PREFIX + ".usedisk"; //$NON-NLS-1$
+
+ /**
+ * Determines the directory to use if buffer management is using disk.
+ * This property is not used if DQP_BUFFER_USEDISK = true. Default value
+ * is ".".
+ */
+ public static final String DQP_BUFFER_DIR = BUFFER_PREFIX + ".dir"; //$NON-NLS-1$
+
+ /**
+ * Determines amount of memory to use in-memory before buffering to
+ * disk. This property is not used if DQP_BUFFER_USEDISK = true. The
+ * value is in megabytes. Default value is 32.
+ */
+ public static final String DQP_BUFFER_MEMORY = BUFFER_PREFIX + ".memory"; //$NON-NLS-1$
+
+ /**
+ * The maximum number of rows a processor batch should contain. Default is 2000.
+ */
+ public static final String DQP_PROCESSOR_BATCH_SIZE = BUFFER_PREFIX + ".processorBatchSize"; //$NON-NLS-1$
+
+ /**
+ * The maximum number of rows a connector batch should contain. Default is 2000.
+ */
+ public static final String DQP_CONNECTOR_BATCH_SIZE = BUFFER_PREFIX + ".connectorBatchSize"; //$NON-NLS-1$
+ }
+
+ public interface DataService {
+ /**
+ * Property prefix for DQP Data Service properties.
+ */
+ public static final String DATA_PREFIX = "dqp.data"; //$NON-NLS-1$
+ }
+
+ public interface MetadataService {
+ /**
+ * Property prefix for DQP Metadata Service properties.
+ */
+ public static final String METADATA_PREFIX = "dqp.metadata"; //$NON-NLS-1$
+ }
+}
Property changes on: trunk/client/src/main/java/com/metamatrix/dqp/embedded/DQPEmbeddedProperties.java
___________________________________________________________________
Name: svn:mergeinfo
+
Modified: trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/EmbeddedConnectionFactory.java
===================================================================
--- trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/EmbeddedConnectionFactory.java 2009-05-28 01:42:53 UTC (rev 1002)
+++ trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/EmbeddedConnectionFactory.java 2009-05-28 11:04:30 UTC (rev 1003)
@@ -22,6 +22,7 @@
package com.metamatrix.jdbc;
+import java.net.URL;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.Properties;
@@ -31,14 +32,17 @@
* defined so that it can be used with DQP class loading.
*/
public interface EmbeddedConnectionFactory {
+
+ public void initialize(URL bootstrapURL, Properties props) throws SQLException;
/**
* Create a Connection to the DQP. This will load a DQP instance if one is not present
+ * @param bootstrapURL
* @param properties
* @return Connection to DQP
* @throws SQLException
*/
- public Connection createConnection(Properties properties) throws SQLException;
+ public Connection createConnection(URL bootstrapURL, Properties properties) throws SQLException;
/**
* Shutdown the connection factory, including the DQP and all its existing connections
Modified: trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/EmbeddedDataSource.java
===================================================================
--- trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/EmbeddedDataSource.java 2009-05-28 01:42:53 UTC (rev 1002)
+++ trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/EmbeddedDataSource.java 2009-05-28 11:04:30 UTC (rev 1003)
@@ -22,7 +22,6 @@
package com.metamatrix.jdbc;
-import java.net.MalformedURLException;
import java.net.URL;
import java.sql.Connection;
import java.sql.SQLException;
@@ -45,44 +44,6 @@
*/
private String bootstrapFile;
- //*************************** ConnectionPoolDataSource Specific Properties
- /**
- * maxstatements -
- * The total number of statements that the pool should keep open.
- * 0 (zero) indicates that caching of statements is disabled.
- */
- private int maxStatements;
- /**
- * initialPoolSize -
- * The number of physical connections the pool should contain when it is created
- */
- private int initialPoolSize;
- /**
- * minPoolSize -
- * The number of physical connections the pool should keep available at all times.
- * 0 (zero) indicates that connections should be created as needed.
- */
- private int minPoolSize;
- /**
- * maxPoolSize -
- * The maximum number of physical connections that the pool should contain.
- * 0 (zero) indicates no maximum size.
- */
- private int maxPoolSize;
- /**
- * maxIdleTime -
- * The number of seconds that a physical connection should remain unused in the pool
- * before the connection is closed. 0 (zero) indicates no limit.
- */
- private int maxIdleTime;
- /**
- * propertyCycle -
- * The interval, in seconds, that the pool should wait before enforcing the current
- * policy defined by the values of the above connection pool properties
- */
- private int propertyCycle;
-
-
// string constant for the embedded configuration file property
public static final String DQP_BOOTSTRAP_FILE = "bootstrapFile"; //$NON-NLS-1$
@@ -100,16 +61,10 @@
final String password) {
Properties props = super.buildProperties(userName, password);
- if (this.getBootstrapFile() != null && this.getBootstrapFile().trim().length() != 0) {
- try {
- if (this.getBootstrapFile().equals(EmbeddedDriver.getDefaultConnectionURL())) {
- props.put("vdb.definition", getDatabaseName() +".vdb"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- props.put(EmbeddedDataSource.DQP_BOOTSTRAP_FILE, URLHelper.buildURL(this.getBootstrapFile().trim()));
- } catch (MalformedURLException e) {
- // we can safely ignore as this will would have caught in validate..
- }
- }
+ if (this.getBootstrapFile().equals(EmbeddedDriver.getDefaultConnectionURL())) {
+ props.put("vdb.definition", getDatabaseName() +".vdb"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ props.put(DQP_BOOTSTRAP_FILE, this.bootstrapFile);
return props;
}
@@ -179,111 +134,4 @@
this.bootstrapFile = configFile;
}
- /**
- * @return Returns the initialPoolSize.
- * @since 4.3
- */
- public int getInitialPoolSize() {
- return this.initialPoolSize;
- }
-
-
- /**
- * @param initialPoolSize The initialPoolSize to set.
- * @since 4.3
- */
- public void setInitialPoolSize(int initialPoolSize) {
- this.initialPoolSize = initialPoolSize;
- }
-
-
- /**
- * @return Returns the maxIdleTime.
- * @since 4.3
- */
- public int getMaxIdleTime() {
- return this.maxIdleTime;
- }
-
-
- /**
- * @param maxIdleTime The maxIdleTime to set.
- * @since 4.3
- */
- public void setMaxIdleTime(int maxIdleTime) {
- this.maxIdleTime = maxIdleTime;
- }
-
-
- /**
- * @return Returns the maxPoolSize.
- * @since 4.3
- */
- public int getMaxPoolSize() {
- return this.maxPoolSize;
- }
-
-
- /**
- * @param maxPoolSize The maxPoolSize to set.
- * @since 4.3
- */
- public void setMaxPoolSize(int maxPoolSize) {
- this.maxPoolSize = maxPoolSize;
- }
-
-
- /**
- * @return Returns the maxStatements.
- * @since 4.3
- */
- public int getMaxStatements() {
- return this.maxStatements;
- }
-
-
- /**
- * @param maxStatements The maxStatements to set.
- * @since 4.3
- */
- public void setMaxStatements(int maxStatements) {
- this.maxStatements = maxStatements;
- }
-
-
- /**
- * @return Returns the minPoolSize.
- * @since 4.3
- */
- public int getMinPoolSize() {
- return this.minPoolSize;
- }
-
-
- /**
- * @param minPoolSize The minPoolSize to set.
- * @since 4.3
- */
- public void setMinPoolSize(int minPoolSize) {
- this.minPoolSize = minPoolSize;
- }
-
-
- /**
- * @return Returns the propertyCycle.
- * @since 4.3
- */
- public int getPropertyCycle() {
- return this.propertyCycle;
- }
-
-
- /**
- * @param propertyCycle The propertyCycle to set.
- * @since 4.3
- */
- public void setPropertyCycle(int propertyCycle) {
- this.propertyCycle = propertyCycle;
- }
-
}
Modified: trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/EmbeddedDriver.java
===================================================================
--- trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/EmbeddedDriver.java 2009-05-28 01:42:53 UTC (rev 1002)
+++ trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/EmbeddedDriver.java 2009-05-28 11:04:30 UTC (rev 1003)
@@ -28,18 +28,16 @@
import java.io.ObjectInputStream;
import java.net.MalformedURLException;
import java.net.URL;
-import java.net.URLClassLoader;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.DriverPropertyInfo;
import java.sql.SQLException;
import java.util.ArrayList;
-import java.util.Arrays;
+import java.util.Collections;
import java.util.Enumeration;
import java.util.Iterator;
import java.util.List;
import java.util.Properties;
-import java.util.StringTokenizer;
import java.util.logging.Logger;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -49,6 +47,8 @@
import com.metamatrix.common.protocol.MetaMatrixURLStreamHandlerFactory;
import com.metamatrix.common.protocol.URLHelper;
import com.metamatrix.common.util.ApplicationInfo;
+import com.metamatrix.common.util.PropertiesUtils;
+import com.metamatrix.dqp.embedded.DQPEmbeddedProperties;
import com.metamatrix.jdbc.util.MMJDBCURL;
/**
@@ -74,10 +74,7 @@
static final String URL_PATTERN = "jdbc:metamatrix:(\\w+)@(([^;]*)[;]?)((.*)*)"; //$NON-NLS-1$
static final String BASE_PATTERN = "jdbc:metamatrix:((\\w+)[;]?)(;([^@])+)*"; //$NON-NLS-1$
public static final String DRIVER_NAME = "Teiid Embedded JDBC Driver"; //$NON-NLS-1$
- public static final String POST_DELEGATION_LIBRARIES = "PostDelegationLibraries"; //$NON-NLS-1$
- static final String DQP_IDENTITY = "dqp.identity"; //$NON-NLS-1$
- static final String MM_IO_TMPDIR = "mm.io.tmpdir"; //$NON-NLS-1$
private static Logger logger = Logger.getLogger("org.teiid.jdbc"); //$NON-NLS-1$
private static EmbeddedTransport currentTransport = null;
@@ -108,6 +105,8 @@
// create a properties obj if it is null
if (info == null) {
info = new Properties();
+ } else {
+ info = PropertiesUtils.clone(info);
}
if (!acceptsURL(url)) {
return null;
@@ -123,22 +122,24 @@
return conn;
}
-
+
Connection createConnection(Properties info) throws SQLException{
// first validate the properties as this may called from the EmbeddedDataSource
// and make sure we have all the properties we need.
validateProperties(info);
+ URL dqpURL;
+ try {
+ dqpURL = URLHelper.buildURL(info.getProperty(EmbeddedDataSource.DQP_BOOTSTRAP_FILE));
+ } catch (MalformedURLException e) {
+ throw MMSQLException.create(e);
+ }
+
// now create the connection
- URL dqpURL = (URL)info.get(EmbeddedDataSource.DQP_BOOTSTRAP_FILE);
EmbeddedTransport transport = getDQPTransport(dqpURL, info);
Connection conn = transport.createConnection(info);
-
- // only upon successful creation of the connection, keep the transport
- // available for future connections
- currentTransport = transport;
return conn;
}
@@ -151,7 +152,7 @@
* @throws SQLException
* @since 4.4
*/
- private static EmbeddedTransport getDQPTransport(URL dqpURL, Properties info) throws SQLException {
+ private synchronized static EmbeddedTransport getDQPTransport(URL dqpURL, Properties info) throws SQLException {
EmbeddedTransport transport = currentTransport;
if (transport != null && currentTransport.getURL().equals(dqpURL)) {
String logMsg = BaseDataSource.getResourceMessage("EmbeddedDriver.use_existing_transport"); //$NON-NLS-1$
@@ -164,6 +165,7 @@
String logMsg = BaseDataSource.getResourceMessage("EmbeddedDriver.use_new_transport"); //$NON-NLS-1$
DriverManager.println(logMsg);
}
+ currentTransport = transport;
return transport;
}
@@ -198,9 +200,7 @@
connectionURL = getDefaultConnectionURL();
info.setProperty("vdb.definition", jdbcURL.getVDBName()+".vdb"); //$NON-NLS-1$ //$NON-NLS-2$
}
-
- // Set the dqp.properties file properties
- URL dqpURL = URLHelper.buildURL(connectionURL);
+ info.setProperty(EmbeddedDataSource.DQP_BOOTSTRAP_FILE, connectionURL);
Properties optionalParams = jdbcURL.getProperties();
MMJDBCURL.normalizeProperties(info);
@@ -221,10 +221,6 @@
if(!info.containsKey(BaseDataSource.APP_NAME)) {
info.setProperty(BaseDataSource.APP_NAME, BaseDataSource.DEFAULT_APP_NAME);
}
-
- // Add the DQP URL as the configuration URL
- info.put(EmbeddedDataSource.DQP_BOOTSTRAP_FILE, dqpURL);
-
} catch (Exception e) {
String logMsg = e.getClass() +": "+e.getMessage(); //$NON-NLS-1$
DriverManager.println(logMsg);
@@ -259,13 +255,6 @@
throw new SQLException(logMsg);
}
- // DQP config file must be supplied
- URL url = (URL)info.get(EmbeddedDataSource.DQP_BOOTSTRAP_FILE);
- if (url == null) {
- String logMsg = BaseDataSource.getResourceMessage("EmbeddedDataSource.Configuration_file_must_be_specified"); //$NON-NLS-1$
- DriverManager.println(logMsg);
- throw new SQLException(logMsg);
- }
}
@@ -297,9 +286,7 @@
@Override
List<DriverPropertyInfo> getAdditionalPropertyInfo(String url,
Properties info) {
- DriverPropertyInfo dpi = new DriverPropertyInfo(EmbeddedDataSource.DQP_BOOTSTRAP_FILE, info.getProperty(EmbeddedDataSource.DQP_BOOTSTRAP_FILE));
- dpi.required = true;
- return Arrays.asList(dpi);
+ return Collections.emptyList();
}
/**
@@ -355,19 +342,22 @@
this.url = dqpURL;
- // Create a temporary workspace directory
- this.workspaceDirectory = createWorkspace(getDQPIdentity());
-
//Load the properties from dqp.properties file
Properties props = loadDQPProperties(dqpURL);
props.putAll(info);
-
+
+ props = PropertiesUtils.resolveNestedProperties(props);
+
+ String dqpId = getDQPIdentity();
+ props.setProperty(DQPEmbeddedProperties.DQP_IDENTITY, dqpId);
+ // Create a temporary workspace directory
+ this.workspaceDirectory = createWorkspace(props.getProperty(DQPEmbeddedProperties.DQP_TMPDIR), dqpId);
+
this.classLoader = this.getClass().getClassLoader();
// a non-delegating class loader will be created from where all third party dependent jars can be loaded
ArrayList<URL> runtimeClasspathList = new ArrayList<URL>();
- ArrayList<URL> postDelegationClasspathList = null;
- String libLocation = info.getProperty("dqp.lib", "./lib/"); //$NON-NLS-1$ //$NON-NLS-2$
+ String libLocation = props.getProperty("dqp.lib", "./lib/"); //$NON-NLS-1$ //$NON-NLS-2$
if (!libLocation.endsWith("/")) { //$NON-NLS-1$
libLocation = libLocation + "/"; //$NON-NLS-1$
}
@@ -375,32 +365,12 @@
// find jars in the "lib" directory; patches is reverse alpaha and not case sensitive so small letters then capitals
if (!EmbeddedDriver.getDefaultConnectionURL().equals(dqpURL.toString())) {
runtimeClasspathList.addAll(libClassPath(dqpURL, libLocation+"patches/", MMURLConnection.REVERSEALPHA)); //$NON-NLS-1$
-
- // check if a specific post delegation rules specified for loading
- String postDelgationLibraries = info.getProperty(POST_DELEGATION_LIBRARIES);
- if (postDelgationLibraries != null) {
- postDelegationClasspathList = resolvePath(dqpURL, libLocation, postDelgationLibraries);
- List<URL> postDelegationPatches = new ArrayList<URL>(runtimeClasspathList);
- postDelegationPatches.retainAll(postDelegationClasspathList);
- postDelegationClasspathList.removeAll(postDelegationPatches);
- postDelegationClasspathList.addAll(0, postDelegationPatches);
- }
-
runtimeClasspathList.addAll(libClassPath(dqpURL, libLocation, MMURLConnection.DATE));
-
- if (postDelegationClasspathList != null) {
- runtimeClasspathList.removeAll(postDelegationClasspathList);
- }
}
URL[] dqpClassPath = runtimeClasspathList.toArray(new URL[runtimeClasspathList.size()]);
- this.classLoader = new URLClassLoader(dqpClassPath, Thread.currentThread().getContextClassLoader(), new MetaMatrixURLStreamHandlerFactory());
+ this.classLoader = new PostDelegatingClassLoader(dqpClassPath, Thread.currentThread().getContextClassLoader(), new MetaMatrixURLStreamHandlerFactory());
- if (postDelegationClasspathList != null && !postDelegationClasspathList.isEmpty()) {
- URL[] path = postDelegationClasspathList.toArray(new URL[postDelegationClasspathList.size()]);
- this.classLoader = new PostDelegatingClassLoader(path, this.classLoader, new MetaMatrixURLStreamHandlerFactory());
- }
-
String logMsg = BaseDataSource.getResourceMessage("EmbeddedDriver.use_classpath"); //$NON-NLS-1$
DriverManager.println(logMsg);
for (int i = 0; i < dqpClassPath.length; i++) {
@@ -408,13 +378,13 @@
}
// Now using this class loader create the connection factory to the dqp.
- ClassLoader current = null;
+ ClassLoader current = Thread.currentThread().getContextClassLoader();
try {
- current = Thread.currentThread().getContextClassLoader();
Thread.currentThread().setContextClassLoader(this.classLoader);
String className = "com.metamatrix.jdbc.EmbeddedConnectionFactoryImpl"; //$NON-NLS-1$
- Class clazz = this.classLoader.loadClass(className);
+ Class<?> clazz = this.classLoader.loadClass(className);
this.connectionFactory = (EmbeddedConnectionFactory)clazz.newInstance();
+ this.connectionFactory.initialize(dqpURL, props);
} catch (Exception e) {
DriverManager.println(e.getClass() +": "+e.getMessage()); //$NON-NLS-1$
throw new EmbeddedSQLException(e);
@@ -455,19 +425,6 @@
return urlList;
}
- private ArrayList<URL> resolvePath(URL dqpURL, String directory, String path) throws SQLException {
- StringTokenizer st = new StringTokenizer(path, ","); //$NON-NLS-1$
- ArrayList<URL> urlList = new ArrayList<URL>();
- while (st.hasMoreTokens()) {
- try {
- urlList.add(URLHelper.buildURL(dqpURL, directory+st.nextToken()));
- } catch (MalformedURLException e) {
- throw new EmbeddedSQLException(e);
- }
- }
- return urlList;
- }
-
/**
* Load DQP Properties from the URL supplied.
* @param dqpURL - URL to the "dqp.properties" object
@@ -526,7 +483,7 @@
try {
current = Thread.currentThread().getContextClassLoader();
Thread.currentThread().setContextClassLoader(classLoader);
- return connectionFactory.createConnection(info);
+ return connectionFactory.createConnection(url, info);
} finally {
Thread.currentThread().setContextClassLoader(current);
}
@@ -537,21 +494,29 @@
* @return a JVM level unique identifier
*/
String getDQPIdentity() {
- String id = System.getProperty(DQP_IDENTITY, "0"); //$NON-NLS-1$
+ String id = System.getProperty(DQPEmbeddedProperties.DQP_IDENTITY, "0"); //$NON-NLS-1$
int identity = Integer.parseInt(id)+1;
id = String.valueOf(identity);
- System.setProperty(DQP_IDENTITY, id);
-
return id;
}
/**
* Create the temporary workspace directory for the dqp
* @param identity - identity of the dqp
+ * @throws MMSQLException
*/
- String createWorkspace(String identity) {
- String dir = System.getProperty("java.io.tmpdir")+"/metamatrix/"+identity; //$NON-NLS-1$ //$NON-NLS-2$
- System.setProperty(MM_IO_TMPDIR, dir);
+ String createWorkspace(String baseDir, String identity) throws MMSQLException {
+ if (baseDir == null) {
+ baseDir = System.getProperty("java.io.tmpdir")+"/teiid/"; //$NON-NLS-1$ //$NON-NLS-2$
+ } else {
+ try {
+ baseDir = URLHelper.buildURL(this.url, baseDir).getPath();
+ } catch (MalformedURLException e) {
+ throw MMSQLException.create(e);
+ }
+ }
+ String dir = baseDir + identity;
+ System.setProperty(DQPEmbeddedProperties.DQP_TMPDIR, dir);
File f = new File(dir);
Modified: trunk/common-core/src/main/java/com/metamatrix/common/classloader/PostDelegatingClassLoader.java
===================================================================
--- trunk/common-core/src/main/java/com/metamatrix/common/classloader/PostDelegatingClassLoader.java 2009-05-28 01:42:53 UTC (rev 1002)
+++ trunk/common-core/src/main/java/com/metamatrix/common/classloader/PostDelegatingClassLoader.java 2009-05-28 11:04:30 UTC (rev 1003)
@@ -23,7 +23,6 @@
package com.metamatrix.common.classloader;
import java.net.URL;
-import java.net.URLClassLoader;
import java.net.URLStreamHandlerFactory;
/**
@@ -62,12 +61,15 @@
*/
public synchronized Class loadClass(String name) throws ClassNotFoundException {
+ if (name.startsWith("javax.") || name.startsWith("java.")) { //$NON-NLS-1$ //$NON-NLS-2$
+ return super.loadClass(name);
+ }
+
Class loadedClass = this.findLoadedClass(name);
if (loadedClass != null) {
return loadedClass;
}
-
// class not in cache
try {
loadedClass = super.findClass(name);
Modified: trunk/common-core/src/main/java/com/metamatrix/common/util/PropertiesUtils.java
===================================================================
--- trunk/common-core/src/main/java/com/metamatrix/common/util/PropertiesUtils.java 2009-05-28 01:42:53 UTC (rev 1002)
+++ trunk/common-core/src/main/java/com/metamatrix/common/util/PropertiesUtils.java 2009-05-28 11:04:30 UTC (rev 1003)
@@ -753,7 +753,7 @@
* @return resolved properties object.
* @since 4.4
*/
- public static Properties resolveNestedProperties(Properties original) throws IOException{
+ public static Properties resolveNestedProperties(Properties original) {
Properties modified = new Properties();
for(Enumeration e = original.keys(); e.hasMoreElements();) {
Modified: trunk/connectors/connector-jdbc/src/main/resources/connector-jdbc.xml
===================================================================
--- trunk/connectors/connector-jdbc/src/main/resources/connector-jdbc.xml 2009-05-28 01:42:53 UTC (rev 1002)
+++ trunk/connectors/connector-jdbc/src/main/resources/connector-jdbc.xml 2009-05-28 11:04:30 UTC (rev 1003)
@@ -1,4 +1,5 @@
<ComponentType Name="JDBC Connector" ComponentTypeCode="2" Deployable="true" Deprecated="false" Monitorable="false" SuperComponentType="Connector" ParentComponentType="Connectors" LastChangedBy="ConfigurationStartup" LastChangedDate="2008-10-31T10:26:19.952-06:00" CreatedBy="ConfigurationStartup" CreationDate="2008-10-31T10:26:19.952-06:00">
+ <PropertyDefinition Name="URL" DisplayName="JDBC URL" ShortDescription="" DefaultValue="jdbc:" IsRequired="true" PropertyType="String"/>
<PropertyDefinition Name="User" DisplayName="User Name" ShortDescription="" />
<PropertyDefinition Name="Password" DisplayName="Password" ShortDescription="" IsMasked="true" />
<PropertyDefinition Name="ConnectorTypeClassPath" DisplayName="Connector Type Class Path" ShortDescription="Connector Type classpath (defined by system, do not modify)" DefaultValue="extensionjar:connector_patch.jar;extensionjar:${project.artifactId}-${project.version}.jar;${classpath}" IsModifiable="false" />
Deleted: trunk/embedded/src/main/java/com/metamatrix/dqp/embedded/DQPEmbeddedProperties.java
===================================================================
--- trunk/embedded/src/main/java/com/metamatrix/dqp/embedded/DQPEmbeddedProperties.java 2009-05-28 01:42:53 UTC (rev 1002)
+++ trunk/embedded/src/main/java/com/metamatrix/dqp/embedded/DQPEmbeddedProperties.java 2009-05-28 11:04:30 UTC (rev 1003)
@@ -1,97 +0,0 @@
-/*
- * 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.dqp.embedded;
-
-/**
- */
-public interface DQPEmbeddedProperties {
-
- public static final String DQP_LOGFILE = "dqp.logFile"; //$NON-NLS-1$
- public static final String DQP_LOGLEVEL = "dqp.logLevel"; //$NON-NLS-1$
- public static final String DQP_SERVICE_METADATA = "dqp.service.metadata"; //$NON-NLS-1$
- public static final String DQP_SERVICE_DATA = "dqp.service.data"; //$NON-NLS-1$
- public static final String DQP_EXTENSIONS = "dqp.extensions"; //$NON-NLS-1$
- public static final String DQP_CONFIGFILE = "dqp.configFile"; //$NON-NLS-1$
- public static final String DQP_METADATA_SYSTEMURL = "dqp.metadata.systemURL"; //$NON-NLS-1$
- public static final String VDB_DEFINITION = "vdb.definition"; //$NON-NLS-1$
- public static final String USER_DEFINED_FUNCTIONS = "dqp.userDefinedFunctionsFile"; //$NON-NLS-1$
- public static final String COMMON_EXTENSION_CLASPATH = "dqp.extension.CommonClasspath"; //$NON-NLS-1$
- public static final String DQP_KEYSTORE = "dqp.keystore"; //$NON-NLS-1$
- public static final String DQP_IDENTITY = "dqp.identity"; //$NON-NLS-1$
- public static final String DQP_TMPDIR = "mm.io.tmpdir"; //$NON-NLS-1$
-
- // Holds the value of the DQP Embedded configuration properties file.
- public static final String DQP_BOOTSTRAP_PROPERTIES_FILE = "dqp.propertiesFile"; //$NON-NLS-1$
-
-
- public interface BufferService {
- /**
- * Property prefix for DQP Buffer Service properties.
- */
- public static final String BUFFER_PREFIX = "dqp.buffer"; //$NON-NLS-1$
-
- /**
- * Determines whether buffer management should be all-memory (if false)
- * or mixed memory and disk access (if true). Default value is false.
- */
- public static final String DQP_BUFFER_USEDISK = BUFFER_PREFIX + ".usedisk"; //$NON-NLS-1$
-
- /**
- * Determines the directory to use if buffer management is using disk.
- * This property is not used if DQP_BUFFER_USEDISK = true. Default value
- * is ".".
- */
- public static final String DQP_BUFFER_DIR = BUFFER_PREFIX + ".dir"; //$NON-NLS-1$
-
- /**
- * Determines amount of memory to use in-memory before buffering to
- * disk. This property is not used if DQP_BUFFER_USEDISK = true. The
- * value is in megabytes. Default value is 32.
- */
- public static final String DQP_BUFFER_MEMORY = BUFFER_PREFIX + ".memory"; //$NON-NLS-1$
-
- /**
- * The maximum number of rows a processor batch should contain. Default is 2000.
- */
- public static final String DQP_PROCESSOR_BATCH_SIZE = BUFFER_PREFIX + ".processorBatchSize"; //$NON-NLS-1$
-
- /**
- * The maximum number of rows a connector batch should contain. Default is 2000.
- */
- public static final String DQP_CONNECTOR_BATCH_SIZE = BUFFER_PREFIX + ".connectorBatchSize"; //$NON-NLS-1$
- }
-
- public interface DataService {
- /**
- * Property prefix for DQP Data Service properties.
- */
- public static final String DATA_PREFIX = "dqp.data"; //$NON-NLS-1$
- }
-
- public interface MetadataService {
- /**
- * Property prefix for DQP Metadata Service properties.
- */
- public static final String METADATA_PREFIX = "dqp.metadata"; //$NON-NLS-1$
- }
-}
Modified: trunk/embedded/src/main/java/com/metamatrix/dqp/embedded/EmbeddedConfigSource.java
===================================================================
--- trunk/embedded/src/main/java/com/metamatrix/dqp/embedded/EmbeddedConfigSource.java 2009-05-28 01:42:53 UTC (rev 1002)
+++ trunk/embedded/src/main/java/com/metamatrix/dqp/embedded/EmbeddedConfigSource.java 2009-05-28 11:04:30 UTC (rev 1003)
@@ -22,8 +22,6 @@
package com.metamatrix.dqp.embedded;
-import java.io.IOException;
-import java.io.InputStream;
import java.net.URL;
import java.util.HashMap;
import java.util.Map;
@@ -33,12 +31,13 @@
import com.google.inject.Binder;
import com.google.inject.Inject;
+import com.google.inject.Singleton;
+import com.google.inject.name.Named;
+import com.google.inject.name.Names;
import com.metamatrix.common.application.ApplicationService;
import com.metamatrix.common.application.DQPConfigSource;
import com.metamatrix.common.application.exception.ApplicationInitializationException;
-import com.metamatrix.common.protocol.URLHelper;
import com.metamatrix.common.util.PropertiesUtils;
-import com.metamatrix.core.MetaMatrixRuntimeException;
import com.metamatrix.dqp.embedded.services.EmbeddedBufferService;
import com.metamatrix.dqp.embedded.services.EmbeddedConfigurationService;
import com.metamatrix.dqp.embedded.services.EmbeddedDataService;
@@ -47,8 +46,6 @@
import com.metamatrix.dqp.embedded.services.EmbeddedTransactionService;
import com.metamatrix.dqp.embedded.services.EmbeddedVDBService;
import com.metamatrix.dqp.service.DQPServiceNames;
-import com.metamatrix.jdbc.EmbeddedDataSource;
-import com.metamatrix.jdbc.JDBCPlugin;
/**
* This class is main hook point for the Embedded DQP configuration. This classe's
@@ -56,11 +53,12 @@
* services used the DQP.
*
*/
+@Singleton
public class EmbeddedConfigSource implements DQPConfigSource {
- private static final String SERVER_CONFIG_FILE_EXTENSION = ".properties"; //$NON-NLS-1$
private Properties props;
private boolean useTxn;
+ private URL dqpURL;
@Inject
DQPContextCache contextCache;
@@ -70,67 +68,12 @@
* @param configFile
* @throws ApplicationInitializationException
*/
- public EmbeddedConfigSource(Properties connectionProperties) {
-
- URL dqpURL = (URL)connectionProperties.get(EmbeddedDataSource.DQP_BOOTSTRAP_FILE);
- if(dqpURL == null) {
- throw new MetaMatrixRuntimeException(JDBCPlugin.Util.getString("LocalTransportHandler.No_configuration_file_set_in_property", DQPEmbeddedProperties.DQP_BOOTSTRAP_PROPERTIES_FILE)); //$NON-NLS-1$
- }
-
- String dqpFileName = dqpURL.toString().toLowerCase();
- if (!dqpFileName.endsWith(SERVER_CONFIG_FILE_EXTENSION)) {
- throw new MetaMatrixRuntimeException(JDBCPlugin.Util.getString("LocalTransportHandler.Invalid_config_file_extension", dqpFileName) ); //$NON-NLS-1$
- }
-
- String dqpURLString = dqpURL.toString();
- try {
- dqpURL = URLHelper.buildURL(dqpURLString);
- InputStream in = dqpURL.openStream();
- if (in == null) {
- throw new MetaMatrixRuntimeException(DQPEmbeddedPlugin.Util.getString("EmbeddedConfigSource.Can_not_load_config_file_2", dqpURL)); //$NON-NLS-1$
- }
-
- // Load the "dqp.properties" file.
- props = new Properties();
- props.load(in);
- in.close();
-
- // Merge any user properties with the mm.properties
- props.putAll(connectionProperties);
-
- // this will resolve any nested properties in the properties
- // file; this created for testing purpose
- props = PropertiesUtils.resolveNestedProperties(props);
-
- // create a unique identity number for this DQP
- props.setProperty(DQPEmbeddedProperties.DQP_IDENTITY, getDQPIdentity());
-
- // create a workspace directory for the DQP
- props.setProperty(DQPEmbeddedProperties.DQP_TMPDIR, getWorkspaceDirectory());
-
- // This is context of where the dqp.properties loaded, VDB are defined relative to
- // this path.
- props.put(DQPEmbeddedProperties.DQP_BOOTSTRAP_PROPERTIES_FILE, dqpURL);
-
- useTxn = PropertiesUtils.getBooleanProperty(props, EmbeddedTransactionService.TRANSACTIONS_ENABLED, true);
- } catch (IOException e) {
- throw new MetaMatrixRuntimeException(e);
- }
+ @Inject public EmbeddedConfigSource(@Named("BootstrapURL") URL dqpURL, @Named("DQPProperties") Properties connectionProperties) {
+ this.dqpURL = dqpURL;
+ this.props = connectionProperties;
+ useTxn = PropertiesUtils.getBooleanProperty(props, EmbeddedTransactionService.TRANSACTIONS_ENABLED, true);
}
- /**
- * create an identity for the DQP instance in this JVM
- * @return int a unique number for this JVM
- */
- String getDQPIdentity() {
- String id = System.getProperty(DQPEmbeddedProperties.DQP_IDENTITY, "0"); //$NON-NLS-1$
- return id;
- }
-
- String getWorkspaceDirectory() {
- return System.getProperty(DQPEmbeddedProperties.DQP_TMPDIR, System.getProperty("java.io.tmpdir")); //$NON-NLS-1$
- }
-
/**
* @see com.metamatrix.common.application.DQPConfigSource#getProperties()
*/
@@ -143,6 +86,7 @@
if (contextCache != null) {
binder.bind(DQPContextCache.class).toInstance(contextCache);
}
+ binder.bind(URL.class).annotatedWith(Names.named("BootstrapURL")).toInstance(this.dqpURL); //$NON-NLS-1$
}
@Override
Modified: trunk/embedded/src/main/java/com/metamatrix/dqp/embedded/services/EmbeddedConfigurationService.java
===================================================================
--- trunk/embedded/src/main/java/com/metamatrix/dqp/embedded/services/EmbeddedConfigurationService.java 2009-05-28 01:42:53 UTC (rev 1002)
+++ trunk/embedded/src/main/java/com/metamatrix/dqp/embedded/services/EmbeddedConfigurationService.java 2009-05-28 11:04:30 UTC (rev 1003)
@@ -38,6 +38,8 @@
import java.util.Set;
import java.util.StringTokenizer;
+import com.google.inject.Inject;
+import com.google.inject.name.Named;
import com.metamatrix.api.exception.MetaMatrixComponentException;
import com.metamatrix.common.application.AbstractClassLoaderManager;
import com.metamatrix.common.application.ApplicationEnvironment;
@@ -96,7 +98,10 @@
private static final String VDB = ".vdb"; //$NON-NLS-1$
private static final String DEF = ".def"; //$NON-NLS-1$
- Properties userPreferences;
+ public final static String PROPERTIES_URL = "dqp.bootstrap"; //$NON-NLS-1$
+
+ private Properties userPreferences;
+ private URL bootStrapURL;
private Map<String, VDBArchive> loadedVDBs = new HashMap<String, VDBArchive>();
Map<String, ConnectorBinding> loadedConnectorBindings = new HashMap<String, ConnectorBinding>();
Map<String, ComponentType> loadedConnectorTypes = new HashMap<String, ComponentType>();
@@ -114,7 +119,7 @@
@Override
public String getCommonExtensionClassPath() {
- return userPreferences.getProperty(DQPEmbeddedProperties.COMMON_EXTENSION_CLASPATH, ""); //$NON-NLS-1$
+ return getUserPreferences().getProperty(DQPEmbeddedProperties.COMMON_EXTENSION_CLASPATH, ""); //$NON-NLS-1$
}
@Override
@@ -122,7 +127,15 @@
return ExtensionModuleReader.resolveExtensionModule(url, getExtensionPath());
}
};
-
+
+ public URL getBootStrapURL() {
+ return bootStrapURL;
+ }
+
+ @Inject public void setBootStrapURL(@Named("BootstrapURL") URL bootStrapURL) {
+ this.bootStrapURL = bootStrapURL;
+ }
+
boolean valid(String str) {
if (str != null) {
str = str.trim();
@@ -136,7 +149,7 @@
* @since 4.3
*/
public URL getSystemVdb() {
- String systemVDB = userPreferences.getProperty(DQPEmbeddedProperties.DQP_METADATA_SYSTEMURL);
+ String systemVDB = getUserPreferences().getProperty(DQPEmbeddedProperties.DQP_METADATA_SYSTEMURL);
if (valid(systemVDB)) {
return getFullyQualifiedPath(systemVDB);
}
@@ -148,7 +161,7 @@
* @since 4.3
*/
public Properties getSystemProperties() {
- return userPreferences;
+ return getUserPreferences();
}
/**
@@ -156,7 +169,7 @@
* @since 4.3
*/
public void setSystemProperty(String key, String value) throws MetaMatrixComponentException {
- userPreferences.setProperty(key, value);
+ getUserPreferences().setProperty(key, value);
DQPEmbeddedPlugin.logInfo("EmbeddedConfigurationService.add_system_property", new Object[] {key, value}); //$NON-NLS-1$
this.configurationModel = ServerConfigFileWriter.addProperty(getSystemConfiguration(), key, value);
saveSystemConfiguration(configurationModel);
@@ -167,7 +180,7 @@
* @since 4.3
*/
public void updateSystemProperties(Properties properties) throws MetaMatrixComponentException {
- userPreferences.putAll(properties);
+ getUserPreferences().putAll(properties);
DQPEmbeddedPlugin.logInfo("EmbeddedConfigurationService.update_system_properties", new Object[] {properties}); //$NON-NLS-1$
this.configurationModel = ServerConfigFileWriter.addProperties(getSystemConfiguration(), properties);
saveSystemConfiguration(configurationModel);
@@ -208,7 +221,7 @@
* @see com.metamatrix.dqp.service.ConfigurationService#getConfigFile()
*/
public URL getConfigFile() {
- String configFile = userPreferences.getProperty(DQPEmbeddedProperties.DQP_CONFIGFILE, "configuration.xml"); //$NON-NLS-1$
+ String configFile = getUserPreferences().getProperty(DQPEmbeddedProperties.DQP_CONFIGFILE, "configuration.xml"); //$NON-NLS-1$
if (valid(configFile)) {
return getFullyQualifiedPath(configFile);
}
@@ -221,7 +234,7 @@
*/
public URL getUDFFile() {
try {
- String udfFile = userPreferences.getProperty(DQPEmbeddedProperties.USER_DEFINED_FUNCTIONS);
+ String udfFile = getUserPreferences().getProperty(DQPEmbeddedProperties.USER_DEFINED_FUNCTIONS);
if (valid(udfFile)) {
return ExtensionModuleReader.resolveExtensionModule(udfFile, getExtensionPath());
}
@@ -250,7 +263,7 @@
* @since 4.3
*/
public URL getLogFile() {
- String logFile = userPreferences.getProperty(DQPEmbeddedProperties.DQP_LOGFILE);
+ String logFile = getUserPreferences().getProperty(DQPEmbeddedProperties.DQP_LOGFILE);
if (valid(logFile)) {
return getFullyQualifiedPath(logFile);
}
@@ -262,7 +275,7 @@
* @since 4.3
*/
public String getLogLevel(){
- String level = userPreferences.getProperty(DQPEmbeddedProperties.DQP_LOGLEVEL);
+ String level = getUserPreferences().getProperty(DQPEmbeddedProperties.DQP_LOGLEVEL);
if (level == null) {
level = "3"; //$NON-NLS-1$
}
@@ -795,7 +808,7 @@
* @since 4.3
*/
public URL[] getExtensionPath() {
- String path = userPreferences.getProperty(DQPEmbeddedProperties.DQP_EXTENSIONS, "./extensions/"); //$NON-NLS-1$
+ String path = getUserPreferences().getProperty(DQPEmbeddedProperties.DQP_EXTENSIONS, "./extensions/"); //$NON-NLS-1$
if (valid(path)) {
ArrayList<URL> urlPaths = new ArrayList<URL>();
StringTokenizer st = new StringTokenizer(path, ";"); //$NON-NLS-1$
@@ -811,7 +824,7 @@
* @see com.metamatrix.dqp.service.ConfigurationService#useExtensionClasspath()
*/
public boolean useExtensionClasspath() {
- String path = userPreferences.getProperty(DQPEmbeddedProperties.DQP_EXTENSIONS);
+ String path = getUserPreferences().getProperty(DQPEmbeddedProperties.DQP_EXTENSIONS);
return valid(path);
}
@@ -963,7 +976,7 @@
throws ApplicationInitializationException {
try {
- userPreferences = PropertiesUtils.clone(properties);
+ this.setUserPreferences(PropertiesUtils.clone(properties));
DQPEmbeddedPlugin.logInfo("EmbeddedConfigurationService.dqp_loading", new Object[] {getInstanceIdenifier()}); //$NON-NLS-1$
@@ -975,7 +988,7 @@
ServerConfigFileReader configReader = loadServerConfigFile();
// Add properties to all the user preferences.
- userPreferences.putAll(configReader.getSystemProperties());
+ getUserPreferences().putAll(configReader.getSystemProperties());
// Get the alternate connector bindings from the server configuration
Map connectorBindings = configReader.getConnectorBindings();
@@ -1031,7 +1044,7 @@
*/
public URL[] getVDBLocations() {
ArrayList vdbs = new ArrayList();
- String vdbProperty = userPreferences.getProperty(DQPEmbeddedProperties.VDB_DEFINITION);
+ String vdbProperty = getUserPreferences().getProperty(DQPEmbeddedProperties.VDB_DEFINITION);
if (vdbProperty != null && vdbProperty.length() != 0) {
StringTokenizer st = new StringTokenizer(vdbProperty, VDB_LIST_SEPARATOR);
while( st.hasMoreTokens() ) {
@@ -1193,9 +1206,6 @@
URL getFullyQualifiedPath(String file){
if (file != null) {
try {
- // get the original URL to kick start the DQP as context URL
- URL bootStrapURL = (URL)userPreferences.get(DQPEmbeddedProperties.DQP_BOOTSTRAP_PROPERTIES_FILE);
-
// since DQP can use metamatrix specific URLs to load the DQP, and we can not
// register the URLStreamHandler, we need to create the URL with correct handler
// URLHelper will let us do that.
@@ -1237,7 +1247,7 @@
* @see com.metamatrix.dqp.service.ConfigurationService#getEncryptionKeyStore()
*/
public URL getEncryptionKeyStore() {
- String keyStoreFile = userPreferences.getProperty(DQPEmbeddedProperties.DQP_KEYSTORE);
+ String keyStoreFile = getUserPreferences().getProperty(DQPEmbeddedProperties.DQP_KEYSTORE);
if (valid(keyStoreFile)) {
return getFullyQualifiedPath(keyStoreFile);
}
@@ -1433,7 +1443,7 @@
* @return true if yes to use buffering; false otherwise
*/
public boolean useDiskBuffering() {
- return Boolean.valueOf(userPreferences.getProperty(DQPEmbeddedProperties.BufferService.DQP_BUFFER_USEDISK, "true")).booleanValue(); //$NON-NLS-1$
+ return Boolean.valueOf(getUserPreferences().getProperty(DQPEmbeddedProperties.BufferService.DQP_BUFFER_USEDISK, "true")).booleanValue(); //$NON-NLS-1$
}
@@ -1443,7 +1453,7 @@
*/
public File getDiskBufferDirectory() {
File bufferDir = null;
- String bufferDirectory = userPreferences.getProperty(DQPEmbeddedProperties.BufferService.DQP_BUFFER_DIR);
+ String bufferDirectory = getUserPreferences().getProperty(DQPEmbeddedProperties.BufferService.DQP_BUFFER_DIR);
if (valid(bufferDirectory)) {
if (!bufferDirectory.endsWith("/")) { //$NON-NLS-1$
bufferDirectory += "/"; //$NON-NLS-1$
@@ -1453,7 +1463,7 @@
bufferDir = new File(bufferURL.getPath());
}
else {
- bufferDir = new File(userPreferences.getProperty(DQPEmbeddedProperties.DQP_TMPDIR));
+ bufferDir = new File(getUserPreferences().getProperty(DQPEmbeddedProperties.DQP_TMPDIR));
}
// create the buffer directory if not alread exists.
@@ -1469,22 +1479,22 @@
* @return must a return a location
*/
public String getBufferMemorySize() {
- return userPreferences.getProperty(DQPEmbeddedProperties.BufferService.DQP_BUFFER_MEMORY, "64"); //$NON-NLS-1$
+ return getUserPreferences().getProperty(DQPEmbeddedProperties.BufferService.DQP_BUFFER_MEMORY, "64"); //$NON-NLS-1$
}
/**
* @see com.metamatrix.dqp.service.ConfigurationService#getInstanceIdenifier()
*/
public String getInstanceIdenifier() {
- return userPreferences.getProperty(DQPEmbeddedProperties.DQP_IDENTITY);
+ return getUserPreferences().getProperty(DQPEmbeddedProperties.DQP_IDENTITY);
}
public String getProcessorBatchSize() {
- return userPreferences.getProperty(DQPEmbeddedProperties.BufferService.DQP_PROCESSOR_BATCH_SIZE, "2000"); //$NON-NLS-1$
+ return getUserPreferences().getProperty(DQPEmbeddedProperties.BufferService.DQP_PROCESSOR_BATCH_SIZE, "2000"); //$NON-NLS-1$
}
public String getConnectorBatchSize() {
- return userPreferences.getProperty(DQPEmbeddedProperties.BufferService.DQP_CONNECTOR_BATCH_SIZE, "2000"); //$NON-NLS-1$
+ return getUserPreferences().getProperty(DQPEmbeddedProperties.BufferService.DQP_CONNECTOR_BATCH_SIZE, "2000"); //$NON-NLS-1$
}
@Override
@@ -1501,5 +1511,18 @@
public void clearClassLoaderCache() throws MetaMatrixComponentException {
this.classLoaderManager.clearCache();
}
+
+ void setUserPreferences(Properties userPreferences) {
+ this.userPreferences = userPreferences;
+ //test hack
+ URL url = (URL)userPreferences.get(PROPERTIES_URL);
+ if (url != null) {
+ this.bootStrapURL = url;
+ }
+ }
+
+ Properties getUserPreferences() {
+ return userPreferences;
+ }
}
Modified: trunk/embedded/src/main/java/com/metamatrix/dqp/embedded/services/EmbeddedTransactionService.java
===================================================================
--- trunk/embedded/src/main/java/com/metamatrix/dqp/embedded/services/EmbeddedTransactionService.java 2009-05-28 01:42:53 UTC (rev 1002)
+++ trunk/embedded/src/main/java/com/metamatrix/dqp/embedded/services/EmbeddedTransactionService.java 2009-05-28 11:04:30 UTC (rev 1003)
@@ -22,11 +22,16 @@
package com.metamatrix.dqp.embedded.services;
+import java.net.MalformedURLException;
+import java.net.URL;
import java.util.Properties;
import org.teiid.dqp.internal.transaction.TransactionServerImpl;
+import com.google.inject.Inject;
+import com.google.inject.name.Named;
import com.metamatrix.common.application.exception.ApplicationInitializationException;
+import com.metamatrix.common.protocol.URLHelper;
import com.metamatrix.common.xa.XATransactionException;
import com.metamatrix.dqp.embedded.DQPEmbeddedProperties;
import com.metamatrix.dqp.service.TransactionService;
@@ -36,6 +41,8 @@
public static final String TRANSACTIONS_ENABLED = "metamatrix.xatxnmgr.enabled"; //$NON-NLS-1$
+ @Inject @Named("BootstrapURL") URL bootstrapURL;
+
@Override
public void initialize(Properties props)
throws ApplicationInitializationException {
@@ -44,10 +51,18 @@
props.put(TransactionService.HOSTNAME, "dqp"); //$NON-NLS-1$
props.put(TransactionService.VMNAME, props.getProperty(DQPEmbeddedProperties.DQP_IDENTITY));
+ String dir = props.getProperty(TransactionService.TXN_STORE_DIR);
+ if (dir != null) {
+ props.setProperty(TXN_STORE_DIR, URLHelper.buildURL(bootstrapURL, dir).getPath());
+ } else {
+ props.setProperty(TXN_STORE_DIR, props.getProperty(DQPEmbeddedProperties.DQP_TMPDIR));
+ }
this.setTransactionProvider(ArjunaTransactionProvider.getInstance(props));
} catch (XATransactionException e) {
throw new ApplicationInitializationException(e);
- }
+ } catch (MalformedURLException e) {
+ throw new ApplicationInitializationException(e);
+ }
}
}
Modified: trunk/embedded/src/main/java/com/metamatrix/jdbc/CacheProvider.java
===================================================================
--- trunk/embedded/src/main/java/com/metamatrix/jdbc/CacheProvider.java 2009-05-28 01:42:53 UTC (rev 1002)
+++ trunk/embedded/src/main/java/com/metamatrix/jdbc/CacheProvider.java 2009-05-28 11:04:30 UTC (rev 1003)
@@ -22,17 +22,29 @@
package com.metamatrix.jdbc;
+import java.util.List;
+import java.util.Properties;
+
import org.jboss.cache.Cache;
import org.jboss.cache.DefaultCacheFactory;
+import org.jboss.cache.config.CacheLoaderConfig.IndividualCacheLoaderConfig;
+import com.google.inject.Inject;
import com.google.inject.Provider;
import com.google.inject.Singleton;
+import com.google.inject.name.Named;
@Singleton
class CacheProvider implements Provider<org.jboss.cache.Cache> {
+
+ @Inject @Named("WorkspaceDir") String workspaceDir;
public Cache get() {
Cache cache = new DefaultCacheFactory().createCache("jboss-cache-configuration.xml", false); //$NON-NLS-1$
+ List<IndividualCacheLoaderConfig> configs = cache.getConfiguration().getCacheLoaderConfig().getIndividualCacheLoaderConfigs();
+ Properties p = configs.get(0).getProperties();
+ p.setProperty("location", workspaceDir + "/cache"); //$NON-NLS-1$ //$NON-NLS-2$
+ configs.get(0).setProperties(p);
return cache;
}
}
Modified: trunk/embedded/src/main/java/com/metamatrix/jdbc/EmbeddedConnectionFactoryImpl.java
===================================================================
--- trunk/embedded/src/main/java/com/metamatrix/jdbc/EmbeddedConnectionFactoryImpl.java 2009-05-28 01:42:53 UTC (rev 1002)
+++ trunk/embedded/src/main/java/com/metamatrix/jdbc/EmbeddedConnectionFactoryImpl.java 2009-05-28 11:04:30 UTC (rev 1003)
@@ -22,6 +22,7 @@
package com.metamatrix.jdbc;
+import java.net.URL;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.Date;
@@ -60,7 +61,6 @@
*/
public class EmbeddedConnectionFactoryImpl implements EmbeddedConnectionFactory {
private static final int ACTIVE = 3;
- private boolean initialized = false;
private LocalTransportHandler handler = null;
private volatile boolean shutdownInProgress = false;
private DQPCore dqp;
@@ -72,12 +72,9 @@
/**
* @see com.metamatrix.jdbc.EmbeddedConnectionFactory#createConnection()
*/
- public Connection createConnection(Properties props) throws SQLException {
+ public Connection createConnection(URL bootstrapURL, Properties props) throws SQLException {
try {
- // Initialize the transport
- initialize(props);
-
// check for the valid connection properties
checkConnectionProperties (props);
@@ -87,8 +84,6 @@
return new EmbeddedConnection(this, serverConn, props, listener);
} catch (ConnectionException e) {
throw new EmbeddedSQLException(e);
- } catch (ApplicationInitializationException e) {
- throw new EmbeddedSQLException(e);
}
}
@@ -98,34 +93,34 @@
* holding on to a previous transport handler, so we need to check if the DQP is
* still alive and create a new one if necessary.
* @param props
- * @throws SQLException
+ * @throws ApplicationInitializationException
* @since 4.3
*/
- private synchronized void initialize(Properties props) throws ApplicationInitializationException {
- if (!initialized) {
-
- Injector injector = Guice.createInjector(new EmbeddedGuiceModule(props));
- ResourceFinder.setInjector(injector);
- DQPConfigSource configSource = injector.getInstance(DQPConfigSource.class);
+ public void initialize(URL bootstrapURL, Properties props) throws SQLException {
+ Injector injector = Guice.createInjector(new EmbeddedGuiceModule(bootstrapURL, props));
+ ResourceFinder.setInjector(injector);
+ DQPConfigSource configSource = injector.getInstance(DQPConfigSource.class);
- // start the DQP
- this.dqp = new DQPCore();
- this.dqp.start(configSource);
-
- // make the configuration service listen for the connection life-cycle events
- // used during VDB delete
- ConfigurationService configService = (ConfigurationService)findService(DQPServiceNames.CONFIGURATION_SERVICE);
-
- //in new class loader - all of these should be created lazily and held locally
- this.handler = new LocalTransportHandler(this.dqp);
- this.handler.registerListener(configService.getConnectionListener());
- this.shutdownThread = new ShutdownWork();
- Runtime.getRuntime().addShutdownHook(this.shutdownThread);
-
- this.initialized = true;
- this.starttime = System.currentTimeMillis();
- DQPEmbeddedPlugin.logInfo("DQPEmbeddedManager.start_dqp", new Object[] {new Date(System.currentTimeMillis()).toString()}); //$NON-NLS-1$
- }
+ // start the DQP
+ this.dqp = new DQPCore();
+ try {
+ this.dqp.start(configSource);
+ } catch (ApplicationInitializationException e) {
+ throw new EmbeddedSQLException(e);
+ }
+
+ // make the configuration service listen for the connection life-cycle events
+ // used during VDB delete
+ ConfigurationService configService = (ConfigurationService)findService(DQPServiceNames.CONFIGURATION_SERVICE);
+
+ //in new class loader - all of these should be created lazily and held locally
+ this.handler = new LocalTransportHandler(this.dqp);
+ this.handler.registerListener(configService.getConnectionListener());
+ this.shutdownThread = new ShutdownWork();
+ Runtime.getRuntime().addShutdownHook(this.shutdownThread);
+
+ this.starttime = System.currentTimeMillis();
+ DQPEmbeddedPlugin.logInfo("DQPEmbeddedManager.start_dqp", new Object[] {new Date(System.currentTimeMillis()).toString()}); //$NON-NLS-1$
}
class ShutdownWork extends Thread {
@@ -166,7 +161,7 @@
}
public ApplicationService findService(String type) {
- return this.dqp.getEnvironment().findService(type);
+ return getDQP().getEnvironment().findService(type);
}
/**
@@ -180,7 +175,7 @@
shutdown(true);
}
- private void shutdown(boolean undoShutdownHook) throws SQLException {
+ private synchronized void shutdown(boolean undoShutdownHook) throws SQLException {
if (undoShutdownHook) {
Runtime.getRuntime().removeShutdownHook(this.shutdownThread);
@@ -189,7 +184,7 @@
// Make sure shutdown is not already in progress; as call to shutdown will close
// connections; and after the last connection closes, the listener also calls shutdown
// for normal route.
- if (!this.shutdownInProgress && this.initialized) {
+ if (!this.shutdownInProgress) {
// this will by pass, and only let shutdown called once.
shutdownInProgress = true;
@@ -207,9 +202,7 @@
this.dqp = null;
this.handler = null;
-
- this.initialized = false;
-
+
// shutdown the cache.
ResourceFinder.getCacheFactory().destroy();
Modified: trunk/embedded/src/main/java/com/metamatrix/jdbc/EmbeddedGuiceModule.java
===================================================================
--- trunk/embedded/src/main/java/com/metamatrix/jdbc/EmbeddedGuiceModule.java 2009-05-28 01:42:53 UTC (rev 1002)
+++ trunk/embedded/src/main/java/com/metamatrix/jdbc/EmbeddedGuiceModule.java 2009-05-28 11:04:30 UTC (rev 1003)
@@ -22,6 +22,7 @@
package com.metamatrix.jdbc;
+import java.net.URL;
import java.util.Properties;
import org.jboss.cache.Cache;
@@ -36,30 +37,36 @@
import com.metamatrix.common.log.LogConfiguration;
import com.metamatrix.common.log.LogManager;
import com.metamatrix.core.log.LogListener;
+import com.metamatrix.dqp.embedded.DQPEmbeddedProperties;
import com.metamatrix.dqp.embedded.EmbeddedConfigSource;
public class EmbeddedGuiceModule extends AbstractModule {
private Properties props;
+ private URL bootstrapURL;
- public EmbeddedGuiceModule(Properties props) {
+ public EmbeddedGuiceModule(URL bootstrapURL, Properties props) {
+ this.bootstrapURL = bootstrapURL;
this.props = props;
}
@Override
protected void configure() {
-
bind(Cache.class).toProvider(CacheProvider.class).in(Scopes.SINGLETON);
bind(CacheFactory.class).to(JBossCacheFactory.class).in(Scopes.SINGLETON);
bindConstant().annotatedWith(Names.named("HostName")).to("embedded"); //$NON-NLS-1$ //$NON-NLS-2$
bindConstant().annotatedWith(Names.named("ProcessName")).to("embedded"); //$NON-NLS-1$ //$NON-NLS-2$
+ String workspaceDir = System.getProperty(DQPEmbeddedProperties.DQP_TMPDIR, System.getProperty("java.io.tmpdir")); //$NON-NLS-1$
+ bindConstant().annotatedWith(Names.named("WorkspaceDir")).to(workspaceDir); //$NON-NLS-1$
+ this.props.setProperty(DQPEmbeddedProperties.DQP_TMPDIR, workspaceDir);
+ bind(Properties.class).annotatedWith(Names.named("DQPProperties")).toInstance(this.props); //$NON-NLS-1$
bind(DQPContextCache.class).in(Scopes.SINGLETON);
- bind(DQPConfigSource.class).toInstance(new EmbeddedConfigSource(this.props));
+ bind(DQPConfigSource.class).to(EmbeddedConfigSource.class);
+ bind(URL.class).annotatedWith(Names.named("BootstrapURL")).toInstance(bootstrapURL); //$NON-NLS-1$
bind(LogConfiguration.class).toProvider(LogConfigurationProvider.class).in(Scopes.SINGLETON);
bind(LogListener.class).toProvider(LogListernerProvider.class).in(Scopes.SINGLETON);
-
// this needs to be removed.
binder().requestStaticInjection(LogManager.class);
}
Modified: trunk/embedded/src/main/java/com/metamatrix/jdbc/LogListernerProvider.java
===================================================================
--- trunk/embedded/src/main/java/com/metamatrix/jdbc/LogListernerProvider.java 2009-05-28 01:42:53 UTC (rev 1002)
+++ trunk/embedded/src/main/java/com/metamatrix/jdbc/LogListernerProvider.java 2009-05-28 11:04:30 UTC (rev 1003)
@@ -29,6 +29,7 @@
import com.google.inject.Inject;
import com.google.inject.Provider;
import com.google.inject.Singleton;
+import com.google.inject.name.Named;
import com.metamatrix.common.application.DQPConfigSource;
import com.metamatrix.common.protocol.URLHelper;
import com.metamatrix.core.MetaMatrixRuntimeException;
@@ -43,9 +44,11 @@
@Inject
DQPConfigSource configSource;
+ @Inject @Named("BootstrapURL")
+ URL dqpURL;
+
@Override
public LogListener get() {
- URL dqpURL = (URL)configSource.getProperties().get(EmbeddedDataSource.DQP_BOOTSTRAP_FILE);
String logFile = configSource.getProperties().getProperty(DQPEmbeddedProperties.DQP_LOGFILE);
String instanceId = configSource.getProperties().getProperty(DQPEmbeddedProperties.DQP_IDENTITY, "0"); //$NON-NLS-1$
Modified: trunk/embedded/src/test/java/com/metamatrix/dqp/embedded/EmbeddedTestUtil.java
===================================================================
--- trunk/embedded/src/test/java/com/metamatrix/dqp/embedded/EmbeddedTestUtil.java 2009-05-28 01:42:53 UTC (rev 1002)
+++ trunk/embedded/src/test/java/com/metamatrix/dqp/embedded/EmbeddedTestUtil.java 2009-05-28 11:04:30 UTC (rev 1003)
@@ -30,6 +30,7 @@
import com.metamatrix.common.util.PropertiesUtils;
import com.metamatrix.core.util.FileUtils;
import com.metamatrix.core.util.UnitTestUtil;
+import com.metamatrix.dqp.embedded.services.EmbeddedConfigurationService;
public class EmbeddedTestUtil {
@@ -39,7 +40,7 @@
public static Properties getProperties(String file) throws IOException {
Properties props = PropertiesUtils.load(file);
- props.put(DQPEmbeddedProperties.DQP_BOOTSTRAP_PROPERTIES_FILE, URLHelper.buildURL(file));
+ props.put(EmbeddedConfigurationService.PROPERTIES_URL, URLHelper.buildURL(file));
return props;
}
Modified: trunk/embedded/src/test/java/com/metamatrix/dqp/embedded/TestEmbeddedConfigSource.java
===================================================================
--- trunk/embedded/src/test/java/com/metamatrix/dqp/embedded/TestEmbeddedConfigSource.java 2009-05-28 01:42:53 UTC (rev 1002)
+++ trunk/embedded/src/test/java/com/metamatrix/dqp/embedded/TestEmbeddedConfigSource.java 2009-05-28 11:04:30 UTC (rev 1003)
@@ -34,7 +34,6 @@
import com.metamatrix.dqp.service.DQPServiceNames;
import com.metamatrix.dqp.service.FakeAbstractService;
import com.metamatrix.dqp.service.FakeVDBService;
-import com.metamatrix.jdbc.EmbeddedDataSource;
public class TestEmbeddedConfigSource extends TestCase {
@@ -48,9 +47,9 @@
public void testServiceLoading() throws Exception {
Properties p = new Properties();
- p.put(EmbeddedDataSource.DQP_BOOTSTRAP_FILE, buildDQPUrl(UnitTestUtil.getTestDataPath() + "/bqt/fakebqt.properties")); //$NON-NLS-1$
-
- EmbeddedConfigSource source = new EmbeddedConfigSource(p);
+ URL url = buildDQPUrl(UnitTestUtil.getTestDataPath() + "/bqt/fakebqt.properties"); //$NON-NLS-1$
+ p.load(url.openStream());
+ EmbeddedConfigSource source = new EmbeddedConfigSource(url, p);
Application application = new Application();
application.start(source);
assertTrue(application.getEnvironment().findService(DQPServiceNames.VDB_SERVICE) instanceof FakeVDBService);
Modified: trunk/embedded/src/test/java/com/metamatrix/dqp/embedded/services/TestEmbeddedConfigurationService.java
===================================================================
--- trunk/embedded/src/test/java/com/metamatrix/dqp/embedded/services/TestEmbeddedConfigurationService.java 2009-05-28 01:42:53 UTC (rev 1002)
+++ trunk/embedded/src/test/java/com/metamatrix/dqp/embedded/services/TestEmbeddedConfigurationService.java 2009-05-28 11:04:30 UTC (rev 1003)
@@ -34,8 +34,6 @@
import junit.framework.TestCase;
-import org.teiid.connector.api.ConnectorPropertyNames;
-
import com.metamatrix.api.exception.MetaMatrixComponentException;
import com.metamatrix.common.application.ApplicationEnvironment;
import com.metamatrix.common.config.api.ComponentType;
@@ -79,19 +77,19 @@
}
public void testUseExtensionPath() throws Exception {
- service.userPreferences = EmbeddedTestUtil.getProperties();
+ service.setUserPreferences(EmbeddedTestUtil.getProperties());
assertTrue(service.useExtensionClasspath());
}
public void testUseExtensionPathFalse() throws Exception {
Properties p = EmbeddedTestUtil.getProperties();
p.remove("dqp.extensions"); //$NON-NLS-1$
- service.userPreferences = p;
+ service.setUserPreferences(p);
assertFalse(service.useExtensionClasspath());
}
public void testGetAvailableVDBFiles() throws Exception {
- service.userPreferences = EmbeddedTestUtil.getProperties();
+ service.setUserPreferences(EmbeddedTestUtil.getProperties());
HashMap vdbFiles = VDBConfigurationReader.loadVDBS(service.getVDBLocations());
int count = vdbFiles.keySet().size();
assertEquals(2, count);
@@ -106,7 +104,7 @@
}
public void testGetConfigFileURL() throws Exception {
- service.userPreferences = EmbeddedTestUtil.getProperties();
+ service.setUserPreferences(EmbeddedTestUtil.getProperties());
assertTrue(service.getConfigFile().toString().endsWith("dqp/config/ServerConfig.xml")); //$NON-NLS-1$
}
@@ -115,7 +113,7 @@
BasicConnectorBinding alternatebinding = new BasicConnectorBinding(new ConfigurationID("foo"), new ConnectorBindingID(new ConfigurationID("foo"), "foo"), new ComponentTypeID("foo type")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
Properties p = EmbeddedTestUtil.getProperties();
- service.userPreferences = p;
+ service.setUserPreferences(p);
service.loadedConnectorBindings.put("foo", alternatebinding); //$NON-NLS-1$
// we did not set use alternate.
@@ -125,7 +123,7 @@
public void defer_testInitializeEncryption() throws Exception {
Properties p = EmbeddedTestUtil.getProperties();
p.setProperty(DQPEmbeddedProperties.DQP_KEYSTORE, "Cluster.key"); //$NON-NLS-1$
- service.userPreferences = p;
+ service.setUserPreferences(p);
service.initializeEncryption();
assertFalse(CryptoUtil.getDecryptor() instanceof NullCryptor);
}
@@ -133,20 +131,20 @@
public void testGetDefaultExtensionPath() throws Exception {
Properties p = EmbeddedTestUtil.getProperties();
p.remove(DQPEmbeddedProperties.DQP_EXTENSIONS);
- service.userPreferences = p;
+ service.setUserPreferences(p);
assertTrue(service.getExtensionPath()[0].toString().endsWith("dqp/extensions/")); //$NON-NLS-1$
}
public void testGetDirectoryToStoreVDBS() throws Exception {
Properties p = EmbeddedTestUtil.getProperties();
- service.userPreferences = p;
+ service.setUserPreferences(p);
assertTrue(service.getVDBSaveLocation().toString().endsWith("dqp/config/")); //$NON-NLS-1$
}
public void testGetDirectoryToStoreVDBSByVDBName() throws Exception {
Properties p = EmbeddedTestUtil.getProperties();
p.setProperty(DQPEmbeddedProperties.VDB_DEFINITION, "./config/QT_Ora9DS.vdb"); //$NON-NLS-1$
- service.userPreferences = p;
+ service.setUserPreferences(p);
service.initializeService(p);
VDBArchive vdb = service.getVDB("QT_Ora9DS", "1"); //$NON-NLS-1$ //$NON-NLS-2$
@@ -157,7 +155,7 @@
public void testGetFileToSaveNewFile() throws Exception{
Properties p = EmbeddedTestUtil.getProperties();
- service.userPreferences = p;
+ service.setUserPreferences(p);
p.setProperty(DQPEmbeddedProperties.VDB_DEFINITION, "./config/QT_Ora9DS.vdb"); //$NON-NLS-1$
service.initializeService(p);
@@ -170,7 +168,7 @@
public void testGetFileAlreadyExisting() throws Exception{
Properties p = EmbeddedTestUtil.getProperties();
- service.userPreferences = p;
+ service.setUserPreferences(p);
service.initializeService(p);
VDBArchive vdb = service.getVDB("QT_Ora9DS", "1"); //$NON-NLS-1$ //$NON-NLS-2$
@@ -181,7 +179,7 @@
public void testGetFullyQualifiedPath() throws Exception{
Properties p = EmbeddedTestUtil.getProperties();
- service.userPreferences = p;
+ service.setUserPreferences(p);
assertTrue(service.getFullyQualifiedPath("http://lib/foo.txt").toString().endsWith("http://lib/foo.txt")); //$NON-NLS-1$ //$NON-NLS-2$
assertTrue(service.getFullyQualifiedPath("file:/c:/lib/foo.txt").toString().endsWith("file:/c:/lib/foo.txt"));//$NON-NLS-1$ //$NON-NLS-2$
assertTrue(service.getFullyQualifiedPath("/lib/foo.txt").toString().endsWith("mmfile:/lib/foo.txt"));//$NON-NLS-1$ //$NON-NLS-2$
@@ -194,14 +192,14 @@
public void testGetNextVdbVersion() throws Exception{
Properties p = EmbeddedTestUtil.getProperties();
- service.userPreferences = p;
+ service.setUserPreferences(p);
service.initializeService(p);
assertEquals(2, service.getNextVdbVersion("QT_Ora9DS")); //$NON-NLS-1$
}
public void testDeleteInUseConnectorBinding() throws Exception{
Properties p = EmbeddedTestUtil.getProperties();
- service.userPreferences = p;
+ service.setUserPreferences(p);
service.initializeService(p);
try {
service.deleteConnectorBinding("BQT2 Oracle 9i Simple Cap"); //$NON-NLS-1$
@@ -213,7 +211,7 @@
public void testDeleteNonExistingConnectorBinding() throws Exception{
Properties p = EmbeddedTestUtil.getProperties();
- service.userPreferences = p;
+ service.setUserPreferences(p);
service.initializeService(p);
try {
service.deleteConnectorBinding("UNKNOWN"); //$NON-NLS-1$
@@ -225,7 +223,7 @@
public void testDeleteConnectorBinding() throws Exception{
Properties p = EmbeddedTestUtil.getProperties();
- service.userPreferences = p;
+ service.setUserPreferences(p);
service.initializeService(p);
service.deleteVDB(service.getVDB("QT_Ora9DS", "1")); //$NON-NLS-1$ //$NON-NLS-2$
@@ -241,7 +239,7 @@
public void testDeleteConnectorType() throws Exception{
Properties p = EmbeddedTestUtil.getProperties();
- service.userPreferences = p;
+ service.setUserPreferences(p);
service.initializeService(p);
try {
@@ -262,7 +260,7 @@
public void testDeleteConnectorTypeInUse() throws Exception{
Properties p = EmbeddedTestUtil.getProperties();
- service.userPreferences = p;
+ service.setUserPreferences(p);
service.initializeService(p);
assertNotNull(service.getConnectorType("Oracle ANSI JDBC Connector"));//$NON-NLS-1$
@@ -277,7 +275,7 @@
public void testDeleteVDB() throws Exception{
Properties p = EmbeddedTestUtil.getProperties();
- service.userPreferences = p;
+ service.setUserPreferences(p);
service.initializeService(p);
VDBArchive vdb = service.getVDB("QT_Ora9DS", "1"); //$NON-NLS-1$ //$NON-NLS-2$
@@ -292,7 +290,7 @@
Properties p = EmbeddedTestUtil.getProperties();
p.setProperty(DQPEmbeddedProperties.DQP_LOGFILE, "./log/dqp.log"); //$NON-NLS-1$
p.setProperty(DQPEmbeddedProperties.DQP_LOGLEVEL, "1"); //$NON-NLS-1$
- service.userPreferences = p;
+ service.setUserPreferences(p);
assertTrue(service.getLogFile().toString().endsWith("/log/dqp.log")); //$NON-NLS-1$
assertEquals(service.getLogLevel(), "1"); //$NON-NLS-1$
@@ -300,7 +298,7 @@
public void testGetSystemProperties() throws Exception {
Properties p = EmbeddedTestUtil.getProperties();
- service.userPreferences = p;
+ service.setUserPreferences(p);
service.initializeService(p);
Properties sp = service.getSystemProperties();
@@ -312,7 +310,7 @@
public void testGetSystemConfiguration() throws Exception{
Properties p = EmbeddedTestUtil.getProperties();
- service.userPreferences = p;
+ service.setUserPreferences(p);
assertNull(service.configurationModel);
service.getSystemConfiguration();
@@ -321,7 +319,7 @@
public void testGetSystemVDB() throws Exception {
Properties p = EmbeddedTestUtil.getProperties();
- service.userPreferences = p;
+ service.setUserPreferences(p);
service.initializeService(p);
assertNotNull(service.getSystemVdb());
}
@@ -330,7 +328,7 @@
Properties p = EmbeddedTestUtil.getProperties();
p.setProperty(DQPEmbeddedProperties.USER_DEFINED_FUNCTIONS, "extensionjar:foo.xmi"); //$NON-NLS-1$
p.setProperty("dqp.extensions", "./foo/;./bar/"); //$NON-NLS-1$ //$NON-NLS-2$
- service.userPreferences = p;
+ service.setUserPreferences(p);
assertNull(service.getUDFFile());
@@ -363,14 +361,14 @@
public void testGetVDBs() throws Exception{
Properties p = EmbeddedTestUtil.getProperties();
- service.userPreferences = p;
+ service.setUserPreferences(p);
service.initializeService(p);
assertTrue(service.getVDBs().size() == 2);
}
public void testSaveConnectorBinding() throws Exception{
Properties p = EmbeddedTestUtil.getProperties();
- service.userPreferences = p;
+ service.setUserPreferences(p);
service.initializeService(p);
String msg = "Test update of the connector binding"; //$NON-NLS-1$
@@ -401,7 +399,7 @@
public void testSaveConnectorType() throws Exception{
Properties p = EmbeddedTestUtil.getProperties();
- service.userPreferences = p;
+ service.setUserPreferences(p);
service.initializeService(p);
String msg = "Test update of the connector type"; //$NON-NLS-1$
@@ -426,7 +424,7 @@
public void testSaveVDB() throws Exception{
Properties p = EmbeddedTestUtil.getProperties();
- service.userPreferences = p;
+ service.setUserPreferences(p);
service.initializeService(p);
VDBArchive vdb = service.getVDB("QT_Ora9DS", "1"); //$NON-NLS-1$ //$NON-NLS-2$
@@ -439,7 +437,7 @@
public void testGetProcessorBatchSize() throws Exception {
Properties p = EmbeddedTestUtil.getProperties();
- service.userPreferences = p;
+ service.setUserPreferences(p);
service.initializeService(p);
assertEquals("3867", service.getProcessorBatchSize()); //$NON-NLS-1$
@@ -447,7 +445,7 @@
public void testGetConnectorBatchSize() throws Exception {
Properties p = EmbeddedTestUtil.getProperties();
- service.userPreferences = p;
+ service.setUserPreferences(p);
service.initializeService(p);
assertEquals("3868", service.getConnectorBatchSize()); //$NON-NLS-1$
@@ -455,7 +453,7 @@
public void testLoadedConnectorBindings() throws Exception {
Properties p = EmbeddedTestUtil.getProperties();
- service.userPreferences = p;
+ service.setUserPreferences(p);
service.initializeService(p);
assertEquals("There shlould be only three connectors", 3, service.getConnectorBindings().size()); //$NON-NLS-1$
@@ -477,7 +475,7 @@
public void testAddConnectorBinding() throws Exception {
Properties p = EmbeddedTestUtil.getProperties();
- service.userPreferences = p;
+ service.setUserPreferences(p);
service.initializeService(p);
ConnectorBinding binding = service.getConnectorBinding("QT_ORA9DS_1.BQT1 Oracle 9i Simple Cap"); //$NON-NLS-1$
@@ -489,7 +487,7 @@
public void testGetConnectorTypes() throws Exception {
Properties p = EmbeddedTestUtil.getProperties();
- service.userPreferences = p;
+ service.setUserPreferences(p);
service.initializeService(p);
assertEquals(23, service.loadedConnectorTypes.size());
@@ -498,7 +496,7 @@
public void testUseMultipleExtensionPath() throws Exception {
Properties p = EmbeddedTestUtil.getProperties();
p.setProperty("dqp.extensions", "/foo/;../x/bar/"); //$NON-NLS-1$ //$NON-NLS-2$
- service.userPreferences = p;
+ service.setUserPreferences(p);
assertEquals("mmfile:/foo/", service.getExtensionPath()[0].toExternalForm()); //$NON-NLS-1$
assertEquals("mmfile:target/scratch/x/bar/", service.getExtensionPath()[1].toExternalForm()); //$NON-NLS-1$
}
@@ -514,7 +512,7 @@
fw.close();
p.setProperty("dqp.extensions", "./foo/;./bar/"); //$NON-NLS-1$ //$NON-NLS-2$
- service.userPreferences = p;
+ service.setUserPreferences(p);
// get all the modules in the system.
List<ExtensionModule> modules = service.getExtensionModules();
@@ -537,7 +535,7 @@
assertEquals(2, modules.size());
// test common class path; also makes sure that the connect in position (1) has the newly added module
- service.userPreferences.setProperty("dqp.extension.CommonClasspath", "extensionjar:added-ext.jar;extensionjar:extfile.jar"); //$NON-NLS-1$ //$NON-NLS-2$
+ service.getUserPreferences().setProperty("dqp.extension.CommonClasspath", "extensionjar:added-ext.jar;extensionjar:extfile.jar"); //$NON-NLS-1$ //$NON-NLS-2$
URL[] urls = service.getClassLoaderManager().parseURLs(service.getClassLoaderManager().getCommonExtensionClassPath());
assertEquals("mmfile:target/scratch/dqp/foo/added-ext.jar", urls[0].toString()); //$NON-NLS-1$
assertEquals("mmfile:target/scratch/dqp/bar/extfile.jar", urls[1].toString()); //$NON-NLS-1$
@@ -572,7 +570,7 @@
fw.close();
p.setProperty("dqp.extensions", "./foo/;./bar/"); //$NON-NLS-1$ //$NON-NLS-2$
- service.userPreferences = p;
+ service.setUserPreferences(p);
assertEquals("", service.getClassLoaderManager().getCommonExtensionClassPath()); //$NON-NLS-1$
Modified: trunk/embedded/src/test/java/com/metamatrix/dqp/embedded/services/TestEmbeddedDataService.java
===================================================================
--- trunk/embedded/src/test/java/com/metamatrix/dqp/embedded/services/TestEmbeddedDataService.java 2009-05-28 01:42:53 UTC (rev 1002)
+++ trunk/embedded/src/test/java/com/metamatrix/dqp/embedded/services/TestEmbeddedDataService.java 2009-05-28 11:04:30 UTC (rev 1003)
@@ -54,7 +54,7 @@
public void testSelectConnector() throws Exception {
Properties p = EmbeddedTestUtil.getProperties(UnitTestUtil.getTestDataPath()+"/dqp/dqp.properties"); //$NON-NLS-1$
- configService.userPreferences = p;
+ configService.setUserPreferences(p);
configService.initializeService(p);
}
Modified: trunk/embedded/src/test/java/com/metamatrix/dqp/embedded/services/TestEmbeddedVDBService.java
===================================================================
--- trunk/embedded/src/test/java/com/metamatrix/dqp/embedded/services/TestEmbeddedVDBService.java 2009-05-28 01:42:53 UTC (rev 1002)
+++ trunk/embedded/src/test/java/com/metamatrix/dqp/embedded/services/TestEmbeddedVDBService.java 2009-05-28 11:04:30 UTC (rev 1003)
@@ -64,8 +64,8 @@
}
public void testGetTestVDB() throws Exception {
- Properties p = EmbeddedTestUtil.getProperties(); //$NON-NLS-1$
- configService.userPreferences = p;
+ Properties p = EmbeddedTestUtil.getProperties();
+ configService.setUserPreferences(p);
configService.initializeService(p);
VDBArchive vdb = vdbService.getVDB("QT_Ora9DS", "1"); //$NON-NLS-1$ //$NON-NLS-2$
@@ -81,8 +81,8 @@
}
public void testSystemModelConnectorBinding() throws Exception {
- Properties p = EmbeddedTestUtil.getProperties(); //$NON-NLS-1$
- configService.userPreferences = p;
+ Properties p = EmbeddedTestUtil.getProperties();
+ configService.setUserPreferences(p);
configService.initializeService(p);
// asking "vdb.name" and stored "vdb.name"
@@ -102,8 +102,8 @@
// name | trim stored | name |
//---------------------------------------
public void testGetConnectorBindingNames() throws Exception {
- Properties p = EmbeddedTestUtil.getProperties(); //$NON-NLS-1$
- configService.userPreferences = p;
+ Properties p = EmbeddedTestUtil.getProperties();
+ configService.setUserPreferences(p);
configService.initializeService(p);
// asking "vdb.name" and stored "vdb.name"
@@ -113,8 +113,8 @@
}
public void testMapConnectorBinding() throws Exception {
- Properties p = EmbeddedTestUtil.getProperties(); //$NON-NLS-1$
- configService.userPreferences = p;
+ Properties p = EmbeddedTestUtil.getProperties();
+ configService.setUserPreferences(p);
configService.initializeService(p);
Properties props = new Properties();
@@ -156,7 +156,7 @@
Application registry = new Application();
configService = new EmbeddedConfigurationService();
- configService.userPreferences = p;
+ configService.setUserPreferences(p);
configService.initializeService(p);
registry.installService(DQPServiceNames.CONFIGURATION_SERVICE, configService);
vdbService = new EmbeddedVDBService();
@@ -170,14 +170,14 @@
public void testVDBResource() throws Exception {
Properties p = EmbeddedTestUtil.getProperties();
- configService.userPreferences = p;
+ configService.setUserPreferences(p);
configService.initializeService(p);
assertNotNull(vdbService.getVDBResource("Admin", "1")); //$NON-NLS-1$ //$NON-NLS-2$
}
public void testAvailableVDBs() throws Exception {
Properties p = EmbeddedTestUtil.getProperties();
- configService.userPreferences = p;
+ configService.setUserPreferences(p);
configService.initializeService(p);
assertEquals(2, vdbService.getAvailableVDBs().size());
@@ -188,8 +188,8 @@
}
public void testDeployNewVDB() throws Exception{
- Properties p = EmbeddedTestUtil.getProperties(); //$NON-NLS-1$
- configService.userPreferences = p;
+ Properties p = EmbeddedTestUtil.getProperties();
+ configService.setUserPreferences(p);
configService.initializeService(p);
assertEquals(2, vdbService.getAvailableVDBs().size());
assertEquals(3, configService.getConnectorBindings().size());
@@ -211,8 +211,8 @@
// when we deploy the already deployed VDB it should take on the next version
// number.
public void testDeploySameVDB() throws Exception{
- Properties p = EmbeddedTestUtil.getProperties(); //$NON-NLS-1$
- configService.userPreferences = p;
+ Properties p = EmbeddedTestUtil.getProperties();
+ configService.setUserPreferences(p);
configService.initializeService(p);
assertEquals(2, vdbService.getAvailableVDBs().size());
assertEquals(3, configService.getConnectorBindings().size());
@@ -232,8 +232,8 @@
public void changeVDBStatus_delete() throws Exception {
- Properties p = EmbeddedTestUtil.getProperties(); //$NON-NLS-1$
- configService.userPreferences = p;
+ Properties p = EmbeddedTestUtil.getProperties();
+ configService.setUserPreferences(p);
configService.initializeService(p);
assertEquals(2, vdbService.getAvailableVDBs().size());
@@ -243,8 +243,8 @@
}
public void changeVDBStatus_inactive() throws Exception {
- Properties p = EmbeddedTestUtil.getProperties(); //$NON-NLS-1$
- configService.userPreferences = p;
+ Properties p = EmbeddedTestUtil.getProperties();
+ configService.setUserPreferences(p);
configService.initializeService(p);
assertEquals(2, vdbService.getAvailableVDBs().size());
Modified: trunk/embedded/src/test/java/com/metamatrix/dqp/service/buffer/TestLocalBufferService.java
===================================================================
--- trunk/embedded/src/test/java/com/metamatrix/dqp/service/buffer/TestLocalBufferService.java 2009-05-28 01:42:53 UTC (rev 1002)
+++ trunk/embedded/src/test/java/com/metamatrix/dqp/service/buffer/TestLocalBufferService.java 2009-05-28 11:04:30 UTC (rev 1003)
@@ -31,6 +31,7 @@
import com.metamatrix.common.buffer.impl.BufferConfig;
import com.metamatrix.common.buffer.impl.BufferManagerImpl;
import com.metamatrix.core.util.UnitTestUtil;
+import com.metamatrix.dqp.embedded.DQPEmbeddedProperties;
import com.metamatrix.dqp.embedded.EmbeddedTestUtil;
import com.metamatrix.dqp.embedded.services.EmbeddedBufferService;
import com.metamatrix.dqp.embedded.services.EmbeddedConfigurationService;
@@ -45,12 +46,12 @@
public void testMissingRequiredProperties() throws Exception {
try {
- System.setProperty("mm.io.tmpdir", System.getProperty("java.io.tmpdir")+"/metamatrix/1"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ System.setProperty(DQPEmbeddedProperties.DQP_TMPDIR, System.getProperty("java.io.tmpdir")+"/metamatrix/1"); //$NON-NLS-1$ //$NON-NLS-2$
Application r = new Application();
ConfigurationService cs = new EmbeddedConfigurationService();
Properties p = EmbeddedTestUtil.getProperties(UnitTestUtil.getTestDataPath() + "/admin/buffertest1.properties"); //$NON-NLS-1$
- p.setProperty("mm.io.tmpdir", System.getProperty("mm.io.tmpdir")); //$NON-NLS-1$ //$NON-NLS-2$
+ p.setProperty(DQPEmbeddedProperties.DQP_TMPDIR, System.getProperty(DQPEmbeddedProperties.DQP_TMPDIR));
cs.initialize(p);
r.installService(DQPServiceNames.CONFIGURATION_SERVICE, cs);
EmbeddedBufferService svc = new EmbeddedBufferService();
@@ -94,12 +95,12 @@
}
public void testCheckMemPropertyGotSet2() throws Exception {
- System.setProperty("mm.io.tmpdir", System.getProperty("java.io.tmpdir")+"/metamatrix/1"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ System.setProperty(DQPEmbeddedProperties.DQP_TMPDIR, System.getProperty("java.io.tmpdir")+"/metamatrix/1"); //$NON-NLS-1$ //$NON-NLS-2$
EmbeddedBufferService svc = null;
Application r = new Application();
ConfigurationService cs = new EmbeddedConfigurationService();
Properties p = EmbeddedTestUtil.getProperties(UnitTestUtil.getTestDataPath() + "/admin/buffertest3.properties"); //$NON-NLS-1$
- p.setProperty("mm.io.tmpdir", System.getProperty("mm.io.tmpdir")); //$NON-NLS-1$ //$NON-NLS-2$
+ p.setProperty(DQPEmbeddedProperties.DQP_TMPDIR, System.getProperty(DQPEmbeddedProperties.DQP_TMPDIR));
cs.initialize(p);
r.installService(DQPServiceNames.CONFIGURATION_SERVICE, cs);
svc = new EmbeddedBufferService();
Modified: trunk/embedded/src/test/java/com/metamatrix/jdbc/TestEmbeddedDriver.java
===================================================================
--- trunk/embedded/src/test/java/com/metamatrix/jdbc/TestEmbeddedDriver.java 2009-05-28 01:42:53 UTC (rev 1002)
+++ trunk/embedded/src/test/java/com/metamatrix/jdbc/TestEmbeddedDriver.java 2009-05-28 11:04:30 UTC (rev 1003)
@@ -85,7 +85,7 @@
Properties p = new Properties();
driver.parseURL("jdbc:metamatrix:BQT@c:\\metamatrix\\dqp\\dqp.properties", p); //$NON-NLS-1$
assertTrue(p.getProperty(BaseDataSource.VDB_NAME).equals("BQT")); //$NON-NLS-1$
- assertTrue(p.get(EmbeddedDataSource.DQP_BOOTSTRAP_FILE).toString().equals("mmfile:/c:/metamatrix/dqp/dqp.properties")); //$NON-NLS-1$
+ assertEquals("c:\\metamatrix\\dqp\\dqp.properties", p.getProperty(EmbeddedDataSource.DQP_BOOTSTRAP_FILE)); //$NON-NLS-1$
assertEquals(3, p.size());
}
@@ -93,7 +93,7 @@
Properties p = new Properties();
driver.parseURL("jdbc:metamatrix:BQT@\\metamatrix\\dqp\\dqp.properties;version=3", p); //$NON-NLS-1$
assertTrue(p.getProperty(BaseDataSource.VDB_NAME).equals("BQT")); //$NON-NLS-1$
- assertTrue(p.get(EmbeddedDataSource.DQP_BOOTSTRAP_FILE).toString().equals("mmfile:/metamatrix/dqp/dqp.properties")); //$NON-NLS-1$
+ assertEquals("\\metamatrix\\dqp\\dqp.properties", p.getProperty(EmbeddedDataSource.DQP_BOOTSTRAP_FILE)); //$NON-NLS-1$
assertTrue(p.getProperty(BaseDataSource.VDB_VERSION).equals("3")); //$NON-NLS-1$
assertTrue(p.getProperty(BaseDataSource.VERSION).equals("3")); //$NON-NLS-1$
assertEquals(5, p.size());
@@ -114,7 +114,7 @@
Properties p = new Properties();
driver.parseURL("jdbc:metamatrix:BQT@testdata/dqp/dqp.properties;partialResultsMode=true", p); //$NON-NLS-1$
assertTrue(p.getProperty(BaseDataSource.VDB_NAME).equals("BQT")); //$NON-NLS-1$
- assertTrue(p.get(EmbeddedDataSource.DQP_BOOTSTRAP_FILE).toString().equals("mmfile:testdata/dqp/dqp.properties")); //$NON-NLS-1$
+ assertEquals("testdata/dqp/dqp.properties", p.getProperty(EmbeddedDataSource.DQP_BOOTSTRAP_FILE)); //$NON-NLS-1$
assertTrue(p.getProperty(ExecutionProperties.PROP_PARTIAL_RESULTS_MODE).equals("true")); //$NON-NLS-1$
assertEquals(4, p.size());
}
@@ -123,21 +123,21 @@
Properties p = new Properties();
driver.parseURL("jdbc:metamatrix:BQT", p); //$NON-NLS-1$
assertTrue(p.getProperty(BaseDataSource.VDB_NAME).equals("BQT")); //$NON-NLS-1$
- assertTrue(p.get(EmbeddedDataSource.DQP_BOOTSTRAP_FILE).toString().equals("classpath:/deploy.properties")); //$NON-NLS-1$
+ assertTrue(p.get(EmbeddedDataSource.DQP_BOOTSTRAP_FILE).equals("classpath:/deploy.properties")); //$NON-NLS-1$
}
public void testParseURL55() throws SQLException{
Properties p = new Properties();
driver.parseURL("jdbc:metamatrix:BQT;", p); //$NON-NLS-1$
assertTrue(p.getProperty(BaseDataSource.VDB_NAME).equals("BQT")); //$NON-NLS-1$
- assertTrue(p.get(EmbeddedDataSource.DQP_BOOTSTRAP_FILE).toString().equals("classpath:/deploy.properties")); //$NON-NLS-1$
+ assertTrue(p.get(EmbeddedDataSource.DQP_BOOTSTRAP_FILE).equals("classpath:/deploy.properties")); //$NON-NLS-1$
}
public void testParseURL6() throws SQLException{
Properties p = new Properties();
driver.parseURL("jdbc:metamatrix:BQT;partialResultsMode=true;version=1", p); //$NON-NLS-1$
assertTrue(p.getProperty(BaseDataSource.VDB_NAME).equals("BQT")); //$NON-NLS-1$
- assertTrue(p.get(EmbeddedDataSource.DQP_BOOTSTRAP_FILE).toString().equals("classpath:/deploy.properties")); //$NON-NLS-1$
+ assertTrue(p.get(EmbeddedDataSource.DQP_BOOTSTRAP_FILE).equals("classpath:/deploy.properties")); //$NON-NLS-1$
assertTrue(p.getProperty(ExecutionProperties.PROP_PARTIAL_RESULTS_MODE).equals("true")); //$NON-NLS-1$
assertTrue(p.getProperty(BaseDataSource.VDB_VERSION).equals("1")); //$NON-NLS-1$
assertTrue(p.getProperty("vdb.definition").equals("BQT.vdb")); //$NON-NLS-1$ //$NON-NLS-2$
Modified: trunk/engine/src/main/java/com/metamatrix/common/application/Application.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/common/application/Application.java 2009-05-28 01:42:53 UTC (rev 1002)
+++ trunk/engine/src/main/java/com/metamatrix/common/application/Application.java 2009-05-28 11:04:30 UTC (rev 1003)
@@ -43,6 +43,7 @@
protected ApplicationEnvironment environment = new ApplicationEnvironment();
private ArrayList<String> installedServices = new ArrayList<String>();
+ private ServiceLoader loader = new ServiceLoader();
/*
* @see com.metamatrix.common.application.Application#initialize(java.util.Properties)
@@ -60,6 +61,7 @@
LogManager.logInfo(LogConstants.CTX_DQP, DQPPlugin.Util.getString("DQPLauncher.InstallService_ServiceIsNull", serviceName)); //$NON-NLS-1$
}else{
ApplicationService appService = injector.getInstance(type);
+ appService = loader.loadService(serviceName, appService);
String loggingContext = DQPServiceNames.SERVICE_LOGGING_CONTEXT[i];
if (loggingContext != null) {
appService = (ApplicationService)LogManager.createLoggingProxy(loggingContext, appService, new Class[] {type}, MessageLevel.DETAIL);
Added: trunk/engine/src/main/java/com/metamatrix/common/application/ServiceLoader.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/common/application/ServiceLoader.java (rev 0)
+++ trunk/engine/src/main/java/com/metamatrix/common/application/ServiceLoader.java 2009-05-28 11:04:30 UTC (rev 1003)
@@ -0,0 +1,35 @@
+/*
+ * 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.common.application;
+
+/**
+ * Used as an entry mechanism for the Designer to extend service classes
+ * without depending upon embedded.
+ */
+public class ServiceLoader {
+
+ public ApplicationService loadService(String serviceType, ApplicationService service) {
+ return service;
+ }
+
+}
Property changes on: trunk/engine/src/main/java/com/metamatrix/common/application/ServiceLoader.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/engine/src/main/java/com/metamatrix/dqp/service/TransactionService.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/dqp/service/TransactionService.java 2009-05-28 01:42:53 UTC (rev 1002)
+++ trunk/engine/src/main/java/com/metamatrix/dqp/service/TransactionService.java 2009-05-28 11:04:30 UTC (rev 1003)
@@ -61,7 +61,6 @@
public static final String DEFAULT_LOGFILE_SIZE= "10"; //$NON-NLS-1$
public static final String DEFAULT_MAX_ROLLOVER_FILES = "10"; //$NON-NLS-1$
public static final String DEFAULT_SEPARATE_TXN_LOG = "false"; //$NON-NLS-1$
- public static final String DEFAULT_TXN_STORE_DIR = System.getProperty("metamatrix.xatxnmgr.txnstore_dir", System.getProperty("user.dir")); //$NON-NLS-1$ //$NON-NLS-2$
public static final String DEFAULT_TXN_STATUS_PORT = "0"; //$NON-NLS-1$
// processor level methods
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/Request.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/Request.java 2009-05-28 01:42:53 UTC (rev 1002)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/Request.java 2009-05-28 11:04:30 UTC (rev 1003)
@@ -586,6 +586,8 @@
public void processRequest()
throws QueryValidatorException, QueryParserException, QueryResolverException, MetaMatrixComponentException, QueryPlannerException {
+ LogManager.logDetail(LogConstants.CTX_DQP, this.requestId, "executing", this.requestMsg.isPreparedStatement()?"prepared":"", this.requestMsg.getCommandString()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+
initMetadata();
Command processingCommand = generatePlan();
Modified: trunk/server/src/main/java/com/metamatrix/server/CacheProvider.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/server/CacheProvider.java 2009-05-28 01:42:53 UTC (rev 1002)
+++ trunk/server/src/main/java/com/metamatrix/server/CacheProvider.java 2009-05-28 11:04:30 UTC (rev 1003)
@@ -22,15 +22,20 @@
package com.metamatrix.server;
+import java.util.List;
+import java.util.Properties;
+
import org.jboss.cache.Cache;
import org.jboss.cache.DefaultCacheFactory;
import org.jboss.cache.config.Configuration;
+import org.jboss.cache.config.CacheLoaderConfig.IndividualCacheLoaderConfig;
import org.jgroups.Channel;
import com.google.inject.Inject;
import com.google.inject.Provider;
import com.google.inject.Singleton;
import com.google.inject.name.Named;
+import com.metamatrix.common.config.CurrentConfiguration;
@Singleton
class CacheProvider implements Provider<org.jboss.cache.Cache> {
@@ -47,6 +52,10 @@
Cache cache = new DefaultCacheFactory().createCache("jboss-cache-configuration.xml", false); //$NON-NLS-1$
Configuration config = cache.getConfiguration();
+ List<IndividualCacheLoaderConfig> configs = config.getCacheLoaderConfig().getIndividualCacheLoaderConfigs();
+ Properties p = configs.get(0).getProperties();
+ p.setProperty("location", CurrentConfiguration.getInstance().getDefaultHost().getDataDirectory() + "/cache"); //$NON-NLS-1$ //$NON-NLS-2$
+ configs.get(0).setProperties(p);
config.getRuntimeConfig().setChannel(channel);
config.setClusterName(this.channelName);
Modified: trunk/txn-jbossts/src/main/java/com/metamatrix/xa/arjuna/ArjunaTransactionProvider.java
===================================================================
--- trunk/txn-jbossts/src/main/java/com/metamatrix/xa/arjuna/ArjunaTransactionProvider.java 2009-05-28 01:42:53 UTC (rev 1002)
+++ trunk/txn-jbossts/src/main/java/com/metamatrix/xa/arjuna/ArjunaTransactionProvider.java 2009-05-28 11:04:30 UTC (rev 1003)
@@ -91,8 +91,8 @@
String txnMgrUniqueName = "txnmgr_" + props.getProperty(TransactionService.HOSTNAME, "").replace('.', '_') + "_" + vmName; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
// set the directory for storing the in-flight transactions
- String baseDir = props.getProperty(TransactionService.TXN_STORE_DIR, TransactionService.DEFAULT_TXN_STORE_DIR);
- Configuration.setObjectStoreRoot(baseDir + File.separator + "MetaMatrixTxnStore" + File.separator + txnMgrUniqueName); //$NON-NLS-1$
+ String baseDir = props.getProperty(TransactionService.TXN_STORE_DIR, System.getProperty("java.io.tmpdir")); //$NON-NLS-1$
+ Configuration.setObjectStoreRoot(baseDir + File.separator + "TeiidTxnStore" + File.separator + txnMgrUniqueName); //$NON-NLS-1$
configureLogging(txnMgrUniqueName, props);
15 years, 6 months