[jboss-cvs] JBossAS SVN: r108006 - in projects/jboss-jca/trunk: common/src/main/java/org/jboss/jca/common/api/metadata/ds and 12 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Sep 7 09:31:43 EDT 2010
Author: maeste
Date: 2010-09-07 09:31:40 -0400 (Tue, 07 Sep 2010)
New Revision: 108006
Added:
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/common/CommonPool.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/common/CommonSecurity.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/common/CommonTimeOut.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/common/CommonValidation.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/resourceadapter/ConnectionDefinition.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/resourceadapter/ResourceAdapters.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/common/
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/common/CommonPoolImpl.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/common/CommonSecurityImpl.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/common/CommonTimeOutImpl.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/common/CommonValidationImpl.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/common/package.html
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/resourceadapter/ConnectionDefinitionImpl.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/resourceadapter/ResourceAdaptersImpl.java
Removed:
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/ds/Pool.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/ds/Security.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/resourceadapter/LocalTxConnectionFactory.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/resourceadapter/NoTxConnectionFactory.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/resourceadapter/Security.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/resourceadapter/TimeOut.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/resourceadapter/Validation.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/resourceadapter/XaTxConnectionFactory.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ds/PoolImpl.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ds/SecurityImpl.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/resourceadapter/LocalTxConnectionFactoryImpl.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/resourceadapter/NoTxConnectionFactoryImpl.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/resourceadapter/SecurityImpl.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/resourceadapter/TimeOutImpl.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/resourceadapter/ValidationImpl.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/resourceadapter/XaTxConnectionFactoryImpl.java
Modified:
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/ds/CommonDataSource.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/ds/DataSource.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/ds/TimeOut.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/ds/Validation.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/ds/XaPool.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/ra/ResourceAdapter1516.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/resourceadapter/AdminObject.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/resourceadapter/ResourceAdapter.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/AbstractParser.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/MetadataFactory.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ds/DataSourceAbstractImpl.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ds/DataSourceImpl.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ds/DsParser.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ds/TimeOutImpl.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ds/ValidationImpl.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ds/XADataSourceImpl.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ds/XaPoolImpl.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/ConnectorAbstractmpl.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/ResourceAdapter1516Impl.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/resourceadapter/AdminObjectImpl.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/resourceadapter/ResourceAdapterImpl.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/resourceadapter/ResourceAdapterParser.java
projects/jboss-jca/trunk/common/src/main/resources/schema/datasources_1_0.xsd
projects/jboss-jca/trunk/common/src/main/resources/schema/resource-adapter_1_0.xsd
projects/jboss-jca/trunk/common/src/test/java/org/jboss/jca/common/metadata/resourceadapter/ResourceAdapterParserTestCase.java
projects/jboss-jca/trunk/common/src/test/resources/resource-adapter/asapxcess-jb3.2-ds.xml
projects/jboss-jca/trunk/deployers/src/main/java/org/jboss/jca/deployers/fungal/RAActivator.java
projects/jboss-jca/trunk/deployers/src/main/java/org/jboss/jca/deployers/fungal/RADeployer.java
projects/jboss-jca/trunk/validator/src/main/java/org/jboss/jca/validator/Validation.java
Log:
JBJCA-401 xsd complete review, impl of metadatas, parser, test suite. Some refactoring too to share common metadatas with -ds.xml MD
Copied: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/common/CommonPool.java (from rev 108002, projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/ds/Pool.java)
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/common/CommonPool.java (rev 0)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/common/CommonPool.java 2010-09-07 13:31:40 UTC (rev 108006)
@@ -0,0 +1,152 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.common.api.metadata.common;
+
+import org.jboss.jca.common.api.metadata.JCAMetadata;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ *
+ * A Pool.
+ *
+ * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
+ *
+ */
+public interface CommonPool extends JCAMetadata
+{
+
+ /**
+ * Get the minPoolSize.
+ *
+ * @return the minPoolSize.
+ */
+ public Integer getMinPoolSize();
+
+ /**
+ * Get the maxPoolSize.
+ *
+ * @return the maxPoolSize.
+ */
+ public Integer getMaxPoolSize();
+
+ /**
+ * Get the prefill.
+ *
+ * @return the prefill.
+ */
+ public boolean isPrefill();
+
+ /**
+ * Get the useStrictMin.
+ *
+ * @return the useStrictMin.
+ */
+ public boolean isUseStrictMin();
+
+ /**
+ *
+ * A Tag.
+ *
+ * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
+ *
+ */
+ public enum Tag
+ {
+ /** always first
+ *
+ */
+ UNKNOWN(null),
+
+ /**
+ * min-pool-size tag
+ */
+ MIN_POOL_SIZE("min-pool-size"),
+
+ /**
+ * maxPoolSize tag
+ */
+ MAXPOOLSIZE("max-pool-size"),
+ /**
+ * prefill tag
+ */
+ PREFILL("prefill"),
+
+ /**
+ * use-strict-min tag
+ */
+ USE_STRICT_MIN("use-strict-min");
+
+ private final String name;
+
+ /**
+ *
+ * Create a new Tag.
+ *
+ * @param name a name
+ */
+ Tag(final String name)
+ {
+ this.name = name;
+ }
+
+ /**
+ * Get the local name of this element.
+ *
+ * @return the local name
+ */
+ public String getLocalName()
+ {
+ return name;
+ }
+
+ private static final Map<String, Tag> MAP;
+
+ static
+ {
+ final Map<String, Tag> map = new HashMap<String, Tag>();
+ for (Tag element : values())
+ {
+ final String name = element.getLocalName();
+ if (name != null)
+ map.put(name, element);
+ }
+ MAP = map;
+ }
+
+ /**
+ *
+ * Static method to get enum instance given localName XsdString
+ *
+ * @param localName a XsdString used as localname (typically tag name as defined in xsd)
+ * @return the enum instance
+ */
+ public static Tag forName(String localName)
+ {
+ final Tag element = MAP.get(localName);
+ return element == null ? UNKNOWN : element;
+ }
+
+ }
+
+}
Copied: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/common/CommonSecurity.java (from rev 108002, projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/ds/Security.java)
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/common/CommonSecurity.java (rev 0)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/common/CommonSecurity.java 2010-09-07 13:31:40 UTC (rev 108006)
@@ -0,0 +1,127 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.common.api.metadata.common;
+
+import org.jboss.jca.common.api.metadata.JCAMetadata;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ *
+ * A Security.
+ *
+ * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
+ *
+ */
+public interface CommonSecurity extends JCAMetadata
+{
+ /**
+ * Get the userName.
+ *
+ * @return the userName.
+ */
+ public String getUserName();
+
+ /**
+ * Get the password.
+ *
+ * @return the password.
+ */
+ public String getPassword();
+
+ /**
+ *
+ * A Tag.
+ *
+ * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
+ *
+ */
+ public enum Tag
+ {
+ /** always first
+ *
+ */
+ UNKNOWN(null),
+
+ /**
+ * userName tag
+ */
+ USERNAME("user-name"),
+ /**
+ * password tag
+ */
+ PASSWORD("password");
+
+ private final String name;
+
+ /**
+ *
+ * Create a new Tag.
+ *
+ * @param name a name
+ */
+ Tag(final String name)
+ {
+ this.name = name;
+ }
+
+ /**
+ * Get the local name of this element.
+ *
+ * @return the local name
+ */
+ public String getLocalName()
+ {
+ return name;
+ }
+
+ private static final Map<String, Tag> MAP;
+
+ static
+ {
+ final Map<String, Tag> map = new HashMap<String, Tag>();
+ for (Tag element : values())
+ {
+ final String name = element.getLocalName();
+ if (name != null)
+ map.put(name, element);
+ }
+ MAP = map;
+ }
+
+ /**
+ *
+ * Static method to get enum instance given localName XsdString
+ *
+ * @param localName a XsdString used as localname (typically tag name as defined in xsd)
+ * @return the enum instance
+ */
+ public static Tag forName(String localName)
+ {
+ final Tag element = MAP.get(localName);
+ return element == null ? UNKNOWN : element;
+ }
+
+ }
+
+}
Copied: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/common/CommonTimeOut.java (from rev 108002, projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/resourceadapter/TimeOut.java)
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/common/CommonTimeOut.java (rev 0)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/common/CommonTimeOut.java 2010-09-07 13:31:40 UTC (rev 108006)
@@ -0,0 +1,160 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.common.api.metadata.common;
+
+import org.jboss.jca.common.api.metadata.JCAMetadata;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ *
+ * A TimeOut.
+ *
+ * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
+ *
+ */
+public interface CommonTimeOut extends JCAMetadata
+{
+
+ /**
+ * Get the blockingTimeoutMillis.
+ *
+ * @return the blockingTimeoutMillis.
+ */
+ public Long getBlockingTimeoutMillis();
+
+ /**
+ * Get the idleTimeoutMinutes.
+ *
+ * @return the idleTimeoutMinutes.
+ */
+ public Long getIdleTimeoutMinutes();
+
+ /**
+ * Get the allocationRetryWaitMillis.
+ *
+ * @return the allocationRetryWaitMillis.
+ */
+ public Long getAllocationRetry();
+
+ /**
+ * Get the allocationRetryWaitMillis.
+ *
+ * @return the allocationRetryWaitMillis.
+ */
+ public Long getAllocationRetryWaitMillis();
+
+ /**
+ * Get the xaResourceTimeout.
+ *
+ * @return the xaResourceTimeout.
+ */
+ public Long getXaResourceTimeout();
+
+ /**
+ *
+ * A Tag.
+ *
+ * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
+ *
+ */
+ public enum Tag
+ {
+ /** always first
+ *
+ */
+ UNKNOWN(null),
+
+ /**
+ blockingTimeoutMillis tag
+ */
+ BLOCKINGTIMEOUTMILLIS("blocking-timeout-millis"),
+ /**
+ idleTimeoutMinutes tag
+ */
+ IDLETIMEOUTMINUTES("idle-timeout-minutes"),
+ /**
+ * xaResourceTimeout tag
+ */
+ XARESOURCETIMEOUT("xa-resource-timeout"),
+ /**
+ allocationRetry tag
+ */
+ ALLOCATIONRETRY("allocation-retry"),
+ /**
+ allocationRetryWaitMillis tag
+ */
+ ALLOCATIONRETRYWAITMILLIS("allocation-retry-wait-millis");
+
+ private final String name;
+
+ /**
+ *
+ * Create a new Tag.
+ *
+ * @param name a name
+ */
+ Tag(final String name)
+ {
+ this.name = name;
+ }
+
+ /**
+ * Get the local name of this element.
+ *
+ * @return the local name
+ */
+ public String getLocalName()
+ {
+ return name;
+ }
+
+ private static final Map<String, Tag> MAP;
+
+ static
+ {
+ final Map<String, Tag> map = new HashMap<String, Tag>();
+ for (Tag element : values())
+ {
+ final String name = element.getLocalName();
+ if (name != null)
+ map.put(name, element);
+ }
+ MAP = map;
+ }
+
+ /**
+ *
+ * Static method to get enum instance given localName XsdString
+ *
+ * @param localName a XsdString used as localname (typically tag name as defined in xsd)
+ * @return the enum instance
+ */
+ public static Tag forName(String localName)
+ {
+ final Tag element = MAP.get(localName);
+ return element == null ? UNKNOWN : element;
+ }
+
+ }
+}
Copied: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/common/CommonValidation.java (from rev 108002, projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/resourceadapter/Validation.java)
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/common/CommonValidation.java (rev 0)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/common/CommonValidation.java 2010-09-07 13:31:40 UTC (rev 108006)
@@ -0,0 +1,138 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.common.api.metadata.common;
+
+import org.jboss.jca.common.api.metadata.JCAMetadata;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ *
+ * A Validation.
+ *
+ * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
+ *
+ */
+public interface CommonValidation extends JCAMetadata
+{
+ /**
+ * Get the backgroundValidation.
+ *
+ * @return the backgroundValidation.
+ */
+ public boolean isBackgroundValidation();
+
+ /**
+ * Get the backgroundValidationMinutes.
+ *
+ * @return the backgroundValidationMinutes.
+ */
+ public Long getBackgroundValidationMinutes();
+
+ /**
+ * Get the useFastFail.
+ *
+ * @return the useFastFail.
+ */
+ public boolean isUseFastFail();
+
+ /**
+ *
+ * A Tag.
+ *
+ * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
+ *
+ */
+ public enum Tag
+ {
+ /** always first
+ *
+ */
+ UNKNOWN(null),
+
+ /**
+ backgroundValidation tag
+ */
+ BACKGROUNDVALIDATION("background-validation"),
+ /**
+ * backgroundValidationMinutes tag
+ */
+ BACKGROUNDVALIDATIONMINUTES("background-validation-minutes"),
+ /**
+ useFastFail tag
+ */
+ USEFASTFAIL("use-fast-fail");
+
+ private final String name;
+
+ /**
+ *
+ * Create a new Tag.
+ *
+ * @param name a name
+ */
+ Tag(final String name)
+ {
+ this.name = name;
+ }
+
+ /**
+ * Get the local name of this element.
+ *
+ * @return the local name
+ */
+ public String getLocalName()
+ {
+ return name;
+ }
+
+ private static final Map<String, Tag> MAP;
+
+ static
+ {
+ final Map<String, Tag> map = new HashMap<String, Tag>();
+ for (Tag element : values())
+ {
+ final String name = element.getLocalName();
+ if (name != null)
+ map.put(name, element);
+ }
+ MAP = map;
+ }
+
+ /**
+ *
+ * Static method to get enum instance given localName XsdString
+ *
+ * @param localName a XsdString used as localname (typically tag name as defined in xsd)
+ * @return the enum instance
+ */
+ public static Tag forName(String localName)
+ {
+ final Tag element = MAP.get(localName);
+ return element == null ? UNKNOWN : element;
+ }
+
+ }
+
+}
Modified: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/ds/CommonDataSource.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/ds/CommonDataSource.java 2010-09-07 12:50:36 UTC (rev 108005)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/ds/CommonDataSource.java 2010-09-07 13:31:40 UTC (rev 108006)
@@ -22,6 +22,7 @@
package org.jboss.jca.common.api.metadata.ds;
import org.jboss.jca.common.api.metadata.JCAMetadata;
+import org.jboss.jca.common.api.metadata.common.CommonSecurity;
/**
*
@@ -55,7 +56,7 @@
* @return the security.
*/
- public Security getSecurity();
+ public CommonSecurity getSecurity();
/**
* Get the validation.
Modified: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/ds/DataSource.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/ds/DataSource.java 2010-09-07 12:50:36 UTC (rev 108005)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/ds/DataSource.java 2010-09-07 13:31:40 UTC (rev 108006)
@@ -21,6 +21,8 @@
*/
package org.jboss.jca.common.api.metadata.ds;
+import org.jboss.jca.common.api.metadata.common.CommonPool;
+
import java.util.HashMap;
import java.util.Map;
@@ -92,7 +94,7 @@
*
* @return the pool.
*/
- public Pool getPool();
+ public CommonPool getPool();
/**
Deleted: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/ds/Pool.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/ds/Pool.java 2010-09-07 12:50:36 UTC (rev 108005)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/ds/Pool.java 2010-09-07 13:31:40 UTC (rev 108006)
@@ -1,152 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.jca.common.api.metadata.ds;
-
-import org.jboss.jca.common.api.metadata.JCAMetadata;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- *
- * A Pool.
- *
- * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
- *
- */
-public interface Pool extends JCAMetadata
-{
-
- /**
- * Get the minPoolSize.
- *
- * @return the minPoolSize.
- */
- public Integer getMinPoolSize();
-
- /**
- * Get the maxPoolSize.
- *
- * @return the maxPoolSize.
- */
- public Integer getMaxPoolSize();
-
- /**
- * Get the prefill.
- *
- * @return the prefill.
- */
- public boolean isPrefill();
-
- /**
- * Get the useStrictMin.
- *
- * @return the useStrictMin.
- */
- public boolean isUseStrictMin();
-
- /**
- *
- * A Tag.
- *
- * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
- *
- */
- public enum Tag
- {
- /** always first
- *
- */
- UNKNOWN(null),
-
- /**
- * min-pool-size tag
- */
- MIN_POOL_SIZE("min-pool-size"),
-
- /**
- * maxPoolSize tag
- */
- MAXPOOLSIZE("max-pool-size"),
- /**
- * prefill tag
- */
- PREFILL("prefill"),
-
- /**
- * use-strict-min tag
- */
- USE_STRICT_MIN("use-strict-min");
-
- private final String name;
-
- /**
- *
- * Create a new Tag.
- *
- * @param name a name
- */
- Tag(final String name)
- {
- this.name = name;
- }
-
- /**
- * Get the local name of this element.
- *
- * @return the local name
- */
- public String getLocalName()
- {
- return name;
- }
-
- private static final Map<String, Tag> MAP;
-
- static
- {
- final Map<String, Tag> map = new HashMap<String, Tag>();
- for (Tag element : values())
- {
- final String name = element.getLocalName();
- if (name != null)
- map.put(name, element);
- }
- MAP = map;
- }
-
- /**
- *
- * Static method to get enum instance given localName XsdString
- *
- * @param localName a XsdString used as localname (typically tag name as defined in xsd)
- * @return the enum instance
- */
- public static Tag forName(String localName)
- {
- final Tag element = MAP.get(localName);
- return element == null ? UNKNOWN : element;
- }
-
- }
-
-}
Deleted: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/ds/Security.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/ds/Security.java 2010-09-07 12:50:36 UTC (rev 108005)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/ds/Security.java 2010-09-07 13:31:40 UTC (rev 108006)
@@ -1,127 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.jca.common.api.metadata.ds;
-
-import org.jboss.jca.common.api.metadata.JCAMetadata;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- *
- * A Security.
- *
- * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
- *
- */
-public interface Security extends JCAMetadata
-{
- /**
- * Get the userName.
- *
- * @return the userName.
- */
- public String getUserName();
-
- /**
- * Get the password.
- *
- * @return the password.
- */
- public String getPassword();
-
- /**
- *
- * A Tag.
- *
- * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
- *
- */
- public enum Tag
- {
- /** always first
- *
- */
- UNKNOWN(null),
-
- /**
- * userName tag
- */
- USERNAME("user-name"),
- /**
- * password tag
- */
- PASSWORD("password");
-
- private final String name;
-
- /**
- *
- * Create a new Tag.
- *
- * @param name a name
- */
- Tag(final String name)
- {
- this.name = name;
- }
-
- /**
- * Get the local name of this element.
- *
- * @return the local name
- */
- public String getLocalName()
- {
- return name;
- }
-
- private static final Map<String, Tag> MAP;
-
- static
- {
- final Map<String, Tag> map = new HashMap<String, Tag>();
- for (Tag element : values())
- {
- final String name = element.getLocalName();
- if (name != null)
- map.put(name, element);
- }
- MAP = map;
- }
-
- /**
- *
- * Static method to get enum instance given localName XsdString
- *
- * @param localName a XsdString used as localname (typically tag name as defined in xsd)
- * @return the enum instance
- */
- public static Tag forName(String localName)
- {
- final Tag element = MAP.get(localName);
- return element == null ? UNKNOWN : element;
- }
-
- }
-
-}
Modified: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/ds/TimeOut.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/ds/TimeOut.java 2010-09-07 12:50:36 UTC (rev 108005)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/ds/TimeOut.java 2010-09-07 13:31:40 UTC (rev 108006)
@@ -21,8 +21,6 @@
*/
package org.jboss.jca.common.api.metadata.ds;
-import org.jboss.jca.common.api.metadata.JCAMetadata;
-
import java.util.HashMap;
import java.util.Map;
@@ -33,24 +31,11 @@
* @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
*
*/
-public interface TimeOut extends JCAMetadata
+public interface TimeOut extends org.jboss.jca.common.api.metadata.common.CommonTimeOut
{
- /**
- * Get the blockingTimeoutMillis.
- *
- * @return the blockingTimeoutMillis.
- */
- public Long getBlockingTimeoutMillis();
/**
- * Get the idleTimeoutMinutes.
- *
- * @return the idleTimeoutMinutes.
- */
- public Long getIdleTimeoutMinutes();
-
- /**
* Get the setTxQuertTimeout.
*
* @return the setTxQuertTimeout.
@@ -71,28 +56,8 @@
*/
public Long getUseTryLock();
- /**
- * Get the allocationRetry.
- *
- * @return the allocationRetry.
- */
- public Long getAllocationRetry();
/**
- * Get the allocationRetryWaitMillis.
- *
- * @return the allocationRetryWaitMillis.
- */
- public Long getAllocationRetryWaitMillis();
-
- /**
- * Get the xaResourceTimeout.
- *
- * @return the xaResourceTimeout.
- */
- public Long getXaResourceTimeout();
-
- /**
*
* A Tag.
*
Modified: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/ds/Validation.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/ds/Validation.java 2010-09-07 12:50:36 UTC (rev 108005)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/ds/Validation.java 2010-09-07 13:31:40 UTC (rev 108006)
@@ -21,7 +21,6 @@
*/
package org.jboss.jca.common.api.metadata.ds;
-import org.jboss.jca.common.api.metadata.JCAMetadata;
import java.util.HashMap;
import java.util.Map;
@@ -33,7 +32,7 @@
* @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
*
*/
-public interface Validation extends JCAMetadata
+public interface Validation extends org.jboss.jca.common.api.metadata.common.CommonValidation
{
/**
@@ -58,27 +57,6 @@
public boolean isValidateOnMatch();
/**
- * Get the backgroundValidation.
- *
- * @return the backgroundValidation.
- */
- public boolean isBackgroundValidation();
-
- /**
- * Get the backgroundValidationMinutes.
- *
- * @return the backgroundValidationMinutes.
- */
- public Long getBackgroundValidationMinutes();
-
- /**
- * Get the useFastFail.
- *
- * @return the useFastFail.
- */
- public boolean isUseFastFail();
-
- /**
* Get the staleConnectionCheckerClassName.
*
* @return the staleConnectionCheckerClassName.
Modified: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/ds/XaPool.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/ds/XaPool.java 2010-09-07 12:50:36 UTC (rev 108005)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/ds/XaPool.java 2010-09-07 13:31:40 UTC (rev 108006)
@@ -21,6 +21,8 @@
*/
package org.jboss.jca.common.api.metadata.ds;
+import org.jboss.jca.common.api.metadata.common.CommonPool;
+
import java.util.HashMap;
import java.util.Map;
@@ -31,7 +33,7 @@
* @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
*
*/
-public interface XaPool extends Pool
+public interface XaPool extends CommonPool
{
/**
Modified: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/ra/ResourceAdapter1516.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/ra/ResourceAdapter1516.java 2010-09-07 12:50:36 UTC (rev 108005)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/ra/ResourceAdapter1516.java 2010-09-07 13:31:40 UTC (rev 108006)
@@ -61,7 +61,7 @@
/**
* @return adminobject
*/
- public abstract List<AdminObject> getAdminobjects();
+ public abstract List<AdminObject> getAdminObjects();
/**
* @return securityPermission
Modified: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/resourceadapter/AdminObject.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/resourceadapter/AdminObject.java 2010-09-07 12:50:36 UTC (rev 108005)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/resourceadapter/AdminObject.java 2010-09-07 13:31:40 UTC (rev 108006)
@@ -58,6 +58,13 @@
public String getJndiName();
/**
+ * Get the poolName.
+ *
+ * @return the poolName.
+ */
+ public String getPoolName();
+
+ /**
* Get the enabled.
*
* @return the enabled.
@@ -162,6 +169,11 @@
*/
CLASS_NAME("class-name"),
+ /** class-name attribute
+ *
+ */
+ POOL_NAME("class-name"),
+
/** enabled attribute
*
*/
Copied: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/resourceadapter/ConnectionDefinition.java (from rev 108002, projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/resourceadapter/NoTxConnectionFactory.java)
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/resourceadapter/ConnectionDefinition.java (rev 0)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/resourceadapter/ConnectionDefinition.java 2010-09-07 13:31:40 UTC (rev 108006)
@@ -0,0 +1,270 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.common.api.metadata.resourceadapter;
+
+import org.jboss.jca.common.api.metadata.JCAMetadata;
+import org.jboss.jca.common.api.metadata.common.CommonPool;
+import org.jboss.jca.common.api.metadata.common.CommonSecurity;
+import org.jboss.jca.common.api.metadata.common.CommonTimeOut;
+import org.jboss.jca.common.api.metadata.common.CommonValidation;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ *
+ * A ConnectionDefinition.
+ *
+ * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
+ *
+ */
+public interface ConnectionDefinition extends JCAMetadata
+{
+
+ /**
+ * Get the configProperties.
+ *
+ * @return the configProperties.
+ */
+ public Map<String, String> getConfigProperties();
+
+ /**
+ * Get the className.
+ *
+ * @return the className.
+ */
+ public String getClassName();
+
+ /**
+ * Get the jndiName.
+ *
+ * @return the jndiName.
+ */
+ public String getJndiName();
+
+ /**
+ * Get the poolName.
+ *
+ * @return the poolName.
+ */
+ public String getPoolName();
+
+ /**
+ * Get the enabled.
+ *
+ * @return the enabled.
+ */
+ public boolean isEnabled();
+
+ /**
+ * Get the useJavaContext.
+ *
+ * @return the useJavaContext.
+ */
+ public boolean isUseJavaContext();
+
+ /**
+ * Get the pool.
+ *
+ * @return the pool.
+ */
+ public CommonPool getPool();
+
+ /**
+ * Get the timeOut.
+ *
+ * @return the timeOut.
+ */
+ public CommonTimeOut getTimeOut();
+
+ /**
+ * Get the validation.
+ *
+ * @return the validation.
+ */
+ public CommonValidation getValidation();
+
+ /**
+ * Get the security.
+ *
+ * @return the security.
+ */
+ public CommonSecurity getSecurity();
+
+ /**
+ * Get the noTxSeparatePool.
+ *
+ * @return the noTxSeparatePool.
+ */
+
+ public boolean isNoTxSeparatePool();
+
+ /**
+ *
+ * A Tag.
+ *
+ * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
+ *
+ */
+ public enum Tag
+ {
+ /** always first
+ *
+ */
+ UNKNOWN(null),
+
+ /**
+ * config-property tag
+ */
+ CONFIG_PROPERTY("config-property"),
+ /**
+ * no-tx-separate-pool tag
+ */
+ NO_TX_SEPARATE_POOL("no-tx-separate-pool"),
+ /**
+ * pool tag
+ */
+ POOL("pool"),
+ /**
+ * security tag
+ */
+ SECURITY("security"),
+ /**
+ * timeout tag
+ */
+ TIMEOUT("timeout"),
+ /**
+ * validation tag
+ */
+ VALIDATION("validation");
+
+ private final String name;
+
+ /**
+ *
+ * Create a new Tag.
+ *
+ * @param name a name
+ */
+ Tag(final String name)
+ {
+ this.name = name;
+ }
+
+ /**
+ * Get the local name of this element.
+ *
+ * @return the local name
+ */
+ public String getLocalName()
+ {
+ return name;
+ }
+
+ private static final Map<String, Tag> MAP;
+
+ static
+ {
+ final Map<String, Tag> map = new HashMap<String, Tag>();
+ for (Tag element : values())
+ {
+ final String name = element.getLocalName();
+ if (name != null)
+ map.put(name, element);
+ }
+ MAP = map;
+ }
+
+ /**
+ *
+ * Static method to get enum instance given localName XsdString
+ *
+ * @param localName a XsdString used as localname (typically tag name as defined in xsd)
+ * @return the enum instance
+ */
+ public static Tag forName(String localName)
+ {
+ final Tag element = MAP.get(localName);
+ return element == null ? UNKNOWN : element;
+ }
+
+ }
+
+ /**
+ *
+ * A Attribute.
+ *
+ * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
+ *
+ */
+ public enum Attribute
+ {
+
+ /** jndiName attribute
+ *
+ */
+ JNDINAME("jndi-name"),
+
+ /** class-name attribute
+ *
+ */
+ CLASS_NAME("class-name"),
+
+ /** class-name attribute
+ *
+ */
+ POOL_NAME("class-name"),
+
+ /** enabled attribute
+ *
+ */
+ ENABLED("enabled"),
+ /** use-java-context attribute
+ *
+ */
+ USEJAVACONTEXT("use-java-context");
+
+ private final String name;
+
+ /**
+ *
+ * Create a new Tag.
+ *
+ * @param name a name
+ */
+ Attribute(final String name)
+ {
+ this.name = name;
+ }
+
+ /**
+ * Get the local name of this element.
+ *
+ * @return the local name
+ */
+ public String getLocalName()
+ {
+ return name;
+ }
+
+ }
+}
Deleted: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/resourceadapter/LocalTxConnectionFactory.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/resourceadapter/LocalTxConnectionFactory.java 2010-09-07 12:50:36 UTC (rev 108005)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/resourceadapter/LocalTxConnectionFactory.java 2010-09-07 13:31:40 UTC (rev 108006)
@@ -1,223 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.jca.common.api.metadata.resourceadapter;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- *
- * A LocalTxConnectionFactory.
- *
- * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
- *
- */
-public interface LocalTxConnectionFactory extends NoTxConnectionFactory
-{
-
- /**
- * Get the noTxSeparatePools.
- *
- * @return the noTxSeparatePools.
- */
- public boolean isNoTxSeparatePools();
-
- /**
- * Get the trackConnectionByTx.
- *
- * @return the trackConnectionByTx.
- */
- public boolean isTrackConnectionByTx();
-
- /**
- *
- * A Tag.
- *
- * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
- *
- */
- public enum Tag
- {
- /** always first
- *
- */
- UNKNOWN(null),
-
- /**
- minPoolSize tag
- */
- MINPOOLSIZE("min-pool-size"),
- /**
- maxPoolSize tag
- */
- MAXPOOLSIZE("max-pool-size"),
- /**
- prefill tag
- */
- PREFILL("prefill"),
- /**
- userName tag
- */
- USERNAME("user-name"),
- /**
- password tag
- */
- PASSWORD("password"),
- /**
- connectionDefinition tag
- */
- CONNECTIONDEFINITION("connection-definition"),
- /**
- configProperty tag
- */
- CONFIGPROPERTY("config-property"),
- /**
- security tag
- */
- SECURITY("security"),
- /**
- timeOut tag
- */
- TIMEOUT("time-out"),
- /**
- validation tag
- */
- VALIDATION("validation"),
-
- /**
- * no-tx-separate-pools tag
- */
- NOTXSEPARATEPOOLS("no-tx-separate-pools"),
- /**
- * track-connection-by-tx
- */
- TRACKCONNECTIONBYTX("track-connection-by-tx");
-
- private final String name;
-
- /**
- *
- * Create a new Tag.
- *
- * @param name a name
- */
- Tag(final String name)
- {
- this.name = name;
- }
-
- /**
- * Get the local name of this element.
- *
- * @return the local name
- */
- public String getLocalName()
- {
- return name;
- }
-
- private static final Map<String, Tag> MAP;
-
- static
- {
- final Map<String, Tag> map = new HashMap<String, Tag>();
- for (Tag element : values())
- {
- final String name = element.getLocalName();
- if (name != null)
- map.put(name, element);
- }
- MAP = map;
- }
-
- /**
- *
- * Static method to get enum instance given localName XsdString
- *
- * @param localName a XsdString used as localname (typically tag name as defined in xsd)
- * @return the enum instance
- */
- public static Tag forName(String localName)
- {
- final Tag element = MAP.get(localName);
- return element == null ? UNKNOWN : element;
- }
-
- }
-
- /**
- *
- * A Attribute.
- *
- * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
- *
- */
- public enum Attribute
- {
-
- /** jndiName attribute
- *
- */
- JNDINAME("jndi-name"),
-
- /** class-name attribute
- *
- */
- CLASS_NAME("class-name"),
-
- /** enabled attribute
- *
- */
- ENABLED("enabled"),
- /** use-java-context attribute
- *
- */
- USEJAVACONTEXT("use-java-context"),
-
- /** pool-name attribute **/
- POOL_NAME("pool-name");
-
- private final String name;
-
- /**
- *
- * Create a new Tag.
- *
- * @param name a name
- */
- Attribute(final String name)
- {
- this.name = name;
- }
-
- /**
- * Get the local name of this element.
- *
- * @return the local name
- */
- public String getLocalName()
- {
- return name;
- }
-
- }
-}
Deleted: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/resourceadapter/NoTxConnectionFactory.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/resourceadapter/NoTxConnectionFactory.java 2010-09-07 12:50:36 UTC (rev 108005)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/resourceadapter/NoTxConnectionFactory.java 2010-09-07 13:31:40 UTC (rev 108006)
@@ -1,308 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.jca.common.api.metadata.resourceadapter;
-
-
-import org.jboss.jca.common.api.metadata.JCAMetadata;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- *
- * A NoTxConnectionFactory.
- *
- * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
- *
- */
-public interface NoTxConnectionFactory extends JCAMetadata
-{
-
- /**
- * Get the minPoolSize.
- *
- * @return the minPoolSize.
- */
- public Integer getMinPoolSize();
-
- /**
- * Get the maxPoolSize.
- *
- * @return the maxPoolSize.
- */
- public Integer getMaxPoolSize();
-
- /**
- * Get the prefill.
- *
- * @return the prefill.
- */
- public boolean isPrefill();
-
- /**
- * Get the userName.
- *
- * @return the userName.
- */
- public String getUserName();
-
- /**
- * Get the password.
- *
- * @return the password.
- */
- public String getPassword();
-
- /**
- * Get the connectionDefinition.
- *
- * @return the connectionDefinition.
- */
- public String getConnectionDefinition();
-
- /**
- * Get the configProperty.
- *
- * @return the configProperty.
- */
- public Map<String, String> getConfigProperties();
-
- /**
- * Get the security.
- *
- * @return the security.
- */
- public Security getSecurity();
-
- /**
- * Get the timeOut.
- *
- * @return the timeOut.
- */
- public TimeOut getTimeOut();
-
- /**
- * Get the validation.
- *
- * @return the validation.
- */
- public Validation getValidation();
-
- /**
- * Get the poolName.
- *
- * @return the poolName.
- */
- public String getPoolName();
-
- /**
- * Get the className.
- *
- * @return the className.
- */
- public String getClassName();
-
- /**
- * Get the jndiName.
- *
- * @return the jndiName.
- */
- public String getJndiName();
-
- /**
- * Get the enabled.
- *
- * @return the enabled.
- */
- public boolean isEnabled();
-
- /**
- * Get the useJavaContext.
- *
- * @return the useJavaContext.
- */
- public boolean isUseJavaContext();
-
- /**
- *
- * A Tag.
- *
- * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
- *
- */
- public enum Tag
- {
- /** always first
- *
- */
- UNKNOWN(null),
-
- /**
- minPoolSize tag
- */
- MINPOOLSIZE("min-pool-size"),
- /**
- maxPoolSize tag
- */
- MAXPOOLSIZE("max-pool-size"),
- /**
- prefill tag
- */
- PREFILL("prefill"),
- /**
- userName tag
- */
- USERNAME("user-name"),
- /**
- password tag
- */
- PASSWORD("password"),
- /**
- connectionDefinition tag
- */
- CONNECTIONDEFINITION("connection-definition"),
- /**
- configProperty tag
- */
- CONFIGPROPERTY("config-property"),
- /**
- security tag
- */
- SECURITY("security"),
- /**
- timeOut tag
- */
- TIMEOUT("time-out"),
- /**
- validation tag
- */
- VALIDATION("validation");
-
- private final String name;
-
- /**
- *
- * Create a new Tag.
- *
- * @param name a name
- */
- Tag(final String name)
- {
- this.name = name;
- }
-
- /**
- * Get the local name of this element.
- *
- * @return the local name
- */
- public String getLocalName()
- {
- return name;
- }
-
- private static final Map<String, Tag> MAP;
-
- static
- {
- final Map<String, Tag> map = new HashMap<String, Tag>();
- for (Tag element : values())
- {
- final String name = element.getLocalName();
- if (name != null)
- map.put(name, element);
- }
- MAP = map;
- }
-
- /**
- *
- * Static method to get enum instance given localName XsdString
- *
- * @param localName a XsdString used as localname (typically tag name as defined in xsd)
- * @return the enum instance
- */
- public static Tag forName(String localName)
- {
- final Tag element = MAP.get(localName);
- return element == null ? UNKNOWN : element;
- }
-
- }
-
- /**
- *
- * A Attribute.
- *
- * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
- *
- */
- public enum Attribute
- {
-
- /** jndiName attribute
- *
- */
- JNDINAME("jndi-name"),
-
- /** class-name attribute
- *
- */
- CLASS_NAME("class-name"),
-
- /** enabled attribute
- *
- */
- ENABLED("enabled"),
- /** use-java-context attribute
- *
- */
- USEJAVACONTEXT("use-java-context"),
-
- /** pool-name attribute **/
- POOL_NAME("pool-name");
-
- private final String name;
-
- /**
- *
- * Create a new Tag.
- *
- * @param name a name
- */
- Attribute(final String name)
- {
- this.name = name;
- }
-
- /**
- * Get the local name of this element.
- *
- * @return the local name
- */
- public String getLocalName()
- {
- return name;
- }
-
- }
-}
Modified: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/resourceadapter/ResourceAdapter.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/resourceadapter/ResourceAdapter.java 2010-09-07 12:50:36 UTC (rev 108005)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/resourceadapter/ResourceAdapter.java 2010-09-07 13:31:40 UTC (rev 108006)
@@ -21,7 +21,6 @@
*/
package org.jboss.jca.common.api.metadata.resourceadapter;
-import org.jboss.jca.common.api.metadata.JCAMetadata;
import org.jboss.jca.common.api.metadata.common.TransactionSupportEnum;
import java.util.HashMap;
@@ -35,7 +34,7 @@
* @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
*
*/
-public interface ResourceAdapter extends JCAMetadata
+public interface ResourceAdapter
{
/**
@@ -57,16 +56,23 @@
*
* @return the connectionFactories.
*/
- public List<? extends NoTxConnectionFactory> getConnectionFactories();
+ public List<ConnectionDefinition> getConnectionDefinitions();
/**
* Get the adminObjects.
*
* @return the adminObjects.
*/
- public List<AdminObject> getAdminobjects();
+ public List<AdminObject> getAdminObjects();
/**
+ * Get the configProperties.
+ *
+ * @return the configProperties.
+ */
+ public Map<String, String> getConfigProperties();
+
+ /**
*
* A Tag.
*
@@ -80,31 +86,38 @@
*/
UNKNOWN(null),
- /**
- transactionsupport tag
+ /** config-property tag
+ *
*/
- TRANSACTIONSUPPORT("transaction-support"),
+ CONFIG_PROPERTY("config-property"),
+
/**
- localtxconnectionfactory tag
- */
- LOCALTXCONNECTIONFACTORY("local-tx-connection-factory"),
+ * archive tag
+ */
+ ARCHIVE("archive"),
+
/**
- xatxconnectionfactory tag
- */
- XATXCONNECTIONFACTORY("xa-tx-connection-factory"),
+ * transaction-support tag
+ */
+ TRANSACTION_SUPPORT("transaction-support"),
/**
- notxconnectionfactory tag
- */
- NOTXCONNECTIONFACTORY("no-txconnection-factory"),
+ * connection-definitions tag
+ */
+ CONNECTION_DEFINITIONS("connection-definitions"),
+
/**
- adminobject tag
+ * admin-objects tag
+ */
+ ADMIN_OBJECTS("admin-objects"),
+ /**
+ * connection-definition tag
*/
- ADMINOBJECT("admin-object"),
+ CONNECTION_DEFINITION("connection-definition"),
- /** archive tag
- *
- */
- ARCHIVE("archive");
+ /**
+ * admin-objects tag
+ */
+ ADMIN_OBJECT("admin-object");
private final String name;
@@ -145,9 +158,9 @@
/**
*
- * Static method to get enum instance given localName XsdString
+ * Static method to get enum instance given localName string
*
- * @param localName a XsdString used as localname (typically tag name as defined in xsd)
+ * @param localName a string used as localname (typically tag name as defined in xsd)
* @return the enum instance
*/
public static Tag forName(String localName)
@@ -157,5 +170,4 @@
}
}
-
}
Copied: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/resourceadapter/ResourceAdapters.java (from rev 108002, projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/resourceadapter/Security.java)
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/resourceadapter/ResourceAdapters.java (rev 0)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/resourceadapter/ResourceAdapters.java 2010-09-07 13:31:40 UTC (rev 108006)
@@ -0,0 +1,118 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.common.api.metadata.resourceadapter;
+
+
+import org.jboss.jca.common.api.metadata.JCAMetadata;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ *
+ * A ResourceAdapters.
+ *
+ * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
+ *
+ */
+public interface ResourceAdapters extends JCAMetadata
+{
+
+ /**
+ * Get the resourceAdapters.
+ *
+ * @return the resourceAdapters.
+ */
+ public List<ResourceAdapter> getResourceAdapters();
+
+ /**
+ *
+ * A Tag.
+ *
+ * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
+ *
+ */
+ public enum Tag
+ {
+ /** always first
+ *
+ */
+ UNKNOWN(null),
+
+ /** jboss-ra tag name
+ *
+ */
+ RESOURCE_ADPTER("resource-adapter");
+
+ private final String name;
+
+ /**
+ *
+ * Create a new Tag.
+ *
+ * @param name a name
+ */
+ Tag(final String name)
+ {
+ this.name = name;
+ }
+
+ /**
+ * Get the local name of this element.
+ *
+ * @return the local name
+ */
+ public String getLocalName()
+ {
+ return name;
+ }
+
+ private static final Map<String, Tag> MAP;
+
+ static
+ {
+ final Map<String, Tag> map = new HashMap<String, Tag>();
+ for (Tag element : values())
+ {
+ final String name = element.getLocalName();
+ if (name != null)
+ map.put(name, element);
+ }
+ MAP = map;
+ }
+
+ /**
+ *
+ * Static method to get enum instance given localName string
+ *
+ * @param localName a string used as localname (typically tag name as defined in xsd)
+ * @return the enum instance
+ */
+ public static Tag forName(String localName)
+ {
+ final Tag element = MAP.get(localName);
+ return element == null ? UNKNOWN : element;
+ }
+
+ }
+}
Deleted: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/resourceadapter/Security.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/resourceadapter/Security.java 2010-09-07 12:50:36 UTC (rev 108005)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/resourceadapter/Security.java 2010-09-07 13:31:40 UTC (rev 108006)
@@ -1,128 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.jca.common.api.metadata.resourceadapter;
-
-import org.jboss.jca.common.api.metadata.JCAMetadata;
-import org.jboss.jca.common.api.metadata.common.SecurityManager;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- *
- * A Security.
- *
- * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
- *
- */
-public interface Security extends JCAMetadata
-{
-
- /**
- * Get the securityManager.
- *
- * @return the securityManager.
- */
- public SecurityManager getSecurityManager();
-
- /**
- * Get the securityDomain.
- *
- * @return the securityDomain.
- */
- public String getSecurityDomain();
-
- /**
- *
- * A Tag.
- *
- * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
- *
- */
- public enum Tag
- {
- /** always first
- *
- */
- UNKNOWN(null),
-
- /**
- securityManager tag
- */
- SECURITYMANAGER("security-manager"),
- /**
- securityDomain tag
- */
- SECURITYDOMAIN("security-domain");
-
- private final String name;
-
- /**
- *
- * Create a new Tag.
- *
- * @param name a name
- */
- Tag(final String name)
- {
- this.name = name;
- }
-
- /**
- * Get the local name of this element.
- *
- * @return the local name
- */
- public String getLocalName()
- {
- return name;
- }
-
- private static final Map<String, Tag> MAP;
-
- static
- {
- final Map<String, Tag> map = new HashMap<String, Tag>();
- for (Tag element : values())
- {
- final String name = element.getLocalName();
- if (name != null)
- map.put(name, element);
- }
- MAP = map;
- }
-
- /**
- *
- * Static method to get enum instance given localName XsdString
- *
- * @param localName a XsdString used as localname (typically tag name as defined in xsd)
- * @return the enum instance
- */
- public static Tag forName(String localName)
- {
- final Tag element = MAP.get(localName);
- return element == null ? UNKNOWN : element;
- }
-
- }
-}
Deleted: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/resourceadapter/TimeOut.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/resourceadapter/TimeOut.java 2010-09-07 12:50:36 UTC (rev 108005)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/resourceadapter/TimeOut.java 2010-09-07 13:31:40 UTC (rev 108006)
@@ -1,149 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.jca.common.api.metadata.resourceadapter;
-
-import org.jboss.jca.common.api.metadata.JCAMetadata;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- *
- * A TimeOut.
- *
- * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
- *
- */
-public interface TimeOut extends JCAMetadata
-{
-
- /**
- * Get the blockingTimeoutMillis.
- *
- * @return the blockingTimeoutMillis.
- */
- public Long getBlockingTimeoutMillis();
-
- /**
- * Get the idleTimeoutMinutes.
- *
- * @return the idleTimeoutMinutes.
- */
- public Long getIdleTimeoutMinutes();
-
- /**
- * Get the allocationRetryWaitMillis.
- *
- * @return the allocationRetryWaitMillis.
- */
- public Long getAllocationRetryWaitMillis();
-
- /**
- * Get the backgroundValidationMinutes.
- *
- * @return the backgroundValidationMinutes.
- */
- public Long getBackgroundValidationMinutes();
-
- /**
- *
- * A Tag.
- *
- * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
- *
- */
- public enum Tag
- {
- /** always first
- *
- */
- UNKNOWN(null),
-
- /**
- blockingTimeoutMillis tag
- */
- BLOCKINGTIMEOUTMILLIS("blocking-timeout-millis"),
- /**
- idleTimeoutMinutes tag
- */
- IDLETIMEOUTMINUTES("idle-timeout-minutes"),
- /**
- allocationRetryWaitMillis tag
- */
- ALLOCATIONRETRYWAITMILLIS("allocation-retry-wait-millis"),
- /**
- backgroundValidationMinutes tag
- */
- BACKGROUNDVALIDATIONMINUTES("background-validation-minutes");
-
- private final String name;
-
- /**
- *
- * Create a new Tag.
- *
- * @param name a name
- */
- Tag(final String name)
- {
- this.name = name;
- }
-
- /**
- * Get the local name of this element.
- *
- * @return the local name
- */
- public String getLocalName()
- {
- return name;
- }
-
- private static final Map<String, Tag> MAP;
-
- static
- {
- final Map<String, Tag> map = new HashMap<String, Tag>();
- for (Tag element : values())
- {
- final String name = element.getLocalName();
- if (name != null)
- map.put(name, element);
- }
- MAP = map;
- }
-
- /**
- *
- * Static method to get enum instance given localName XsdString
- *
- * @param localName a XsdString used as localname (typically tag name as defined in xsd)
- * @return the enum instance
- */
- public static Tag forName(String localName)
- {
- final Tag element = MAP.get(localName);
- return element == null ? UNKNOWN : element;
- }
-
- }
-}
Deleted: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/resourceadapter/Validation.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/resourceadapter/Validation.java 2010-09-07 12:50:36 UTC (rev 108005)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/resourceadapter/Validation.java 2010-09-07 13:31:40 UTC (rev 108006)
@@ -1,138 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.jca.common.api.metadata.resourceadapter;
-
-import org.jboss.jca.common.api.metadata.JCAMetadata;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- *
- * A Validation.
- *
- * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
- *
- */
-public interface Validation extends JCAMetadata
-{
-
- /**
- * Get the allocationRetry.
- *
- * @return the allocationRetry.
- */
- public Integer getAllocationRetry();
-
- /**
- * Get the backgroundValidation.
- *
- * @return the backgroundValidation.
- */
- public boolean isBackgroundValidation();
-
- /**
- * Get the useFastFail.
- *
- * @return the useFastFail.
- */
- public boolean isUseFastFail();
-
- /**
- *
- * A Tag.
- *
- * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
- *
- */
- public enum Tag
- {
- /** always first
- *
- */
- UNKNOWN(null),
-
- /**
- allocationRetry tag
- */
- ALLOCATIONRETRY("allocation-retry"),
- /**
- backgroundValidation tag
- */
- BACKGROUNDVALIDATION("background-validation"),
- /**
- useFastFail tag
- */
- USEFASTFAIL("use-fast-fail");
-
- private final String name;
-
- /**
- *
- * Create a new Tag.
- *
- * @param name a name
- */
- Tag(final String name)
- {
- this.name = name;
- }
-
- /**
- * Get the local name of this element.
- *
- * @return the local name
- */
- public String getLocalName()
- {
- return name;
- }
-
- private static final Map<String, Tag> MAP;
-
- static
- {
- final Map<String, Tag> map = new HashMap<String, Tag>();
- for (Tag element : values())
- {
- final String name = element.getLocalName();
- if (name != null)
- map.put(name, element);
- }
- MAP = map;
- }
-
- /**
- *
- * Static method to get enum instance given localName XsdString
- *
- * @param localName a XsdString used as localname (typically tag name as defined in xsd)
- * @return the enum instance
- */
- public static Tag forName(String localName)
- {
- final Tag element = MAP.get(localName);
- return element == null ? UNKNOWN : element;
- }
-
- }
-}
Deleted: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/resourceadapter/XaTxConnectionFactory.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/resourceadapter/XaTxConnectionFactory.java 2010-09-07 12:50:36 UTC (rev 108005)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/resourceadapter/XaTxConnectionFactory.java 2010-09-07 13:31:40 UTC (rev 108006)
@@ -1,221 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.jca.common.api.metadata.resourceadapter;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- *
- * A XaTxConnectionFactory.
- *
- * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
- *
- */
-public interface XaTxConnectionFactory extends LocalTxConnectionFactory
-{
-
- /**
- * Get the xaResourceTimeout.
- *
- * @return the xaResourceTimeout.
- */
- public Long getXaResourceTimeout();
-
- /**
- *
- * A Tag.
- *
- * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
- *
- */
- public enum Tag
- {
- /** always first
- *
- */
- UNKNOWN(null),
-
- /**
- minPoolSize tag
- */
- MINPOOLSIZE("min-pool-size"),
- /**
- maxPoolSize tag
- */
- MAXPOOLSIZE("max-pool-size"),
- /**
- prefill tag
- */
- PREFILL("prefill"),
- /**
- userName tag
- */
- USERNAME("user-name"),
- /**
- password tag
- */
- PASSWORD("password"),
- /**
- connectionDefinition tag
- */
- CONNECTIONDEFINITION("connection-definition"),
- /**
- configProperty tag
- */
- CONFIGPROPERTY("config-property"),
- /**
- security tag
- */
- SECURITY("security"),
- /**
- timeOut tag
- */
- TIMEOUT("time-out"),
- /**
- validation tag
- */
- VALIDATION("validation"),
-
- /**
- * no-tx-separate-pools tag
- */
- NOTXSEPARATEPOOLS("no-tx-separate-pools"),
- /**
- * track-connection-by-tx
- */
- TRACKCONNECTIONBYTX("track-connection-by-tx"),
-
- /**
- * xa-resource-timeout tag
- */
- XARESOURCETIMEOUT("xa-resource-timeout");
-
- private final String name;
-
- /**
- *
- * Create a new Tag.
- *
- * @param name a name
- */
- Tag(final String name)
- {
- this.name = name;
- }
-
- /**
- * Get the local name of this element.
- *
- * @return the local name
- */
- public String getLocalName()
- {
- return name;
- }
-
- private static final Map<String, Tag> MAP;
-
- static
- {
- final Map<String, Tag> map = new HashMap<String, Tag>();
- for (Tag element : values())
- {
- final String name = element.getLocalName();
- if (name != null)
- map.put(name, element);
- }
- MAP = map;
- }
-
- /**
- *
- * Static method to get enum instance given localName XsdString
- *
- * @param localName a XsdString used as localname (typically tag name as defined in xsd)
- * @return the enum instance
- */
- public static Tag forName(String localName)
- {
- final Tag element = MAP.get(localName);
- return element == null ? UNKNOWN : element;
- }
-
- }
-
- /**
- *
- * A Attribute.
- *
- * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
- *
- */
- public enum Attribute
- {
-
- /** jndiName attribute
- *
- */
- JNDINAME("jndi-name"),
-
- /** class-name attribute
- *
- */
- CLASS_NAME("class-name"),
-
- /** enabled attribute
- *
- */
- ENABLED("enabled"),
- /** use-java-context attribute
- *
- */
- USEJAVACONTEXT("use-java-context"),
-
- /** pool-name attribute **/
- POOL_NAME("pool-name");
-
- private final String name;
-
- /**
- *
- * Create a new Tag.
- *
- * @param name a name
- */
- Attribute(final String name)
- {
- this.name = name;
- }
-
- /**
- * Get the local name of this element.
- *
- * @return the local name
- */
- public String getLocalName()
- {
- return name;
- }
-
- }
-}
Modified: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/AbstractParser.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/AbstractParser.java 2010-09-07 12:50:36 UTC (rev 108005)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/AbstractParser.java 2010-09-07 13:31:40 UTC (rev 108006)
@@ -21,9 +21,18 @@
*/
package org.jboss.jca.common.metadata;
+import org.jboss.jca.common.api.metadata.common.CommonPool;
+import org.jboss.jca.common.api.metadata.common.CommonSecurity;
+import org.jboss.jca.common.api.metadata.ds.DataSource;
+import org.jboss.jca.common.metadata.common.CommonPoolImpl;
+import org.jboss.jca.common.metadata.common.CommonSecurityImpl;
+
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader;
+import static javax.xml.stream.XMLStreamConstants.END_ELEMENT;
+import static javax.xml.stream.XMLStreamConstants.START_ELEMENT;
+
/**
*
* A AbstractParser.
@@ -139,4 +148,125 @@
return longValue;
}
+ /**
+ *
+ * parse a {@link CommonPool} object
+ *
+ * @param reader reader
+ * @return the parsed {@link CommonPool} object
+ * @throws XMLStreamException XMLStreamException
+ * @throws ParserException ParserException
+ */
+ protected CommonPool parsePool(XMLStreamReader reader) throws XMLStreamException, ParserException
+ {
+ Integer minPoolSize = null;
+ Integer maxPoolSize = null;
+ boolean prefill = false;
+ boolean useStrictMin = false;
+
+ while (reader.hasNext())
+ {
+ switch (reader.nextTag())
+ {
+ case END_ELEMENT : {
+ if (DataSource.Tag.forName(reader.getLocalName()) == DataSource.Tag.POOL)
+ {
+
+ return new CommonPoolImpl(minPoolSize, maxPoolSize, prefill, useStrictMin);
+
+ }
+ else
+ {
+ if (CommonPool.Tag.forName(reader.getLocalName()) == CommonPool.Tag.UNKNOWN)
+ {
+ throw new ParserException("unexpected end tag" + reader.getLocalName());
+ }
+ }
+ break;
+ }
+ case START_ELEMENT : {
+ switch (CommonPool.Tag.forName(reader.getLocalName()))
+ {
+ case MAXPOOLSIZE : {
+ maxPoolSize = elementAsInteger(reader);
+ break;
+ }
+ case MIN_POOL_SIZE : {
+ minPoolSize = elementAsInteger(reader);
+ break;
+ }
+
+ case PREFILL : {
+ prefill = elementAsBoolean(reader);
+ break;
+ }
+ case USE_STRICT_MIN : {
+ useStrictMin = elementAsBoolean(reader);
+ break;
+ }
+ default :
+ throw new ParserException("Unexpected element:" + reader.getLocalName());
+ }
+ break;
+ }
+ }
+ }
+ throw new ParserException("Reached end of xml document unexpectedly");
+ }
+
+ /**
+ *
+ * parse a {@link CommonSecurity} element
+ *
+ * @param reader reader
+ * @return a {@link CommonSecurity} object
+ * @throws XMLStreamException XMLStreamException
+ * @throws ParserException ParserException
+ */
+ protected CommonSecurity parseSecuritySettings(XMLStreamReader reader) throws XMLStreamException, ParserException
+ {
+
+ String userName = null;
+ String password = null;
+
+ while (reader.hasNext())
+ {
+ switch (reader.nextTag())
+ {
+ case END_ELEMENT : {
+ if (DataSource.Tag.forName(reader.getLocalName()) == DataSource.Tag.SECURITY)
+ {
+
+ return new CommonSecurityImpl(userName, password);
+ }
+ else
+ {
+ if (CommonSecurity.Tag.forName(reader.getLocalName()) == CommonSecurity.Tag.UNKNOWN)
+ {
+ throw new ParserException("unexpected end tag" + reader.getLocalName());
+ }
+ }
+ break;
+ }
+ case START_ELEMENT : {
+ switch (CommonSecurity.Tag.forName(reader.getLocalName()))
+ {
+ case PASSWORD : {
+ password = elementAsString(reader);
+ break;
+ }
+ case USERNAME : {
+ userName = elementAsString(reader);
+ break;
+ }
+ default :
+ throw new ParserException("Unexpected element:" + reader.getLocalName());
+ }
+ break;
+ }
+ }
+ }
+ throw new ParserException("Reached end of xml document unexpectedly");
+ }
+
}
Modified: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/MetadataFactory.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/MetadataFactory.java 2010-09-07 12:50:36 UTC (rev 108005)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/MetadataFactory.java 2010-09-07 13:31:40 UTC (rev 108006)
@@ -22,10 +22,10 @@
package org.jboss.jca.common.metadata;
+import org.jboss.jca.common.api.metadata.common.CommonSecurity;
import org.jboss.jca.common.api.metadata.common.TransactionSupportEnum;
import org.jboss.jca.common.api.metadata.ds.CommonDataSource;
import org.jboss.jca.common.api.metadata.ds.DataSource;
-import org.jboss.jca.common.api.metadata.ds.Security;
import org.jboss.jca.common.api.metadata.ds.XaDataSource;
import org.jboss.jca.common.api.metadata.jbossra.JbossRa;
import org.jboss.jca.common.api.metadata.ra.AdminObject;
@@ -332,7 +332,7 @@
case USERNAME : {
if (ds != null)
{
- Security security = ds.getSecurity();
+ CommonSecurity security = ds.getSecurity();
if (security != null && security.getUserName() != null &&
!security.getUserName().trim().equals(""))
{
@@ -346,7 +346,7 @@
case PASSWORD : {
if (ds != null)
{
- Security security = ds.getSecurity();
+ CommonSecurity security = ds.getSecurity();
if (security != null && security.getPassword() != null &&
!security.getPassword().trim().equals(""))
{
Copied: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/common/CommonPoolImpl.java (from rev 108002, projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ds/PoolImpl.java)
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/common/CommonPoolImpl.java (rev 0)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/common/CommonPoolImpl.java 2010-09-07 13:31:40 UTC (rev 108006)
@@ -0,0 +1,120 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.common.metadata.common;
+
+import org.jboss.jca.common.api.metadata.common.CommonPool;
+
+/**
+ *
+ * A PoolImpl.
+ *
+ * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
+ *
+ */
+public class CommonPoolImpl implements CommonPool
+{
+
+ /** The serialVersionUID */
+ private static final long serialVersionUID = -8705723067326455982L;
+
+ /**
+ * minPoolSize
+ */
+ protected final Integer minPoolSize;
+
+ /**
+ * maxPoolSize
+ */
+ protected final Integer maxPoolSize;
+
+ /**
+ * prefill
+ */
+ protected final boolean prefill;
+
+ /**
+ * use-strict-min
+ */
+ protected final boolean useStrictMin;
+
+ /**
+ * Create a new PoolImpl.
+ *
+ * @param minPoolSize minPoolSize
+ * @param maxPoolSize maxPoolSize
+ * @param prefill prefill
+ * @param useStrictMin useStrictMin
+ */
+ public CommonPoolImpl(Integer minPoolSize, Integer maxPoolSize, boolean prefill, boolean useStrictMin)
+ {
+ super();
+ this.minPoolSize = minPoolSize;
+ this.maxPoolSize = maxPoolSize;
+ this.prefill = prefill;
+ this.useStrictMin = useStrictMin;
+ }
+
+ /**
+ * Get the minPoolSize.
+ *
+ * @return the minPoolSize.
+ */
+ @Override
+ public final Integer getMinPoolSize()
+ {
+ return minPoolSize;
+ }
+
+ /**
+ * Get the maxPoolSize.
+ *
+ * @return the maxPoolSize.
+ */
+ @Override
+ public final Integer getMaxPoolSize()
+ {
+ return maxPoolSize;
+ }
+
+ /**
+ * Get the prefill.
+ *
+ * @return the prefill.
+ */
+ @Override
+ public final boolean isPrefill()
+ {
+ return prefill;
+ }
+
+ /**
+ * Get the useStrictMin.
+ *
+ * @return the useStrictMin.
+ */
+ @Override
+ public final boolean isUseStrictMin()
+ {
+ return useStrictMin;
+ }
+
+}
Copied: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/common/CommonSecurityImpl.java (from rev 108002, projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ds/SecurityImpl.java)
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/common/CommonSecurityImpl.java (rev 0)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/common/CommonSecurityImpl.java 2010-09-07 13:31:40 UTC (rev 108006)
@@ -0,0 +1,123 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.common.metadata.common;
+
+import org.jboss.jca.common.api.metadata.common.CommonSecurity;
+
+
+/**
+ *
+ * A SecurityImpl.
+ *
+ * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
+ *
+ */
+public class CommonSecurityImpl implements CommonSecurity
+{
+
+ /** The serialVersionUID */
+ private static final long serialVersionUID = -5842402120520191086L;
+
+ private final String userName;
+
+ private final String password;
+
+ /**
+ * Create a new SecurityImpl.
+ *
+ * @param userName userName
+ * @param password password
+ */
+ public CommonSecurityImpl(String userName, String password)
+ {
+ super();
+ this.userName = userName;
+ this.password = password;
+ }
+
+ /**
+ * Get the userName.
+ *
+ * @return the userName.
+ */
+ @Override
+ public final String getUserName()
+ {
+ return userName;
+ }
+
+ /**
+ * Get the password.
+ *
+ * @return the password.
+ */
+ @Override
+ public final String getPassword()
+ {
+ return password;
+ }
+
+ @Override
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((password == null) ? 0 : password.hashCode());
+ result = prime * result + ((userName == null) ? 0 : userName.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (!(obj instanceof CommonSecurityImpl))
+ return false;
+ CommonSecurityImpl other = (CommonSecurityImpl) obj;
+ if (password == null)
+ {
+ if (other.password != null)
+ return false;
+ }
+ else if (!password.equals(other.password))
+ return false;
+ if (userName == null)
+ {
+ if (other.userName != null)
+ return false;
+ }
+ else if (!userName.equals(other.userName))
+ return false;
+ return true;
+ }
+
+ @Override
+ public String toString()
+ {
+ return "SecurityImpl [userName=" + userName + ", password=" + password + "]";
+ }
+
+
+}
Copied: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/common/CommonTimeOutImpl.java (from rev 108002, projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/resourceadapter/TimeOutImpl.java)
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/common/CommonTimeOutImpl.java (rev 0)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/common/CommonTimeOutImpl.java 2010-09-07 13:31:40 UTC (rev 108006)
@@ -0,0 +1,198 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.common.metadata.common;
+
+import org.jboss.jca.common.api.metadata.common.CommonTimeOut;
+
+/**
+ *
+ * A TimeOutImpl.
+ *
+ * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
+ *
+ */
+public class CommonTimeOutImpl implements CommonTimeOut
+{
+
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 7351813875143571341L;
+
+ /** blockingTimeoutMillis **/
+ protected final Long blockingTimeoutMillis;
+
+ /** idleTimeoutMinutes **/
+ protected final Long idleTimeoutMinutes;
+
+ /** allocationRetry **/
+ protected final Long allocationRetry;
+
+ /** allocationRetryWaitMillis **/
+ protected final Long allocationRetryWaitMillis;
+
+ /** xaResourceTimeout **/
+ protected final Long xaResourceTimeout;
+
+ /**
+ * Create a new STimeOutImpl.
+ *
+ * @param blockingTimeoutMillis blockingTimeoutMillis
+ * @param idleTimeoutMinutes idleTimeoutMinutes
+ * @param allocationRetry allocationRetry
+ * @param allocationRetryWaitMillis allocationRetryWaitMillis
+ * @param xaResourceTimeout xaResourceTimeout
+ */
+ public CommonTimeOutImpl(Long blockingTimeoutMillis, Long idleTimeoutMinutes, Long allocationRetry,
+ Long allocationRetryWaitMillis, Long xaResourceTimeout)
+ {
+ super();
+ this.blockingTimeoutMillis = blockingTimeoutMillis;
+ this.idleTimeoutMinutes = idleTimeoutMinutes;
+ this.allocationRetry = allocationRetry;
+ this.allocationRetryWaitMillis = allocationRetryWaitMillis;
+ this.xaResourceTimeout = xaResourceTimeout;
+ }
+
+ /**
+ * Get the blockingTimeoutMillis.
+ *
+ * @return the blockingTimeoutMillis.
+ */
+ @Override
+ public final Long getBlockingTimeoutMillis()
+ {
+ return blockingTimeoutMillis;
+ }
+
+ /**
+ * Get the idleTimeoutMinutes.
+ *
+ * @return the idleTimeoutMinutes.
+ */
+ @Override
+ public final Long getIdleTimeoutMinutes()
+ {
+ return idleTimeoutMinutes;
+ }
+
+ /**
+ * Get the allocationRetry.
+ *
+ * @return the allocationRetry.
+ */
+ @Override
+ public final Long getAllocationRetry()
+ {
+ return allocationRetry;
+ }
+
+ /**
+ * Get the allocationRetryWaitMillis.
+ *
+ * @return the allocationRetryWaitMillis.
+ */
+ @Override
+ public final Long getAllocationRetryWaitMillis()
+ {
+ return allocationRetryWaitMillis;
+ }
+
+ /**
+ * Get the xaResourceTimeout.
+ *
+ * @return the xaResourceTimeout.
+ */
+ @Override
+ public Long getXaResourceTimeout()
+ {
+ return xaResourceTimeout;
+ }
+
+ @Override
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((allocationRetry == null) ? 0 : allocationRetry.hashCode());
+ result = prime * result + ((allocationRetryWaitMillis == null) ? 0 : allocationRetryWaitMillis.hashCode());
+ result = prime * result + ((blockingTimeoutMillis == null) ? 0 : blockingTimeoutMillis.hashCode());
+ result = prime * result + ((idleTimeoutMinutes == null) ? 0 : idleTimeoutMinutes.hashCode());
+ result = prime * result + ((xaResourceTimeout == null) ? 0 : xaResourceTimeout.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (!(obj instanceof CommonTimeOutImpl))
+ return false;
+ CommonTimeOutImpl other = (CommonTimeOutImpl) obj;
+ if (allocationRetry == null)
+ {
+ if (other.allocationRetry != null)
+ return false;
+ }
+ else if (!allocationRetry.equals(other.allocationRetry))
+ return false;
+ if (allocationRetryWaitMillis == null)
+ {
+ if (other.allocationRetryWaitMillis != null)
+ return false;
+ }
+ else if (!allocationRetryWaitMillis.equals(other.allocationRetryWaitMillis))
+ return false;
+ if (blockingTimeoutMillis == null)
+ {
+ if (other.blockingTimeoutMillis != null)
+ return false;
+ }
+ else if (!blockingTimeoutMillis.equals(other.blockingTimeoutMillis))
+ return false;
+ if (idleTimeoutMinutes == null)
+ {
+ if (other.idleTimeoutMinutes != null)
+ return false;
+ }
+ else if (!idleTimeoutMinutes.equals(other.idleTimeoutMinutes))
+ return false;
+ if (xaResourceTimeout == null)
+ {
+ if (other.xaResourceTimeout != null)
+ return false;
+ }
+ else if (!xaResourceTimeout.equals(other.xaResourceTimeout))
+ return false;
+ return true;
+ }
+
+ @Override
+ public String toString()
+ {
+ return "CommonTimeOutImpl [blockingTimeoutMillis=" + blockingTimeoutMillis + ", idleTimeoutMinutes=" +
+ idleTimeoutMinutes + ", allocationRetry=" + allocationRetry + ", allocationRetryWaitMillis=" +
+ allocationRetryWaitMillis + ", xaResourceTimeout=" + xaResourceTimeout + "]";
+ }
+
+}
Copied: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/common/CommonValidationImpl.java (from rev 108002, projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/resourceadapter/ValidationImpl.java)
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/common/CommonValidationImpl.java (rev 0)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/common/CommonValidationImpl.java 2010-09-07 13:31:40 UTC (rev 108006)
@@ -0,0 +1,139 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.common.metadata.common;
+
+import org.jboss.jca.common.api.metadata.common.CommonValidation;
+
+/**
+ *
+ * A SValidationImpl.
+ *
+ * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
+ *
+ */
+public class CommonValidationImpl implements CommonValidation
+{
+
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 2158460908861877316L;
+
+ /** backgroundValidation **/
+ protected final boolean backgroundValidation;
+
+ /** backgroundValidationMinutes **/
+ protected final Long backgroundValidationMinutes;
+
+ /** useFastFail **/
+ protected final boolean useFastFail;
+
+ /**
+ * Create a new SValidationImpl.
+ *
+ * @param backgroundValidation backgroundValidation
+ * @param backgroundValidationMinutes backgroundValidationMinutes
+ * @param useFastFail useFastFail
+ */
+ public CommonValidationImpl(boolean backgroundValidation, Long backgroundValidationMinutes, boolean useFastFail)
+ {
+ super();
+ this.backgroundValidation = backgroundValidation;
+ this.backgroundValidationMinutes = backgroundValidationMinutes;
+ this.useFastFail = useFastFail;
+ }
+
+ /**
+ * Get the backgroundValidation.
+ *
+ * @return the backgroundValidation.
+ */
+ @Override
+ public final boolean isBackgroundValidation()
+ {
+ return backgroundValidation;
+ }
+
+ /**
+ * Get the backgroundValidationMinutes.
+ *
+ * @return the backgroundValidationMinutes.
+ */
+ @Override
+ public final Long getBackgroundValidationMinutes()
+ {
+ return backgroundValidationMinutes;
+ }
+
+ /**
+ * Get the useFastFail.
+ *
+ * @return the useFastFail.
+ */
+ @Override
+ public final boolean isUseFastFail()
+ {
+ return useFastFail;
+ }
+
+ @Override
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + (backgroundValidation ? 1231 : 1237);
+ result = prime * result +
+ ((backgroundValidationMinutes == null) ? 0 : backgroundValidationMinutes.hashCode());
+ result = prime * result + (useFastFail ? 1231 : 1237);
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (!(obj instanceof CommonValidationImpl))
+ return false;
+ CommonValidationImpl other = (CommonValidationImpl) obj;
+ if (backgroundValidation != other.backgroundValidation)
+ return false;
+ if (backgroundValidationMinutes == null)
+ {
+ if (other.backgroundValidationMinutes != null)
+ return false;
+ }
+ else if (!backgroundValidationMinutes.equals(other.backgroundValidationMinutes))
+ return false;
+ if (useFastFail != other.useFastFail)
+ return false;
+ return true;
+ }
+
+ @Override
+ public String toString()
+ {
+ return "SValidationImpl [backgroundValidation=" + backgroundValidation + ", backgroundValidationMinutes=" +
+ backgroundValidationMinutes + ", useFastFail=" + useFastFail + "]";
+ }
+
+}
Added: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/common/package.html
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/common/package.html (rev 0)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/common/package.html 2010-09-07 13:31:40 UTC (rev 108006)
@@ -0,0 +1,3 @@
+<body>
+This package contains metadatas commons for ironJacamar's extension xsd like -ds.xml, -ra.xml, ironjacamar.xml
+</body>
Modified: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ds/DataSourceAbstractImpl.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ds/DataSourceAbstractImpl.java 2010-09-07 12:50:36 UTC (rev 108005)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ds/DataSourceAbstractImpl.java 2010-09-07 13:31:40 UTC (rev 108006)
@@ -21,8 +21,8 @@
*/
package org.jboss.jca.common.metadata.ds;
+import org.jboss.jca.common.api.metadata.common.CommonSecurity;
import org.jboss.jca.common.api.metadata.ds.CommonDataSource;
-import org.jboss.jca.common.api.metadata.ds.Security;
import org.jboss.jca.common.api.metadata.ds.Statement;
import org.jboss.jca.common.api.metadata.ds.TimeOut;
import org.jboss.jca.common.api.metadata.ds.TransactionIsolation;
@@ -54,7 +54,7 @@
/**
* security
*/
- protected final Security security;
+ protected final CommonSecurity security;
/**
* statement
@@ -111,7 +111,7 @@
* @param enabled enabled
* @param jndiName jndiName
*/
- protected DataSourceAbstractImpl(TransactionIsolation transactionIsolation, TimeOut timeOut, Security security,
+ protected DataSourceAbstractImpl(TransactionIsolation transactionIsolation, TimeOut timeOut, CommonSecurity security,
Statement statement, Validation validation, String urlDelimiter, String urlSelectorStrategyClassName,
boolean useJavaContext, String poolName, boolean enabled, String jndiName)
{
@@ -162,7 +162,7 @@
*/
@Override
- public final Security getSecurity()
+ public final CommonSecurity getSecurity()
{
return security;
}
Modified: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ds/DataSourceImpl.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ds/DataSourceImpl.java 2010-09-07 12:50:36 UTC (rev 108005)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ds/DataSourceImpl.java 2010-09-07 13:31:40 UTC (rev 108006)
@@ -21,9 +21,9 @@
*/
package org.jboss.jca.common.metadata.ds;
+import org.jboss.jca.common.api.metadata.common.CommonPool;
+import org.jboss.jca.common.api.metadata.common.CommonSecurity;
import org.jboss.jca.common.api.metadata.ds.DataSource;
-import org.jboss.jca.common.api.metadata.ds.Pool;
-import org.jboss.jca.common.api.metadata.ds.Security;
import org.jboss.jca.common.api.metadata.ds.Statement;
import org.jboss.jca.common.api.metadata.ds.TimeOut;
import org.jboss.jca.common.api.metadata.ds.TransactionIsolation;
@@ -53,7 +53,7 @@
private final String newConnectionSql;
- private final Pool pool;
+ private final CommonPool pool;
/**
* Create a new DataSourceImpl.
@@ -76,9 +76,9 @@
* @param pool pool
*/
public DataSourceImpl(String connectionUrl, String driverClass, TransactionIsolation transactionIsolation,
- Map<String, String> connectionProperties, TimeOut timeOut, Security security, Statement statement,
+ Map<String, String> connectionProperties, TimeOut timeOut, CommonSecurity security, Statement statement,
Validation validation, String urlDelimiter, String urlSelectorStrategyClassName, String newConnectionSql,
- boolean useJavaContext, String poolName, boolean enabled, String jndiName, Pool pool)
+ boolean useJavaContext, String poolName, boolean enabled, String jndiName, CommonPool pool)
{
super(transactionIsolation, timeOut, security, statement, validation, urlDelimiter,
urlSelectorStrategyClassName, useJavaContext, poolName, enabled, jndiName);
@@ -181,7 +181,7 @@
* @return the pool.
*/
@Override
- public final Pool getPool()
+ public final CommonPool getPool()
{
return pool;
}
Modified: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ds/DsParser.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ds/DsParser.java 2010-09-07 12:50:36 UTC (rev 108005)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ds/DsParser.java 2010-09-07 13:31:40 UTC (rev 108006)
@@ -21,10 +21,10 @@
*/
package org.jboss.jca.common.metadata.ds;
+import org.jboss.jca.common.api.metadata.common.CommonPool;
+import org.jboss.jca.common.api.metadata.common.CommonSecurity;
import org.jboss.jca.common.api.metadata.ds.DataSource;
import org.jboss.jca.common.api.metadata.ds.DataSources;
-import org.jboss.jca.common.api.metadata.ds.Pool;
-import org.jboss.jca.common.api.metadata.ds.Security;
import org.jboss.jca.common.api.metadata.ds.Statement;
import org.jboss.jca.common.api.metadata.ds.Statement.TrackStatementsEnum;
import org.jboss.jca.common.api.metadata.ds.TimeOut;
@@ -165,7 +165,7 @@
TransactionIsolation transactionIsolation = null;
Map<String, String> xaDataSourceProperty = new HashMap<String, String>();
TimeOut timeOutSettings = null;
- Security securitySettings = null;
+ CommonSecurity securitySettings = null;
Statement statementSettings = null;
Validation validationSettings = null;
String urlDelimiter = null;
@@ -298,13 +298,13 @@
TransactionIsolation transactionIsolation = null;
Map<String, String> connectionProperties = new HashMap<String, String>();
TimeOut timeOutSettings = null;
- Security securitySettings = null;
+ CommonSecurity securitySettings = null;
Statement statementSettings = null;
Validation validationSettings = null;
String urlDelimiter = null;
String urlSelectorStrategyClassName = null;
String newConnectionSql = null;
- Pool pool = null;
+ CommonPool pool = null;
//attributes reading
boolean useJavaContext = false;
@@ -504,63 +504,6 @@
throw new ParserException("Reached end of xml document unexpectedly");
}
- private Pool parsePool(XMLStreamReader reader) throws XMLStreamException, ParserException
- {
- Integer minPoolSize = null;
- Integer maxPoolSize = null;
- boolean prefill = false;
- boolean useStrictMin = false;
-
- while (reader.hasNext())
- {
- switch (reader.nextTag())
- {
- case END_ELEMENT : {
- if (DataSource.Tag.forName(reader.getLocalName()) == DataSource.Tag.POOL)
- {
-
- return new PoolImpl(minPoolSize, maxPoolSize, prefill, useStrictMin);
-
- }
- else
- {
- if (Pool.Tag.forName(reader.getLocalName()) == Pool.Tag.UNKNOWN)
- {
- throw new ParserException("unexpected end tag" + reader.getLocalName());
- }
- }
- break;
- }
- case START_ELEMENT : {
- switch (Pool.Tag.forName(reader.getLocalName()))
- {
- case MAXPOOLSIZE : {
- maxPoolSize = elementAsInteger(reader);
- break;
- }
- case MIN_POOL_SIZE : {
- minPoolSize = elementAsInteger(reader);
- break;
- }
-
- case PREFILL : {
- prefill = elementAsBoolean(reader);
- break;
- }
- case USE_STRICT_MIN : {
- useStrictMin = elementAsBoolean(reader);
- break;
- }
- default :
- throw new ParserException("Unexpected element:" + reader.getLocalName());
- }
- break;
- }
- }
- }
- throw new ParserException("Reached end of xml document unexpectedly");
- }
-
private Validation parseValidationSetting(XMLStreamReader reader) throws XMLStreamException, ParserException
{
boolean validateOnMatch = false;
@@ -580,9 +523,10 @@
if (DataSource.Tag.forName(reader.getLocalName()) == DataSource.Tag.VALIDATION)
{
- return new ValidationImpl(validConnectionCheckerClassName, checkValidConnectionSql,
- validateOnMatch, backgroundValidation, backgroundValidationMinutes,
- useFastFail, staleConnectionCheckerClassName, exceptionSorterClassName);
+ return new ValidationImpl(backgroundValidation, backgroundValidationMinutes, useFastFail,
+ validConnectionCheckerClassName, checkValidConnectionSql,
+ validateOnMatch, staleConnectionCheckerClassName,
+ exceptionSorterClassName);
}
else
@@ -659,9 +603,9 @@
if (DataSource.Tag.forName(reader.getLocalName()) == DataSource.Tag.TIMEOUT)
{
- return new TimeOutImpl(blockingTimeoutMillis, idleTimeoutMinutes, setTxQuertTimeout,
- queryTimeout, useTryLock, allocationRetry, allocationRetryWaitMillis,
- xaResourceTimeout);
+ return new TimeOutImpl(blockingTimeoutMillis, idleTimeoutMinutes, allocationRetry,
+ allocationRetryWaitMillis, xaResourceTimeout, setTxQuertTimeout,
+ queryTimeout, useTryLock);
}
else
{
@@ -770,52 +714,6 @@
throw new ParserException("Reached end of xml document unexpectedly");
}
- private Security parseSecuritySettings(XMLStreamReader reader) throws XMLStreamException, ParserException
- {
-
- String userName = null;
- String password = null;
-
- while (reader.hasNext())
- {
- switch (reader.nextTag())
- {
- case END_ELEMENT : {
- if (DataSource.Tag.forName(reader.getLocalName()) == DataSource.Tag.SECURITY)
- {
-
- return new SecurityImpl(userName, password);
- }
- else
- {
- if (Security.Tag.forName(reader.getLocalName()) == Security.Tag.UNKNOWN)
- {
- throw new ParserException("unexpected end tag" + reader.getLocalName());
- }
- }
- break;
- }
- case START_ELEMENT : {
- switch (Security.Tag.forName(reader.getLocalName()))
- {
- case PASSWORD : {
- password = elementAsString(reader);
- break;
- }
- case USERNAME : {
- userName = elementAsString(reader);
- break;
- }
- default :
- throw new ParserException("Unexpected element:" + reader.getLocalName());
- }
- break;
- }
- }
- }
- throw new ParserException("Reached end of xml document unexpectedly");
- }
-
/**
*
* A Tag.
Deleted: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ds/PoolImpl.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ds/PoolImpl.java 2010-09-07 12:50:36 UTC (rev 108005)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ds/PoolImpl.java 2010-09-07 13:31:40 UTC (rev 108006)
@@ -1,120 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.jca.common.metadata.ds;
-
-import org.jboss.jca.common.api.metadata.ds.Pool;
-
-/**
- *
- * A PoolImpl.
- *
- * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
- *
- */
-public class PoolImpl implements Pool
-{
-
- /** The serialVersionUID */
- private static final long serialVersionUID = -8705723067326455982L;
-
- /**
- * minPoolSize
- */
- protected final Integer minPoolSize;
-
- /**
- * maxPoolSize
- */
- protected final Integer maxPoolSize;
-
- /**
- * prefill
- */
- protected final boolean prefill;
-
- /**
- * use-strict-min
- */
- protected final boolean useStrictMin;
-
- /**
- * Create a new PoolImpl.
- *
- * @param minPoolSize minPoolSize
- * @param maxPoolSize maxPoolSize
- * @param prefill prefill
- * @param useStrictMin useStrictMin
- */
- public PoolImpl(Integer minPoolSize, Integer maxPoolSize, boolean prefill, boolean useStrictMin)
- {
- super();
- this.minPoolSize = minPoolSize;
- this.maxPoolSize = maxPoolSize;
- this.prefill = prefill;
- this.useStrictMin = useStrictMin;
- }
-
- /**
- * Get the minPoolSize.
- *
- * @return the minPoolSize.
- */
- @Override
- public final Integer getMinPoolSize()
- {
- return minPoolSize;
- }
-
- /**
- * Get the maxPoolSize.
- *
- * @return the maxPoolSize.
- */
- @Override
- public final Integer getMaxPoolSize()
- {
- return maxPoolSize;
- }
-
- /**
- * Get the prefill.
- *
- * @return the prefill.
- */
- @Override
- public final boolean isPrefill()
- {
- return prefill;
- }
-
- /**
- * Get the useStrictMin.
- *
- * @return the useStrictMin.
- */
- @Override
- public final boolean isUseStrictMin()
- {
- return useStrictMin;
- }
-
-}
Deleted: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ds/SecurityImpl.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ds/SecurityImpl.java 2010-09-07 12:50:36 UTC (rev 108005)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ds/SecurityImpl.java 2010-09-07 13:31:40 UTC (rev 108006)
@@ -1,123 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.jca.common.metadata.ds;
-
-import org.jboss.jca.common.api.metadata.ds.Security;
-
-
-/**
- *
- * A SecurityImpl.
- *
- * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
- *
- */
-public class SecurityImpl implements Security
-{
-
- /** The serialVersionUID */
- private static final long serialVersionUID = -5842402120520191086L;
-
- private final String userName;
-
- private final String password;
-
- /**
- * Create a new SecurityImpl.
- *
- * @param userName userName
- * @param password password
- */
- public SecurityImpl(String userName, String password)
- {
- super();
- this.userName = userName;
- this.password = password;
- }
-
- /**
- * Get the userName.
- *
- * @return the userName.
- */
- @Override
- public final String getUserName()
- {
- return userName;
- }
-
- /**
- * Get the password.
- *
- * @return the password.
- */
- @Override
- public final String getPassword()
- {
- return password;
- }
-
- @Override
- public int hashCode()
- {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((password == null) ? 0 : password.hashCode());
- result = prime * result + ((userName == null) ? 0 : userName.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj)
- {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (!(obj instanceof SecurityImpl))
- return false;
- SecurityImpl other = (SecurityImpl) obj;
- if (password == null)
- {
- if (other.password != null)
- return false;
- }
- else if (!password.equals(other.password))
- return false;
- if (userName == null)
- {
- if (other.userName != null)
- return false;
- }
- else if (!userName.equals(other.userName))
- return false;
- return true;
- }
-
- @Override
- public String toString()
- {
- return "SecurityImpl [userName=" + userName + ", password=" + password + "]";
- }
-
-
-}
Modified: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ds/TimeOutImpl.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ds/TimeOutImpl.java 2010-09-07 12:50:36 UTC (rev 108005)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ds/TimeOutImpl.java 2010-09-07 13:31:40 UTC (rev 108006)
@@ -30,77 +30,41 @@
* @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
*
*/
-public class TimeOutImpl implements TimeOut
+public class TimeOutImpl extends org.jboss.jca.common.metadata.common.CommonTimeOutImpl implements TimeOut
{
/** The serialVersionUID */
private static final long serialVersionUID = -8797718258493768716L;
- private final Long blockingTimeoutMillis;
-
- private final Long idleTimeoutMinutes;
-
private final boolean setTxQuertTimeout;
private final Long queryTimeout;
private final Long useTryLock;
- private final Long allocationRetry;
-
- private final Long allocationRetryWaitMillis;
-
- private final Long xaResourceTimeout;
-
/**
* Create a new TimeOutImpl.
*
* @param blockingTimeoutMillis blockingTimeoutMillis
* @param idleTimeoutMinutes idleTimeoutMinutes
- * @param setTxQuertTimeout setTxQuertTimeout
- * @param queryTimeout queryTimeout
- * @param useTryLock useTryLock
* @param allocationRetry allocationRetry
* @param allocationRetryWaitMillis allocationRetryWaitMillis
* @param xaResourceTimeout xaResourceTimeout
+ * @param setTxQuertTimeout setTxQuertTimeout
+ * @param queryTimeout queryTimeout
+ * @param useTryLock useTryLock
*/
- public TimeOutImpl(Long blockingTimeoutMillis, Long idleTimeoutMinutes, boolean setTxQuertTimeout,
- Long queryTimeout, Long useTryLock, Long allocationRetry, Long allocationRetryWaitMillis,
- Long xaResourceTimeout)
+ public TimeOutImpl(Long blockingTimeoutMillis, Long idleTimeoutMinutes, Long allocationRetry,
+ Long allocationRetryWaitMillis, Long xaResourceTimeout, boolean setTxQuertTimeout, Long queryTimeout,
+ Long useTryLock)
{
- super();
- this.blockingTimeoutMillis = blockingTimeoutMillis;
- this.idleTimeoutMinutes = idleTimeoutMinutes;
+ super(blockingTimeoutMillis, idleTimeoutMinutes, allocationRetry, allocationRetryWaitMillis,
+ xaResourceTimeout);
this.setTxQuertTimeout = setTxQuertTimeout;
this.queryTimeout = queryTimeout;
this.useTryLock = useTryLock;
- this.allocationRetry = allocationRetry;
- this.allocationRetryWaitMillis = allocationRetryWaitMillis;
- this.xaResourceTimeout = xaResourceTimeout;
}
/**
- * Get the blockingTimeoutMillis.
- *
- * @return the blockingTimeoutMillis.
- */
- @Override
- public final Long getBlockingTimeoutMillis()
- {
- return blockingTimeoutMillis;
- }
-
- /**
- * Get the idleTimeoutMinutes.
- *
- * @return the idleTimeoutMinutes.
- */
- @Override
- public final Long getIdleTimeoutMinutes()
- {
- return idleTimeoutMinutes;
- }
-
- /**
* Get the setTxQuertTimeout.
*
* @return the setTxQuertTimeout.
@@ -133,41 +97,14 @@
return useTryLock;
}
- /**
- * Get the allocationRetry.
- *
- * @return the allocationRetry.
- */
@Override
- public final Long getAllocationRetry()
- {
- return allocationRetry;
- }
-
- /**
- * Get the allocationRetryWaitMillis.
- *
- * @return the allocationRetryWaitMillis.
- */
- @Override
- public final Long getAllocationRetryWaitMillis()
- {
- return allocationRetryWaitMillis;
- }
-
- @Override
public int hashCode()
{
final int prime = 31;
- int result = 1;
- result = prime * result + ((allocationRetry == null) ? 0 : allocationRetry.hashCode());
- result = prime * result + ((allocationRetryWaitMillis == null) ? 0 : allocationRetryWaitMillis.hashCode());
- result = prime * result + ((blockingTimeoutMillis == null) ? 0 : blockingTimeoutMillis.hashCode());
- result = prime * result + ((idleTimeoutMinutes == null) ? 0 : idleTimeoutMinutes.hashCode());
+ int result = super.hashCode();
result = prime * result + ((queryTimeout == null) ? 0 : queryTimeout.hashCode());
result = prime * result + (setTxQuertTimeout ? 1231 : 1237);
result = prime * result + ((useTryLock == null) ? 0 : useTryLock.hashCode());
- result = prime * result + ((xaResourceTimeout == null) ? 0 : xaResourceTimeout.hashCode());
return result;
}
@@ -176,39 +113,11 @@
{
if (this == obj)
return true;
- if (obj == null)
+ if (!super.equals(obj))
return false;
if (!(obj instanceof TimeOutImpl))
return false;
TimeOutImpl other = (TimeOutImpl) obj;
- if (allocationRetry == null)
- {
- if (other.allocationRetry != null)
- return false;
- }
- else if (!allocationRetry.equals(other.allocationRetry))
- return false;
- if (allocationRetryWaitMillis == null)
- {
- if (other.allocationRetryWaitMillis != null)
- return false;
- }
- else if (!allocationRetryWaitMillis.equals(other.allocationRetryWaitMillis))
- return false;
- if (blockingTimeoutMillis == null)
- {
- if (other.blockingTimeoutMillis != null)
- return false;
- }
- else if (!blockingTimeoutMillis.equals(other.blockingTimeoutMillis))
- return false;
- if (idleTimeoutMinutes == null)
- {
- if (other.idleTimeoutMinutes != null)
- return false;
- }
- else if (!idleTimeoutMinutes.equals(other.idleTimeoutMinutes))
- return false;
if (queryTimeout == null)
{
if (other.queryTimeout != null)
@@ -225,35 +134,14 @@
}
else if (!useTryLock.equals(other.useTryLock))
return false;
- if (xaResourceTimeout == null)
- {
- if (other.xaResourceTimeout != null)
- return false;
- }
- else if (!xaResourceTimeout.equals(other.xaResourceTimeout))
- return false;
return true;
}
@Override
public String toString()
{
- return "TimeOutImpl [blockingTimeoutMillis=" + blockingTimeoutMillis + ", idleTimeoutMinutes="
- + idleTimeoutMinutes + ", setTxQuertTimeout=" + setTxQuertTimeout + ", queryTimeout=" + queryTimeout
- + ", useTryLock=" + useTryLock + ", allocationRetry=" + allocationRetry + ", allocationRetryWaitMillis="
- + allocationRetryWaitMillis + ", xaResourceTimeout=" + xaResourceTimeout + "]";
+ return "TimeOutImpl [setTxQuertTimeout=" + setTxQuertTimeout + ", queryTimeout=" + queryTimeout +
+ ", useTryLock=" + useTryLock + "]";
}
- /**
- * Get the xaResourceTimeout.
- *
- * @return the xaResourceTimeout.
- */
- @Override
- public Long getXaResourceTimeout()
- {
- return xaResourceTimeout;
- }
-
}
-
Modified: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ds/ValidationImpl.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ds/ValidationImpl.java 2010-09-07 12:50:36 UTC (rev 108005)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ds/ValidationImpl.java 2010-09-07 13:31:40 UTC (rev 108006)
@@ -23,6 +23,7 @@
import org.jboss.jca.common.api.metadata.ds.Validation;
+
/**
*
* A ValidationImpl.
@@ -30,7 +31,7 @@
* @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
*
*/
-public class ValidationImpl implements Validation
+public class ValidationImpl extends org.jboss.jca.common.metadata.common.CommonValidationImpl implements Validation
{
/** The serialVersionUID */
private static final long serialVersionUID = 7816717816552118419L;
@@ -41,12 +42,6 @@
private final boolean validateOnMatch;
- private final boolean backgroundValidation;
-
- private final Long backgroundValidationMinutes;
-
- private final boolean useFastFail;
-
private final String staleConnectionCheckerClassName;
private final String exceptionSorterClassName;
@@ -54,26 +49,23 @@
/**
* Create a new ValidationImpl.
*
- * @param validConnectionCheckerClassName validConnectionCheckerClassName
- * @param checkValidConnectionSql checkValidConnectionSql
- * @param validateOnMatch validateOnMatch
* @param backgroundValidation backgroundValidation
* @param backgroundValidationMinutes backgroundValidationMinutes
* @param useFastFail useFastFail
+ * @param validConnectionCheckerClassName validConnectionCheckerClassName
+ * @param checkValidConnectionSql checkValidConnectionSql
+ * @param validateOnMatch validateOnMatch
* @param staleConnectionCheckerClassName staleConnectionCheckerClassName
* @param exceptionSorterClassName exceptionSorterClassName
*/
- public ValidationImpl(String validConnectionCheckerClassName, String checkValidConnectionSql,
- boolean validateOnMatch, boolean backgroundValidation, Long backgroundValidationMinutes, boolean useFastFail,
- String staleConnectionCheckerClassName, String exceptionSorterClassName)
+ public ValidationImpl(boolean backgroundValidation, Long backgroundValidationMinutes, boolean useFastFail,
+ String validConnectionCheckerClassName, String checkValidConnectionSql, boolean validateOnMatch,
+ String staleConnectionCheckerClassName, String exceptionSorterClassName)
{
- super();
+ super(backgroundValidation, backgroundValidationMinutes, useFastFail);
this.validConnectionCheckerClassName = validConnectionCheckerClassName;
this.checkValidConnectionSql = checkValidConnectionSql;
this.validateOnMatch = validateOnMatch;
- this.backgroundValidation = backgroundValidation;
- this.backgroundValidationMinutes = backgroundValidationMinutes;
- this.useFastFail = useFastFail;
this.staleConnectionCheckerClassName = staleConnectionCheckerClassName;
this.exceptionSorterClassName = exceptionSorterClassName;
}
@@ -112,39 +104,6 @@
}
/**
- * Get the backgroundValidation.
- *
- * @return the backgroundValidation.
- */
- @Override
- public final boolean isBackgroundValidation()
- {
- return backgroundValidation;
- }
-
- /**
- * Get the backgroundValidationMinutes.
- *
- * @return the backgroundValidationMinutes.
- */
- @Override
- public final Long getBackgroundValidationMinutes()
- {
- return backgroundValidationMinutes;
- }
-
- /**
- * Get the useFastFail.
- *
- * @return the useFastFail.
- */
- @Override
- public final boolean isUseFastFail()
- {
- return useFastFail;
- }
-
- /**
* Get the staleConnectionCheckerClassName.
*
* @return the staleConnectionCheckerClassName.
@@ -170,16 +129,13 @@
public int hashCode()
{
final int prime = 31;
- int result = 1;
- result = prime * result + (backgroundValidation ? 1231 : 1237);
- result = prime * result + ((backgroundValidationMinutes == null) ? 0 : backgroundValidationMinutes.hashCode());
+ int result = super.hashCode();
result = prime * result + ((checkValidConnectionSql == null) ? 0 : checkValidConnectionSql.hashCode());
result = prime * result + ((exceptionSorterClassName == null) ? 0 : exceptionSorterClassName.hashCode());
- result = prime * result
- + ((staleConnectionCheckerClassName == null) ? 0 : staleConnectionCheckerClassName.hashCode());
- result = prime * result + (useFastFail ? 1231 : 1237);
- result = prime * result
- + ((validConnectionCheckerClassName == null) ? 0 : validConnectionCheckerClassName.hashCode());
+ result = prime * result +
+ ((staleConnectionCheckerClassName == null) ? 0 : staleConnectionCheckerClassName.hashCode());
+ result = prime * result +
+ ((validConnectionCheckerClassName == null) ? 0 : validConnectionCheckerClassName.hashCode());
result = prime * result + (validateOnMatch ? 1231 : 1237);
return result;
}
@@ -189,20 +145,11 @@
{
if (this == obj)
return true;
- if (obj == null)
+ if (!super.equals(obj))
return false;
if (!(obj instanceof ValidationImpl))
return false;
ValidationImpl other = (ValidationImpl) obj;
- if (backgroundValidation != other.backgroundValidation)
- return false;
- if (backgroundValidationMinutes == null)
- {
- if (other.backgroundValidationMinutes != null)
- return false;
- }
- else if (!backgroundValidationMinutes.equals(other.backgroundValidationMinutes))
- return false;
if (checkValidConnectionSql == null)
{
if (other.checkValidConnectionSql != null)
@@ -224,8 +171,6 @@
}
else if (!staleConnectionCheckerClassName.equals(other.staleConnectionCheckerClassName))
return false;
- if (useFastFail != other.useFastFail)
- return false;
if (validConnectionCheckerClassName == null)
{
if (other.validConnectionCheckerClassName != null)
@@ -241,11 +186,12 @@
@Override
public String toString()
{
- return "ValidationImpl [validConnectionCheckerClassName=" + validConnectionCheckerClassName
- + ", checkValidConnectionSql=" + checkValidConnectionSql + ", validateOnMatch=" + validateOnMatch
- + ", backgroundValidation=" + backgroundValidation + ", backgroundValidationMinutes="
- + backgroundValidationMinutes + ", useFastFail=" + useFastFail + ", staleConnectionCheckerClassName="
- + staleConnectionCheckerClassName + ", exceptionSorterClassName=" + exceptionSorterClassName + "]";
+ return "ValidationImpl [validConnectionCheckerClassName=" + validConnectionCheckerClassName +
+ ", checkValidConnectionSql=" + checkValidConnectionSql + ", validateOnMatch=" + validateOnMatch +
+ ", staleConnectionCheckerClassName=" + staleConnectionCheckerClassName +
+ ", exceptionSorterClassName=" + exceptionSorterClassName + ", backgroundValidation=" +
+ backgroundValidation + ", backgroundValidationMinutes=" + backgroundValidationMinutes +
+ ", useFastFail=" + useFastFail + "]";
}
}
Modified: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ds/XADataSourceImpl.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ds/XADataSourceImpl.java 2010-09-07 12:50:36 UTC (rev 108005)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ds/XADataSourceImpl.java 2010-09-07 13:31:40 UTC (rev 108006)
@@ -21,7 +21,7 @@
*/
package org.jboss.jca.common.metadata.ds;
-import org.jboss.jca.common.api.metadata.ds.Security;
+import org.jboss.jca.common.api.metadata.common.CommonSecurity;
import org.jboss.jca.common.api.metadata.ds.Statement;
import org.jboss.jca.common.api.metadata.ds.TimeOut;
import org.jboss.jca.common.api.metadata.ds.TransactionIsolation;
@@ -72,7 +72,7 @@
* @param newConnectionSql newConnectionSql
* @param xaPool xaPool
*/
- public XADataSourceImpl(TransactionIsolation transactionIsolation, TimeOut timeOut, Security security,
+ public XADataSourceImpl(TransactionIsolation transactionIsolation, TimeOut timeOut, CommonSecurity security,
Statement statement, Validation validation, String urlDelimiter, String urlSelectorStrategyClassName,
boolean useJavaContext, String poolName, boolean enabled, String jndiName,
Map<String, String> xaDataSourceProperty, String xaDataSourceClass, String newConnectionSql,
Modified: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ds/XaPoolImpl.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ds/XaPoolImpl.java 2010-09-07 12:50:36 UTC (rev 108005)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ds/XaPoolImpl.java 2010-09-07 13:31:40 UTC (rev 108006)
@@ -22,6 +22,7 @@
package org.jboss.jca.common.metadata.ds;
import org.jboss.jca.common.api.metadata.ds.XaPool;
+import org.jboss.jca.common.metadata.common.CommonPoolImpl;
/**
*
@@ -30,7 +31,7 @@
* @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
*
*/
-public class XaPoolImpl extends PoolImpl implements XaPool
+public class XaPoolImpl extends CommonPoolImpl implements XaPool
{
/** The serialVersionUID */
private static final long serialVersionUID = 3261597366235425250L;
Modified: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/ConnectorAbstractmpl.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/ConnectorAbstractmpl.java 2010-09-07 12:50:36 UTC (rev 108005)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/ConnectorAbstractmpl.java 2010-09-07 13:31:40 UTC (rev 108006)
@@ -414,11 +414,11 @@
{
if (this.getResourceadapter() != null
&& !(this instanceof Connector10)
- && ((ResourceAdapter1516) this.getResourceadapter()).getAdminobjects() != null
- && ((ResourceAdapter1516) this.getResourceadapter()).getAdminobjects().size() > 0
- && ((ResourceAdapter1516) this.getResourceadapter()).getAdminobjects().get(0) != null)
+ && ((ResourceAdapter1516) this.getResourceadapter()).getAdminObjects() != null
+ && ((ResourceAdapter1516) this.getResourceadapter()).getAdminObjects().size() > 0
+ && ((ResourceAdapter1516) this.getResourceadapter()).getAdminObjects().get(0) != null)
{
- listConfigProp = ((ResourceAdapter1516) this.getResourceadapter()).getAdminobjects().get(0)
+ listConfigProp = ((ResourceAdapter1516) this.getResourceadapter()).getAdminObjects().get(0)
.getConfigProperties();
}
}
Modified: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/ResourceAdapter1516Impl.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/ResourceAdapter1516Impl.java 2010-09-07 12:50:36 UTC (rev 108005)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/ResourceAdapter1516Impl.java 2010-09-07 13:31:40 UTC (rev 108006)
@@ -148,7 +148,7 @@
* @return adminobject
*/
@Override
- public List<AdminObject> getAdminobjects()
+ public List<AdminObject> getAdminObjects()
{
return adminobjects == null ? null : Collections.unmodifiableList(adminobjects);
}
Modified: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/resourceadapter/AdminObjectImpl.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/resourceadapter/AdminObjectImpl.java 2010-09-07 12:50:36 UTC (rev 108005)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/resourceadapter/AdminObjectImpl.java 2010-09-07 13:31:40 UTC (rev 108006)
@@ -45,6 +45,8 @@
private final String jndiName;
+ private final String poolName;
+
private final boolean enabled;
private final boolean useJavaContext;
@@ -55,11 +57,12 @@
* @param configProperties configProperties
* @param className className
* @param jndiName jndiName
+ * @param poolName poolName
* @param enabled enabled
* @param useJavaContext useJavaContext
*/
- public AdminObjectImpl(Map<String, String> configProperties, String className, String jndiName, boolean enabled,
- boolean useJavaContext)
+ public AdminObjectImpl(Map<String, String> configProperties, String className, String jndiName,
+ String poolName, boolean enabled, boolean useJavaContext)
{
super();
if (configProperties != null)
@@ -73,6 +76,7 @@
}
this.className = className;
this.jndiName = jndiName;
+ this.poolName = poolName;
this.enabled = enabled;
this.useJavaContext = useJavaContext;
}
@@ -141,6 +145,7 @@
result = prime * result + ((configProperties == null) ? 0 : configProperties.hashCode());
result = prime * result + (enabled ? 1231 : 1237);
result = prime * result + ((jndiName == null) ? 0 : jndiName.hashCode());
+ result = prime * result + ((poolName == null) ? 0 : poolName.hashCode());
result = prime * result + (useJavaContext ? 1231 : 1237);
return result;
}
@@ -178,6 +183,13 @@
}
else if (!jndiName.equals(other.jndiName))
return false;
+ if (poolName == null)
+ {
+ if (other.poolName != null)
+ return false;
+ }
+ else if (!poolName.equals(other.poolName))
+ return false;
if (useJavaContext != other.useJavaContext)
return false;
return true;
@@ -186,8 +198,19 @@
@Override
public String toString()
{
- return "AdminObjectImpl [configProperties=" + configProperties + ", className=" + className + ", jndiName="
- + jndiName + ", enabled=" + enabled + ", useJavaContext=" + useJavaContext + "]";
+ return "AdminObjectImpl [configProperties=" + configProperties + ", className=" + className + ", jndiName=" +
+ jndiName + ", poolName=" + poolName + ", enabled=" + enabled + ", useJavaContext=" + useJavaContext +
+ "]";
}
+
+ /**
+ * Get the poolName.
+ *
+ * @return the poolName.
+ */
+ @Override
+ public final String getPoolName()
+ {
+ return poolName;
+ }
}
-
Copied: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/resourceadapter/ConnectionDefinitionImpl.java (from rev 108002, projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/resourceadapter/NoTxConnectionFactoryImpl.java)
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/resourceadapter/ConnectionDefinitionImpl.java (rev 0)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/resourceadapter/ConnectionDefinitionImpl.java 2010-09-07 13:31:40 UTC (rev 108006)
@@ -0,0 +1,333 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.common.metadata.resourceadapter;
+
+import org.jboss.jca.common.api.metadata.common.CommonPool;
+import org.jboss.jca.common.api.metadata.common.CommonSecurity;
+import org.jboss.jca.common.api.metadata.common.CommonTimeOut;
+import org.jboss.jca.common.api.metadata.common.CommonValidation;
+import org.jboss.jca.common.api.metadata.resourceadapter.ConnectionDefinition;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ *
+ * A ConnectionDefinition.
+ *
+ * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
+ *
+ */
+public class ConnectionDefinitionImpl implements ConnectionDefinition
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = -7109775624169563102L;
+
+ private final HashMap<String, String> configProperties;
+
+ private final String className;
+
+ private final String jndiName;
+
+ private final String poolName;
+
+ private final boolean enabled;
+
+ private final boolean useJavaContext;
+
+ private final CommonPool pool;
+
+ private final CommonTimeOut timeOut;
+
+ private final CommonValidation validation;
+
+ private final CommonSecurity security;
+
+ private final boolean noTxSeparatePool;
+
+ /**
+ * Create a new ConnectionDefinition.
+ *
+ * @param configProperties configProperties
+ * @param className className
+ * @param jndiName jndiName
+ * @param poolName poolName
+ * @param enabled enabled
+ * @param useJavaContext useJavaContext
+ * @param pool pool
+ * @param timeOut timeOut
+ * @param validation validation
+ * @param security security
+ * @param noTxSeparatePool noTxSeparatePool
+ */
+ public ConnectionDefinitionImpl(Map<String, String> configProperties, String className, String jndiName,
+ String poolName, boolean enabled, boolean useJavaContext, CommonPool pool, CommonTimeOut timeOut,
+ CommonValidation validation, CommonSecurity security, boolean noTxSeparatePool)
+ {
+ super();
+ if (configProperties != null)
+ {
+ this.configProperties = new HashMap<String, String>(configProperties.size());
+ this.configProperties.putAll(configProperties);
+ }
+ else
+ {
+ this.configProperties = new HashMap<String, String>(0);
+ }
+ this.className = className;
+ this.jndiName = jndiName;
+ this.poolName = poolName;
+ this.enabled = enabled;
+ this.useJavaContext = useJavaContext;
+ this.pool = pool;
+ this.timeOut = timeOut;
+ this.validation = validation;
+ this.security = security;
+ this.noTxSeparatePool = noTxSeparatePool;
+ }
+
+ /**
+ * Get the configProperties.
+ *
+ * @return the configProperties.
+ */
+ @Override
+ public final Map<String, String> getConfigProperties()
+ {
+ return Collections.unmodifiableMap(configProperties);
+ }
+
+ /**
+ * Get the className.
+ *
+ * @return the className.
+ */
+ @Override
+ public final String getClassName()
+ {
+ return className;
+ }
+
+ /**
+ * Get the jndiName.
+ *
+ * @return the jndiName.
+ */
+ @Override
+ public final String getJndiName()
+ {
+ return jndiName;
+ }
+
+ /**
+ * Get the poolName.
+ *
+ * @return the poolName.
+ */
+ @Override
+ public final String getPoolName()
+ {
+ return poolName;
+ }
+
+ /**
+ * Get the enabled.
+ *
+ * @return the enabled.
+ */
+ @Override
+ public final boolean isEnabled()
+ {
+ return enabled;
+ }
+
+ /**
+ * Get the useJavaContext.
+ *
+ * @return the useJavaContext.
+ */
+ @Override
+ public final boolean isUseJavaContext()
+ {
+ return useJavaContext;
+ }
+
+ /**
+ * Get the pool.
+ *
+ * @return the pool.
+ */
+ @Override
+ public final CommonPool getPool()
+ {
+ return pool;
+ }
+
+ /**
+ * Get the timeOut.
+ *
+ * @return the timeOut.
+ */
+ @Override
+ public final CommonTimeOut getTimeOut()
+ {
+ return timeOut;
+ }
+
+ /**
+ * Get the validation.
+ *
+ * @return the validation.
+ */
+ @Override
+ public final CommonValidation getValidation()
+ {
+ return validation;
+ }
+
+ /**
+ * Get the security.
+ *
+ * @return the security.
+ */
+ @Override
+ public final CommonSecurity getSecurity()
+ {
+ return security;
+ }
+
+ /**
+ * Get the noTxSeparatePool.
+ *
+ * @return the noTxSeparatePool.
+ */
+ @Override
+ public final boolean isNoTxSeparatePool()
+ {
+ return noTxSeparatePool;
+ }
+
+ @Override
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((className == null) ? 0 : className.hashCode());
+ result = prime * result + ((configProperties == null) ? 0 : configProperties.hashCode());
+ result = prime * result + (enabled ? 1231 : 1237);
+ result = prime * result + ((jndiName == null) ? 0 : jndiName.hashCode());
+ result = prime * result + (noTxSeparatePool ? 1231 : 1237);
+ result = prime * result + ((pool == null) ? 0 : pool.hashCode());
+ result = prime * result + ((poolName == null) ? 0 : poolName.hashCode());
+ result = prime * result + ((security == null) ? 0 : security.hashCode());
+ result = prime * result + ((timeOut == null) ? 0 : timeOut.hashCode());
+ result = prime * result + (useJavaContext ? 1231 : 1237);
+ result = prime * result + ((validation == null) ? 0 : validation.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (!(obj instanceof ConnectionDefinitionImpl))
+ return false;
+ ConnectionDefinitionImpl other = (ConnectionDefinitionImpl) obj;
+ if (className == null)
+ {
+ if (other.className != null)
+ return false;
+ }
+ else if (!className.equals(other.className))
+ return false;
+ if (configProperties == null)
+ {
+ if (other.configProperties != null)
+ return false;
+ }
+ else if (!configProperties.equals(other.configProperties))
+ return false;
+ if (enabled != other.enabled)
+ return false;
+ if (jndiName == null)
+ {
+ if (other.jndiName != null)
+ return false;
+ }
+ else if (!jndiName.equals(other.jndiName))
+ return false;
+ if (noTxSeparatePool != other.noTxSeparatePool)
+ return false;
+ if (pool == null)
+ {
+ if (other.pool != null)
+ return false;
+ }
+ else if (!pool.equals(other.pool))
+ return false;
+ if (poolName == null)
+ {
+ if (other.poolName != null)
+ return false;
+ }
+ else if (!poolName.equals(other.poolName))
+ return false;
+ if (security == null)
+ {
+ if (other.security != null)
+ return false;
+ }
+ else if (!security.equals(other.security))
+ return false;
+ if (timeOut == null)
+ {
+ if (other.timeOut != null)
+ return false;
+ }
+ else if (!timeOut.equals(other.timeOut))
+ return false;
+ if (useJavaContext != other.useJavaContext)
+ return false;
+ if (validation == null)
+ {
+ if (other.validation != null)
+ return false;
+ }
+ else if (!validation.equals(other.validation))
+ return false;
+ return true;
+ }
+
+ @Override
+ public String toString()
+ {
+ return "ConnectionDefinitionImpl [configProperties=" + configProperties + ", className=" + className +
+ ", jndiName=" + jndiName + ", poolName=" + poolName + ", enabled=" + enabled + ", useJavaContext=" +
+ useJavaContext + ", pool=" + pool + ", timeOut=" + timeOut + ", validation=" + validation +
+ ", security=" + security + ", noTxSeparatePool=" + noTxSeparatePool + "]";
+ }
+
+}
Deleted: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/resourceadapter/LocalTxConnectionFactoryImpl.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/resourceadapter/LocalTxConnectionFactoryImpl.java 2010-09-07 12:50:36 UTC (rev 108005)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/resourceadapter/LocalTxConnectionFactoryImpl.java 2010-09-07 13:31:40 UTC (rev 108006)
@@ -1,140 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.jca.common.metadata.resourceadapter;
-
-import org.jboss.jca.common.api.metadata.resourceadapter.LocalTxConnectionFactory;
-import org.jboss.jca.common.api.metadata.resourceadapter.Security;
-import org.jboss.jca.common.api.metadata.resourceadapter.TimeOut;
-import org.jboss.jca.common.api.metadata.resourceadapter.Validation;
-
-import java.util.Map;
-
-/**
- *
- * A LocalTxConnectionFactoryImpl.
- *
- * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
- *
- */
-public class LocalTxConnectionFactoryImpl extends NoTxConnectionFactoryImpl implements LocalTxConnectionFactory
-{
- /** The serialVersionUID */
- private static final long serialVersionUID = -7691787666361594149L;
-
- private final boolean noTxSeparatePools;
-
- private final boolean trackConnectionByTx;
-
- /**
- * Create a new LocalTxConnectionFactoryImpl.
- *
- * @param minPoolSize minPoolSize
- * @param maxPoolSize maxPoolSize
- * @param prefill prefill
- * @param userName userName
- * @param password password
- * @param connectionDefinition connectionDefinition
- * @param configProperties configProperties
- * @param security security
- * @param timeOut timeOut
- * @param validation validation
- * @param poolName poolName
- * @param className className
- * @param jndiName jndiName
- * @param enabled enabled
- * @param useJavaContext useJavaContext
- * @param noTxSeparatePools noTxSeparatePools
- * @param trackConnectionByTx trackConnectionByTx
- */
- public LocalTxConnectionFactoryImpl(Integer minPoolSize, Integer maxPoolSize, boolean prefill, String userName,
- String password, String connectionDefinition, Map<String, String> configProperties, Security security,
- TimeOut timeOut, Validation validation, String poolName, String className, String jndiName, boolean enabled,
- boolean useJavaContext, boolean noTxSeparatePools, boolean trackConnectionByTx)
- {
- super(minPoolSize, maxPoolSize, prefill, userName, password, connectionDefinition, configProperties, security,
- timeOut, validation, poolName, className, jndiName, enabled, useJavaContext);
- this.noTxSeparatePools = noTxSeparatePools;
- this.trackConnectionByTx = trackConnectionByTx;
- }
-
- /**
- * Get the noTxSeparatePools.
- *
- * @return the noTxSeparatePools.
- */
- @Override
- public final boolean isNoTxSeparatePools()
- {
- return noTxSeparatePools;
- }
-
- /**
- * Get the trackConnectionByTx.
- *
- * @return the trackConnectionByTx.
- */
- @Override
- public final boolean isTrackConnectionByTx()
- {
- return trackConnectionByTx;
- }
-
- @Override
- public int hashCode()
- {
- final int prime = 31;
- int result = super.hashCode();
- result = prime * result + (noTxSeparatePools ? 1231 : 1237);
- result = prime * result + (trackConnectionByTx ? 1231 : 1237);
- return result;
- }
-
- @Override
- public boolean equals(Object obj)
- {
- if (this == obj)
- return true;
- if (!super.equals(obj))
- return false;
- if (!(obj instanceof LocalTxConnectionFactoryImpl))
- return false;
- LocalTxConnectionFactoryImpl other = (LocalTxConnectionFactoryImpl) obj;
- if (noTxSeparatePools != other.noTxSeparatePools)
- return false;
- if (trackConnectionByTx != other.trackConnectionByTx)
- return false;
- return true;
- }
-
- @Override
- public String toString()
- {
- return "LocalTxConnectionFactoryImpl [noTxSeparatePools=" + noTxSeparatePools + ", trackConnectionByTx="
- + trackConnectionByTx + ", minPoolSize=" + minPoolSize + ", maxPoolSize=" + maxPoolSize + ", prefill="
- + prefill + ", userName=" + userName + ", password=" + password + ", connectionDefinition="
- + connectionDefinition + ", configProperties=" + configProperties + ", security=" + security + ", timeOut="
- + timeOut + ", validation=" + validation + ", poolName=" + poolName + ", className=" + className
- + ", jndiName=" + jndiName + ", enabled=" + enabled + ", useJavaContext=" + useJavaContext + "]";
- }
-
-}
-
Deleted: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/resourceadapter/NoTxConnectionFactoryImpl.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/resourceadapter/NoTxConnectionFactoryImpl.java 2010-09-07 12:50:36 UTC (rev 108005)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/resourceadapter/NoTxConnectionFactoryImpl.java 2010-09-07 13:31:40 UTC (rev 108006)
@@ -1,440 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.jca.common.metadata.resourceadapter;
-
-import org.jboss.jca.common.api.metadata.resourceadapter.NoTxConnectionFactory;
-import org.jboss.jca.common.api.metadata.resourceadapter.Security;
-import org.jboss.jca.common.api.metadata.resourceadapter.TimeOut;
-import org.jboss.jca.common.api.metadata.resourceadapter.Validation;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- *
- * A NoTxConnectionFactoryImpl.
- *
- * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
- *
- */
-public class NoTxConnectionFactoryImpl implements NoTxConnectionFactory
-{
- /** The serialVersionUID */
- private static final long serialVersionUID = -2475537312421610650L;
-
- /** minPoolSize field **/
- protected final Integer minPoolSize;
-
- /** maxPoolSize field **/
- protected final Integer maxPoolSize;
-
- /** prefill field **/
- protected final boolean prefill;
-
- /** userName field **/
- protected final String userName;
-
- /** password field **/
- protected final String password;
-
- /** connectionDefinition field **/
- protected final String connectionDefinition;
-
- /** configProperty field **/
- protected final HashMap<String, String> configProperties;
-
- /** security field **/
- protected final Security security;
-
- /** timeOut field **/
- protected final TimeOut timeOut;
-
- /** validation field **/
- protected final Validation validation;
-
- /** poolName field **/
- protected final String poolName;
-
- /** className field **/
- protected final String className;
-
- /** jndiName field **/
- protected final String jndiName;
-
- /** enabled field **/
- protected final boolean enabled;
-
- /** useJavaContext field **/
- protected final boolean useJavaContext;
-
- /**
- * Create a new NoTxConnectionFactoryImpl.
- *
- * @param minPoolSize minPoolSize
- * @param maxPoolSize maxPoolSize
- * @param prefill prefill
- * @param userName userName
- * @param password password
- * @param connectionDefinition connectionDefinition
- * @param configProperties configProperties
- * @param security security
- * @param timeOut timeOut
- * @param validation validation
- * @param poolName poolName
- * @param className className
- * @param jndiName jndiName
- * @param enabled enabled
- * @param useJavaContext useJavaContext
- */
- public NoTxConnectionFactoryImpl(Integer minPoolSize, Integer maxPoolSize, boolean prefill, String userName,
- String password, String connectionDefinition, Map<String, String> configProperties, Security security,
- TimeOut timeOut, Validation validation, String poolName, String className, String jndiName, boolean enabled,
- boolean useJavaContext)
- {
- super();
- this.minPoolSize = minPoolSize;
- this.maxPoolSize = maxPoolSize;
- this.prefill = prefill;
- this.userName = userName;
- this.password = password;
- this.connectionDefinition = connectionDefinition;
- if (configProperties != null)
- {
- this.configProperties = new HashMap<String, String>(configProperties.size());
- this.configProperties.putAll(configProperties);
- }
- else
- {
- this.configProperties = new HashMap<String, String>(0);
- }
- this.security = security;
- this.timeOut = timeOut;
- this.validation = validation;
- this.poolName = poolName;
- this.className = className;
- this.jndiName = jndiName;
- this.enabled = enabled;
- this.useJavaContext = useJavaContext;
- }
-
- /**
- * Get the minPoolSize.
- *
- * @return the minPoolSize.
- */
- @Override
- public final Integer getMinPoolSize()
- {
- return minPoolSize;
- }
-
- /**
- * Get the maxPoolSize.
- *
- * @return the maxPoolSize.
- */
- @Override
- public final Integer getMaxPoolSize()
- {
- return maxPoolSize;
- }
-
- /**
- * Get the prefill.
- *
- * @return the prefill.
- */
- @Override
- public final boolean isPrefill()
- {
- return prefill;
- }
-
- /**
- * Get the userName.
- *
- * @return the userName.
- */
- @Override
- public final String getUserName()
- {
- return userName;
- }
-
- /**
- * Get the password.
- *
- * @return the password.
- */
- @Override
- public final String getPassword()
- {
- return password;
- }
-
- /**
- * Get the connectionDefinition.
- *
- * @return the connectionDefinition.
- */
- @Override
- public final String getConnectionDefinition()
- {
- return connectionDefinition;
- }
-
- /**
- * Get the configProperty.
- *
- * @return the configProperty.
- */
- @Override
- public final Map<String, String> getConfigProperties()
- {
- return Collections.unmodifiableMap(configProperties);
- }
-
- /**
- * Get the security.
- *
- * @return the security.
- */
- @Override
- public final Security getSecurity()
- {
- return security;
- }
-
- /**
- * Get the timeOut.
- *
- * @return the timeOut.
- */
- @Override
- public final TimeOut getTimeOut()
- {
- return timeOut;
- }
-
- /**
- * Get the validation.
- *
- * @return the validation.
- */
- @Override
- public final Validation getValidation()
- {
- return validation;
- }
-
- /**
- * Get the poolName.
- *
- * @return the poolName.
- */
- @Override
- public final String getPoolName()
- {
- return poolName;
- }
-
- /**
- * Get the className.
- *
- * @return the className.
- */
- @Override
- public final String getClassName()
- {
- return className;
- }
-
- /**
- * Get the jndiName.
- *
- * @return the jndiName.
- */
- @Override
- public final String getJndiName()
- {
- return jndiName;
- }
-
- /**
- * Get the enabled.
- *
- * @return the enabled.
- */
- @Override
- public final boolean isEnabled()
- {
- return enabled;
- }
-
- /**
- * Get the useJavaContext.
- *
- * @return the useJavaContext.
- */
- @Override
- public final boolean isUseJavaContext()
- {
- return useJavaContext;
- }
-
- @Override
- public int hashCode()
- {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((className == null) ? 0 : className.hashCode());
- result = prime * result + ((configProperties == null) ? 0 : configProperties.hashCode());
- result = prime * result + ((connectionDefinition == null) ? 0 : connectionDefinition.hashCode());
- result = prime * result + (enabled ? 1231 : 1237);
- result = prime * result + ((jndiName == null) ? 0 : jndiName.hashCode());
- result = prime * result + ((maxPoolSize == null) ? 0 : maxPoolSize.hashCode());
- result = prime * result + ((minPoolSize == null) ? 0 : minPoolSize.hashCode());
- result = prime * result + ((password == null) ? 0 : password.hashCode());
- result = prime * result + ((poolName == null) ? 0 : poolName.hashCode());
- result = prime * result + (prefill ? 1231 : 1237);
- result = prime * result + ((security == null) ? 0 : security.hashCode());
- result = prime * result + ((timeOut == null) ? 0 : timeOut.hashCode());
- result = prime * result + (useJavaContext ? 1231 : 1237);
- result = prime * result + ((userName == null) ? 0 : userName.hashCode());
- result = prime * result + ((validation == null) ? 0 : validation.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj)
- {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (!(obj instanceof NoTxConnectionFactoryImpl))
- return false;
- NoTxConnectionFactoryImpl other = (NoTxConnectionFactoryImpl) obj;
- if (className == null)
- {
- if (other.className != null)
- return false;
- }
- else if (!className.equals(other.className))
- return false;
- if (configProperties == null)
- {
- if (other.configProperties != null)
- return false;
- }
- else if (!configProperties.equals(other.configProperties))
- return false;
- if (connectionDefinition == null)
- {
- if (other.connectionDefinition != null)
- return false;
- }
- else if (!connectionDefinition.equals(other.connectionDefinition))
- return false;
- if (enabled != other.enabled)
- return false;
- if (jndiName == null)
- {
- if (other.jndiName != null)
- return false;
- }
- else if (!jndiName.equals(other.jndiName))
- return false;
- if (maxPoolSize == null)
- {
- if (other.maxPoolSize != null)
- return false;
- }
- else if (!maxPoolSize.equals(other.maxPoolSize))
- return false;
- if (minPoolSize == null)
- {
- if (other.minPoolSize != null)
- return false;
- }
- else if (!minPoolSize.equals(other.minPoolSize))
- return false;
- if (password == null)
- {
- if (other.password != null)
- return false;
- }
- else if (!password.equals(other.password))
- return false;
- if (poolName == null)
- {
- if (other.poolName != null)
- return false;
- }
- else if (!poolName.equals(other.poolName))
- return false;
- if (prefill != other.prefill)
- return false;
- if (security == null)
- {
- if (other.security != null)
- return false;
- }
- else if (!security.equals(other.security))
- return false;
- if (timeOut == null)
- {
- if (other.timeOut != null)
- return false;
- }
- else if (!timeOut.equals(other.timeOut))
- return false;
- if (useJavaContext != other.useJavaContext)
- return false;
- if (userName == null)
- {
- if (other.userName != null)
- return false;
- }
- else if (!userName.equals(other.userName))
- return false;
- if (validation == null)
- {
- if (other.validation != null)
- return false;
- }
- else if (!validation.equals(other.validation))
- return false;
- return true;
- }
-
- @Override
- public String toString()
- {
- return "NoTxConnectionFactoryImpl [minPoolSize=" + minPoolSize + ", maxPoolSize=" + maxPoolSize + ", prefill="
- + prefill + ", userName=" + userName + ", password=" + password + ", connectionDefinition="
- + connectionDefinition + ", configProperties=" + configProperties + ", security=" + security + ", timeOut="
- + timeOut + ", validation=" + validation + ", poolName=" + poolName + ", className=" + className
- + ", jndiName=" + jndiName + ", enabled=" + enabled + ", useJavaContext=" + useJavaContext + "]";
- }
-}
Modified: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/resourceadapter/ResourceAdapterImpl.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/resourceadapter/ResourceAdapterImpl.java 2010-09-07 12:50:36 UTC (rev 108005)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/resourceadapter/ResourceAdapterImpl.java 2010-09-07 13:31:40 UTC (rev 108006)
@@ -23,12 +23,14 @@
import org.jboss.jca.common.api.metadata.common.TransactionSupportEnum;
import org.jboss.jca.common.api.metadata.resourceadapter.AdminObject;
-import org.jboss.jca.common.api.metadata.resourceadapter.NoTxConnectionFactory;
+import org.jboss.jca.common.api.metadata.resourceadapter.ConnectionDefinition;
import org.jboss.jca.common.api.metadata.resourceadapter.ResourceAdapter;
import java.util.ArrayList;
import java.util.Collections;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
/**
*
@@ -44,32 +46,37 @@
private final String archive;
private final TransactionSupportEnum transactionSupport;
- private final ArrayList<NoTxConnectionFactory> connectionFactories;
+ private final HashMap<String, String> configProperties;
private final ArrayList<AdminObject> adminObjects;
+ private final ArrayList<ConnectionDefinition> connectionDefinitions;
+
/**
+ *
* Create a new ResourceAdapterImpl.
*
* @param archive archive
* @param transactionSupport transactionSupport
- * @param connectionFactories connectionFactories
+ * @param connectionDefinitions connectionDefinitions
* @param adminObjects adminObjects
+ * @param configProperties configProperties
*/
public ResourceAdapterImpl(String archive, TransactionSupportEnum transactionSupport,
- List<? extends NoTxConnectionFactory> connectionFactories, List<AdminObject> adminObjects)
+ List<ConnectionDefinition> connectionDefinitions, List<AdminObject> adminObjects,
+ Map<String, String> configProperties)
{
super();
this.archive = archive;
this.transactionSupport = transactionSupport;
- if (connectionFactories != null)
+ if (connectionDefinitions != null)
{
- this.connectionFactories = new ArrayList<NoTxConnectionFactory>(connectionFactories.size());
- this.connectionFactories.addAll(connectionFactories);
+ this.connectionDefinitions = new ArrayList<ConnectionDefinition>(connectionDefinitions.size());
+ this.connectionDefinitions.addAll(connectionDefinitions);
}
else
{
- this.connectionFactories = new ArrayList<NoTxConnectionFactory>(0);
+ this.connectionDefinitions = new ArrayList<ConnectionDefinition>(0);
}
if (adminObjects != null)
@@ -81,6 +88,15 @@
{
this.adminObjects = new ArrayList<AdminObject>(0);
}
+ if (configProperties != null)
+ {
+ this.configProperties = new HashMap<String, String>(configProperties.size());
+ this.configProperties.putAll(configProperties);
+ }
+ else
+ {
+ this.configProperties = new HashMap<String, String>(0);
+ }
}
@@ -112,9 +128,9 @@
* @return the connectionFactories.
*/
@Override
- public final List<? extends NoTxConnectionFactory> getConnectionFactories()
+ public final List<ConnectionDefinition> getConnectionDefinitions()
{
- return Collections.unmodifiableList(connectionFactories);
+ return Collections.unmodifiableList(connectionDefinitions);
}
/**
@@ -123,64 +139,20 @@
* @return the adminObjects.
*/
@Override
- public final List<AdminObject> getAdminobjects()
+ public final List<AdminObject> getAdminObjects()
{
return Collections.unmodifiableList(adminObjects);
}
+ /**
+ * Get the configProperties.
+ *
+ * @return the configProperties.
+ */
@Override
- public int hashCode()
+ public Map<String, String> getConfigProperties()
{
- final int prime = 31;
- int result = 1;
- result = prime * result + ((adminObjects == null) ? 0 : adminObjects.hashCode());
- result = prime * result + ((archive == null) ? 0 : archive.hashCode());
- result = prime * result + ((connectionFactories == null) ? 0 : connectionFactories.hashCode());
- result = prime * result + ((transactionSupport == null) ? 0 : transactionSupport.hashCode());
- return result;
+ return Collections.unmodifiableMap(configProperties);
}
-
- @Override
- public boolean equals(Object obj)
- {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (!(obj instanceof ResourceAdapterImpl))
- return false;
- ResourceAdapterImpl other = (ResourceAdapterImpl) obj;
- if (adminObjects == null)
- {
- if (other.adminObjects != null)
- return false;
- }
- else if (!adminObjects.equals(other.adminObjects))
- return false;
- if (archive == null)
- {
- if (other.archive != null)
- return false;
- }
- else if (!archive.equals(other.archive))
- return false;
- if (connectionFactories == null)
- {
- if (other.connectionFactories != null)
- return false;
- }
- else if (!connectionFactories.equals(other.connectionFactories))
- return false;
- if (transactionSupport != other.transactionSupport)
- return false;
- return true;
- }
-
- @Override
- public String toString()
- {
- return "ResourceAdapterImpl [archive=" + archive + ", transactionSupport=" + transactionSupport
- + ", connectionFactories=" + connectionFactories + ", adminObjects=" + adminObjects + "]";
- }
}
Modified: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/resourceadapter/ResourceAdapterParser.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/resourceadapter/ResourceAdapterParser.java 2010-09-07 12:50:36 UTC (rev 108005)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/resourceadapter/ResourceAdapterParser.java 2010-09-07 13:31:40 UTC (rev 108006)
@@ -21,20 +21,21 @@
*/
package org.jboss.jca.common.metadata.resourceadapter;
-import org.jboss.jca.common.api.metadata.common.SecurityManager;
+import org.jboss.jca.common.api.metadata.common.CommonPool;
+import org.jboss.jca.common.api.metadata.common.CommonSecurity;
+import org.jboss.jca.common.api.metadata.common.CommonTimeOut;
+import org.jboss.jca.common.api.metadata.common.CommonValidation;
import org.jboss.jca.common.api.metadata.common.TransactionSupportEnum;
import org.jboss.jca.common.api.metadata.resourceadapter.AdminObject;
import org.jboss.jca.common.api.metadata.resourceadapter.AdminObject.Attribute;
-import org.jboss.jca.common.api.metadata.resourceadapter.LocalTxConnectionFactory;
-import org.jboss.jca.common.api.metadata.resourceadapter.NoTxConnectionFactory;
+import org.jboss.jca.common.api.metadata.resourceadapter.ConnectionDefinition;
import org.jboss.jca.common.api.metadata.resourceadapter.ResourceAdapter;
-import org.jboss.jca.common.api.metadata.resourceadapter.Security;
-import org.jboss.jca.common.api.metadata.resourceadapter.TimeOut;
-import org.jboss.jca.common.api.metadata.resourceadapter.Validation;
-import org.jboss.jca.common.api.metadata.resourceadapter.XaTxConnectionFactory;
+import org.jboss.jca.common.api.metadata.resourceadapter.ResourceAdapters;
import org.jboss.jca.common.metadata.AbstractParser;
import org.jboss.jca.common.metadata.MetadataParser;
import org.jboss.jca.common.metadata.ParserException;
+import org.jboss.jca.common.metadata.common.CommonTimeOutImpl;
+import org.jboss.jca.common.metadata.common.CommonValidationImpl;
import java.io.InputStream;
import java.util.ArrayList;
@@ -55,15 +56,15 @@
* @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
*
*/
-public class ResourceAdapterParser extends AbstractParser implements MetadataParser<ResourceAdapter>
+public class ResourceAdapterParser extends AbstractParser implements MetadataParser<ResourceAdapters>
{
@Override
- public ResourceAdapter parse(InputStream xmlInputStream) throws Exception
+ public ResourceAdapters parse(InputStream xmlInputStream) throws Exception
{
XMLStreamReader reader = null;
- ResourceAdapter adapter = null;
+ ResourceAdapters adapters = null;
try
{
@@ -91,8 +92,8 @@
switch (Tag.forName(reader.getLocalName()))
{
- case RESOURCE_ADPTER : {
- adapter = parseResourceAdapter(reader);
+ case RESOURCE_ADPTERS : {
+ adapters = parseResourceAdapters(reader);
break;
}
default :
@@ -110,28 +111,27 @@
if (reader != null)
reader.close();
}
- return adapter;
+ return adapters;
}
- private ResourceAdapter parseResourceAdapter(XMLStreamReader reader) throws XMLStreamException, ParserException
+ private ResourceAdapters parseResourceAdapters(XMLStreamReader reader) throws XMLStreamException,
+ ParserException
{
- ArrayList<NoTxConnectionFactory> connectionFactories = new ArrayList<NoTxConnectionFactory>();
- ArrayList<AdminObject> adminObjects = new ArrayList<AdminObject>();
- String archive = null;
- TransactionSupportEnum transactionSupport = null;
+ ArrayList<ResourceAdapter> resourceAdapters = new ArrayList<ResourceAdapter>();
while (reader.hasNext())
{
switch (reader.nextTag())
{
case END_ELEMENT : {
- if (Tag.forName(reader.getLocalName()) == Tag.RESOURCE_ADPTER)
+ if (Tag.forName(reader.getLocalName()) == Tag.RESOURCE_ADPTERS)
{
- return new ResourceAdapterImpl(archive, transactionSupport, connectionFactories, adminObjects);
+ resourceAdapters.trimToSize();
+ return new ResourceAdaptersImpl(resourceAdapters);
}
else
{
- if (ResourceAdapter.Tag.forName(reader.getLocalName()) == ResourceAdapter.Tag.UNKNOWN)
+ if (ResourceAdapters.Tag.forName(reader.getLocalName()) == ResourceAdapters.Tag.UNKNOWN)
{
throw new ParserException("unexpected end tag" + reader.getLocalName());
}
@@ -139,32 +139,12 @@
break;
}
case START_ELEMENT : {
- switch (ResourceAdapter.Tag.forName(reader.getLocalName()))
+ switch (ResourceAdapters.Tag.forName(reader.getLocalName()))
{
- case ADMINOBJECT : {
- adminObjects.add(parseAdminObjects(reader));
+ case RESOURCE_ADPTER : {
+ resourceAdapters.add(parseResourceAdapter(reader));
break;
}
- case LOCALTXCONNECTIONFACTORY : {
- connectionFactories.add(parseLocalTxConnectionFactrory(reader));
- break;
- }
- case NOTXCONNECTIONFACTORY : {
- connectionFactories.add(parseNoTxConnectionFactrory(reader));
- break;
- }
- case XATXCONNECTIONFACTORY : {
- connectionFactories.add(parseXaTxConnectionFactrory(reader));
- break;
- }
- case TRANSACTIONSUPPORT : {
- transactionSupport = TransactionSupportEnum.valueOf(elementAsString(reader));
- break;
- }
- case ARCHIVE : {
- archive = elementAsString(reader);
- break;
- }
default :
throw new ParserException("Unexpected element:" + reader.getLocalName());
}
@@ -175,74 +155,26 @@
throw new ParserException("Reached end of xml document unexpectedly");
}
- private XaTxConnectionFactory parseXaTxConnectionFactrory(XMLStreamReader reader) throws XMLStreamException,
- ParserException
+ private ResourceAdapter parseResourceAdapter(XMLStreamReader reader) throws XMLStreamException, ParserException
{
+ ArrayList<ConnectionDefinition> connectionDefinitions = new ArrayList<ConnectionDefinition>();
+ ArrayList<AdminObject> adminObjects = new ArrayList<AdminObject>();
+ String archive = null;
+ TransactionSupportEnum transactionSupport = null;
HashMap<String, String> configProperties = new HashMap<String, String>();
- String connectionDefinition = null;
- Integer minPoolSize = null;
- Integer maxPoolSize = null;
- String userName = null;
- Security security = null;
- TimeOut timeOut = null;
- boolean prefill = false;
- Validation validation = null;
- String password = null;
- boolean trackConnectionByTx = false;
- boolean noTxSeparatePools = false;
- Long xaResourceTimeout = null;
-
- //attributes reading
- boolean useJavaContext = false;
- String className = null;
- boolean enabled = true;
- String jndiName = null;
- String poolName = null;
-
- for (XaTxConnectionFactory.Attribute attribute : XaTxConnectionFactory.Attribute.values())
- {
- switch (attribute)
- {
- case ENABLED : {
- enabled = attributeAsBoolean(reader, attribute.getLocalName(), true);
- break;
- }
- case JNDINAME : {
- jndiName = attributeAsString(reader, attribute.getLocalName());
- break;
- }
- case CLASS_NAME : {
- className = attributeAsString(reader, attribute.getLocalName());
- break;
- }
- case POOL_NAME : {
- poolName = attributeAsString(reader, attribute.getLocalName());
- break;
- }
- case USEJAVACONTEXT : {
- useJavaContext = attributeAsBoolean(reader, attribute.getLocalName(), true);
- break;
- }
- default :
- break;
- }
- }
-
while (reader.hasNext())
{
switch (reader.nextTag())
{
case END_ELEMENT : {
- if (ResourceAdapter.Tag.forName(reader.getLocalName()) == ResourceAdapter.Tag.XATXCONNECTIONFACTORY)
+ if (ResourceAdapters.Tag.forName(reader.getLocalName()) == ResourceAdapters.Tag.RESOURCE_ADPTER)
{
-
- return new XaTxConnectionFactoryImpl(minPoolSize, maxPoolSize, prefill, userName, password,
- connectionDefinition, configProperties, security, timeOut, validation, poolName, className,
- jndiName, enabled, useJavaContext, noTxSeparatePools, trackConnectionByTx, xaResourceTimeout);
+ return new ResourceAdapterImpl(archive, transactionSupport, connectionDefinitions, adminObjects,
+ configProperties);
}
else
{
- if (XaTxConnectionFactory.Tag.forName(reader.getLocalName()) == XaTxConnectionFactory.Tag.UNKNOWN)
+ if (ResourceAdapter.Tag.forName(reader.getLocalName()) == ResourceAdapter.Tag.UNKNOWN)
{
throw new ParserException("unexpected end tag" + reader.getLocalName());
}
@@ -250,60 +182,35 @@
break;
}
case START_ELEMENT : {
- switch (XaTxConnectionFactory.Tag.forName(reader.getLocalName()))
+ switch (ResourceAdapter.Tag.forName(reader.getLocalName()))
{
- case CONFIGPROPERTY : {
- configProperties.put(attributeAsString(reader, "name"), elementAsString(reader));
+ case ADMIN_OBJECTS :
+ case CONNECTION_DEFINITIONS : {
+ //ignore it, we will parse single admin_object and connection_definition directly
break;
}
- case CONNECTIONDEFINITION : {
- connectionDefinition = elementAsString(reader);
+ case ADMIN_OBJECT : {
+ adminObjects.add(parseAdminObjects(reader));
break;
}
- case MAXPOOLSIZE : {
- maxPoolSize = elementAsInteger(reader);
+
+ case CONNECTION_DEFINITION : {
+ connectionDefinitions.add(parseConnectionDefinitions(reader));
break;
}
- case MINPOOLSIZE : {
- minPoolSize = elementAsInteger(reader);
+ case CONFIG_PROPERTY : {
+ configProperties.put(attributeAsString(reader, "name"), elementAsString(reader));
break;
+
}
- case USERNAME : {
- userName = elementAsString(reader);
+ case TRANSACTION_SUPPORT : {
+ transactionSupport = TransactionSupportEnum.valueOf(elementAsString(reader));
break;
}
- case PASSWORD : {
- password = elementAsString(reader);
+ case ARCHIVE : {
+ archive = elementAsString(reader);
break;
}
- case PREFILL : {
- prefill = elementAsBoolean(reader);
- break;
- }
- case SECURITY : {
- security = parseSecurity(reader);
- break;
- }
- case TIMEOUT : {
- timeOut = parseTimeOut(reader);
- break;
- }
- case VALIDATION : {
- validation = parseValidation(reader);
- break;
- }
- case NOTXSEPARATEPOOLS : {
- noTxSeparatePools = elementAsBoolean(reader);
- break;
- }
- case TRACKCONNECTIONBYTX : {
- trackConnectionByTx = elementAsBoolean(reader);
- break;
- }
- case XARESOURCETIMEOUT : {
- xaResourceTimeout = elementAsLong(reader);
- break;
- }
default :
throw new ParserException("Unexpected element:" + reader.getLocalName());
}
@@ -314,21 +221,16 @@
throw new ParserException("Reached end of xml document unexpectedly");
}
- private LocalTxConnectionFactory parseLocalTxConnectionFactrory(XMLStreamReader reader) throws XMLStreamException,
+ private ConnectionDefinition parseConnectionDefinitions(XMLStreamReader reader) throws XMLStreamException,
ParserException
{
HashMap<String, String> configProperties = new HashMap<String, String>();
- String connectionDefinition = null;
- Integer minPoolSize = null;
- Integer maxPoolSize = null;
- String userName = null;
- Security security = null;
- TimeOut timeOut = null;
+ CommonSecurity security = null;
+ CommonTimeOut timeOut = null;
boolean prefill = false;
- Validation validation = null;
- String password = null;
- boolean trackConnectionByTx = false;
+ CommonValidation validation = null;
boolean noTxSeparatePools = false;
+ CommonPool pool = null;
//attributes reading
boolean useJavaContext = false;
@@ -337,7 +239,7 @@
String jndiName = null;
String poolName = null;
- for (LocalTxConnectionFactory.Attribute attribute : LocalTxConnectionFactory.Attribute.values())
+ for (ConnectionDefinition.Attribute attribute : ConnectionDefinition.Attribute.values())
{
switch (attribute)
{
@@ -371,17 +273,16 @@
switch (reader.nextTag())
{
case END_ELEMENT : {
- if (ResourceAdapter.Tag.forName(reader.getLocalName()) == ResourceAdapter.Tag.LOCALTXCONNECTIONFACTORY)
+ if (ResourceAdapter.Tag.forName(reader.getLocalName()) == ResourceAdapter.Tag.CONNECTION_DEFINITION)
{
- return new LocalTxConnectionFactoryImpl(minPoolSize, maxPoolSize, prefill, userName, password,
- connectionDefinition, configProperties, security, timeOut, validation, poolName, className,
- jndiName, enabled, useJavaContext, noTxSeparatePools, trackConnectionByTx);
+ return new ConnectionDefinitionImpl(configProperties, className, jndiName, poolName, enabled,
+ useJavaContext, pool, timeOut, validation, security,
+ noTxSeparatePools);
}
else
{
- if (LocalTxConnectionFactory.Tag.
- forName(reader.getLocalName()) == LocalTxConnectionFactory.Tag.UNKNOWN)
+ if (ConnectionDefinition.Tag.forName(reader.getLocalName()) == ConnectionDefinition.Tag.UNKNOWN)
{
throw new ParserException("unexpected end tag" + reader.getLocalName());
}
@@ -389,38 +290,14 @@
break;
}
case START_ELEMENT : {
- switch (LocalTxConnectionFactory.Tag.forName(reader.getLocalName()))
+ switch (ConnectionDefinition.Tag.forName(reader.getLocalName()))
{
- case CONFIGPROPERTY : {
+ case CONFIG_PROPERTY : {
configProperties.put(attributeAsString(reader, "name"), elementAsString(reader));
break;
}
- case CONNECTIONDEFINITION : {
- connectionDefinition = elementAsString(reader);
- break;
- }
- case MAXPOOLSIZE : {
- maxPoolSize = elementAsInteger(reader);
- break;
- }
- case MINPOOLSIZE : {
- minPoolSize = elementAsInteger(reader);
- break;
- }
- case USERNAME : {
- userName = elementAsString(reader);
- break;
- }
- case PASSWORD : {
- password = elementAsString(reader);
- break;
- }
- case PREFILL : {
- prefill = elementAsBoolean(reader);
- break;
- }
case SECURITY : {
- security = parseSecurity(reader);
+ security = parseSecuritySettings(reader);
break;
}
case TIMEOUT : {
@@ -431,12 +308,12 @@
validation = parseValidation(reader);
break;
}
- case NOTXSEPARATEPOOLS : {
+ case NO_TX_SEPARATE_POOL : {
noTxSeparatePools = elementAsBoolean(reader);
break;
}
- case TRACKCONNECTIONBYTX : {
- trackConnectionByTx = elementAsBoolean(reader);
+ case POOL : {
+ pool = parsePool(reader);
break;
}
default :
@@ -449,149 +326,25 @@
throw new ParserException("Reached end of xml document unexpectedly");
}
- private NoTxConnectionFactory parseNoTxConnectionFactrory(XMLStreamReader reader) throws XMLStreamException,
- ParserException
+ private CommonValidation parseValidation(XMLStreamReader reader) throws XMLStreamException, ParserException
{
- HashMap<String, String> configProperties = new HashMap<String, String>();
- String connectionDefinition = null;
- Integer minPoolSize = null;
- Integer maxPoolSize = null;
- String userName = null;
- Security security = null;
- TimeOut timeOut = null;
- boolean prefill = false;
- Validation validation = null;
- String password = null;
-
- //attributes reading
- boolean useJavaContext = false;
- String className = null;
- boolean enabled = true;
- String jndiName = null;
- String poolName = null;
-
- for (NoTxConnectionFactory.Attribute attribute : NoTxConnectionFactory.Attribute.values())
- {
- switch (attribute)
- {
- case ENABLED : {
- enabled = attributeAsBoolean(reader, attribute.getLocalName(), true);
- break;
- }
- case JNDINAME : {
- jndiName = attributeAsString(reader, attribute.getLocalName());
- break;
- }
- case CLASS_NAME : {
- className = attributeAsString(reader, attribute.getLocalName());
- break;
- }
- case POOL_NAME : {
- poolName = attributeAsString(reader, attribute.getLocalName());
- break;
- }
- case USEJAVACONTEXT : {
- useJavaContext = attributeAsBoolean(reader, attribute.getLocalName(), true);
- break;
- }
- default :
- break;
- }
- }
-
- while (reader.hasNext())
- {
- switch (reader.nextTag())
- {
- case END_ELEMENT : {
- if (ResourceAdapter.Tag.forName(reader.getLocalName()) == ResourceAdapter.Tag.NOTXCONNECTIONFACTORY)
- {
-
- return new NoTxConnectionFactoryImpl(minPoolSize, maxPoolSize, prefill, userName, password,
- connectionDefinition, configProperties, security, timeOut, validation, poolName, className,
- jndiName, enabled, useJavaContext);
- }
- else
- {
- if (NoTxConnectionFactory.Tag.forName(reader.getLocalName()) == NoTxConnectionFactory.Tag.UNKNOWN)
- {
- throw new ParserException("unexpected end tag" + reader.getLocalName());
- }
- }
- break;
- }
- case START_ELEMENT : {
- switch (NoTxConnectionFactory.Tag.forName(reader.getLocalName()))
- {
- case CONFIGPROPERTY : {
- configProperties.put(attributeAsString(reader, "name"), elementAsString(reader));
- break;
- }
- case CONNECTIONDEFINITION : {
- connectionDefinition = elementAsString(reader);
- break;
- }
- case MAXPOOLSIZE : {
- maxPoolSize = elementAsInteger(reader);
- break;
- }
- case MINPOOLSIZE : {
- minPoolSize = elementAsInteger(reader);
- break;
- }
- case USERNAME : {
- userName = elementAsString(reader);
- break;
- }
- case PASSWORD : {
- password = elementAsString(reader);
- break;
- }
- case PREFILL : {
- prefill = elementAsBoolean(reader);
- break;
- }
- case SECURITY : {
- security = parseSecurity(reader);
- break;
- }
- case TIMEOUT : {
- timeOut = parseTimeOut(reader);
- break;
- }
- case VALIDATION : {
- validation = parseValidation(reader);
- break;
- }
- default :
- throw new ParserException("Unexpected element:" + reader.getLocalName());
- }
- break;
- }
- }
- }
- throw new ParserException("Reached end of xml document unexpectedly");
- }
-
- private Validation parseValidation(XMLStreamReader reader) throws XMLStreamException, ParserException
- {
- Integer allocationRetry = null;
boolean useFastFail = false;
boolean backgroundValidation = false;
+ Long backgroundValidationMinutes = null;
while (reader.hasNext())
{
switch (reader.nextTag())
{
case END_ELEMENT : {
- if (NoTxConnectionFactory.Tag.forName(reader.getLocalName()) == NoTxConnectionFactory.Tag.VALIDATION)
+ if (ConnectionDefinition.Tag.forName(reader.getLocalName()) == ConnectionDefinition.Tag.VALIDATION)
{
- return new ValidationImpl(allocationRetry, backgroundValidation, useFastFail);
+ return new CommonValidationImpl(backgroundValidation, backgroundValidationMinutes, useFastFail);
}
else
{
- if (Validation.Tag.forName(reader.getLocalName()) == Validation.Tag.UNKNOWN)
+ if (CommonValidation.Tag.forName(reader.getLocalName()) == CommonValidation.Tag.UNKNOWN)
{
throw new ParserException("unexpected end tag" + reader.getLocalName());
}
@@ -599,10 +352,10 @@
break;
}
case START_ELEMENT : {
- switch (Validation.Tag.forName(reader.getLocalName()))
+ switch (CommonValidation.Tag.forName(reader.getLocalName()))
{
- case ALLOCATIONRETRY : {
- allocationRetry = elementAsInteger(reader);
+ case BACKGROUNDVALIDATIONMINUTES : {
+ backgroundValidationMinutes = elementAsLong(reader);
break;
}
case BACKGROUNDVALIDATION : {
@@ -623,27 +376,28 @@
throw new ParserException("Reached end of xml document unexpectedly");
}
- private TimeOut parseTimeOut(XMLStreamReader reader) throws XMLStreamException, ParserException
+ private CommonTimeOut parseTimeOut(XMLStreamReader reader) throws XMLStreamException, ParserException
{
Long blockingTimeoutMillis = null;
- Long backgroundValidationMinutes = null;
Long allocationRetryWaitMillis = null;
Long idleTimeoutMinutes = null;
+ Long allocationRetry = null;
+ Long xaResourceTimeout = null;
while (reader.hasNext())
{
switch (reader.nextTag())
{
case END_ELEMENT : {
- if (NoTxConnectionFactory.Tag.forName(reader.getLocalName()) == NoTxConnectionFactory.Tag.TIMEOUT)
+ if (ConnectionDefinition.Tag.forName(reader.getLocalName()) == ConnectionDefinition.Tag.TIMEOUT)
{
- return new TimeOutImpl(blockingTimeoutMillis, idleTimeoutMinutes, allocationRetryWaitMillis,
- backgroundValidationMinutes);
+ return new CommonTimeOutImpl(blockingTimeoutMillis, idleTimeoutMinutes, allocationRetry,
+ allocationRetryWaitMillis, xaResourceTimeout);
}
else
{
- if (TimeOut.Tag.forName(reader.getLocalName()) == TimeOut.Tag.UNKNOWN)
+ if (CommonTimeOut.Tag.forName(reader.getLocalName()) == CommonTimeOut.Tag.UNKNOWN)
{
throw new ParserException("unexpected end tag" + reader.getLocalName());
}
@@ -651,14 +405,14 @@
break;
}
case START_ELEMENT : {
- switch (TimeOut.Tag.forName(reader.getLocalName()))
+ switch (CommonTimeOut.Tag.forName(reader.getLocalName()))
{
case ALLOCATIONRETRYWAITMILLIS : {
allocationRetryWaitMillis = elementAsLong(reader);
break;
}
- case BACKGROUNDVALIDATIONMINUTES : {
- backgroundValidationMinutes = elementAsLong(reader);
+ case ALLOCATIONRETRY : {
+ allocationRetry = elementAsLong(reader);
break;
}
case BLOCKINGTIMEOUTMILLIS : {
@@ -669,50 +423,10 @@
idleTimeoutMinutes = elementAsLong(reader);
break;
}
- default :
- throw new ParserException("Unexpected element:" + reader.getLocalName());
- }
- break;
- }
- }
- }
- throw new ParserException("Reached end of xml document unexpectedly");
- }
-
- private Security parseSecurity(XMLStreamReader reader) throws XMLStreamException, ParserException
- {
- SecurityManager securityManager = null;
- String securityDomain = null;
- while (reader.hasNext())
- {
- switch (reader.nextTag())
- {
- case END_ELEMENT : {
- if (NoTxConnectionFactory.Tag.forName(reader.getLocalName()) == NoTxConnectionFactory.Tag.SECURITY)
- {
-
- return new SecurityImpl(securityManager, securityDomain);
- }
- else
- {
- if (Security.Tag.forName(reader.getLocalName()) == Security.Tag.UNKNOWN)
- {
- throw new ParserException("unexpected end tag" + reader.getLocalName());
- }
- }
- break;
- }
- case START_ELEMENT : {
- switch (Security.Tag.forName(reader.getLocalName()))
- {
- case SECURITYDOMAIN : {
- securityDomain = elementAsString(reader);
+ case XARESOURCETIMEOUT : {
+ xaResourceTimeout = elementAsLong(reader);
break;
}
- case SECURITYMANAGER : {
- securityManager = SecurityManager.valueOf(elementAsString(reader));
- break;
- }
default :
throw new ParserException("Unexpected element:" + reader.getLocalName());
}
@@ -732,6 +446,7 @@
String className = null;
boolean enabled = true;
String jndiName = null;
+ String poolName = null;
for (Attribute attribute : AdminObject.Attribute.values())
{
@@ -753,6 +468,10 @@
useJavaContext = attributeAsBoolean(reader, attribute.getLocalName(), true);
break;
}
+ case POOL_NAME : {
+ poolName = attributeAsString(reader, attribute.getLocalName());
+ break;
+ }
default :
break;
}
@@ -763,10 +482,11 @@
switch (reader.nextTag())
{
case END_ELEMENT : {
- if (ResourceAdapter.Tag.forName(reader.getLocalName()) == ResourceAdapter.Tag.ADMINOBJECT)
+ if (ResourceAdapter.Tag.forName(reader.getLocalName()) == ResourceAdapter.Tag.ADMIN_OBJECT)
{
- return new AdminObjectImpl(configProperties, className, jndiName, enabled, useJavaContext);
+ return new AdminObjectImpl(configProperties, className, jndiName, poolName, enabled,
+ useJavaContext);
}
else
{
@@ -811,7 +531,7 @@
/** jboss-ra tag name
*
*/
- RESOURCE_ADPTER("resource-adapter");
+ RESOURCE_ADPTERS("resource-adapters");
private final String name;
Copied: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/resourceadapter/ResourceAdaptersImpl.java (from rev 108002, projects/jboss-jca/trunk/common/src/test/java/org/jboss/jca/common/metadata/resourceadapter/ResourceAdapterParserTestCase.java)
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/resourceadapter/ResourceAdaptersImpl.java (rev 0)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/resourceadapter/ResourceAdaptersImpl.java 2010-09-07 13:31:40 UTC (rev 108006)
@@ -0,0 +1,76 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.common.metadata.resourceadapter;
+
+import org.jboss.jca.common.api.metadata.resourceadapter.ResourceAdapter;
+import org.jboss.jca.common.api.metadata.resourceadapter.ResourceAdapters;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ *
+ * A ResourceAdaptersImpl.
+ *
+ * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
+ *
+ */
+public class ResourceAdaptersImpl implements ResourceAdapters
+{
+
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 4852619088689662467L;
+ private final ArrayList<ResourceAdapter> resourceAdapters;
+
+ /**
+ * Create a new ResopurceAdaptersImpl.
+ *
+ * @param resourceAdapters resourceAdapters
+ */
+ public ResourceAdaptersImpl(List<ResourceAdapter> resourceAdapters)
+ {
+ super();
+ if (resourceAdapters != null)
+ {
+ this.resourceAdapters = new ArrayList<ResourceAdapter>(resourceAdapters.size());
+ this.resourceAdapters.addAll(resourceAdapters);
+ }
+ else
+ {
+ this.resourceAdapters = new ArrayList<ResourceAdapter>(0);
+ }
+ }
+
+ /**
+ * Get the resourceAdapters.
+ *
+ * @return the resourceAdapters.
+ */
+ @Override
+ public final List<ResourceAdapter> getResourceAdapters()
+ {
+ return Collections.unmodifiableList(resourceAdapters);
+ }
+
+}
+
Deleted: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/resourceadapter/SecurityImpl.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/resourceadapter/SecurityImpl.java 2010-09-07 12:50:36 UTC (rev 108005)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/resourceadapter/SecurityImpl.java 2010-09-07 13:31:40 UTC (rev 108006)
@@ -1,117 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.jca.common.metadata.resourceadapter;
-
-import org.jboss.jca.common.api.metadata.common.SecurityManager;
-import org.jboss.jca.common.api.metadata.resourceadapter.Security;
-
-/**
- *
- * A SecurityImpl.
- *
- * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
- *
- */
-public class SecurityImpl implements Security
-{
-
- /** The serialVersionUID */
- private static final long serialVersionUID = 1792878989502127046L;
-
- private final SecurityManager securityManager;
-
- private final String securityDomain;
-
- /**
- * Create a new SecurityImpl.
- *
- * @param securityManager securityManager
- * @param securityDomain securityDomain
- */
- public SecurityImpl(SecurityManager securityManager, String securityDomain)
- {
- super();
- this.securityManager = securityManager;
- this.securityDomain = securityDomain;
- }
-
- /**
- * Get the securityManager.
- *
- * @return the securityManager.
- */
- @Override
- public final SecurityManager getSecurityManager()
- {
- return securityManager;
- }
-
- /**
- * Get the securityDomain.
- *
- * @return the securityDomain.
- */
- @Override
- public final String getSecurityDomain()
- {
- return securityDomain;
- }
-
- @Override
- public int hashCode()
- {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((securityDomain == null) ? 0 : securityDomain.hashCode());
- result = prime * result + ((securityManager == null) ? 0 : securityManager.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj)
- {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (!(obj instanceof SecurityImpl))
- return false;
- SecurityImpl other = (SecurityImpl) obj;
- if (securityDomain == null)
- {
- if (other.securityDomain != null)
- return false;
- }
- else if (!securityDomain.equals(other.securityDomain))
- return false;
- if (securityManager != other.securityManager)
- return false;
- return true;
- }
-
- @Override
- public String toString()
- {
- return "SecurityImpl [securityManager=" + securityManager + ", securityDomain=" + securityDomain + "]";
- }
-}
-
Deleted: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/resourceadapter/TimeOutImpl.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/resourceadapter/TimeOutImpl.java 2010-09-07 12:50:36 UTC (rev 108005)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/resourceadapter/TimeOutImpl.java 2010-09-07 13:31:40 UTC (rev 108006)
@@ -1,170 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.jca.common.metadata.resourceadapter;
-
-import org.jboss.jca.common.api.metadata.resourceadapter.TimeOut;
-
-/**
- *
- * A TimeOutImpl.
- *
- * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
- *
- */
-public class TimeOutImpl implements TimeOut
-{
-
- /** The serialVersionUID */
- private static final long serialVersionUID = -4482517387845540925L;
-
- private final Long blockingTimeoutMillis;
-
- private final Long idleTimeoutMinutes;
-
- private final Long allocationRetryWaitMillis;
-
- private final Long backgroundValidationMinutes;
-
- /**
- * Create a new TimeOutImpl.
- *
- * @param blockingTimeoutMillis blockingTimeoutMillis
- * @param idleTimeoutMinutes idleTimeoutMinutes
- * @param allocationRetryWaitMillis allocationRetryWaitMillis
- * @param backgroundValidationMinutes backgroundValidationMinutes
- */
- public TimeOutImpl(Long blockingTimeoutMillis, Long idleTimeoutMinutes, Long allocationRetryWaitMillis,
- Long backgroundValidationMinutes)
- {
- super();
- this.blockingTimeoutMillis = blockingTimeoutMillis;
- this.idleTimeoutMinutes = idleTimeoutMinutes;
- this.allocationRetryWaitMillis = allocationRetryWaitMillis;
- this.backgroundValidationMinutes = backgroundValidationMinutes;
- }
-
- /**
- * Get the blockingTimeoutMillis.
- *
- * @return the blockingTimeoutMillis.
- */
- @Override
- public final Long getBlockingTimeoutMillis()
- {
- return blockingTimeoutMillis;
- }
-
- /**
- * Get the idleTimeoutMinutes.
- *
- * @return the idleTimeoutMinutes.
- */
- @Override
- public final Long getIdleTimeoutMinutes()
- {
- return idleTimeoutMinutes;
- }
-
- /**
- * Get the allocationRetryWaitMillis.
- *
- * @return the allocationRetryWaitMillis.
- */
- @Override
- public final Long getAllocationRetryWaitMillis()
- {
- return allocationRetryWaitMillis;
- }
-
- /**
- * Get the backgroundValidationMinutes.
- *
- * @return the backgroundValidationMinutes.
- */
- @Override
- public final Long getBackgroundValidationMinutes()
- {
- return backgroundValidationMinutes;
- }
-
- @Override
- public int hashCode()
- {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((allocationRetryWaitMillis == null) ? 0 : allocationRetryWaitMillis.hashCode());
- result = prime * result + ((backgroundValidationMinutes == null) ? 0 : backgroundValidationMinutes.hashCode());
- result = prime * result + ((blockingTimeoutMillis == null) ? 0 : blockingTimeoutMillis.hashCode());
- result = prime * result + ((idleTimeoutMinutes == null) ? 0 : idleTimeoutMinutes.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj)
- {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (!(obj instanceof TimeOutImpl))
- return false;
- TimeOutImpl other = (TimeOutImpl) obj;
- if (allocationRetryWaitMillis == null)
- {
- if (other.allocationRetryWaitMillis != null)
- return false;
- }
- else if (!allocationRetryWaitMillis.equals(other.allocationRetryWaitMillis))
- return false;
- if (backgroundValidationMinutes == null)
- {
- if (other.backgroundValidationMinutes != null)
- return false;
- }
- else if (!backgroundValidationMinutes.equals(other.backgroundValidationMinutes))
- return false;
- if (blockingTimeoutMillis == null)
- {
- if (other.blockingTimeoutMillis != null)
- return false;
- }
- else if (!blockingTimeoutMillis.equals(other.blockingTimeoutMillis))
- return false;
- if (idleTimeoutMinutes == null)
- {
- if (other.idleTimeoutMinutes != null)
- return false;
- }
- else if (!idleTimeoutMinutes.equals(other.idleTimeoutMinutes))
- return false;
- return true;
- }
-
- @Override
- public String toString()
- {
- return "TimeOutImpl [blockingTimeoutMillis=" + blockingTimeoutMillis + ", idleTimeoutMinutes="
- + idleTimeoutMinutes + ", allocationRetryWaitMillis=" + allocationRetryWaitMillis
- + ", backgroundValidationMinutes=" + backgroundValidationMinutes + "]";
- }
-}
-
Deleted: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/resourceadapter/ValidationImpl.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/resourceadapter/ValidationImpl.java 2010-09-07 12:50:36 UTC (rev 108005)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/resourceadapter/ValidationImpl.java 2010-09-07 13:31:40 UTC (rev 108006)
@@ -1,135 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.jca.common.metadata.resourceadapter;
-
-import org.jboss.jca.common.api.metadata.resourceadapter.Validation;
-
-/**
- *
- * A ValidationImpl.
- *
- * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
- *
- */
-public class ValidationImpl implements Validation
-{
- /** The serialVersionUID */
- private static final long serialVersionUID = 2178081632626071094L;
-
- private final Integer allocationRetry;
-
- private final boolean backgroundValidation;
-
- private final boolean useFastFail;
-
- /**
- * Create a new ValidationImpl.
- *
- * @param allocationRetry allocationRetry
- * @param backgroundValidation backgroundValidation
- * @param useFastFail useFastFail
- */
- public ValidationImpl(Integer allocationRetry, boolean backgroundValidation, boolean useFastFail)
- {
- super();
- this.allocationRetry = allocationRetry;
- this.backgroundValidation = backgroundValidation;
- this.useFastFail = useFastFail;
- }
-
- /**
- * Get the allocationRetry.
- *
- * @return the allocationRetry.
- */
- @Override
- public final Integer getAllocationRetry()
- {
- return allocationRetry;
- }
-
- /**
- * Get the backgroundValidation.
- *
- * @return the backgroundValidation.
- */
- @Override
- public final boolean isBackgroundValidation()
- {
- return backgroundValidation;
- }
-
- /**
- * Get the useFastFail.
- *
- * @return the useFastFail.
- */
- @Override
- public final boolean isUseFastFail()
- {
- return useFastFail;
- }
-
- @Override
- public int hashCode()
- {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((allocationRetry == null) ? 0 : allocationRetry.hashCode());
- result = prime * result + (backgroundValidation ? 1231 : 1237);
- result = prime * result + (useFastFail ? 1231 : 1237);
- return result;
- }
-
- @Override
- public boolean equals(Object obj)
- {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (!(obj instanceof ValidationImpl))
- return false;
- ValidationImpl other = (ValidationImpl) obj;
- if (allocationRetry == null)
- {
- if (other.allocationRetry != null)
- return false;
- }
- else if (!allocationRetry.equals(other.allocationRetry))
- return false;
- if (backgroundValidation != other.backgroundValidation)
- return false;
- if (useFastFail != other.useFastFail)
- return false;
- return true;
- }
-
- @Override
- public String toString()
- {
- return "ValidationImpl [allocationRetry=" + allocationRetry + ", backgroundValidation=" + backgroundValidation
- + ", useFastFail=" + useFastFail + "]";
- }
-
-}
-
Deleted: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/resourceadapter/XaTxConnectionFactoryImpl.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/resourceadapter/XaTxConnectionFactoryImpl.java 2010-09-07 12:50:36 UTC (rev 108005)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/resourceadapter/XaTxConnectionFactoryImpl.java 2010-09-07 13:31:40 UTC (rev 108006)
@@ -1,129 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.jca.common.metadata.resourceadapter;
-
-import org.jboss.jca.common.api.metadata.resourceadapter.Security;
-import org.jboss.jca.common.api.metadata.resourceadapter.TimeOut;
-import org.jboss.jca.common.api.metadata.resourceadapter.Validation;
-import org.jboss.jca.common.api.metadata.resourceadapter.XaTxConnectionFactory;
-
-import java.util.Map;
-
-/**
- *
- * A XaTxConnectionFactoryImpl.
- *
- * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
- *
- */
-public class XaTxConnectionFactoryImpl extends LocalTxConnectionFactoryImpl implements XaTxConnectionFactory
-{
- /** The serialVersionUID */
- private static final long serialVersionUID = 8211429129210108351L;
-
- private final Long xaResourceTimeout;
-
- /**
- * Create a new XaTxConnectionFactoryImpl.
- *
- * @param minPoolSize minPoolSize
- * @param maxPoolSize maxPoolSize
- * @param prefill prefill
- * @param userName userName
- * @param password password
- * @param connectionDefinition connectionDefinition
- * @param configProperties configProperty
- * @param security security
- * @param timeOut timeOut
- * @param validation validation
- * @param poolName poolName
- * @param className className
- * @param jndiName jndiName
- * @param enabled enabled
- * @param useJavaContext useJavaContext
- * @param noTxSeparatePools noTxSeparatePools
- * @param trackConnectionByTx trackConnectionByTx
- * @param xaResourceTimeout xaResourceTimeout
- */
- public XaTxConnectionFactoryImpl(Integer minPoolSize, Integer maxPoolSize, boolean prefill, String userName,
- String password, String connectionDefinition, Map<String, String> configProperties, Security security,
- TimeOut timeOut, Validation validation, String poolName, String className, String jndiName, boolean enabled,
- boolean useJavaContext, boolean noTxSeparatePools, boolean trackConnectionByTx, Long xaResourceTimeout)
- {
- super(minPoolSize, maxPoolSize, prefill, userName, password, connectionDefinition, configProperties, security,
- timeOut, validation, poolName, className, jndiName, enabled, useJavaContext, noTxSeparatePools,
- trackConnectionByTx);
- this.xaResourceTimeout = xaResourceTimeout;
- }
-
- /**
- * Get the xaResourceTimeout.
- *
- * @return the xaResourceTimeout.
- */
- @Override
- public final Long getXaResourceTimeout()
- {
- return xaResourceTimeout;
- }
-
- @Override
- public int hashCode()
- {
- final int prime = 31;
- int result = super.hashCode();
- result = prime * result + ((xaResourceTimeout == null) ? 0 : xaResourceTimeout.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj)
- {
- if (this == obj)
- return true;
- if (!super.equals(obj))
- return false;
- if (!(obj instanceof XaTxConnectionFactoryImpl))
- return false;
- XaTxConnectionFactoryImpl other = (XaTxConnectionFactoryImpl) obj;
- if (xaResourceTimeout == null)
- {
- if (other.xaResourceTimeout != null)
- return false;
- }
- else if (!xaResourceTimeout.equals(other.xaResourceTimeout))
- return false;
- return true;
- }
-
- @Override
- public String toString()
- {
- return "XaTxConnectionFactoryImpl [xaResourceTimeout=" + xaResourceTimeout + ", minPoolSize=" + minPoolSize
- + ", maxPoolSize=" + maxPoolSize + ", prefill=" + prefill + ", userName=" + userName + ", password="
- + password + ", connectionDefinition=" + connectionDefinition + ", configProperties=" + configProperties
- + ", security=" + security + ", timeOut=" + timeOut + ", validation=" + validation + ", poolName="
- + poolName + ", className=" + className + ", jndiName=" + jndiName + ", enabled=" + enabled
- + ", useJavaContext=" + useJavaContext + "]";
- }
-}
-
Modified: projects/jboss-jca/trunk/common/src/main/resources/schema/datasources_1_0.xsd
===================================================================
--- projects/jboss-jca/trunk/common/src/main/resources/schema/datasources_1_0.xsd 2010-09-07 12:50:36 UTC (rev 108005)
+++ projects/jboss-jca/trunk/common/src/main/resources/schema/datasources_1_0.xsd 2010-09-07 13:31:40 UTC (rev 108006)
@@ -113,7 +113,7 @@
</xs:documentation>
</xs:annotation>
</xs:element>
- <xs:element name="security" type="xs:string" minOccurs="0">
+ <xs:element name="security" type="securityType" minOccurs="0">
<xs:annotation>
<xs:documentation>
<![CDATA[[
@@ -233,7 +233,7 @@
</xs:documentation>
</xs:annotation>
</xs:element>
- <xs:element name="security" type="xs:string" minOccurs="0">
+ <xs:element name="security" type="securityType" minOccurs="0">
<xs:annotation>
<xs:documentation>
<![CDATA[[
@@ -681,4 +681,27 @@
</xs:extension>
</xs:complexContent>
</xs:complexType>
+ <xs:complexType name="securityType">
+ <xs:sequence>
+ <xs:element name="user-name" type="xs:token" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation>
+ <![CDATA[[
+ Specify the default username used when creating a new connection.
+ Ex: <user-name>sa</user-name>
+ ]]>
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="password" type="xs:token" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation>
+ <![CDATA[[
+ Specify the default password used when creating a new connection.
+ Ex: <password>sa-pass</password>]]>
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
</xs:schema>
Modified: projects/jboss-jca/trunk/common/src/main/resources/schema/resource-adapter_1_0.xsd
===================================================================
--- projects/jboss-jca/trunk/common/src/main/resources/schema/resource-adapter_1_0.xsd 2010-09-07 12:50:36 UTC (rev 108005)
+++ projects/jboss-jca/trunk/common/src/main/resources/schema/resource-adapter_1_0.xsd 2010-09-07 13:31:40 UTC (rev 108006)
@@ -1,87 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
- <xs:complexType name="local-tx-connection-factoryType">
- <xs:complexContent>
- <xs:extension base="no-tx-connection-factoryType">
- <xs:sequence>
- <xs:element name="no-tx-separate-pools" type="boolean-presenceType" maxOccurs="1" minOccurs="0">
- <xs:annotation>
- <xs:documentation>
- <![CDATA[[
- Whether to use separete pools for connection retrieved in a transaction
- and those retieved outside a transaction e.g. <no-tx-separate-pools/>
- ]]>
- </xs:documentation>
- </xs:annotation>
- </xs:element>
- <xs:element name="track-connection-by-tx" type="boolean-presenceType" maxOccurs="1" minOccurs="0"></xs:element>
- </xs:sequence>
+ <xs:complexType name="boolean-presenceType"></xs:complexType>
+ <xs:complexType name="config-propertyType" mixed="true">
+ <xs:simpleContent>
+ <xs:extension base="xs:token">
+ <xs:attribute use="required" name="name" type="xs:token"></xs:attribute>
</xs:extension>
- </xs:complexContent>
+ </xs:simpleContent>
</xs:complexType>
- <xs:complexType name="no-tx-connection-factoryType">
+
+ <xs:complexType name="resource-adapterType">
<xs:sequence>
- <xs:element name="min-pool-size" type="xs:nonNegativeInteger" minOccurs="0" maxOccurs="1">
- <xs:annotation>
- <xs:documentation>
- <![CDATA[[
- The min-pool-size element indicates the minimum number of connections
- a pool should hold. These are not created until a Subject is known from a
- request for a connection. This default to 0. Ex: <min-pool-size>1</min-pool-size>
- ]]>
- </xs:documentation>
- </xs:annotation>
- </xs:element>
- <xs:element name="max-pool-size" type="xs:nonNegativeInteger" minOccurs="0" maxOccurs="1">
- <xs:annotation>
- <xs:documentation>
- <![CDATA[[
- The max-pool-size element indicates the maximum number of connections
- for a pool. No more than MaxSize connections will be created in each sub-pool.
- This defaults to 20.
- ]]>
- </xs:documentation>
- </xs:annotation>
- </xs:element>
- <xs:element name="prefill" type="xs:boolean" minOccurs="0">
- <xs:annotation>
- <xs:documentation>
- <![CDATA[[
- Whether to attempt to prefill the connection pool. Empty element denotes
- a false value. e.g. <prefill>true</prefill>
- ]]>
- </xs:documentation>
- </xs:annotation>
- </xs:element>
- <xs:element name="user-name" type="xs:token" minOccurs="0">
- <xs:annotation>
- <xs:documentation>
- <![CDATA[[
- Specify the default username used when creating a new connection.
- Ex: <user-name>sa</user-name>
- ]]>
- </xs:documentation>
- </xs:annotation>
- </xs:element>
- <xs:element name="password" type="xs:token" minOccurs="0">
- <xs:annotation>
- <xs:documentation>
- <![CDATA[[
- Specify the default password used when creating a new connection.
- Ex: <password>sa-pass</password>]]>
- </xs:documentation>
- </xs:annotation>
- </xs:element>
- <xs:element name="connection-definition" type="xs:token" minOccurs="0">
- <xs:annotation>
- <xs:documentation>
- <![CDATA[[
- The connection definition inside the rar deployment uniquely identified
- by the connection factory interface, e.g. javax.sql.DataSource
- ]]>
- </xs:documentation>
- </xs:annotation>
- </xs:element>
+ <xs:element name="archive" type="xs:token" minOccurs="1" maxOccurs="1"></xs:element>
<xs:element name="config-property" type="config-propertyType" minOccurs="0" maxOccurs="unbounded">
<xs:annotation>
<xs:documentation>
@@ -91,115 +21,10 @@
</xs:documentation>
</xs:annotation>
</xs:element>
- <xs:element name="security" type="securityType" minOccurs="1"></xs:element>
- <xs:element name="time-out" type="time-outType" minOccurs="0" maxOccurs="1"></xs:element>
- <xs:element name="validation" type="validationType" minOccurs="0" maxOccurs="1"></xs:element>
- </xs:sequence>
- <xs:attributeGroup ref="common-attribute"></xs:attributeGroup>
- <xs:attribute name="pool-name" type="xs:token"></xs:attribute>
- </xs:complexType>
- <xs:complexType name="boolean-presenceType"></xs:complexType>
- <xs:complexType name="config-propertyType" mixed="true">
- <xs:attribute use="required" name="name" type="xs:token">
- </xs:attribute>
- </xs:complexType>
- <xs:complexType name="securityType">
- <xs:sequence>
- <xs:element name="security-manager" type="security-managerType" minOccurs="0">
- <xs:annotation>
- <xs:documentation>
- <![CDATA[[
- Possible value are:
- * APPLICATION: Indicates that app supplied parameters (such as from getConnection(user,
- pw)) are used to distinguish connections in the pool.
- * DOMAIN: Indicates Subject (from security domain) are used to distinguish connections
- in the pool. The content is the security-domain is the name of the JAAS security
- manager that will handle authentication.
- * APPLICATION-AND-DOMAIN: Indicates that either app supplied parameters (such as from getConnection(user,
- pw)) or Subject (from security domain) are used to distinguish connections
- in the pool. The content is the security-domain is the name of the JAAS security
- manager that will handle authentication.
- * NONE: user/password provided in datasource definition are used.
- ]]>
- </xs:documentation>
- </xs:annotation>
- </xs:element>
- <xs:element name="security-domain" type="xs:token" minOccurs="0">
- <xs:annotation>
- <xs:documentation>
- <![CDATA[[
- The content of the security-domain is the name of the JAAS security
- manager that will handle authentication. This name correlates to the JAAS
- login-config.xml descriptor application-policy/name attribute.
- Ex: <security-domain>HsqlDbRealm</security-domain>
- used for DOMAIN and APPLICATION-AND-DOMAIN security manager
- ]]>
- </xs:documentation>
- </xs:annotation>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- <xs:simpleType name="security-managerType">
- <xs:annotation>
- <xs:documentation> Define constants used as the possible security manager in security-settings_type. See there for
- complete documentation Include: APPLICATION DOMAIN APPLICATION_AND_DOMAIN NONE</xs:documentation>
- </xs:annotation>
- <xs:restriction base="xs:token">
- <xs:enumeration value="APPLICATION" />
- <xs:enumeration value="DOMAIN" />
- <xs:enumeration value="APPLICATION_AND_DOMAIN" />
- <xs:enumeration value="NONE" />
- </xs:restriction>
- </xs:simpleType>
- <xs:element name="resource-adapter" type="resource-adapterType"></xs:element>
- <xs:complexType name="resource-adapterType">
- <xs:sequence>
- <xs:element name="archive" type="xs:token" minOccurs="1" maxOccurs="1"></xs:element>
<xs:element name="transaction-support" type="transaction-supportType" minOccurs="0"></xs:element>
- <xs:choice minOccurs="0" maxOccurs="unbounded">
- <xs:element name="no-tx-connection-factory" type="no-tx-connection-factoryType">
- <xs:annotation>
- <xs:documentation>
- <![CDATA[[
- The no-tx-connection-factory element is used to configure generic
- resource adapters that do not support transactions
- ]]>
- </xs:documentation>
- </xs:annotation>
- </xs:element>
- <xs:element name="local-tx-connection-factory" type="local-tx-connection-factoryType">
- <xs:annotation>
- <xs:documentation>
- <![CDATA[[
- The tx-connection-factory element is used to configure generic resource
- adapters supporting transactions
- ]]>
- </xs:documentation>
- </xs:annotation>
- </xs:element>
- <xs:element name="xa-tx-connection-factory" type="xa-tx-connection-factoryType"></xs:element>
- </xs:choice>
- <xs:element name="admin-object" type="admin-objectType" minOccurs="0" maxOccurs="unbounded"></xs:element>
- </xs:sequence>
- </xs:complexType>
- <xs:complexType name="xa-tx-connection-factoryType">
- <xs:complexContent>
- <xs:extension base="local-tx-connection-factoryType">
- <xs:sequence>
- <xs:element name="xa-resource-timeout" type="xs:nonNegativeInteger" minOccurs="0" maxOccurs="1">
- <xs:annotation>
- <xs:documentation><![CDATA[[
- EXPRESSED IN SECONDS
- Passed to XAResource.setTransactionTimeout()
- Default is zero which does not invoke the setter
- e.g. 5 minutes
- <xa-resource-timeout>300</xa-resource-timeout>]]>
- </xs:documentation>
- </xs:annotation>
- </xs:element>
+ <xs:element name="connection-definitions" type="connection-definitionsType" minOccurs="0" maxOccurs="1"></xs:element>
+ <xs:element name="admin-objects" type="admin-objectsType" minOccurs="0" maxOccurs="1"></xs:element>
</xs:sequence>
- </xs:extension>
- </xs:complexContent>
</xs:complexType>
<xs:simpleType name="transaction-supportType">
<xs:annotation>
@@ -213,13 +38,13 @@
</xs:restriction>
</xs:simpleType>
<xs:attributeGroup name="common-attribute">
- <xs:attribute name="class-name" type="xs:token" use="required"></xs:attribute>
+ <xs:attribute name="class-name" type="xs:token" use="optional"></xs:attribute>
<xs:attribute name="jndi-name" type="xs:token" use="required" />
<xs:attribute name="enabled" type="xs:boolean" default="true" form="unqualified" use="optional" />
<xs:attribute default="false" name="use-java-context" type="xs:boolean">
<xs:annotation>
<xs:documentation>
- <![CDATA[[
+ <![CDATA[[
Setting this to false will bind the DataSource into global jndi
Ex:
<use-java-context>false</use-java-context>
@@ -227,6 +52,7 @@
</xs:documentation>
</xs:annotation>
</xs:attribute>
+ <xs:attribute name="pool-name" type="xs:token" use="optional"></xs:attribute>
</xs:attributeGroup>
<xs:complexType name="admin-objectType">
<xs:sequence>
@@ -261,6 +87,17 @@
</xs:documentation>
</xs:annotation>
</xs:element>
+ <xs:element name="allocation-retry" type="xs:nonNegativeInteger" minOccurs="0" maxOccurs="1">
+ <xs:annotation>
+ <xs:documentation>
+ <![CDATA[[
+ The allocation retry element indicates the number of times that allocating
+ a connection should be tried before throwing an exception. The default is
+ 0.
+ ]]>
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
<xs:element name="allocation-retry-wait-millis" type="xs:nonNegativeInteger" minOccurs="0" maxOccurs="1">
<xs:annotation>
<xs:documentation>
@@ -272,6 +109,31 @@
</xs:documentation>
</xs:annotation>
</xs:element>
+ <xs:element name="xa-resource-timeout" type="xs:nonNegativeInteger" minOccurs="0" maxOccurs="1">
+ <xs:annotation>
+ <xs:documentation><![CDATA[[
+ EXPRESSED IN SECONDS
+ Passed to XAResource.setTransactionTimeout()
+ Default is zero which does not invoke the setter
+ e.g. 5 minutes
+ <xa-resource-timeout>300</xa-resource-timeout>]]>
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="validationType">
+ <xs:sequence>
+ <xs:element name="background-validation" type="xs:boolean" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation>
+ <![CDATA[[
+ An element to specify that connections should be validated on a background
+ thread versus being validated prior to use
+ ]]>
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
<xs:element name="background-validation-minutes" type="xs:nonNegativeInteger" minOccurs="0">
<xs:annotation>
<xs:documentation>
@@ -282,42 +144,124 @@
</xs:documentation>
</xs:annotation>
</xs:element>
+ <xs:element name="use-fast-fail" type="xs:boolean" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation>
+ <![CDATA[[
+ Whether fail a connection allocation on the first connection if it
+ is invalid (true) or keep trying until the pool is exhausted of all potential
+ connections (false) default false. e.g. <use-fast-fail>true</use-fast-fail>
+ ]]>
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:element name="resource-adapters" type="resource-adaptersType"></xs:element>
+ <xs:complexType name="resource-adaptersType">
+ <xs:sequence>
+ <xs:element name="resource-adapter" type="resource-adapterType" minOccurs="1" maxOccurs="unbounded"></xs:element>
</xs:sequence>
</xs:complexType>
- <xs:complexType name="validationType">
+
+ <xs:complexType name="connection-definitionsType">
<xs:sequence>
- <xs:element name="allocation-retry" type="xs:nonNegativeInteger" minOccurs="0" maxOccurs="1">
+ <xs:element name="connection-definition" type="connection-defintionType" minOccurs="1" maxOccurs="unbounded"></xs:element>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="connection-defintionType">
+ <xs:sequence>
+ <xs:element name="config-property" type="config-propertyType" minOccurs="0" maxOccurs="unbounded"></xs:element>
+ <xs:element name="no-tx-separate-pools" type="boolean-presenceType" minOccurs="0" maxOccurs="1">
<xs:annotation>
<xs:documentation>
<![CDATA[[
- The allocation retry element indicates the number of times that allocating
- a connection should be tried before throwing an exception. The default is
- 0.
+ Whether to use separete pools for connection retrieved in a transaction
+ and those retieved outside a transaction e.g. <no-tx-separate-pools/>
]]>
</xs:documentation>
</xs:annotation>
</xs:element>
- <xs:element name="background-validation" type="xs:boolean" minOccurs="0">
+ <xs:element name="pool" type="poolType" minOccurs="0" maxOccurs="1"></xs:element>
+ <xs:element name="security" type="securityType" minOccurs="0" maxOccurs="1"></xs:element>
+ <xs:element name="timeout" type="time-outType" minOccurs="0" maxOccurs="1"></xs:element>
+ <xs:element name="vaidation" type="validationType" minOccurs="0" maxOccurs="1"></xs:element>
+ </xs:sequence>
+ <xs:attributeGroup ref="common-attribute"></xs:attributeGroup>
+ </xs:complexType>
+ <xs:complexType name="poolType">
+ <xs:sequence>
+ <xs:element name="min-pool-size" type="xs:nonNegativeInteger" minOccurs="0">
<xs:annotation>
<xs:documentation>
<![CDATA[[
- An element to specify that connections should be validated on a background
- thread versus being validated prior to use
- ]]>
+ The min-pool-size element indicates the minimum number of connections
+ a pool should hold. These are not created until a Subject is known from a
+ request for a connection. This default to 0. Ex: <min-pool-size>1</min-pool-size>
+ ]]>
</xs:documentation>
</xs:annotation>
</xs:element>
- <xs:element name="use-fast-fail" type="xs:boolean" minOccurs="0">
+ <xs:element name="max-pool-size" type="xs:nonNegativeInteger" minOccurs="0">
<xs:annotation>
<xs:documentation>
<![CDATA[[
- Whether fail a connection allocation on the first connection if it
- is invalid (true) or keep trying until the pool is exhausted of all potential
- connections (false) default false. e.g. <use-fast-fail>true</use-fast-fail>
+ The max-pool-size element indicates the maximum number of connections
+ for a pool. No more than MaxSize connections will be created in each sub-pool.
+ This defaults to 20.
+ ]]>
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="prefill" type="xs:boolean" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation>
+ <![CDATA[[
+ Whether to attempt to prefill the connection pool. Empty element denotes
+ a true value. e.g. <prefill>true</prefill>.
+ Default is true
+ ]]>
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="use-strict-min" type="xs:boolean" minOccurs="0" maxOccurs="1">
+ <xs:annotation>
+ <xs:documentation>
+ <![CDATA[[
+ Define if the min-pool-size should be considered a strictly.
+ Default false
+ ]]>
+ </xs:documentation>
+ </xs:annotation></xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="securityType">
+ <xs:sequence>
+ <xs:element name="user-name" type="xs:token" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation>
+ <![CDATA[[
+ Specify the default username used when creating a new connection.
+ Ex: <user-name>sa</user-name>
]]>
</xs:documentation>
</xs:annotation>
</xs:element>
+ <xs:element name="password" type="xs:token" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation>
+ <![CDATA[[
+ Specify the default password used when creating a new connection.
+ Ex: <password>sa-pass</password>]]>
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
</xs:sequence>
</xs:complexType>
+
+ <xs:complexType name="admin-objectsType">
+ <xs:sequence><xs:element name="admin-object" type="admin-objectType" minOccurs="0" maxOccurs="unbounded"></xs:element></xs:sequence>
+ </xs:complexType>
</xs:schema>
\ No newline at end of file
Modified: projects/jboss-jca/trunk/common/src/test/java/org/jboss/jca/common/metadata/resourceadapter/ResourceAdapterParserTestCase.java
===================================================================
--- projects/jboss-jca/trunk/common/src/test/java/org/jboss/jca/common/metadata/resourceadapter/ResourceAdapterParserTestCase.java 2010-09-07 12:50:36 UTC (rev 108005)
+++ projects/jboss-jca/trunk/common/src/test/java/org/jboss/jca/common/metadata/resourceadapter/ResourceAdapterParserTestCase.java 2010-09-07 13:31:40 UTC (rev 108006)
@@ -21,7 +21,7 @@
*/
package org.jboss.jca.common.metadata.resourceadapter;
-import org.jboss.jca.common.api.metadata.resourceadapter.ResourceAdapter;
+import org.jboss.jca.common.api.metadata.resourceadapter.ResourceAdapters;
import java.io.File;
import java.io.FileInputStream;
@@ -61,9 +61,9 @@
is = new FileInputStream(xmlFile);
ResourceAdapterParser parser = new ResourceAdapterParser();
//when
- ResourceAdapter ra = parser.parse(is);
+ ResourceAdapters ra = parser.parse(is);
//then
- assertThat(ra.getConnectionFactories().size() >= 1, is(true));
+ assertThat(ra.getResourceAdapters().size() >= 1, is(true));
}
finally
Modified: projects/jboss-jca/trunk/common/src/test/resources/resource-adapter/asapxcess-jb3.2-ds.xml
===================================================================
--- projects/jboss-jca/trunk/common/src/test/resources/resource-adapter/asapxcess-jb3.2-ds.xml 2010-09-07 12:50:36 UTC (rev 108005)
+++ projects/jboss-jca/trunk/common/src/test/resources/resource-adapter/asapxcess-jb3.2-ds.xml 2010-09-07 13:31:40 UTC (rev 108006)
@@ -5,41 +5,48 @@
<!-- Contact: aif_support at asapsolutions.com -->
<!-- -->
<!-- ==================================================================== -->
-<resource-adapter xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../main/resources/schema/resource-adapter_1_0.xsd">
- <archive>token</archive>
- <transaction-support>NoTransaction</transaction-support>
- <local-tx-connection-factory class-name="token" enabled="true" jndi-name="aSAPXcess"
- pool-name="aSAPXcess">
- <min-pool-size>0</min-pool-size>
- <max-pool-size>64</max-pool-size>
- <config-property name="LogConfigFile" >ASAP_SAP_1_0.xml</config-property>
- <config-property name="RootLogContext" >ASAP_SAP_1_0</config-property>
- <config-property name="LogLevel" >WARN</config-property>
- <config-property name="MessageBundleBase" >ASAP_SAP_1_0</config-property>
- <config-property name="LanguageCode" >en</config-property>
- <config-property name="CountryCode" >US</config-property>
- <config-property name="UserName" ></config-property>
- <config-property name="Password" ></config-property>
- <config-property name="ClientNumber" ></config-property>
- <config-property name="ServerName" ></config-property>
- <config-property name="SystemNumber" ></config-property>
- <config-property name="GatewayServerName" ></config-property>
- <config-property name="GatewayServiceNumber" ></config-property>
- <config-property name="SystemName" ></config-property>
- <config-property name="MessageServerName" ></config-property>
- <config-property name="GroupName" ></config-property>
- <config-property name="ConnectionURL" ></config-property>
- <security>
- <security-manager>APPLICATION</security-manager>
- <!-- If you supply the usr/pw from a JAAS login module -->
- <security-domain>MySecurityDomain</security-domain>
- </security>
- <time-out>
- <blocking-timeout-millis>5000</blocking-timeout-millis>
- <idle-timeout-minutes>15</idle-timeout-minutes>
- </time-out>
- </local-tx-connection-factory>
- <admin-object class-name="token" enabled="true" jndi-name="token" use-java-context="false">
- <config-property name="token" />
- </admin-object>
-</resource-adapter>
+<resource-adapters xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="../../../main/resources/schema/resource-adapter_1_0.xsd">
+ <resource-adapter>
+ <archive>token</archive>
+ <transaction-support>NoTransaction</transaction-support>
+ <connection-definitions>
+ <connection-definition class-name="token" enabled="true" jndi-name="aSAPXcess" pool-name="aSAPXcess">
+ <config-property name="LogConfigFile">ASAP_SAP_1_0.xml</config-property>
+ <config-property name="RootLogContext">ASAP_SAP_1_0</config-property>
+ <config-property name="LogLevel">WARN</config-property>
+ <config-property name="MessageBundleBase">ASAP_SAP_1_0</config-property>
+ <config-property name="LanguageCode">en</config-property>
+ <config-property name="CountryCode">US</config-property>
+ <config-property name="UserName"></config-property>
+ <config-property name="Password"></config-property>
+ <config-property name="ClientNumber"></config-property>
+ <config-property name="ServerName"></config-property>
+ <config-property name="SystemNumber"></config-property>
+ <config-property name="GatewayServerName"></config-property>
+ <config-property name="GatewayServiceNumber"></config-property>
+ <config-property name="SystemName"></config-property>
+ <config-property name="MessageServerName"></config-property>
+ <config-property name="GroupName"></config-property>
+ <config-property name="ConnectionURL"></config-property>
+ <pool>
+ <min-pool-size>0</min-pool-size>
+ <max-pool-size>64</max-pool-size>
+ </pool>
+ <security>
+ <user-name>aaa</user-name>
+ <password>bbb</password>
+ </security>
+ <timeout>
+ <blocking-timeout-millis>5000</blocking-timeout-millis>
+ <idle-timeout-minutes>15</idle-timeout-minutes>
+ </timeout>
+ </connection-definition>
+ </connection-definitions>
+ <admin-objects>
+ <admin-object class-name="token" enabled="true" jndi-name="token" use-java-context="false">
+ <config-property name="token" />
+ </admin-object>
+ </admin-objects>
+ </resource-adapter>
+</resource-adapters>
\ No newline at end of file
Modified: projects/jboss-jca/trunk/deployers/src/main/java/org/jboss/jca/deployers/fungal/RAActivator.java
===================================================================
--- projects/jboss-jca/trunk/deployers/src/main/java/org/jboss/jca/deployers/fungal/RAActivator.java 2010-09-07 12:50:36 UTC (rev 108005)
+++ projects/jboss-jca/trunk/deployers/src/main/java/org/jboss/jca/deployers/fungal/RAActivator.java 2010-09-07 13:31:40 UTC (rev 108006)
@@ -542,9 +542,9 @@
if (cmd.getVersion() != Version.V_10)
{
ResourceAdapter1516 ra1516 = (ResourceAdapter1516) cmd.getResourceadapter();
- if (ra1516 != null && ra1516.getAdminobjects() != null)
+ if (ra1516 != null && ra1516.getAdminObjects() != null)
{
- List<AdminObject> aoMetas = ((ResourceAdapter1516) cmd.getResourceadapter()).getAdminobjects();
+ List<AdminObject> aoMetas = ((ResourceAdapter1516) cmd.getResourceadapter()).getAdminObjects();
if (aoMetas.size() > 0)
{
for (AdminObject aoMeta : aoMetas)
Modified: projects/jboss-jca/trunk/deployers/src/main/java/org/jboss/jca/deployers/fungal/RADeployer.java
===================================================================
--- projects/jboss-jca/trunk/deployers/src/main/java/org/jboss/jca/deployers/fungal/RADeployer.java 2010-09-07 12:50:36 UTC (rev 108005)
+++ projects/jboss-jca/trunk/deployers/src/main/java/org/jboss/jca/deployers/fungal/RADeployer.java 2010-09-07 13:31:40 UTC (rev 108006)
@@ -504,9 +504,9 @@
if (cmd.getVersion() != Version.V_10)
{
ResourceAdapter1516 ra1516 = (ResourceAdapter1516)cmd.getResourceadapter();
- if (ra1516 != null && ra1516.getAdminobjects() != null)
+ if (ra1516 != null && ra1516.getAdminObjects() != null)
{
- List<AdminObject> aoMetas = ((ResourceAdapter1516) cmd.getResourceadapter()).getAdminobjects();
+ List<AdminObject> aoMetas = ((ResourceAdapter1516) cmd.getResourceadapter()).getAdminObjects();
if (aoMetas.size() > 0)
{
for (AdminObject aoMeta : aoMetas)
Modified: projects/jboss-jca/trunk/validator/src/main/java/org/jboss/jca/validator/Validation.java
===================================================================
--- projects/jboss-jca/trunk/validator/src/main/java/org/jboss/jca/validator/Validation.java 2010-09-07 12:50:36 UTC (rev 108005)
+++ projects/jboss-jca/trunk/validator/src/main/java/org/jboss/jca/validator/Validation.java 2010-09-07 13:31:40 UTC (rev 108006)
@@ -394,9 +394,9 @@
if (cmd.getResourceadapter() != null
&& cmd.getVersion() != Version.V_10
- && ((ResourceAdapter1516) cmd.getResourceadapter()).getAdminobjects() != null)
+ && ((ResourceAdapter1516) cmd.getResourceadapter()).getAdminObjects() != null)
{
- List<AdminObject> aoMetas = ((ResourceAdapter1516) cmd.getResourceadapter()).getAdminobjects();
+ List<AdminObject> aoMetas = ((ResourceAdapter1516) cmd.getResourceadapter()).getAdminObjects();
if (aoMetas.size() > 0)
{
for (AdminObject aoMeta : aoMetas)
More information about the jboss-cvs-commits
mailing list