[jboss-cvs] JBossAS SVN: r111944 - in projects/jboss-jca/trunk: deployers and 10 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Fri Aug 5 12:13:40 EDT 2011
Author: jesper.pedersen
Date: 2011-08-05 12:13:39 -0400 (Fri, 05 Aug 2011)
New Revision: 111944
Added:
projects/jboss-jca/trunk/deployers/src/main/java/org/jboss/jca/deployers/fungal/RAActivatorComparator.java
projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/multiple/
projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/multiple/Multiple2ManagedConnectionMetaData.java
projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/multiple/MultipleAdminObject1.java
projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/multiple/MultipleAdminObject1Impl.java
projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/multiple/MultipleAdminObject2.java
projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/multiple/MultipleAdminObject2Impl.java
projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/multiple/MultipleConnection1.java
projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/multiple/MultipleConnection1Impl.java
projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/multiple/MultipleConnection2.java
projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/multiple/MultipleConnection2Impl.java
projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/multiple/MultipleConnectionFactory1.java
projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/multiple/MultipleConnectionFactory1Impl.java
projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/multiple/MultipleConnectionFactory2.java
projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/multiple/MultipleConnectionFactory2Impl.java
projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/multiple/MultipleManagedConnection1.java
projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/multiple/MultipleManagedConnection2.java
projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/multiple/MultipleManagedConnectionFactory1.java
projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/multiple/MultipleManagedConnectionFactory2.java
projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/multiple/MultipleManagedConnectionMetaData.java
projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/multiple/MultipleRaMetaData.java
projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/multiple/MultipleResourceAdapter.java
projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/multiple/package.html
projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/testcases/MultipleFullTestCase.java
projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/testcases/MultiplePartialTestCase.java
projects/jboss-jca/trunk/deployers/src/test/resources/multiple-full.rar/
projects/jboss-jca/trunk/deployers/src/test/resources/multiple-full.rar/META-INF/
projects/jboss-jca/trunk/deployers/src/test/resources/multiple-full.rar/META-INF/ironjacamar.xml
projects/jboss-jca/trunk/deployers/src/test/resources/multiple-full.rar/META-INF/ra.xml
projects/jboss-jca/trunk/deployers/src/test/resources/multiple-partial.rar/
projects/jboss-jca/trunk/deployers/src/test/resources/multiple-partial.rar/META-INF/
projects/jboss-jca/trunk/deployers/src/test/resources/multiple-partial.rar/META-INF/ironjacamar.xml
projects/jboss-jca/trunk/deployers/src/test/resources/multiple-partial.rar/META-INF/ra.xml
Modified:
projects/jboss-jca/trunk/core/src/main/java/org/jboss/jca/core/mdr/SimpleMetadataRepository.java
projects/jboss-jca/trunk/deployers/build.xml
projects/jboss-jca/trunk/deployers/src/main/java/org/jboss/jca/deployers/common/AbstractResourceAdapterDeployer.java
projects/jboss-jca/trunk/deployers/src/main/java/org/jboss/jca/deployers/fungal/RAActivator.java
Log:
[JBJCA-641] Too eager registration of components
Modified: projects/jboss-jca/trunk/core/src/main/java/org/jboss/jca/core/mdr/SimpleMetadataRepository.java
===================================================================
--- projects/jboss-jca/trunk/core/src/main/java/org/jboss/jca/core/mdr/SimpleMetadataRepository.java 2011-08-05 15:48:27 UTC (rev 111943)
+++ projects/jboss-jca/trunk/core/src/main/java/org/jboss/jca/core/mdr/SimpleMetadataRepository.java 2011-08-05 16:13:39 UTC (rev 111944)
@@ -325,4 +325,24 @@
return Collections.unmodifiableMap(mappings);
}
+
+ /**
+ * String representation
+ * @return The string
+ */
+ @Override
+ public String toString()
+ {
+ StringBuilder sb = new StringBuilder();
+
+ sb.append("SimpleMetadataRepository@").append(Integer.toHexString(System.identityHashCode(this)));
+ sb.append("[");
+ sb.append(" raTemplates=").append(raTemplates);
+ sb.append(" raRoots=").append(raRoots);
+ sb.append(" ironJacamar=").append(ironJacamar);
+ sb.append(" jndiMappings=").append(jndiMappings);
+ sb.append("]");
+
+ return sb.toString();
+ }
}
Modified: projects/jboss-jca/trunk/deployers/build.xml
===================================================================
--- projects/jboss-jca/trunk/deployers/build.xml 2011-08-05 15:48:27 UTC (rev 111943)
+++ projects/jboss-jca/trunk/deployers/build.xml 2011-08-05 16:13:39 UTC (rev 111944)
@@ -179,6 +179,16 @@
includes="org/jboss/jca/test/deployers/spec/rars/ra16annoconfprop/*.class"/>
<fileset dir="src/test/resources/ra16annoconfprop.rar"/>
</jar>
+ <jar destfile="${build.deployers.dir}/multiple-full.rar">
+ <fileset dir="${build.deployers.dir}/test"
+ includes="org/jboss/jca/test/deployers/spec/rars/multiple/*.class"/>
+ <fileset dir="src/test/resources/multiple-full.rar"/>
+ </jar>
+ <jar destfile="${build.deployers.dir}/multiple-partial.rar">
+ <fileset dir="${build.deployers.dir}/test"
+ includes="org/jboss/jca/test/deployers/spec/rars/multiple/*.class"/>
+ <fileset dir="src/test/resources/multiple-partial.rar"/>
+ </jar>
</target>
Modified: projects/jboss-jca/trunk/deployers/src/main/java/org/jboss/jca/deployers/common/AbstractResourceAdapterDeployer.java
===================================================================
--- projects/jboss-jca/trunk/deployers/src/main/java/org/jboss/jca/deployers/common/AbstractResourceAdapterDeployer.java 2011-08-05 15:48:27 UTC (rev 111943)
+++ projects/jboss-jca/trunk/deployers/src/main/java/org/jboss/jca/deployers/common/AbstractResourceAdapterDeployer.java 2011-08-05 16:13:39 UTC (rev 111944)
@@ -382,25 +382,87 @@
}
/**
+ * Return a list of ManagedConnectionFactory classes
+ * @param ra The metadata
+ * @return The classes
+ */
+ private List<String> findManagedConnectionFactories(org.jboss.jca.common.api.metadata.ra.ResourceAdapter ra)
+ {
+ List<String> result = new ArrayList<String>(1);
+
+ if (ra != null)
+ {
+ if (ra instanceof ResourceAdapter10)
+ {
+ result.add(((ResourceAdapter10)ra).getManagedConnectionFactoryClass().getValue());
+ }
+ else
+ {
+ ResourceAdapter1516 ra1516 = (ResourceAdapter1516)ra;
+ if (ra1516.getOutboundResourceadapter() != null)
+ {
+ for (org.jboss.jca.common.api.metadata.ra.ConnectionDefinition cd :
+ ra1516.getOutboundResourceadapter().getConnectionDefinitions())
+ {
+ result.add(cd.getManagedConnectionFactoryClass().getValue());
+ }
+ }
+ }
+ }
+
+ return result;
+ }
+
+ /**
+ * Return a list of AdminObject classes
+ * @param ra The metadata
+ * @return The classes
+ */
+ private List<String> findAdminObjects(org.jboss.jca.common.api.metadata.ra.ResourceAdapter ra)
+ {
+ List<String> result = new ArrayList<String>(1);
+
+ if (ra != null)
+ {
+ if (ra instanceof ResourceAdapter1516)
+ {
+ ResourceAdapter1516 ra1516 = (ResourceAdapter1516)ra;
+ if (ra1516.getAdminObjects() != null)
+ {
+ for (org.jboss.jca.common.api.metadata.ra.AdminObject ao : ra1516.getAdminObjects())
+ {
+ result.add(ao.getAdminobjectClass().getValue());
+ }
+ }
+ }
+ }
+
+ return result;
+ }
+
+ /**
* Find the metadata for a managed connection factory
* @param clz The fully quilified class name for the managed connection factory
+ * @param mcfs The managed connection facotries
* @param defs The connection definitions
* @return The metadata; <code>null</code> if none could be found
+ * @exception Exception Thrown if the deployment shouldn't be activated
*/
protected org.jboss.jca.common.api.metadata.common.CommonConnDef findConnectionDefinition(String clz,
- List<org.jboss.jca.common.api.metadata.common.CommonConnDef> defs)
+ List<String> mcfs,
+ List<org.jboss.jca.common.api.metadata.common.CommonConnDef> defs) throws Exception
{
- if (defs != null)
+ if (mcfs != null && defs != null)
{
// If there is only one we will return that
- if (defs.size() == 1)
+ if (mcfs.size() == 1 && defs.size() == 1)
{
org.jboss.jca.common.api.metadata.common.CommonConnDef cd = defs.get(0);
if (cd.getClassName() != null && !clz.equals(cd.getClassName()))
{
log.connectionDefinitionMismatch(cd.getClassName());
- return null;
+ throw new Exception(clz + " not a valid connection definition");
}
return cd;
@@ -417,29 +479,35 @@
}
}
- return null;
+ if (mcfs != null && mcfs.size() == 1 && defs == null)
+ return null;
+
+ throw new Exception("No connection definition found");
}
/**
* Find the metadata for an admin object
* @param clz The fully quilified class name for the admin object
+ * @param aos The admin object classes
* @param defs The admin object definitions
* @return The metadata; <code>null</code> if none could be found
+ * @exception Exception Thrown if the deployment shouldn't be activated
*/
protected org.jboss.jca.common.api.metadata.common.CommonAdminObject findAdminObject(String clz,
- List<org.jboss.jca.common.api.metadata.common.CommonAdminObject> defs)
+ List<String> aos,
+ List<org.jboss.jca.common.api.metadata.common.CommonAdminObject> defs) throws Exception
{
- if (defs != null)
+ if (aos != null && defs != null)
{
// If there is only one we will return that
- if (defs.size() == 1)
+ if (aos.size() == 1 && defs.size() == 1)
{
org.jboss.jca.common.api.metadata.common.CommonAdminObject cao = defs.get(0);
if (cao.getClassName() != null && !clz.equals(cao.getClassName()))
{
log.adminObjectMismatch(cao.getClassName());
- return null;
+ throw new Exception(clz + " not a valid admin object");
}
return cao;
@@ -456,7 +524,10 @@
}
}
- return null;
+ if (aos != null && aos.size() == 1 && defs == null)
+ return null;
+
+ throw new Exception("No admin object found");
}
/**
@@ -631,6 +702,7 @@
List<AdminObject> aoMetas = ra1516.getAdminObjects();
if (aoMetas.size() > 0)
{
+ List<String> aosClz = findAdminObjects(ra1516);
for (int i = 0; i < aoMetas.size(); i++)
{
@@ -638,17 +710,34 @@
if (aoMeta.getAdminobjectClass() != null && aoMeta.getAdminobjectClass().getValue() != null)
{
- CommonAdminObject aoRaXml = findAdminObject(aoMeta.getAdminobjectClass().getValue(), aosRaXml);
- CommonAdminObject ijAO = findAdminObject(aoMeta.getAdminobjectClass().getValue(), aosIronJacamar);
-
failures = validateArchive(url,
Arrays.asList((Validate) new ValidateClass(Key.ADMIN_OBJECT, aoMeta.getAdminobjectClass()
.getValue(), cl, aoMeta.getConfigProperties())), failures);
if (!(getConfiguration().getArchiveValidationFailOnError() && hasFailuresLevel(failures,
Severity.ERROR)))
{
- if (activateDeployment)
+ CommonAdminObject aoRaXml = null;
+ CommonAdminObject ijAO = null;
+ boolean aoActivation = true;
+
+ try
{
+ if (aosRaXml != null || aosClz.size() == 1)
+ aoRaXml = findAdminObject(aoMeta.getAdminobjectClass().getValue(),
+ aosClz, aosRaXml);
+
+ if (aosIronJacamar != null || aosClz.size() == 1)
+ ijAO = findAdminObject(aoMeta.getAdminobjectClass().getValue(),
+ aosClz, aosIronJacamar);
+ }
+ catch (Exception e)
+ {
+ log.debug("No activation: " + aoMeta.getAdminobjectClass().getValue());
+ aoActivation = false;
+ }
+
+ if (activateDeployment && aoActivation)
+ {
Object ao = initAndInject(aoMeta.getAdminobjectClass().getValue(),
aoMeta.getConfigProperties(), cl);
@@ -847,21 +936,44 @@
{
ResourceAdapter10 ra10 = (ResourceAdapter10) cmd.getResourceadapter();
- if (activateDeployment)
+ List<String> mcfs = findManagedConnectionFactories(ra10);
+
+ CommonConnDef ijCD = null;
+ CommonConnDef cdRaXml = null;
+ boolean mcfActivation = true;
+
+ try
{
- CommonConnDef ijCD = null;
- CommonConnDef cdRaXml = null;
+ List<CommonConnDef> cdDefs = null;
+
if (raxml != null)
+ cdDefs = raxml.getConnectionDefinitions();
+
+ if (cdDefs != null)
{
cdRaXml = findConnectionDefinition(ra10.getManagedConnectionFactoryClass().getValue(),
- raxml.getConnectionDefinitions());
+ mcfs, cdDefs);
}
- if (ijmd != null)
+
+ if (cdRaXml == null && ijmd != null)
{
- ijCD = findConnectionDefinition(ra10.getManagedConnectionFactoryClass().getValue(),
- ijmd.getConnectionDefinitions());
+ cdDefs = ijmd.getConnectionDefinitions();
+
+ if (cdDefs != null || mcfs.size() == 1)
+ {
+ ijCD = findConnectionDefinition(ra10.getManagedConnectionFactoryClass().getValue(),
+ mcfs, cdDefs);
+ }
}
+ }
+ catch (Exception e)
+ {
+ log.debug("No activation: " + ra10.getManagedConnectionFactoryClass().getValue());
+ mcfActivation = false;
+ }
+ if (activateDeployment && mcfActivation)
+ {
if (ijCD == null || ijCD.isEnabled() || (cdRaXml != null && cdRaXml.isEnabled()))
{
String mcfClz = ra10.getManagedConnectionFactoryClass().getValue();
@@ -1201,6 +1313,8 @@
List<ConnectionDefinition> cdMetas = ra.getOutboundResourceadapter().getConnectionDefinitions();
if (cdMetas.size() > 0)
{
+ List<String> mcfs = findManagedConnectionFactories(ra);
+
cfs = new ArrayList<Object>();
cfJndiNames = new ArrayList<String>();
@@ -1216,23 +1330,43 @@
if (!(getConfiguration().getArchiveValidationFailOnError() && hasFailuresLevel(failures,
Severity.ERROR)))
{
- if (activateDeployment)
+ org.jboss.jca.common.api.metadata.common.CommonConnDef ijCD = null;
+ org.jboss.jca.common.api.metadata.common.CommonConnDef cdRaXml = null;
+ boolean mcfActivation = true;
+
+ try
{
- org.jboss.jca.common.api.metadata.common.CommonConnDef ijCD = null;
- org.jboss.jca.common.api.metadata.common.CommonConnDef cdRaXml = null;
+ List<CommonConnDef> cdDefs = null;
if (raxml != null)
+ cdDefs = raxml.getConnectionDefinitions();
+
+ if (cdDefs != null)
{
cdRaXml = findConnectionDefinition(cdMeta.getManagedConnectionFactoryClass()
- .getValue(), raxml.getConnectionDefinitions());
+ .getValue(), mcfs, cdDefs);
}
- if (ijmd != null)
+
+ if (cdRaXml == null && ijmd != null)
{
- ijCD = findConnectionDefinition(
- cdMeta.getManagedConnectionFactoryClass().getValue(),
- ijmd.getConnectionDefinitions());
+ cdDefs = ijmd.getConnectionDefinitions();
+
+ if (cdDefs != null || mcfs.size() == 1)
+ {
+ ijCD =
+ findConnectionDefinition(cdMeta.getManagedConnectionFactoryClass().getValue(),
+ mcfs, cdDefs);
+ }
}
+ }
+ catch (Exception e)
+ {
+ log.debug("No activation: " + cdMeta.getManagedConnectionFactoryClass().getValue());
+ mcfActivation = false;
+ }
+ if (activateDeployment && mcfActivation)
+ {
if (ijCD == null || ijCD.isEnabled() || (cdRaXml != null && cdRaXml.isEnabled()))
{
String mcfClz = cdMeta.getManagedConnectionFactoryClass().getValue();
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 2011-08-05 15:48:27 UTC (rev 111943)
+++ projects/jboss-jca/trunk/deployers/src/main/java/org/jboss/jca/deployers/fungal/RAActivator.java 2011-08-05 16:13:39 UTC (rev 111944)
@@ -24,6 +24,9 @@
import org.jboss.jca.common.api.metadata.ironjacamar.IronJacamar;
import org.jboss.jca.common.api.metadata.ra.Connector;
+import org.jboss.jca.common.api.metadata.ra.ResourceAdapter;
+import org.jboss.jca.common.api.metadata.ra.ResourceAdapter1516;
+import org.jboss.jca.common.api.metadata.ra.ra10.ResourceAdapter10;
import org.jboss.jca.common.metadata.merge.Merger;
import org.jboss.jca.core.spi.mdr.MetadataRepository;
import org.jboss.jca.core.spi.naming.JndiStrategy;
@@ -34,8 +37,11 @@
import java.io.File;
import java.net.URL;
import java.util.ArrayList;
+import java.util.HashSet;
import java.util.List;
import java.util.Set;
+import java.util.SortedSet;
+import java.util.TreeSet;
import javax.management.ObjectName;
@@ -145,6 +151,7 @@
MetadataRepository mdr = ((RAConfiguration) getConfiguration()).getMetadataRepository();
Set<String> rarDeployments = mdr.getResourceAdapters();
+ Set<String> configuredRars = getConfiguredResourceAdapters(mdr);
for (String deployment : rarDeployments)
{
@@ -162,7 +169,7 @@
}
}
- if (include && !mdr.hasJndiMappings(deployment))
+ if (include && !configuredRars.contains(deployment))
{
// If there isn't any JNDI mappings then the archive isn't active
// so activate it
@@ -216,6 +223,56 @@
}
/**
+ * Get the set of configured resource adapters
+ * @param mdr The metadata repository
+ * @return The resource adapters
+ */
+ private Set<String> getConfiguredResourceAdapters(MetadataRepository mdr)
+ {
+ Set<String> configured = new HashSet<String>();
+
+ SortedSet<String> deployments = new TreeSet<String>(new RAActivatorComparator());
+ for (String entry : mdr.getResourceAdapters())
+ {
+ deployments.add(entry);
+ }
+
+ for (String deployment : deployments)
+ {
+ if (deployment.endsWith(".rar"))
+ {
+ if (mdr.hasJndiMappings(deployment))
+ configured.add(deployment);
+ }
+ else if (deployment.endsWith("-ra.xml"))
+ {
+ configured.add(deployment);
+ try
+ {
+ Connector raXml = mdr.getResourceAdapter(deployment);
+
+ for (String entry : mdr.getResourceAdapters())
+ {
+ if (entry.endsWith(".rar"))
+ {
+ Connector entryXml = mdr.getResourceAdapter(entry);
+
+ if (raXml.equals(entryXml))
+ configured.add(entry);
+ }
+ }
+ }
+ catch (Throwable t)
+ {
+ log.debug("Ignoring: " + deployment);
+ }
+ }
+ }
+
+ return configured;
+ }
+
+ /**
* Deploy
* @param url The url
* @param parent The parent classloader
@@ -317,6 +374,34 @@
@Override
protected boolean checkActivation(Connector cmd, IronJacamar ijmd)
{
- return true;
+ if (cmd == null)
+ return false;
+
+ if (ijmd != null)
+ return true;
+
+ ResourceAdapter ra = cmd.getResourceadapter();
+
+ if (ra == null)
+ return false;
+
+ if (ra instanceof ResourceAdapter10)
+ {
+ return true;
+ }
+ else
+ {
+ ResourceAdapter1516 ra1516 = (ResourceAdapter1516)ra;
+ int mcfs = 0;
+ int aos = ra1516.getAdminObjects() != null ? ra1516.getAdminObjects().size() : 0;
+
+ if (ra1516.getOutboundResourceadapter() != null)
+ {
+ mcfs = ra1516.getOutboundResourceadapter().getConnectionDefinitions() != null ?
+ ra1516.getOutboundResourceadapter().getConnectionDefinitions().size() : 0;
+ }
+
+ return mcfs <= 1 && aos <= 1;
+ }
}
}
Added: projects/jboss-jca/trunk/deployers/src/main/java/org/jboss/jca/deployers/fungal/RAActivatorComparator.java
===================================================================
--- projects/jboss-jca/trunk/deployers/src/main/java/org/jboss/jca/deployers/fungal/RAActivatorComparator.java (rev 0)
+++ projects/jboss-jca/trunk/deployers/src/main/java/org/jboss/jca/deployers/fungal/RAActivatorComparator.java 2011-08-05 16:13:39 UTC (rev 111944)
@@ -0,0 +1,96 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, 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.deployers.fungal;
+
+import java.io.Serializable;
+import java.util.Comparator;
+
+/**
+ * The comparator for the RA activator
+ * @author <a href="mailto:jesper.pedersen at jboss.org">Jesper Pedersen</a>
+ */
+public class RAActivatorComparator implements Comparator<String>, Serializable
+{
+ /** Serial version uid */
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * Constructor
+ */
+ RAActivatorComparator()
+ {
+ }
+
+ /**
+ * Compare
+ * @param o1 The first object
+ * @param o2 The second object
+ * @return <code>-1</code> if o1 should be invoked first, <code>1</code> if o2 should
+ * be invoked first, otherwise <code>0</code>
+ */
+ public int compare(String o1, String o2)
+ {
+ boolean raXml1 = o1.endsWith("-ra.xml");
+ boolean raXml2 = o2.endsWith("-ra.xml");
+
+ if (raXml1 && !raXml2)
+ {
+ return -1;
+ }
+ else if (!raXml1 && raXml2)
+ {
+ return 1;
+ }
+
+ return o1.compareTo(o2);
+ }
+
+ /**
+ * Hash code
+ * @return The hash
+ */
+ public int hashCode()
+ {
+ return 42;
+ }
+
+ /**
+ * Equals
+ * @param o The object
+ * @return True if equal; otherwise false
+ */
+ public boolean equals(Object o)
+ {
+ if (o == this)
+ return true;
+
+ if (o == null)
+ return false;
+
+ if (!(o instanceof RAActivatorComparator))
+ return false;
+
+ return true;
+ }
+
+}
Added: projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/multiple/Multiple2ManagedConnectionMetaData.java
===================================================================
--- projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/multiple/Multiple2ManagedConnectionMetaData.java (rev 0)
+++ projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/multiple/Multiple2ManagedConnectionMetaData.java 2011-08-05 16:13:39 UTC (rev 111944)
@@ -0,0 +1,101 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, 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.test.deployers.spec.rars.multiple;
+
+import java.util.logging.Logger;
+
+import javax.resource.ResourceException;
+
+import javax.resource.spi.ManagedConnectionMetaData;
+
+/**
+ * Multiple2ManagedConnectionMetaData
+ *
+ * @version $Revision: $
+ */
+public class Multiple2ManagedConnectionMetaData implements ManagedConnectionMetaData
+{
+ /** The logger */
+ private static Logger log = Logger.getLogger("Multiple2ManagedConnectionMetaData");
+
+ /**
+ * Default constructor
+ */
+ public Multiple2ManagedConnectionMetaData()
+ {
+
+ }
+
+ /**
+ * Returns Product name of the underlying EIS instance connected through the ManagedConnection.
+ *
+ * @return Product name of the EIS instance
+ * @throws ResourceException Thrown if an error occurs
+ */
+ @Override
+ public String getEISProductName() throws ResourceException
+ {
+ log.finest("getEISProductName()");
+ return null; //TODO
+ }
+
+ /**
+ * Returns Product version of the underlying EIS instance connected through the ManagedConnection.
+ *
+ * @return Product version of the EIS instance
+ * @throws ResourceException Thrown if an error occurs
+ */
+ @Override
+ public String getEISProductVersion() throws ResourceException
+ {
+ log.finest("getEISProductVersion()");
+ return null; //TODO
+ }
+
+ /**
+ * Returns maximum limit on number of active concurrent connections
+ *
+ * @return Maximum limit for number of active concurrent connections
+ * @throws ResourceException Thrown if an error occurs
+ */
+ @Override
+ public int getMaxConnections() throws ResourceException
+ {
+ log.finest("getMaxConnections()");
+ return 0; //TODO
+ }
+
+ /**
+ * Returns name of the user associated with the ManagedConnection instance
+ *
+ * @return Name of the user
+ * @throws ResourceException Thrown if an error occurs
+ */
+ @Override
+ public String getUserName() throws ResourceException
+ {
+ log.finest("getUserName()");
+ return null; //TODO
+ }
+
+
+}
Added: projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/multiple/MultipleAdminObject1.java
===================================================================
--- projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/multiple/MultipleAdminObject1.java (rev 0)
+++ projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/multiple/MultipleAdminObject1.java 2011-08-05 16:13:39 UTC (rev 111944)
@@ -0,0 +1,49 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, 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.test.deployers.spec.rars.multiple;
+
+import java.io.Serializable;
+
+import javax.resource.Referenceable;
+
+/**
+ * MultipleAdminObject1
+ *
+ * @version $Revision: $
+ */
+public interface MultipleAdminObject1 extends Referenceable, Serializable
+{
+
+ /**
+ * Set name
+ * @param name The value
+ */
+ public void setName(String name);
+
+ /**
+ * Get name
+ * @return The value
+ */
+ public String getName();
+
+
+}
Added: projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/multiple/MultipleAdminObject1Impl.java
===================================================================
--- projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/multiple/MultipleAdminObject1Impl.java (rev 0)
+++ projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/multiple/MultipleAdminObject1Impl.java 2011-08-05 16:13:39 UTC (rev 111944)
@@ -0,0 +1,161 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, 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.test.deployers.spec.rars.multiple;
+
+import java.io.Serializable;
+
+import javax.naming.NamingException;
+import javax.naming.Reference;
+
+import javax.resource.Referenceable;
+import javax.resource.spi.ResourceAdapter;
+import javax.resource.spi.ResourceAdapterAssociation;
+
+/**
+ * MultipleAdminObject1Impl
+ *
+ * @version $Revision: $
+ */
+public class MultipleAdminObject1Impl implements MultipleAdminObject1,
+ ResourceAdapterAssociation, Referenceable, Serializable
+{
+ /** The resource adapter */
+ private ResourceAdapter ra;
+
+ /** Reference */
+ private Reference reference;
+
+ /** Name */
+ private String name;
+
+ /**
+ * Default constructor
+ */
+ public MultipleAdminObject1Impl()
+ {
+
+ }
+
+ /**
+ * Set name
+ * @param name The value
+ */
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+ /**
+ * Get name
+ * @return The value
+ */
+ public String getName()
+ {
+ return name;
+ }
+
+ /**
+ * Get the resource adapter
+ *
+ * @return The handle
+ */
+ public ResourceAdapter getResourceAdapter()
+ {
+ return ra;
+ }
+
+ /**
+ * Set the resource adapter
+ *
+ * @param ra The handle
+ */
+ public void setResourceAdapter(ResourceAdapter ra)
+ {
+ this.ra = ra;
+ }
+
+ /**
+ * Get the Reference instance.
+ *
+ * @return Reference instance
+ * @exception NamingException Thrown if a reference can't be obtained
+ */
+ @Override
+ public Reference getReference() throws NamingException
+ {
+ return reference;
+ }
+
+ /**
+ * Set the Reference instance.
+ *
+ * @param reference A Reference instance
+ */
+ @Override
+ public void setReference(Reference reference)
+ {
+ this.reference = reference;
+ }
+
+ /**
+ * Returns a hash code value for the object.
+ * @return A hash code value for this object.
+ */
+ @Override
+ public int hashCode()
+ {
+ int result = 17;
+ if (name != null)
+ result += 31 * result + 7 * name.hashCode();
+ else
+ result += 31 * result + 7;
+ return result;
+ }
+
+ /**
+ * Indicates whether some other object is equal to this one.
+ * @param other The reference object with which to compare.
+ * @return true if this object is the same as the obj argument, false otherwise.
+ */
+ @Override
+ public boolean equals(Object other)
+ {
+ if (other == null)
+ return false;
+ if (other == this)
+ return true;
+ if (!(other instanceof MultipleAdminObject1Impl))
+ return false;
+ MultipleAdminObject1Impl obj = (MultipleAdminObject1Impl)other;
+ boolean result = true;
+ if (result)
+ {
+ if (name == null)
+ result = obj.getName() == null;
+ else
+ result = name.equals(obj.getName());
+ }
+ return result;
+ }
+
+
+}
Added: projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/multiple/MultipleAdminObject2.java
===================================================================
--- projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/multiple/MultipleAdminObject2.java (rev 0)
+++ projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/multiple/MultipleAdminObject2.java 2011-08-05 16:13:39 UTC (rev 111944)
@@ -0,0 +1,49 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, 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.test.deployers.spec.rars.multiple;
+
+import java.io.Serializable;
+
+import javax.resource.Referenceable;
+
+/**
+ * MultipleAdminObject2
+ *
+ * @version $Revision: $
+ */
+public interface MultipleAdminObject2 extends Referenceable, Serializable
+{
+
+ /**
+ * Set name
+ * @param name The value
+ */
+ public void setName(String name);
+
+ /**
+ * Get name
+ * @return The value
+ */
+ public String getName();
+
+
+}
Added: projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/multiple/MultipleAdminObject2Impl.java
===================================================================
--- projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/multiple/MultipleAdminObject2Impl.java (rev 0)
+++ projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/multiple/MultipleAdminObject2Impl.java 2011-08-05 16:13:39 UTC (rev 111944)
@@ -0,0 +1,161 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, 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.test.deployers.spec.rars.multiple;
+
+import java.io.Serializable;
+
+import javax.naming.NamingException;
+import javax.naming.Reference;
+
+import javax.resource.Referenceable;
+import javax.resource.spi.ResourceAdapter;
+import javax.resource.spi.ResourceAdapterAssociation;
+
+/**
+ * MultipleAdminObject2Impl
+ *
+ * @version $Revision: $
+ */
+public class MultipleAdminObject2Impl implements MultipleAdminObject2,
+ ResourceAdapterAssociation, Referenceable, Serializable
+{
+ /** The resource adapter */
+ private ResourceAdapter ra;
+
+ /** Reference */
+ private Reference reference;
+
+ /** Name */
+ private String name;
+
+ /**
+ * Default constructor
+ */
+ public MultipleAdminObject2Impl()
+ {
+
+ }
+
+ /**
+ * Set name
+ * @param name The value
+ */
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+ /**
+ * Get name
+ * @return The value
+ */
+ public String getName()
+ {
+ return name;
+ }
+
+ /**
+ * Get the resource adapter
+ *
+ * @return The handle
+ */
+ public ResourceAdapter getResourceAdapter()
+ {
+ return ra;
+ }
+
+ /**
+ * Set the resource adapter
+ *
+ * @param ra The handle
+ */
+ public void setResourceAdapter(ResourceAdapter ra)
+ {
+ this.ra = ra;
+ }
+
+ /**
+ * Get the Reference instance.
+ *
+ * @return Reference instance
+ * @exception NamingException Thrown if a reference can't be obtained
+ */
+ @Override
+ public Reference getReference() throws NamingException
+ {
+ return reference;
+ }
+
+ /**
+ * Set the Reference instance.
+ *
+ * @param reference A Reference instance
+ */
+ @Override
+ public void setReference(Reference reference)
+ {
+ this.reference = reference;
+ }
+
+ /**
+ * Returns a hash code value for the object.
+ * @return A hash code value for this object.
+ */
+ @Override
+ public int hashCode()
+ {
+ int result = 17;
+ if (name != null)
+ result += 31 * result + 7 * name.hashCode();
+ else
+ result += 31 * result + 7;
+ return result;
+ }
+
+ /**
+ * Indicates whether some other object is equal to this one.
+ * @param other The reference object with which to compare.
+ * @return true if this object is the same as the obj argument, false otherwise.
+ */
+ @Override
+ public boolean equals(Object other)
+ {
+ if (other == null)
+ return false;
+ if (other == this)
+ return true;
+ if (!(other instanceof MultipleAdminObject2Impl))
+ return false;
+ MultipleAdminObject2Impl obj = (MultipleAdminObject2Impl)other;
+ boolean result = true;
+ if (result)
+ {
+ if (name == null)
+ result = obj.getName() == null;
+ else
+ result = name.equals(obj.getName());
+ }
+ return result;
+ }
+
+
+}
Added: projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/multiple/MultipleConnection1.java
===================================================================
--- projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/multiple/MultipleConnection1.java (rev 0)
+++ projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/multiple/MultipleConnection1.java 2011-08-05 16:13:39 UTC (rev 111944)
@@ -0,0 +1,42 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, 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.test.deployers.spec.rars.multiple;
+
+/**
+ * MultipleConnection1
+ *
+ * @version $Revision: $
+ */
+public interface MultipleConnection1
+{
+ /**
+ * test
+ * @param s s
+ * @return String
+ */
+ public String test(String s);
+
+ /**
+ * Close
+ */
+ public void close();
+}
Added: projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/multiple/MultipleConnection1Impl.java
===================================================================
--- projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/multiple/MultipleConnection1Impl.java (rev 0)
+++ projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/multiple/MultipleConnection1Impl.java 2011-08-05 16:13:39 UTC (rev 111944)
@@ -0,0 +1,73 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, 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.test.deployers.spec.rars.multiple;
+
+import java.util.logging.Logger;
+
+/**
+ * MultipleConnection1Impl
+ *
+ * @version $Revision: $
+ */
+public class MultipleConnection1Impl implements MultipleConnection1
+{
+ /** The logger */
+ private static Logger log = Logger.getLogger("MultipleConnection1Impl");
+
+ /** ManagedConnection */
+ private MultipleManagedConnection1 mc;
+
+ /** ManagedConnectionFactory */
+ private MultipleManagedConnectionFactory1 mcf;
+
+ /**
+ * Default constructor
+ * @param mc MultipleManagedConnection1
+ * @param mcf MultipleManagedConnectionFactory1
+ */
+ public MultipleConnection1Impl(MultipleManagedConnection1 mc, MultipleManagedConnectionFactory1 mcf)
+ {
+ this.mc = mc;
+ this.mcf = mcf;
+ }
+
+ /**
+ * Call test
+ * @param s String
+ * @return String
+ */
+ public String test(String s)
+ {
+ log.finest("test()");
+ return null;
+
+ }
+
+ /**
+ * Close
+ */
+ public void close()
+ {
+ mc.closeHandle(this);
+ }
+
+}
Added: projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/multiple/MultipleConnection2.java
===================================================================
--- projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/multiple/MultipleConnection2.java (rev 0)
+++ projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/multiple/MultipleConnection2.java 2011-08-05 16:13:39 UTC (rev 111944)
@@ -0,0 +1,42 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, 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.test.deployers.spec.rars.multiple;
+
+/**
+ * MultipleConnection2
+ *
+ * @version $Revision: $
+ */
+public interface MultipleConnection2
+{
+ /**
+ * test
+ * @param s s
+ * @return String
+ */
+ public String test(String s);
+
+ /**
+ * Close
+ */
+ public void close();
+}
Added: projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/multiple/MultipleConnection2Impl.java
===================================================================
--- projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/multiple/MultipleConnection2Impl.java (rev 0)
+++ projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/multiple/MultipleConnection2Impl.java 2011-08-05 16:13:39 UTC (rev 111944)
@@ -0,0 +1,73 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, 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.test.deployers.spec.rars.multiple;
+
+import java.util.logging.Logger;
+
+/**
+ * MultipleConnection2Impl
+ *
+ * @version $Revision: $
+ */
+public class MultipleConnection2Impl implements MultipleConnection2
+{
+ /** The logger */
+ private static Logger log = Logger.getLogger("MultipleConnection2Impl");
+
+ /** ManagedConnection */
+ private MultipleManagedConnection2 mc;
+
+ /** ManagedConnectionFactory */
+ private MultipleManagedConnectionFactory2 mcf;
+
+ /**
+ * Default constructor
+ * @param mc MultipleManagedConnection2
+ * @param mcf MultipleManagedConnectionFactory2
+ */
+ public MultipleConnection2Impl(MultipleManagedConnection2 mc, MultipleManagedConnectionFactory2 mcf)
+ {
+ this.mc = mc;
+ this.mcf = mcf;
+ }
+
+ /**
+ * Call test
+ * @param s String
+ * @return String
+ */
+ public String test(String s)
+ {
+ log.finest("test()");
+ return null;
+
+ }
+
+ /**
+ * Close
+ */
+ public void close()
+ {
+ mc.closeHandle(this);
+ }
+
+}
Added: projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/multiple/MultipleConnectionFactory1.java
===================================================================
--- projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/multiple/MultipleConnectionFactory1.java (rev 0)
+++ projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/multiple/MultipleConnectionFactory1.java 2011-08-05 16:13:39 UTC (rev 111944)
@@ -0,0 +1,44 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, 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.test.deployers.spec.rars.multiple;
+
+import java.io.Serializable;
+
+import javax.resource.Referenceable;
+import javax.resource.ResourceException;
+
+/**
+ * MultipleConnectionFactory1
+ *
+ * @version $Revision: $
+ */
+public interface MultipleConnectionFactory1 extends Serializable, Referenceable
+{
+ /**
+ * Get connection from factory
+ *
+ * @return MultipleConnection1 instance
+ * @exception ResourceException Thrown if a connection can't be obtained
+ */
+ public MultipleConnection1 getConnection() throws ResourceException;
+
+}
Added: projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/multiple/MultipleConnectionFactory1Impl.java
===================================================================
--- projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/multiple/MultipleConnectionFactory1Impl.java (rev 0)
+++ projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/multiple/MultipleConnectionFactory1Impl.java 2011-08-05 16:13:39 UTC (rev 111944)
@@ -0,0 +1,112 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, 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.test.deployers.spec.rars.multiple;
+
+import java.util.logging.Logger;
+
+import javax.naming.NamingException;
+import javax.naming.Reference;
+
+import javax.resource.ResourceException;
+import javax.resource.spi.ConnectionManager;
+
+/**
+ * MultipleConnectionFactory1Impl
+ *
+ * @version $Revision: $
+ */
+public class MultipleConnectionFactory1Impl implements MultipleConnectionFactory1
+{
+ /** The serial version UID */
+ private static final long serialVersionUID = 1L;
+
+ /** The logger */
+ private static Logger log = Logger.getLogger("MultipleConnectionFactory1Impl");
+
+ /** Reference */
+ private Reference reference;
+
+ /** ManagedConnectionFactory */
+ private MultipleManagedConnectionFactory1 mcf;
+
+ /** ConnectionManager */
+ private ConnectionManager connectionManager;
+
+ /**
+ * Default constructor
+ */
+ public MultipleConnectionFactory1Impl()
+ {
+
+ }
+
+ /**
+ * Default constructor
+ * @param mcf ManagedConnectionFactory
+ * @param cxManager ConnectionManager
+ */
+ public MultipleConnectionFactory1Impl(MultipleManagedConnectionFactory1 mcf, ConnectionManager cxManager)
+ {
+ this.mcf = mcf;
+ this.connectionManager = cxManager;
+ }
+
+ /**
+ * Get connection from factory
+ *
+ * @return MultipleConnection1 instance
+ * @exception ResourceException Thrown if a connection can't be obtained
+ */
+ @Override
+ public MultipleConnection1 getConnection() throws ResourceException
+ {
+ log.finest("getConnection()");
+ return (MultipleConnection1)connectionManager.allocateConnection(mcf, null);
+ }
+
+ /**
+ * Get the Reference instance.
+ *
+ * @return Reference instance
+ * @exception NamingException Thrown if a reference can't be obtained
+ */
+ @Override
+ public Reference getReference() throws NamingException
+ {
+ log.finest("getReference()");
+ return reference;
+ }
+
+ /**
+ * Set the Reference instance.
+ *
+ * @param reference A Reference instance
+ */
+ @Override
+ public void setReference(Reference reference)
+ {
+ log.finest("setReference()");
+ this.reference = reference;
+ }
+
+
+}
Added: projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/multiple/MultipleConnectionFactory2.java
===================================================================
--- projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/multiple/MultipleConnectionFactory2.java (rev 0)
+++ projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/multiple/MultipleConnectionFactory2.java 2011-08-05 16:13:39 UTC (rev 111944)
@@ -0,0 +1,44 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, 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.test.deployers.spec.rars.multiple;
+
+import java.io.Serializable;
+
+import javax.resource.Referenceable;
+import javax.resource.ResourceException;
+
+/**
+ * MultipleConnectionFactory2
+ *
+ * @version $Revision: $
+ */
+public interface MultipleConnectionFactory2 extends Serializable, Referenceable
+{
+ /**
+ * Get connection from factory
+ *
+ * @return MultipleConnection2 instance
+ * @exception ResourceException Thrown if a connection can't be obtained
+ */
+ public MultipleConnection2 getConnection() throws ResourceException;
+
+}
Added: projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/multiple/MultipleConnectionFactory2Impl.java
===================================================================
--- projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/multiple/MultipleConnectionFactory2Impl.java (rev 0)
+++ projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/multiple/MultipleConnectionFactory2Impl.java 2011-08-05 16:13:39 UTC (rev 111944)
@@ -0,0 +1,112 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, 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.test.deployers.spec.rars.multiple;
+
+import java.util.logging.Logger;
+
+import javax.naming.NamingException;
+import javax.naming.Reference;
+
+import javax.resource.ResourceException;
+import javax.resource.spi.ConnectionManager;
+
+/**
+ * MultipleConnectionFactory2Impl
+ *
+ * @version $Revision: $
+ */
+public class MultipleConnectionFactory2Impl implements MultipleConnectionFactory2
+{
+ /** The serial version UID */
+ private static final long serialVersionUID = 1L;
+
+ /** The logger */
+ private static Logger log = Logger.getLogger("MultipleConnectionFactory2Impl");
+
+ /** Reference */
+ private Reference reference;
+
+ /** ManagedConnectionFactory */
+ private MultipleManagedConnectionFactory2 mcf;
+
+ /** ConnectionManager */
+ private ConnectionManager connectionManager;
+
+ /**
+ * Default constructor
+ */
+ public MultipleConnectionFactory2Impl()
+ {
+
+ }
+
+ /**
+ * Default constructor
+ * @param mcf ManagedConnectionFactory
+ * @param cxManager ConnectionManager
+ */
+ public MultipleConnectionFactory2Impl(MultipleManagedConnectionFactory2 mcf, ConnectionManager cxManager)
+ {
+ this.mcf = mcf;
+ this.connectionManager = cxManager;
+ }
+
+ /**
+ * Get connection from factory
+ *
+ * @return MultipleConnection2 instance
+ * @exception ResourceException Thrown if a connection can't be obtained
+ */
+ @Override
+ public MultipleConnection2 getConnection() throws ResourceException
+ {
+ log.finest("getConnection()");
+ return (MultipleConnection2)connectionManager.allocateConnection(mcf, null);
+ }
+
+ /**
+ * Get the Reference instance.
+ *
+ * @return Reference instance
+ * @exception NamingException Thrown if a reference can't be obtained
+ */
+ @Override
+ public Reference getReference() throws NamingException
+ {
+ log.finest("getReference()");
+ return reference;
+ }
+
+ /**
+ * Set the Reference instance.
+ *
+ * @param reference A Reference instance
+ */
+ @Override
+ public void setReference(Reference reference)
+ {
+ log.finest("setReference()");
+ this.reference = reference;
+ }
+
+
+}
Added: projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/multiple/MultipleManagedConnection1.java
===================================================================
--- projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/multiple/MultipleManagedConnection1.java (rev 0)
+++ projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/multiple/MultipleManagedConnection1.java 2011-08-05 16:13:39 UTC (rev 111944)
@@ -0,0 +1,228 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, 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.test.deployers.spec.rars.multiple;
+
+import java.io.PrintWriter;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.logging.Logger;
+
+import javax.resource.NotSupportedException;
+import javax.resource.ResourceException;
+import javax.resource.spi.ConnectionEvent;
+import javax.resource.spi.ConnectionEventListener;
+import javax.resource.spi.ConnectionRequestInfo;
+import javax.resource.spi.LocalTransaction;
+import javax.resource.spi.ManagedConnection;
+import javax.resource.spi.ManagedConnectionMetaData;
+
+import javax.security.auth.Subject;
+import javax.transaction.xa.XAResource;
+
+/**
+ * MultipleManagedConnection1
+ *
+ * @version $Revision: $
+ */
+public class MultipleManagedConnection1 implements ManagedConnection
+{
+
+ /** The logger */
+ private static Logger log = Logger.getLogger("MultipleManagedConnection1");
+
+ /** The logwriter */
+ private PrintWriter logwriter;
+
+ /** ManagedConnectionFactory */
+ private MultipleManagedConnectionFactory1 mcf;
+
+ /** Listeners */
+ private List<ConnectionEventListener> listeners;
+
+ /** Connection */
+ private Object connection;
+
+ /**
+ * Default constructor
+ * @param mcf mcf
+ */
+ public MultipleManagedConnection1(MultipleManagedConnectionFactory1 mcf)
+ {
+ this.mcf = mcf;
+ this.logwriter = null;
+ this.listeners = new ArrayList<ConnectionEventListener>(1);
+ this.connection = null;
+ }
+
+ /**
+ * Creates a new connection handle for the underlying physical connection
+ * represented by the ManagedConnection instance.
+ *
+ * @param subject Security context as JAAS subject
+ * @param cxRequestInfo ConnectionRequestInfo instance
+ * @return generic Object instance representing the connection handle.
+ * @throws ResourceException generic exception if operation fails
+ */
+ public Object getConnection(Subject subject,
+ ConnectionRequestInfo cxRequestInfo) throws ResourceException
+ {
+ log.finest("getConnection()");
+ connection = new MultipleConnection1Impl(this, mcf);
+ return connection;
+ }
+
+ /**
+ * Used by the container to change the association of an
+ * application-level connection handle with a ManagedConneciton instance.
+ *
+ * @param connection Application-level connection handle
+ * @throws ResourceException generic exception if operation fails
+ */
+ public void associateConnection(Object connection) throws ResourceException
+ {
+ log.finest("associateConnection()");
+ }
+
+ /**
+ * Application server calls this method to force any cleanup on the ManagedConnection instance.
+ *
+ * @throws ResourceException generic exception if operation fails
+ */
+ public void cleanup() throws ResourceException
+
+ {
+ log.finest("cleanup()");
+ }
+
+ /**
+ * Destroys the physical connection to the underlying resource manager.
+ *
+ * @throws ResourceException generic exception if operation fails
+ */
+ public void destroy() throws ResourceException
+ {
+ log.finest("destroy()");
+ }
+
+ /**
+ * Adds a connection event listener to the ManagedConnection instance.
+ *
+ * @param listener A new ConnectionEventListener to be registered
+ */
+ public void addConnectionEventListener(ConnectionEventListener listener)
+ {
+ log.finest("addConnectionEventListener()");
+ if (listener == null)
+ throw new IllegalArgumentException("Listener is null");
+ listeners.add(listener);
+ }
+
+ /**
+ * Removes an already registered connection event listener from the ManagedConnection instance.
+ *
+ * @param listener already registered connection event listener to be removed
+ */
+ public void removeConnectionEventListener(ConnectionEventListener listener)
+ {
+ log.finest("removeConnectionEventListener()");
+ if (listener == null)
+ throw new IllegalArgumentException("Listener is null");
+ listeners.remove(listener);
+ }
+
+ /**
+ * Close handle
+ *
+ * @param handle The handle
+ */
+ public void closeHandle(MultipleConnection1 handle)
+ {
+ ConnectionEvent event = new ConnectionEvent(this, ConnectionEvent.CONNECTION_CLOSED);
+ event.setConnectionHandle(handle);
+ for (ConnectionEventListener cel : listeners)
+ {
+ cel.connectionClosed(event);
+ }
+
+ }
+
+ /**
+ * Gets the log writer for this ManagedConnection instance.
+ *
+ * @return Character ourput stream associated with this Managed-Connection instance
+ * @throws ResourceException generic exception if operation fails
+ */
+ public PrintWriter getLogWriter() throws ResourceException
+ {
+ log.finest("getLogWriter()");
+ return logwriter;
+ }
+
+ /**
+ * Sets the log writer for this ManagedConnection instance.
+ *
+ * @param out Character Output stream to be associated
+ * @throws ResourceException generic exception if operation fails
+ */
+ public void setLogWriter(PrintWriter out) throws ResourceException
+ {
+ log.finest("setLogWriter()");
+ logwriter = out;
+ }
+
+ /**
+ * Returns an <code>javax.resource.spi.LocalTransaction</code> instance.
+ *
+ * @return LocalTransaction instance
+ * @throws ResourceException generic exception if operation fails
+ */
+ public LocalTransaction getLocalTransaction() throws ResourceException
+ {
+ throw new NotSupportedException("LocalTransaction not supported");
+ }
+
+ /**
+ * Returns an <code>javax.transaction.xa.XAresource</code> instance.
+ *
+ * @return XAResource instance
+ * @throws ResourceException generic exception if operation fails
+ */
+ public XAResource getXAResource() throws ResourceException
+ {
+ throw new NotSupportedException("GetXAResource not supported not supported");
+ }
+
+ /**
+ * Gets the metadata information for this connection's underlying EIS resource manager instance.
+ *
+ * @return ManagedConnectionMetaData instance
+ * @throws ResourceException generic exception if operation fails
+ */
+ public ManagedConnectionMetaData getMetaData() throws ResourceException
+ {
+ log.finest("getMetaData()");
+ return new MultipleManagedConnectionMetaData();
+ }
+
+
+}
Added: projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/multiple/MultipleManagedConnection2.java
===================================================================
--- projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/multiple/MultipleManagedConnection2.java (rev 0)
+++ projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/multiple/MultipleManagedConnection2.java 2011-08-05 16:13:39 UTC (rev 111944)
@@ -0,0 +1,228 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, 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.test.deployers.spec.rars.multiple;
+
+import java.io.PrintWriter;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.logging.Logger;
+
+import javax.resource.NotSupportedException;
+import javax.resource.ResourceException;
+import javax.resource.spi.ConnectionEvent;
+import javax.resource.spi.ConnectionEventListener;
+import javax.resource.spi.ConnectionRequestInfo;
+import javax.resource.spi.LocalTransaction;
+import javax.resource.spi.ManagedConnection;
+import javax.resource.spi.ManagedConnectionMetaData;
+
+import javax.security.auth.Subject;
+import javax.transaction.xa.XAResource;
+
+/**
+ * MultipleManagedConnection2
+ *
+ * @version $Revision: $
+ */
+public class MultipleManagedConnection2 implements ManagedConnection
+{
+
+ /** The logger */
+ private static Logger log = Logger.getLogger("MultipleManagedConnection2");
+
+ /** The logwriter */
+ private PrintWriter logwriter;
+
+ /** ManagedConnectionFactory */
+ private MultipleManagedConnectionFactory2 mcf;
+
+ /** Listeners */
+ private List<ConnectionEventListener> listeners;
+
+ /** Connection */
+ private Object connection;
+
+ /**
+ * Default constructor
+ * @param mcf mcf
+ */
+ public MultipleManagedConnection2(MultipleManagedConnectionFactory2 mcf)
+ {
+ this.mcf = mcf;
+ this.logwriter = null;
+ this.listeners = new ArrayList<ConnectionEventListener>(1);
+ this.connection = null;
+ }
+
+ /**
+ * Creates a new connection handle for the underlying physical connection
+ * represented by the ManagedConnection instance.
+ *
+ * @param subject Security context as JAAS subject
+ * @param cxRequestInfo ConnectionRequestInfo instance
+ * @return generic Object instance representing the connection handle.
+ * @throws ResourceException generic exception if operation fails
+ */
+ public Object getConnection(Subject subject,
+ ConnectionRequestInfo cxRequestInfo) throws ResourceException
+ {
+ log.finest("getConnection()");
+ connection = new MultipleConnection2Impl(this, mcf);
+ return connection;
+ }
+
+ /**
+ * Used by the container to change the association of an
+ * application-level connection handle with a ManagedConneciton instance.
+ *
+ * @param connection Application-level connection handle
+ * @throws ResourceException generic exception if operation fails
+ */
+ public void associateConnection(Object connection) throws ResourceException
+ {
+ log.finest("associateConnection()");
+ }
+
+ /**
+ * Application server calls this method to force any cleanup on the ManagedConnection instance.
+ *
+ * @throws ResourceException generic exception if operation fails
+ */
+ public void cleanup() throws ResourceException
+
+ {
+ log.finest("cleanup()");
+ }
+
+ /**
+ * Destroys the physical connection to the underlying resource manager.
+ *
+ * @throws ResourceException generic exception if operation fails
+ */
+ public void destroy() throws ResourceException
+ {
+ log.finest("destroy()");
+ }
+
+ /**
+ * Adds a connection event listener to the ManagedConnection instance.
+ *
+ * @param listener A new ConnectionEventListener to be registered
+ */
+ public void addConnectionEventListener(ConnectionEventListener listener)
+ {
+ log.finest("addConnectionEventListener()");
+ if (listener == null)
+ throw new IllegalArgumentException("Listener is null");
+ listeners.add(listener);
+ }
+
+ /**
+ * Removes an already registered connection event listener from the ManagedConnection instance.
+ *
+ * @param listener already registered connection event listener to be removed
+ */
+ public void removeConnectionEventListener(ConnectionEventListener listener)
+ {
+ log.finest("removeConnectionEventListener()");
+ if (listener == null)
+ throw new IllegalArgumentException("Listener is null");
+ listeners.remove(listener);
+ }
+
+ /**
+ * Close handle
+ *
+ * @param handle The handle
+ */
+ public void closeHandle(MultipleConnection2 handle)
+ {
+ ConnectionEvent event = new ConnectionEvent(this, ConnectionEvent.CONNECTION_CLOSED);
+ event.setConnectionHandle(handle);
+ for (ConnectionEventListener cel : listeners)
+ {
+ cel.connectionClosed(event);
+ }
+
+ }
+
+ /**
+ * Gets the log writer for this ManagedConnection instance.
+ *
+ * @return Character ourput stream associated with this Managed-Connection instance
+ * @throws ResourceException generic exception if operation fails
+ */
+ public PrintWriter getLogWriter() throws ResourceException
+ {
+ log.finest("getLogWriter()");
+ return logwriter;
+ }
+
+ /**
+ * Sets the log writer for this ManagedConnection instance.
+ *
+ * @param out Character Output stream to be associated
+ * @throws ResourceException generic exception if operation fails
+ */
+ public void setLogWriter(PrintWriter out) throws ResourceException
+ {
+ log.finest("setLogWriter()");
+ logwriter = out;
+ }
+
+ /**
+ * Returns an <code>javax.resource.spi.LocalTransaction</code> instance.
+ *
+ * @return LocalTransaction instance
+ * @throws ResourceException generic exception if operation fails
+ */
+ public LocalTransaction getLocalTransaction() throws ResourceException
+ {
+ throw new NotSupportedException("LocalTransaction not supported");
+ }
+
+ /**
+ * Returns an <code>javax.transaction.xa.XAresource</code> instance.
+ *
+ * @return XAResource instance
+ * @throws ResourceException generic exception if operation fails
+ */
+ public XAResource getXAResource() throws ResourceException
+ {
+ throw new NotSupportedException("GetXAResource not supported not supported");
+ }
+
+ /**
+ * Gets the metadata information for this connection's underlying EIS resource manager instance.
+ *
+ * @return ManagedConnectionMetaData instance
+ * @throws ResourceException generic exception if operation fails
+ */
+ public ManagedConnectionMetaData getMetaData() throws ResourceException
+ {
+ log.finest("getMetaData()");
+ return new Multiple2ManagedConnectionMetaData();
+ }
+
+
+}
Added: projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/multiple/MultipleManagedConnectionFactory1.java
===================================================================
--- projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/multiple/MultipleManagedConnectionFactory1.java (rev 0)
+++ projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/multiple/MultipleManagedConnectionFactory1.java 2011-08-05 16:13:39 UTC (rev 111944)
@@ -0,0 +1,243 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, 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.test.deployers.spec.rars.multiple;
+
+import java.io.PrintWriter;
+import java.util.Iterator;
+import java.util.Set;
+
+import java.util.logging.Logger;
+
+import javax.resource.ResourceException;
+import javax.resource.spi.ConnectionManager;
+import javax.resource.spi.ConnectionRequestInfo;
+import javax.resource.spi.ManagedConnection;
+import javax.resource.spi.ManagedConnectionFactory;
+import javax.resource.spi.ResourceAdapter;
+import javax.resource.spi.ResourceAdapterAssociation;
+
+import javax.security.auth.Subject;
+
+/**
+ * MultipleManagedConnectionFactory1
+ *
+ * @version $Revision: $
+ */
+public class MultipleManagedConnectionFactory1 implements ManagedConnectionFactory, ResourceAdapterAssociation
+{
+
+ /** The serial version UID */
+ private static final long serialVersionUID = 1L;
+
+ /** The logger */
+ private static Logger log = Logger.getLogger("MultipleManagedConnectionFactory1");
+
+ /** The resource adapter */
+ private ResourceAdapter ra;
+
+ /** The logwriter */
+ private PrintWriter logwriter;
+
+ /** Name */
+ private String name;
+
+ /**
+ * Default constructor
+ */
+ public MultipleManagedConnectionFactory1()
+ {
+
+ }
+
+ /**
+ * Set name
+ * @param name The value
+ */
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+ /**
+ * Get name
+ * @return The value
+ */
+ public String getName()
+ {
+ return name;
+ }
+
+ /**
+ * Creates a Connection Factory instance.
+ *
+ * @param cxManager ConnectionManager to be associated with created EIS connection factory instance
+ * @return EIS-specific Connection Factory instance or javax.resource.cci.ConnectionFactory instance
+ * @throws ResourceException Generic exception
+ */
+ public Object createConnectionFactory(ConnectionManager cxManager) throws ResourceException
+ {
+ log.finest("createConnectionFactory()");
+ return new MultipleConnectionFactory1Impl(this, cxManager);
+ }
+
+ /**
+ * Creates a Connection Factory instance.
+ *
+ * @return EIS-specific Connection Factory instance or javax.resource.cci.ConnectionFactory instance
+ * @throws ResourceException Generic exception
+ */
+ public Object createConnectionFactory() throws ResourceException
+ {
+ throw new ResourceException("This resource adapter doesn't support non-managed environments");
+ }
+
+ /**
+ * Creates a new physical connection to the underlying EIS resource manager.
+ *
+ * @param subject Caller's security information
+ * @param cxRequestInfo Additional resource adapter specific connection request information
+ * @throws ResourceException generic exception
+ * @return ManagedConnection instance
+ */
+ public ManagedConnection createManagedConnection(Subject subject,
+ ConnectionRequestInfo cxRequestInfo) throws ResourceException
+ {
+ log.finest("createManagedConnection()");
+ return new MultipleManagedConnection1(this);
+ }
+
+ /**
+ * Returns a matched connection from the candidate set of connections.
+ *
+ * @param connectionSet Candidate connection set
+ * @param subject Caller's security information
+ * @param cxRequestInfo Additional resource adapter specific connection request information
+ * @throws ResourceException generic exception
+ * @return ManagedConnection if resource adapter finds an acceptable match otherwise null
+ */
+ public ManagedConnection matchManagedConnections(Set connectionSet,
+ Subject subject, ConnectionRequestInfo cxRequestInfo) throws ResourceException
+ {
+ log.finest("matchManagedConnections()");
+ ManagedConnection result = null;
+ Iterator it = connectionSet.iterator();
+ while (result == null && it.hasNext())
+ {
+ ManagedConnection mc = (ManagedConnection)it.next();
+ if (mc instanceof MultipleManagedConnection1)
+ {
+ result = mc;
+ }
+
+ }
+ return result;
+ }
+
+ /**
+ * Get the log writer for this ManagedConnectionFactory instance.
+ *
+ * @return PrintWriter
+ * @throws ResourceException generic exception
+ */
+ public PrintWriter getLogWriter() throws ResourceException
+ {
+ log.finest("getLogWriter()");
+ return logwriter;
+ }
+
+ /**
+ * Set the log writer for this ManagedConnectionFactory instance.
+ *
+ * @param out PrintWriter - an out stream for error logging and tracing
+ * @throws ResourceException generic exception
+ */
+ public void setLogWriter(PrintWriter out) throws ResourceException
+ {
+ log.finest("setLogWriter()");
+ logwriter = out;
+ }
+
+ /**
+ * Get the resource adapter
+ *
+ * @return The handle
+ */
+ public ResourceAdapter getResourceAdapter()
+ {
+ log.finest("getResourceAdapter()");
+ return ra;
+ }
+
+ /**
+ * Set the resource adapter
+ *
+ * @param ra The handle
+ */
+ public void setResourceAdapter(ResourceAdapter ra)
+ {
+ log.finest("setResourceAdapter()");
+ this.ra = ra;
+ }
+
+ /**
+ * Returns a hash code value for the object.
+ * @return A hash code value for this object.
+ */
+ @Override
+ public int hashCode()
+ {
+ int result = 17;
+ if (name != null)
+ result += 31 * result + 7 * name.hashCode();
+ else
+ result += 31 * result + 7;
+ return result;
+ }
+
+ /**
+ * Indicates whether some other object is equal to this one.
+ * @param other The reference object with which to compare.
+ * @return true if this object is the same as the obj argument, false otherwise.
+ */
+ @Override
+ public boolean equals(Object other)
+ {
+ if (other == null)
+ return false;
+ if (other == this)
+ return true;
+ if (!(other instanceof MultipleManagedConnectionFactory1))
+ return false;
+ MultipleManagedConnectionFactory1 obj = (MultipleManagedConnectionFactory1)other;
+ boolean result = true;
+ if (result)
+ {
+ if (name == null)
+ result = obj.getName() == null;
+ else
+ result = name.equals(obj.getName());
+ }
+ return result;
+ }
+
+
+}
Added: projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/multiple/MultipleManagedConnectionFactory2.java
===================================================================
--- projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/multiple/MultipleManagedConnectionFactory2.java (rev 0)
+++ projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/multiple/MultipleManagedConnectionFactory2.java 2011-08-05 16:13:39 UTC (rev 111944)
@@ -0,0 +1,243 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, 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.test.deployers.spec.rars.multiple;
+
+import java.io.PrintWriter;
+import java.util.Iterator;
+import java.util.Set;
+
+import java.util.logging.Logger;
+
+import javax.resource.ResourceException;
+import javax.resource.spi.ConnectionManager;
+import javax.resource.spi.ConnectionRequestInfo;
+import javax.resource.spi.ManagedConnection;
+import javax.resource.spi.ManagedConnectionFactory;
+import javax.resource.spi.ResourceAdapter;
+import javax.resource.spi.ResourceAdapterAssociation;
+
+import javax.security.auth.Subject;
+
+/**
+ * MultipleManagedConnectionFactory2
+ *
+ * @version $Revision: $
+ */
+public class MultipleManagedConnectionFactory2 implements ManagedConnectionFactory, ResourceAdapterAssociation
+{
+
+ /** The serial version UID */
+ private static final long serialVersionUID = 1L;
+
+ /** The logger */
+ private static Logger log = Logger.getLogger("MultipleManagedConnectionFactory2");
+
+ /** The resource adapter */
+ private ResourceAdapter ra;
+
+ /** The logwriter */
+ private PrintWriter logwriter;
+
+ /** Name */
+ private String name;
+
+ /**
+ * Default constructor
+ */
+ public MultipleManagedConnectionFactory2()
+ {
+
+ }
+
+ /**
+ * Set name
+ * @param name The value
+ */
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+ /**
+ * Get name
+ * @return The value
+ */
+ public String getName()
+ {
+ return name;
+ }
+
+ /**
+ * Creates a Connection Factory instance.
+ *
+ * @param cxManager ConnectionManager to be associated with created EIS connection factory instance
+ * @return EIS-specific Connection Factory instance or javax.resource.cci.ConnectionFactory instance
+ * @throws ResourceException Generic exception
+ */
+ public Object createConnectionFactory(ConnectionManager cxManager) throws ResourceException
+ {
+ log.finest("createConnectionFactory()");
+ return new MultipleConnectionFactory2Impl(this, cxManager);
+ }
+
+ /**
+ * Creates a Connection Factory instance.
+ *
+ * @return EIS-specific Connection Factory instance or javax.resource.cci.ConnectionFactory instance
+ * @throws ResourceException Generic exception
+ */
+ public Object createConnectionFactory() throws ResourceException
+ {
+ throw new ResourceException("This resource adapter doesn't support non-managed environments");
+ }
+
+ /**
+ * Creates a new physical connection to the underlying EIS resource manager.
+ *
+ * @param subject Caller's security information
+ * @param cxRequestInfo Additional resource adapter specific connection request information
+ * @throws ResourceException generic exception
+ * @return ManagedConnection instance
+ */
+ public ManagedConnection createManagedConnection(Subject subject,
+ ConnectionRequestInfo cxRequestInfo) throws ResourceException
+ {
+ log.finest("createManagedConnection()");
+ return new MultipleManagedConnection2(this);
+ }
+
+ /**
+ * Returns a matched connection from the candidate set of connections.
+ *
+ * @param connectionSet Candidate connection set
+ * @param subject Caller's security information
+ * @param cxRequestInfo Additional resource adapter specific connection request information
+ * @throws ResourceException generic exception
+ * @return ManagedConnection if resource adapter finds an acceptable match otherwise null
+ */
+ public ManagedConnection matchManagedConnections(Set connectionSet,
+ Subject subject, ConnectionRequestInfo cxRequestInfo) throws ResourceException
+ {
+ log.finest("matchManagedConnections()");
+ ManagedConnection result = null;
+ Iterator it = connectionSet.iterator();
+ while (result == null && it.hasNext())
+ {
+ ManagedConnection mc = (ManagedConnection)it.next();
+ if (mc instanceof MultipleManagedConnection2)
+ {
+ result = mc;
+ }
+
+ }
+ return result;
+ }
+
+ /**
+ * Get the log writer for this ManagedConnectionFactory instance.
+ *
+ * @return PrintWriter
+ * @throws ResourceException generic exception
+ */
+ public PrintWriter getLogWriter() throws ResourceException
+ {
+ log.finest("getLogWriter()");
+ return logwriter;
+ }
+
+ /**
+ * Set the log writer for this ManagedConnectionFactory instance.
+ *
+ * @param out PrintWriter - an out stream for error logging and tracing
+ * @throws ResourceException generic exception
+ */
+ public void setLogWriter(PrintWriter out) throws ResourceException
+ {
+ log.finest("setLogWriter()");
+ logwriter = out;
+ }
+
+ /**
+ * Get the resource adapter
+ *
+ * @return The handle
+ */
+ public ResourceAdapter getResourceAdapter()
+ {
+ log.finest("getResourceAdapter()");
+ return ra;
+ }
+
+ /**
+ * Set the resource adapter
+ *
+ * @param ra The handle
+ */
+ public void setResourceAdapter(ResourceAdapter ra)
+ {
+ log.finest("setResourceAdapter()");
+ this.ra = ra;
+ }
+
+ /**
+ * Returns a hash code value for the object.
+ * @return A hash code value for this object.
+ */
+ @Override
+ public int hashCode()
+ {
+ int result = 17;
+ if (name != null)
+ result += 31 * result + 7 * name.hashCode();
+ else
+ result += 31 * result + 7;
+ return result;
+ }
+
+ /**
+ * Indicates whether some other object is equal to this one.
+ * @param other The reference object with which to compare.
+ * @return true if this object is the same as the obj argument, false otherwise.
+ */
+ @Override
+ public boolean equals(Object other)
+ {
+ if (other == null)
+ return false;
+ if (other == this)
+ return true;
+ if (!(other instanceof MultipleManagedConnectionFactory2))
+ return false;
+ MultipleManagedConnectionFactory2 obj = (MultipleManagedConnectionFactory2)other;
+ boolean result = true;
+ if (result)
+ {
+ if (name == null)
+ result = obj.getName() == null;
+ else
+ result = name.equals(obj.getName());
+ }
+ return result;
+ }
+
+
+}
Added: projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/multiple/MultipleManagedConnectionMetaData.java
===================================================================
--- projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/multiple/MultipleManagedConnectionMetaData.java (rev 0)
+++ projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/multiple/MultipleManagedConnectionMetaData.java 2011-08-05 16:13:39 UTC (rev 111944)
@@ -0,0 +1,101 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, 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.test.deployers.spec.rars.multiple;
+
+import java.util.logging.Logger;
+
+import javax.resource.ResourceException;
+
+import javax.resource.spi.ManagedConnectionMetaData;
+
+/**
+ * MultipleManagedConnectionMetaData
+ *
+ * @version $Revision: $
+ */
+public class MultipleManagedConnectionMetaData implements ManagedConnectionMetaData
+{
+ /** The logger */
+ private static Logger log = Logger.getLogger("MultipleManagedConnectionMetaData");
+
+ /**
+ * Default constructor
+ */
+ public MultipleManagedConnectionMetaData()
+ {
+
+ }
+
+ /**
+ * Returns Product name of the underlying EIS instance connected through the ManagedConnection.
+ *
+ * @return Product name of the EIS instance
+ * @throws ResourceException Thrown if an error occurs
+ */
+ @Override
+ public String getEISProductName() throws ResourceException
+ {
+ log.finest("getEISProductName()");
+ return null; //TODO
+ }
+
+ /**
+ * Returns Product version of the underlying EIS instance connected through the ManagedConnection.
+ *
+ * @return Product version of the EIS instance
+ * @throws ResourceException Thrown if an error occurs
+ */
+ @Override
+ public String getEISProductVersion() throws ResourceException
+ {
+ log.finest("getEISProductVersion()");
+ return null; //TODO
+ }
+
+ /**
+ * Returns maximum limit on number of active concurrent connections
+ *
+ * @return Maximum limit for number of active concurrent connections
+ * @throws ResourceException Thrown if an error occurs
+ */
+ @Override
+ public int getMaxConnections() throws ResourceException
+ {
+ log.finest("getMaxConnections()");
+ return 0; //TODO
+ }
+
+ /**
+ * Returns name of the user associated with the ManagedConnection instance
+ *
+ * @return Name of the user
+ * @throws ResourceException Thrown if an error occurs
+ */
+ @Override
+ public String getUserName() throws ResourceException
+ {
+ log.finest("getUserName()");
+ return null; //TODO
+ }
+
+
+}
Added: projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/multiple/MultipleRaMetaData.java
===================================================================
--- projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/multiple/MultipleRaMetaData.java (rev 0)
+++ projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/multiple/MultipleRaMetaData.java 2011-08-05 16:13:39 UTC (rev 111944)
@@ -0,0 +1,141 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, 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.test.deployers.spec.rars.multiple;
+
+import javax.resource.cci.ResourceAdapterMetaData;
+
+/**
+ * MultipleRaMetaData
+ *
+ * @version $Revision: $
+ */
+public class MultipleRaMetaData implements ResourceAdapterMetaData
+{
+ /**
+ * Default constructor
+ */
+ public MultipleRaMetaData()
+ {
+
+ }
+
+ /**
+ * Gets the version of the resource adapter.
+ *
+ * @return String representing version of the resource adapter
+ */
+ @Override
+ public String getAdapterVersion()
+ {
+ return null; //TODO
+ }
+
+ /**
+ * Gets the name of the vendor that has provided the resource adapter.
+ *
+ * @return String representing name of the vendor
+ */
+ @Override
+ public String getAdapterVendorName()
+ {
+ return null; //TODO
+ }
+
+ /**
+ * Gets a tool displayable name of the resource adapter.
+ *
+ * @return String representing the name of the resource adapter
+ */
+ @Override
+ public String getAdapterName()
+ {
+ return null; //TODO
+ }
+
+ /**
+ * Gets a tool displayable short desription of the resource adapter.
+ *
+ * @return String describing the resource adapter
+ */
+ @Override
+ public String getAdapterShortDescription()
+ {
+ return null; //TODO
+ }
+
+ /**
+ * Returns a string representation of the version
+ *
+ * @return String representing the supported version of the connector architecture
+ */
+ @Override
+ public String getSpecVersion()
+ {
+ return null; //TODO
+ }
+
+ /**
+ * Returns an array of fully-qualified names of InteractionSpec
+ *
+ * @return Array of fully-qualified class names of InteractionSpec classes
+ */
+ @Override
+ public String[] getInteractionSpecsSupported()
+ {
+ return null; //TODO
+ }
+
+ /**
+ * Returns true if the implementation class for the Interaction
+ *
+ * @return boolean Depending on method support
+ */
+ @Override
+ public boolean supportsExecuteWithInputAndOutputRecord()
+ {
+ return false; //TODO
+ }
+
+ /**
+ * Returns true if the implementation class for the Interaction
+ *
+ * @return boolean Depending on method support
+ */
+ @Override
+ public boolean supportsExecuteWithInputRecordOnly()
+ {
+ return false; //TODO
+ }
+
+ /**
+ * Returns true if the resource adapter implements the LocalTransaction
+ *
+ * @return true If resource adapter supports resource manager local transaction demarcation
+ */
+ @Override
+ public boolean supportsLocalTransactionDemarcation()
+ {
+ return false; //TODO
+ }
+
+
+}
Added: projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/multiple/MultipleResourceAdapter.java
===================================================================
--- projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/multiple/MultipleResourceAdapter.java (rev 0)
+++ projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/multiple/MultipleResourceAdapter.java 2011-08-05 16:13:39 UTC (rev 111944)
@@ -0,0 +1,177 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, 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.test.deployers.spec.rars.multiple;
+
+import java.util.logging.Logger;
+
+import javax.resource.ResourceException;
+import javax.resource.spi.ActivationSpec;
+import javax.resource.spi.BootstrapContext;
+import javax.resource.spi.ResourceAdapter;
+import javax.resource.spi.ResourceAdapterInternalException;
+import javax.resource.spi.endpoint.MessageEndpointFactory;
+
+import javax.transaction.xa.XAResource;
+
+/**
+ * MultipleResourceAdapter
+ *
+ * @version $Revision: $
+ */
+public class MultipleResourceAdapter implements ResourceAdapter
+{
+
+ /** The logger */
+ private static Logger log = Logger.getLogger("MultipleResourceAdapter");
+
+ /** Name */
+ private String name;
+
+ /**
+ * Default constructor
+ */
+ public MultipleResourceAdapter()
+ {
+
+ }
+
+ /**
+ * Set name
+ * @param name The value
+ */
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+ /**
+ * Get name
+ * @return The value
+ */
+ public String getName()
+ {
+ return name;
+ }
+
+ /**
+ * This is called during the activation of a message endpoint.
+ *
+ * @param endpointFactory A message endpoint factory instance.
+ * @param spec An activation spec JavaBean instance.
+ * @throws ResourceException generic exception
+ */
+ public void endpointActivation(MessageEndpointFactory endpointFactory,
+ ActivationSpec spec) throws ResourceException
+ {
+ log.finest("endpointActivation()");
+ }
+
+ /**
+ * This is called when a message endpoint is deactivated.
+ *
+ * @param endpointFactory A message endpoint factory instance.
+ * @param spec An activation spec JavaBean instance.
+ */
+ public void endpointDeactivation(MessageEndpointFactory endpointFactory,
+ ActivationSpec spec)
+ {
+ log.finest("endpointDeactivation()");
+ }
+
+ /**
+ * This is called when a resource adapter instance is bootstrapped.
+ *
+ * @param ctx A bootstrap context containing references
+ * @throws ResourceAdapterInternalException indicates bootstrap failure.
+ */
+ public void start(BootstrapContext ctx)
+ throws ResourceAdapterInternalException
+ {
+ log.finest("start()");
+ }
+
+ /**
+ * This is called when a resource adapter instance is undeployed or
+ * during application server shutdown.
+ */
+ public void stop()
+ {
+ log.finest("stop()");
+ }
+
+ /**
+ * This method is called by the application server during crash recovery.
+ *
+ * @param specs An array of ActivationSpec JavaBeans
+ * @throws ResourceException generic exception
+ * @return An array of XAResource objects
+ */
+ public XAResource[] getXAResources(ActivationSpec[] specs)
+ throws ResourceException
+ {
+ log.finest("getXAResources()");
+ return null;
+ }
+
+ /**
+ * Returns a hash code value for the object.
+ * @return A hash code value for this object.
+ */
+ @Override
+ public int hashCode()
+ {
+ int result = 17;
+ if (name != null)
+ result += 31 * result + 7 * name.hashCode();
+ else
+ result += 31 * result + 7;
+ return result;
+ }
+
+ /**
+ * Indicates whether some other object is equal to this one.
+ * @param other The reference object with which to compare.
+ * @return true if this object is the same as the obj argument, false otherwise.
+ */
+ @Override
+ public boolean equals(Object other)
+ {
+ if (other == null)
+ return false;
+ if (other == this)
+ return true;
+ if (!(other instanceof MultipleResourceAdapter))
+ return false;
+ MultipleResourceAdapter obj = (MultipleResourceAdapter)other;
+ boolean result = true;
+ if (result)
+ {
+ if (name == null)
+ result = obj.getName() == null;
+ else
+ result = name.equals(obj.getName());
+ }
+ return result;
+ }
+
+
+}
Added: projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/multiple/package.html
===================================================================
--- projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/multiple/package.html (rev 0)
+++ projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/multiple/package.html 2011-08-05 16:13:39 UTC (rev 111944)
@@ -0,0 +1,3 @@
+<body>
+This package contains a resource adapter with two MCFs and two AOs.
+</body>
Added: projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/testcases/MultipleFullTestCase.java
===================================================================
--- projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/testcases/MultipleFullTestCase.java (rev 0)
+++ projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/testcases/MultipleFullTestCase.java 2011-08-05 16:13:39 UTC (rev 111944)
@@ -0,0 +1,104 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008-2009, 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.test.deployers.spec.rars.testcases;
+
+import org.jboss.jca.test.deployers.spec.ArquillianJCATestUtils;
+import org.jboss.jca.test.deployers.spec.rars.multiple.MultipleAdminObject1;
+import org.jboss.jca.test.deployers.spec.rars.multiple.MultipleAdminObject2;
+import org.jboss.jca.test.deployers.spec.rars.multiple.MultipleConnectionFactory1;
+import org.jboss.jca.test.deployers.spec.rars.multiple.MultipleConnectionFactory2;
+
+import javax.annotation.Resource;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.shrinkwrap.api.spec.ResourceAdapterArchive;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static org.junit.Assert.assertNotNull;
+
+/**
+ * Test cases for deploying resource adapter archives (.RAR) with multiple
+ * mananged connection factories and admin objects
+ *
+ * @author <a href="mailto:jesper.pedersen at jboss.org">Jesper Pedersen</a>
+ */
+ at RunWith(Arquillian.class)
+public class MultipleFullTestCase
+{
+
+ //-------------------------------------------------------------------------------------||
+ //---------------------- GIVEN --------------------------------------------------------||
+ //-------------------------------------------------------------------------------------||
+ /**
+ * Define the deployment
+ * @return The deployment archive
+ * @throws Exception in case of errors
+ */
+ @Deployment
+ public static ResourceAdapterArchive createDeployment() throws Exception
+ {
+ String archiveName = "multiple-full.rar";
+ String packageName = "org.jboss.jca.test.deployers.spec.rars.multiple";
+ ResourceAdapterArchive raa = ArquillianJCATestUtils.buidShrinkwrapRa(archiveName, packageName);
+ raa.addAsManifestResource(archiveName + "/META-INF/ra.xml", "ra.xml");
+ raa.addAsManifestResource(archiveName + "/META-INF/ironjacamar.xml", "ironjacamar.xml");
+
+ return raa;
+ }
+
+ //-------------------------------------------------------------------------------------||
+ //---------------------- WHEN --------------------------------------------------------||
+ //-------------------------------------------------------------------------------------||
+ //
+ @Resource(mappedName = "java:/eis/MultipleConnectionFactory1")
+ private MultipleConnectionFactory1 connectionFactory1;
+
+ @Resource(mappedName = "java:/eis/MultipleConnectionFactory2")
+ private MultipleConnectionFactory2 connectionFactory2;
+
+ @Resource(mappedName = "java:/eis/MultipleAdminObject1")
+ private MultipleAdminObject1 adminObject1;
+
+ @Resource(mappedName = "java:/eis/MultipleAdminObject2")
+ private MultipleAdminObject2 adminObject2;
+
+ //-------------------------------------------------------------------------------------||
+ //---------------------- THEN --------------------------------------------------------||
+ //-------------------------------------------------------------------------------------||
+
+ /**
+ * Basic
+ * @exception Throwable Thrown if case of an error
+ */
+ @Test
+ public void testBasic() throws Throwable
+ {
+ assertNotNull(connectionFactory1);
+ assertNotNull(connectionFactory2);
+ assertNotNull(adminObject1);
+ assertNotNull(adminObject2);
+ }
+}
Added: projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/testcases/MultiplePartialTestCase.java
===================================================================
--- projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/testcases/MultiplePartialTestCase.java (rev 0)
+++ projects/jboss-jca/trunk/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/testcases/MultiplePartialTestCase.java 2011-08-05 16:13:39 UTC (rev 111944)
@@ -0,0 +1,94 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008-2009, 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.test.deployers.spec.rars.testcases;
+
+import org.jboss.jca.test.deployers.spec.ArquillianJCATestUtils;
+import org.jboss.jca.test.deployers.spec.rars.multiple.MultipleAdminObject1;
+import org.jboss.jca.test.deployers.spec.rars.multiple.MultipleConnectionFactory1;
+
+import javax.annotation.Resource;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.shrinkwrap.api.spec.ResourceAdapterArchive;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static org.junit.Assert.assertNotNull;
+
+/**
+ * Test cases for deploying resource adapter archives (.RAR) with multiple
+ * mananged connection factories and admin objects - but only partial configured
+ *
+ * @author <a href="mailto:jesper.pedersen at jboss.org">Jesper Pedersen</a>
+ */
+ at RunWith(Arquillian.class)
+public class MultiplePartialTestCase
+{
+
+ //-------------------------------------------------------------------------------------||
+ //---------------------- GIVEN --------------------------------------------------------||
+ //-------------------------------------------------------------------------------------||
+ /**
+ * Define the deployment
+ * @return The deployment archive
+ * @throws Exception in case of errors
+ */
+ @Deployment
+ public static ResourceAdapterArchive createDeployment() throws Exception
+ {
+ String archiveName = "multiple-partial.rar";
+ String packageName = "org.jboss.jca.test.deployers.spec.rars.multiple";
+ ResourceAdapterArchive raa = ArquillianJCATestUtils.buidShrinkwrapRa(archiveName, packageName);
+ raa.addAsManifestResource(archiveName + "/META-INF/ra.xml", "ra.xml");
+ raa.addAsManifestResource(archiveName + "/META-INF/ironjacamar.xml", "ironjacamar.xml");
+
+ return raa;
+ }
+
+ //-------------------------------------------------------------------------------------||
+ //---------------------- WHEN --------------------------------------------------------||
+ //-------------------------------------------------------------------------------------||
+ //
+ @Resource(mappedName = "java:/eis/MultipleConnectionFactory1")
+ private MultipleConnectionFactory1 connectionFactory1;
+
+ @Resource(mappedName = "java:/eis/MultipleAdminObject1")
+ private MultipleAdminObject1 adminObject1;
+
+ //-------------------------------------------------------------------------------------||
+ //---------------------- THEN --------------------------------------------------------||
+ //-------------------------------------------------------------------------------------||
+
+ /**
+ * Basic
+ * @exception Throwable Thrown if case of an error
+ */
+ @Test
+ public void testBasic() throws Throwable
+ {
+ assertNotNull(connectionFactory1);
+ assertNotNull(adminObject1);
+ }
+}
Added: projects/jboss-jca/trunk/deployers/src/test/resources/multiple-full.rar/META-INF/ironjacamar.xml
===================================================================
--- projects/jboss-jca/trunk/deployers/src/test/resources/multiple-full.rar/META-INF/ironjacamar.xml (rev 0)
+++ projects/jboss-jca/trunk/deployers/src/test/resources/multiple-full.rar/META-INF/ironjacamar.xml 2011-08-05 16:13:39 UTC (rev 111944)
@@ -0,0 +1,59 @@
+<!--
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, 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.
+ */
+-->
+
+<ironjacamar xmlns="http://www.jboss.org/ironjacamar/schema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.jboss.org/ironjacamar/schema
+ http://www.jboss.org/ironjacamar/schema/ironjacamar_1_0.xsd">
+ <config-property name="Name"></config-property>
+
+ <transaction-support>NoTransaction</transaction-support>
+
+ <connection-definitions>
+ <connection-definition class-name="org.jboss.jca.test.deployers.spec.rars.multiple.MultipleManagedConnectionFactory1"
+ enabled="true" jndi-name="java:/eis/MultipleConnectionFactory1"
+ pool-name="MultipleConnectionFactory1">
+ <config-property name="Name">A</config-property>
+ </connection-definition>
+
+ <connection-definition class-name="org.jboss.jca.test.deployers.spec.rars.multiple.MultipleManagedConnectionFactory2"
+ enabled="true" jndi-name="java:/eis/MultipleConnectionFactory2"
+ pool-name="MultipleConnectionFactory2">
+ <config-property name="Name">B</config-property>
+ </connection-definition>
+
+ </connection-definitions>
+
+ <admin-objects>
+ <admin-object class-name="org.jboss.jca.test.deployers.spec.rars.multiple.MultipleAdminObject1Impl"
+ jndi-name="java:/eis/MultipleAdminObject1">
+ <config-property name="Name">C</config-property>
+ </admin-object>
+ <admin-object class-name="org.jboss.jca.test.deployers.spec.rars.multiple.MultipleAdminObject2Impl"
+ jndi-name="java:/eis/MultipleAdminObject2">
+ <config-property name="Name">D</config-property>
+ </admin-object>
+ </admin-objects>
+
+</ironjacamar>
Added: projects/jboss-jca/trunk/deployers/src/test/resources/multiple-full.rar/META-INF/ra.xml
===================================================================
--- projects/jboss-jca/trunk/deployers/src/test/resources/multiple-full.rar/META-INF/ra.xml (rev 0)
+++ projects/jboss-jca/trunk/deployers/src/test/resources/multiple-full.rar/META-INF/ra.xml 2011-08-05 16:13:39 UTC (rev 111944)
@@ -0,0 +1,95 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, 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.
+ */
+-->
+
+<connector xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
+ http://java.sun.com/xml/ns/j2ee/connector_1_5.xsd"
+ version="1.5">
+
+ <vendor-name>Red Hat Middleware LLC</vendor-name>
+ <eis-type>Test RA</eis-type>
+ <resourceadapter-version>0.1</resourceadapter-version>
+ <resourceadapter>
+ <resourceadapter-class>org.jboss.jca.test.deployers.spec.rars.multiple.MultipleResourceAdapter</resourceadapter-class>
+ <config-property>
+ <config-property-name>Name</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value></config-property-value>
+ </config-property>
+
+ <outbound-resourceadapter>
+ <connection-definition>
+ <managedconnectionfactory-class>org.jboss.jca.test.deployers.spec.rars.multiple.MultipleManagedConnectionFactory1</managedconnectionfactory-class>
+ <config-property>
+ <config-property-name>Name</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value></config-property-value>
+ </config-property>
+
+ <connectionfactory-interface>org.jboss.jca.test.deployers.spec.rars.multiple.MultipleConnectionFactory1</connectionfactory-interface>
+ <connectionfactory-impl-class>org.jboss.jca.test.deployers.spec.rars.multiple.MultipleConnectionFactory1Impl</connectionfactory-impl-class>
+ <connection-interface>org.jboss.jca.test.deployers.spec.rars.multiple.MultipleConnection1</connection-interface>
+ <connection-impl-class>org.jboss.jca.test.deployers.spec.rars.multiple.MultipleConnection1Impl</connection-impl-class>
+ </connection-definition>
+ <connection-definition>
+ <managedconnectionfactory-class>org.jboss.jca.test.deployers.spec.rars.multiple.MultipleManagedConnectionFactory2</managedconnectionfactory-class>
+ <config-property>
+ <config-property-name>Name</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value></config-property-value>
+ </config-property>
+
+ <connectionfactory-interface>org.jboss.jca.test.deployers.spec.rars.multiple.MultipleConnectionFactory2</connectionfactory-interface>
+ <connectionfactory-impl-class>org.jboss.jca.test.deployers.spec.rars.multiple.MultipleConnectionFactory2Impl</connectionfactory-impl-class>
+ <connection-interface>org.jboss.jca.test.deployers.spec.rars.multiple.MultipleConnection2</connection-interface>
+ <connection-impl-class>org.jboss.jca.test.deployers.spec.rars.multiple.MultipleConnection2Impl</connection-impl-class>
+ </connection-definition>
+ <transaction-support>NoTransaction</transaction-support>
+ <reauthentication-support>false</reauthentication-support>
+ </outbound-resourceadapter>
+ <adminobject>
+ <adminobject-interface>org.jboss.jca.test.deployers.spec.rars.multiple.MultipleAdminObject1</adminobject-interface>
+ <adminobject-class>org.jboss.jca.test.deployers.spec.rars.multiple.MultipleAdminObject1Impl</adminobject-class>
+ <config-property>
+ <config-property-name>Name</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value></config-property-value>
+ </config-property>
+
+ </adminobject>
+ <adminobject>
+ <adminobject-interface>org.jboss.jca.test.deployers.spec.rars.multiple.MultipleAdminObject2</adminobject-interface>
+ <adminobject-class>org.jboss.jca.test.deployers.spec.rars.multiple.MultipleAdminObject2Impl</adminobject-class>
+ <config-property>
+ <config-property-name>Name</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value></config-property-value>
+ </config-property>
+
+ </adminobject>
+ </resourceadapter>
+</connector>
Added: projects/jboss-jca/trunk/deployers/src/test/resources/multiple-partial.rar/META-INF/ironjacamar.xml
===================================================================
--- projects/jboss-jca/trunk/deployers/src/test/resources/multiple-partial.rar/META-INF/ironjacamar.xml (rev 0)
+++ projects/jboss-jca/trunk/deployers/src/test/resources/multiple-partial.rar/META-INF/ironjacamar.xml 2011-08-05 16:13:39 UTC (rev 111944)
@@ -0,0 +1,48 @@
+<!--
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, 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.
+ */
+-->
+
+<ironjacamar xmlns="http://www.jboss.org/ironjacamar/schema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.jboss.org/ironjacamar/schema
+ http://www.jboss.org/ironjacamar/schema/ironjacamar_1_0.xsd">
+ <config-property name="Name"></config-property>
+
+ <transaction-support>NoTransaction</transaction-support>
+
+ <connection-definitions>
+ <connection-definition class-name="org.jboss.jca.test.deployers.spec.rars.multiple.MultipleManagedConnectionFactory1"
+ enabled="true" jndi-name="java:/eis/MultipleConnectionFactory1"
+ pool-name="MultipleConnectionFactory1">
+ <config-property name="Name">A</config-property>
+ </connection-definition>
+ </connection-definitions>
+
+ <admin-objects>
+ <admin-object class-name="org.jboss.jca.test.deployers.spec.rars.multiple.MultipleAdminObject1Impl"
+ jndi-name="java:/eis/MultipleAdminObject1">
+ <config-property name="Name">C</config-property>
+ </admin-object>
+ </admin-objects>
+
+</ironjacamar>
Added: projects/jboss-jca/trunk/deployers/src/test/resources/multiple-partial.rar/META-INF/ra.xml
===================================================================
--- projects/jboss-jca/trunk/deployers/src/test/resources/multiple-partial.rar/META-INF/ra.xml (rev 0)
+++ projects/jboss-jca/trunk/deployers/src/test/resources/multiple-partial.rar/META-INF/ra.xml 2011-08-05 16:13:39 UTC (rev 111944)
@@ -0,0 +1,95 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, 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.
+ */
+-->
+
+<connector xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
+ http://java.sun.com/xml/ns/j2ee/connector_1_5.xsd"
+ version="1.5">
+
+ <vendor-name>Red Hat Middleware LLC</vendor-name>
+ <eis-type>Test RA</eis-type>
+ <resourceadapter-version>0.1</resourceadapter-version>
+ <resourceadapter>
+ <resourceadapter-class>org.jboss.jca.test.deployers.spec.rars.multiple.MultipleResourceAdapter</resourceadapter-class>
+ <config-property>
+ <config-property-name>Name</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value></config-property-value>
+ </config-property>
+
+ <outbound-resourceadapter>
+ <connection-definition>
+ <managedconnectionfactory-class>org.jboss.jca.test.deployers.spec.rars.multiple.MultipleManagedConnectionFactory1</managedconnectionfactory-class>
+ <config-property>
+ <config-property-name>Name</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value></config-property-value>
+ </config-property>
+
+ <connectionfactory-interface>org.jboss.jca.test.deployers.spec.rars.multiple.MultipleConnectionFactory1</connectionfactory-interface>
+ <connectionfactory-impl-class>org.jboss.jca.test.deployers.spec.rars.multiple.MultipleConnectionFactory1Impl</connectionfactory-impl-class>
+ <connection-interface>org.jboss.jca.test.deployers.spec.rars.multiple.MultipleConnection1</connection-interface>
+ <connection-impl-class>org.jboss.jca.test.deployers.spec.rars.multiple.MultipleConnection1Impl</connection-impl-class>
+ </connection-definition>
+ <connection-definition>
+ <managedconnectionfactory-class>org.jboss.jca.test.deployers.spec.rars.multiple.MultipleManagedConnectionFactory2</managedconnectionfactory-class>
+ <config-property>
+ <config-property-name>Name</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value></config-property-value>
+ </config-property>
+
+ <connectionfactory-interface>org.jboss.jca.test.deployers.spec.rars.multiple.MultipleConnectionFactory2</connectionfactory-interface>
+ <connectionfactory-impl-class>org.jboss.jca.test.deployers.spec.rars.multiple.MultipleConnectionFactory2Impl</connectionfactory-impl-class>
+ <connection-interface>org.jboss.jca.test.deployers.spec.rars.multiple.MultipleConnection2</connection-interface>
+ <connection-impl-class>org.jboss.jca.test.deployers.spec.rars.multiple.MultipleConnection2Impl</connection-impl-class>
+ </connection-definition>
+ <transaction-support>NoTransaction</transaction-support>
+ <reauthentication-support>false</reauthentication-support>
+ </outbound-resourceadapter>
+ <adminobject>
+ <adminobject-interface>org.jboss.jca.test.deployers.spec.rars.multiple.MultipleAdminObject1</adminobject-interface>
+ <adminobject-class>org.jboss.jca.test.deployers.spec.rars.multiple.MultipleAdminObject1Impl</adminobject-class>
+ <config-property>
+ <config-property-name>Name</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value></config-property-value>
+ </config-property>
+
+ </adminobject>
+ <adminobject>
+ <adminobject-interface>org.jboss.jca.test.deployers.spec.rars.multiple.MultipleAdminObject2</adminobject-interface>
+ <adminobject-class>org.jboss.jca.test.deployers.spec.rars.multiple.MultipleAdminObject2Impl</adminobject-class>
+ <config-property>
+ <config-property-name>Name</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value></config-property-value>
+ </config-property>
+
+ </adminobject>
+ </resourceadapter>
+</connector>
More information about the jboss-cvs-commits
mailing list