Author: vhalbert(a)redhat.com
Date: 2009-04-10 14:41:33 -0400 (Fri, 10 Apr 2009)
New Revision: 749
Modified:
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/api/ComponentType.java
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/api/ConnectorBinding.java
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/api/ConnectorBindingType.java
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/model/BasicComponentType.java
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/model/BasicConnectorBinding.java
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/model/BasicConnectorBindingType.java
Log:
Teiid 323 - the xa supported flag was moved from the connector type to a property on the
connector. Now the binding will indicate if it suports XA versus the type
Modified:
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/api/ComponentType.java
===================================================================
---
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/api/ComponentType.java 2009-04-10
15:58:04 UTC (rev 748)
+++
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/api/ComponentType.java 2009-04-10
18:41:33 UTC (rev 749)
@@ -46,6 +46,7 @@
// public static final int SHARED_RESOURCE_COMPONENT_TYPE_CODE = 10;
+
/**
* Returns the <code>Collection</code> of
<code>ComponentTypeDefn</code>s
@@ -125,29 +126,13 @@
* Returns true if this component type is monitored
* @return boolean true if monitored
*/
- boolean isMonitored();
+ boolean isMonitored();
/**
- * Returns true if this component type is a member of the connectors product type
based on
- * @link
com.metamatrix.core.util.MetaMatrixProductVersion#CONNECTOR_PRODUCT_TYPE_NAME
- * @return boolean true if a member of the connectors product type
- */
- boolean isOfConnectorProductType();
-
- /**
* Returns true if this component type is a connector type
* @return boolean true if a connector type
*/
- boolean isOfTypeConnector();
-
- /**
- * Returns true if this component type is a XA connector type.
- * If this is <code>true</code>, then @link #isOfTypeConnector()
- * will also be true. However, @link #isOfTypeConnector() can be true
- * and this can be <code>false</code>.
- * @return boolean true if a connector type
- */
- boolean isOfTypeXAConnector();
+ boolean isOfTypeConnector();
/**
* Returns the principal who created this type
Modified:
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/api/ConnectorBinding.java
===================================================================
---
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/api/ConnectorBinding.java 2009-04-10
15:58:04 UTC (rev 748)
+++
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/api/ConnectorBinding.java 2009-04-10
18:41:33 UTC (rev 749)
@@ -35,4 +35,13 @@
String getConnectorClass();
String getDeployedName();
+
+ /**
+ * Returns true if this component type supports XA transactions.
+ * If this is <code>true</code>, then @link #isOfTypeConnector()
+ * will also be true. However, @link #isOfTypeConnector() can be true
+ * and this can be <code>false</code>.
+ * @return boolean true if a connector type
+ */
+ boolean isXASupported();
}
Modified:
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/api/ConnectorBindingType.java
===================================================================
---
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/api/ConnectorBindingType.java 2009-04-10
15:58:04 UTC (rev 748)
+++
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/api/ConnectorBindingType.java 2009-04-10
18:41:33 UTC (rev 749)
@@ -22,7 +22,6 @@
package com.metamatrix.common.config.api;
-import com.metamatrix.core.util.MetaMatrixProductVersion;
/**
@@ -32,9 +31,12 @@
public static final String COMPONENT_TYPE_NAME = "Connector";
//$NON-NLS-1$
public static final ComponentTypeID CONNECTOR_TYPE_ID = new
ComponentTypeID(COMPONENT_TYPE_NAME);
- public static final ProductTypeID CONNECTOR_PROD_TYPEID =
ProductTypeID.PRODUCT_TYPE_ID;
-
+
+ /*
+ * NOTE: These attributes must match the ConnectorAPI property names in
org.teiid.connector.internal.ConnectorPropertyNames
+ */
public interface Attributes {
+ public static final String IS_XA = "IsXA"; //$NON-NLS-1$
public static final String CONNECTOR_CLASS =
"ConnectorClass";//$NON-NLS-1$
public static final String MM_JAR_PROTOCOL = "extensionjar";
//$NON-NLS-1$
public static final String CONNECTOR_CLASSPATH = "ConnectorClassPath";
//$NON-NLS-1$
Modified:
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/model/BasicComponentType.java
===================================================================
---
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/model/BasicComponentType.java 2009-04-10
15:58:04 UTC (rev 748)
+++
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/model/BasicComponentType.java 2009-04-10
18:41:33 UTC (rev 749)
@@ -217,19 +217,7 @@
return false;
}
- /**
- * Returns true if this component type is a member of the connectors product type
based on
- * @link
com.metamatrix.core.util.MetaMatrixProductVersion#CONNECTOR_PRODUCT_TYPE_NAME
- * @return boolean true if a member of the connectors product type
- */
- public boolean isOfConnectorProductType() {
- return false;
- }
- public boolean isOfTypeXAConnector() {
- return false;
- }
-
/**
* Returns the principal who created this type
* @return String principal name
Modified:
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/model/BasicConnectorBinding.java
===================================================================
---
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/model/BasicConnectorBinding.java 2009-04-10
15:58:04 UTC (rev 748)
+++
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/model/BasicConnectorBinding.java 2009-04-10
18:41:33 UTC (rev 749)
@@ -41,6 +41,21 @@
protected BasicConnectorBinding(BasicConnectorBinding component) {
super(component);
}
+
+ /**
+ * Returns true if this component type supports XA transactions.
+ * If this is <code>true</code>, then @link #isOfTypeConnector()
+ * will also be true. However, @link #isOfTypeConnector() can be true
+ * and this can be <code>false</code>.
+ * @return boolean true if a connector type
+ */
+ public boolean isXASupported() {
+ String xa = this.getProperty(ConnectorBindingType.Attributes.IS_XA);
+ if (xa != null && xa.equalsIgnoreCase("true")) {
+ return true;
+ }
+ return false;
+ }
/**
* Return a deep cloned instance of this object. Subclasses must override
Modified:
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/model/BasicConnectorBindingType.java
===================================================================
---
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/model/BasicConnectorBindingType.java 2009-04-10
15:58:04 UTC (rev 748)
+++
branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/model/BasicConnectorBindingType.java 2009-04-10
18:41:33 UTC (rev 749)
@@ -37,7 +37,7 @@
public static final long serialVersionUID = 1592753260156781311L;
- private static final String XA_CONNECTOR = "XA Connector";//$NON-NLS-1$
+ // private static final String XA_CONNECTOR = "XA Connector";//$NON-NLS-1$
public BasicConnectorBindingType(ComponentTypeID id, ComponentTypeID parentID,
ComponentTypeID superID, boolean deployable, boolean deprecated, boolean monitored) {
super(id, parentID, superID, deployable, deprecated, monitored);
@@ -64,16 +64,9 @@
public boolean isOfTypeConnector() {
return true;
}
-
- public boolean isOfTypeXAConnector() {
- if (this.getFullName().endsWith(XA_CONNECTOR)) {
- return true;
- }
+
- return false;
- }
-
public synchronized Object clone() {
BasicComponentType result = null;
result = new BasicConnectorBindingType(this);