[jboss-cvs] JBossAS SVN: r107641 - in projects/jboss-jca/branches/performance: rars and 8 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Aug 17 06:12:36 EDT 2010


Author: jeff.zhang
Date: 2010-08-17 06:12:34 -0400 (Tue, 17 Aug 2010)
New Revision: 107641

Added:
   projects/jboss-jca/branches/performance/rars/src/main/java/org/jboss/jca/performance/rars/connection/ConnectionTest.java
   projects/jboss-jca/branches/performance/rars/src/main/java/org/jboss/jca/performance/rars/connection/ejb/
   projects/jboss-jca/branches/performance/rars/src/main/java/org/jboss/jca/performance/rars/connection/ejb/Connection.java
   projects/jboss-jca/branches/performance/rars/src/main/java/org/jboss/jca/performance/rars/connection/ejb/ConnectionBean.java
   projects/jboss-jca/branches/performance/rars/src/main/java/org/jboss/jca/performance/rars/connection/ejb/ConnectionClient.java
   projects/jboss-jca/branches/performance/rars/src/main/java/org/jboss/jca/performance/rars/connection/ejb/ConnectionHome.java
   projects/jboss-jca/branches/performance/rars/src/main/resources/connection/ds/
   projects/jboss-jca/branches/performance/rars/src/main/resources/connection/ds/connection-no-ds.xml
   projects/jboss-jca/branches/performance/rars/src/main/resources/connection/ds/connection-xa-ds.xml
   projects/jboss-jca/branches/performance/rars/src/main/resources/connection/ds/jndi.properties
   projects/jboss-jca/branches/performance/rars/src/main/resources/connection/ejb/
   projects/jboss-jca/branches/performance/rars/src/main/resources/connection/ejb/META-INF/
   projects/jboss-jca/branches/performance/rars/src/main/resources/connection/ejb/META-INF/ejb-jar.xml
   projects/jboss-jca/branches/performance/rars/src/main/resources/connection/ejb/META-INF/jboss.xml
Modified:
   projects/jboss-jca/branches/performance/build.xml
   projects/jboss-jca/branches/performance/ivy.xml
   projects/jboss-jca/branches/performance/rars/build.xml
   projects/jboss-jca/branches/performance/rars/src/main/java/org/jboss/jca/performance/rars/connection/ConnectionUnit.java
   projects/jboss-jca/branches/performance/rars/src/main/java/org/jboss/jca/performance/rars/connection/PerfResourceAdapter.java
   projects/jboss-jca/branches/performance/rars/src/main/resources/connection/META-INF/ra.xml
   projects/jboss-jca/branches/performance/servers/build.xml
Log:
[JBJCA-381] for jbas, deploy rar,ds,ejb and client

Modified: projects/jboss-jca/branches/performance/build.xml
===================================================================
--- projects/jboss-jca/branches/performance/build.xml	2010-08-17 09:46:50 UTC (rev 107640)
+++ projects/jboss-jca/branches/performance/build.xml	2010-08-17 10:12:34 UTC (rev 107641)
@@ -103,6 +103,7 @@
        Versions              
        ================================= -->
   <property name="version.jboss.jca.api" value="1.5.0.GA"/>
+  <property name="version.jboss.ejb.api" value="3.0.0.GA"/>
   <property name="version.jboss.stdio" value="1.0.0.CR3"/>
   <property name="version.fungal" value="0.8.0.Beta6"/>
   <property name="version.jboss.test" value="1.1.9.GA"/>

Modified: projects/jboss-jca/branches/performance/ivy.xml
===================================================================
--- projects/jboss-jca/branches/performance/ivy.xml	2010-08-17 09:46:50 UTC (rev 107640)
+++ projects/jboss-jca/branches/performance/ivy.xml	2010-08-17 10:12:34 UTC (rev 107641)
@@ -37,6 +37,7 @@
 
   <dependencies>
     <dependency org="org.jboss.javaee" name="jboss-jca-api" rev="${version.jboss.jca.api}" conf="common"/>
+    <dependency org="org.jboss.javaee" name="jboss-ejb-api" rev="${version.jboss.ejb.api}" conf="common"/>
     <dependency org="org.jboss.stdio" name="jboss-stdio" rev="${version.jboss.stdio}" conf="common"/>
     <dependency org="log4j" name="log4j" rev="${version.log4j}" conf="common"/>
     <dependency org="org.jboss.logging" name="jboss-logging-log4j" rev="${version.jboss.logging}" conf="common"/>

Modified: projects/jboss-jca/branches/performance/rars/build.xml
===================================================================
--- projects/jboss-jca/branches/performance/rars/build.xml	2010-08-17 09:46:50 UTC (rev 107640)
+++ projects/jboss-jca/branches/performance/rars/build.xml	2010-08-17 10:12:34 UTC (rev 107641)
@@ -66,7 +66,7 @@
            <fileset dir="${build.rars.dir}/jars/rars"
         	    includes="org/jboss/jca/performance/rars/@{type}/*.class"/>
 
-           <fileset dir="${build.rars.dir}/jars/rars//noblock/@{as}/@{trans}/@{count}/@{type}"
+           <fileset dir="${build.rars.dir}/jars/rars/noblock/@{as}/@{trans}/@{count}/@{type}"
         	    includes="**/**"/>
         </jar>
     </sequential>
@@ -99,6 +99,27 @@
     </sequential>
   </macrodef>
 
+  <macrodef name="make-jbas-connection-rar">
+    <attribute name="trans"/>
+    <sequential>
+        <copy todir="${build.rars.dir}/jars/rars/noblock/JBAS/@{trans}/1">
+          <fileset dir="src/main/resources/" includes="**/ra.xml"/>
+          <filterset>
+          	<filter token="TRANS" value="@{trans}"/>
+          </filterset>
+        </copy>
+      	
+        <jar destfile="${target.dir}/connection_JBAS_@{trans}_1.rar"
+             manifest="src/main/resources/rar-manifest.mf">
+           <fileset dir="${build.rars.dir}/jars/rars"
+        	    includes="org/jboss/jca/performance/rars/connection/*.class"/>
+
+           <fileset dir="${build.rars.dir}/jars/rars/noblock/JBAS/@{trans}/1/connection"
+        	    includes="**/**"/>
+        </jar>
+    </sequential>
+  </macrodef>
+	
   <!-- ================================= 
        Target: jars 
        ================================= -->
@@ -151,8 +172,8 @@
     <make-rar type="connection" count="10000" as="JBJCA" trans="XATransaction"/>
     <make-rar type="connection" count="100000" as="JBJCA" trans="NoTransaction"/>
     <make-rar type="connection" count="100000" as="JBJCA" trans="XATransaction"/>
+    <make-rar type="connection" count="99" as="JBJCA" trans="NoTransaction"/>
 
-
     <make-rar type="workmanager" count="1" as="JBAS" trans="NoTransaction"/>
     <make-rar type="workmanager" count="1" as="JBAS" trans="XATransaction"/>
     <make-rar type="workmanager" count="10" as="JBAS" trans="NoTransaction"/>
@@ -179,19 +200,25 @@
     <make-block-rar type="workmanager" count="100000" as="JBAS" trans="NoTransaction"/>
     <make-block-rar type="workmanager" count="100000" as="JBAS" trans="XATransaction"/>
 
-    <make-rar type="connection" count="1" as="JBAS" trans="NoTransaction"/>
-    <make-rar type="connection" count="1" as="JBAS" trans="XATransaction"/>
-    <make-rar type="connection" count="10" as="JBAS" trans="NoTransaction"/>
-    <make-rar type="connection" count="10" as="JBAS" trans="XATransaction"/>
-    <make-rar type="connection" count="100" as="JBAS" trans="NoTransaction"/>
-    <make-rar type="connection" count="100" as="JBAS" trans="XATransaction"/>
-    <make-rar type="connection" count="1000" as="JBAS" trans="NoTransaction"/>
-    <make-rar type="connection" count="1000" as="JBAS" trans="XATransaction"/>
-    <make-rar type="connection" count="10000" as="JBAS" trans="NoTransaction"/>
-    <make-rar type="connection" count="10000" as="JBAS" trans="XATransaction"/>
-    <make-rar type="connection" count="100000" as="JBAS" trans="NoTransaction"/>
-    <make-rar type="connection" count="100000" as="JBAS" trans="XATransaction"/>
+    <make-jbas-connection-rar trans="NoTransaction"/>
+    <make-jbas-connection-rar trans="XATransaction"/>
 
+    <copy todir="${build.rars.dir}/jars/rars/ds/">
+      <fileset dir="src/main/resources/connection/ds" includes="*"/>
+    </copy>
+  	
+    <copy todir="${build.rars.dir}/jars/rars/ejb/">
+      <fileset dir="src/main/resources/connection/ejb" includes="**"/>
+    </copy>
+
+    <jar destfile="${target.dir}/connection_ejb.jar"
+         manifest="src/main/resources/rar-manifest.mf">
+       <fileset dir="${build.rars.dir}/jars/rars"
+    	    includes="org/jboss/jca/performance/rars/connection/ejb/*.class"/>
+
+       <fileset dir="${build.rars.dir}/jars/rars/ejb"
+    	    includes="**/**"/>
+    </jar>
   </target>
 
   <!-- ================================= 

Added: projects/jboss-jca/branches/performance/rars/src/main/java/org/jboss/jca/performance/rars/connection/ConnectionTest.java
===================================================================
--- projects/jboss-jca/branches/performance/rars/src/main/java/org/jboss/jca/performance/rars/connection/ConnectionTest.java	                        (rev 0)
+++ projects/jboss-jca/branches/performance/rars/src/main/java/org/jboss/jca/performance/rars/connection/ConnectionTest.java	2010-08-17 10:12:34 UTC (rev 107641)
@@ -0,0 +1,111 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, 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.performance.rars.connection;
+
+/**
+ * A ConnectionTest.
+ * 
+ * @author Jeff Zhang
+ * @version $Revision: $
+ */
+public class ConnectionTest
+{
+   /** count */
+   private int count;
+   /** app server */
+   private String appserver;
+   /** trans */
+   private String trans;
+
+   /**
+    * constructor
+    * @param count count
+    * @param trans transaction type
+    */
+   public ConnectionTest(int count, String trans)
+   {
+      this(count, "JBAS", trans);
+   }
+   
+   /**
+    * constructor
+    * @param count count
+    * @param appserver appserver name
+    * @param trans transaction type
+    */
+   public ConnectionTest(int count, String appserver, String trans)
+   {
+      this.count = count;
+      this.appserver = appserver;
+      this.trans = trans;
+   }
+   
+   /**
+    * test get connection reference and invocation
+    */
+   public void test() throws Exception
+   {
+      String rarname = "connection_" + appserver + "_" + trans + "_" + count;
+      long l1 = System.nanoTime();
+      ConnectionUnit cu = new ConnectionUnit(count, rarname);
+      cu.test();
+
+      long l2 = System.nanoTime();
+      long time = (l2 - l1) / 1000;
+
+      System.out.println("@@,connection," + appserver + "," + trans + "," + count + "," + time);
+   }
+   
+   /**
+    * main
+    *
+    * @param args param
+    */
+   public static void main(String[] args)
+   {
+      if (args.length < 2)
+         usage("Wrong number of arguments.");
+      try
+      {
+         int count = Integer.parseInt(args[0]);
+         ConnectionTest ct = new ConnectionTest(count, args[1]);
+         ct.test();
+      }
+      catch (Exception e)
+      {
+         e.printStackTrace();
+      }
+      
+   }
+   
+   /**
+    * print usage
+    *
+    * @param msg usage message
+    */
+   static void usage(String msg)
+   {
+      System.err.println(msg);
+      System.err.println("Usage: java " + ConnectionTest.class.getName() + " count trans");
+      System.exit(1);
+   }
+}

Modified: projects/jboss-jca/branches/performance/rars/src/main/java/org/jboss/jca/performance/rars/connection/ConnectionUnit.java
===================================================================
--- projects/jboss-jca/branches/performance/rars/src/main/java/org/jboss/jca/performance/rars/connection/ConnectionUnit.java	2010-08-17 09:46:50 UTC (rev 107640)
+++ projects/jboss-jca/branches/performance/rars/src/main/java/org/jboss/jca/performance/rars/connection/ConnectionUnit.java	2010-08-17 10:12:34 UTC (rev 107641)
@@ -54,6 +54,7 @@
     */
    public void test() throws Exception
    {
+
       Context context = new InitialContext();
 
       PerfConnectionFactory pcf = (PerfConnectionFactory)context.lookup("java:/eis/" + rarname);
@@ -63,6 +64,6 @@
          PerfConnection pc = pcf.getConnection();
          pc.callMe();
       }
+
    }
-
 }

Modified: projects/jboss-jca/branches/performance/rars/src/main/java/org/jboss/jca/performance/rars/connection/PerfResourceAdapter.java
===================================================================
--- projects/jboss-jca/branches/performance/rars/src/main/java/org/jboss/jca/performance/rars/connection/PerfResourceAdapter.java	2010-08-17 09:46:50 UTC (rev 107640)
+++ projects/jboss-jca/branches/performance/rars/src/main/java/org/jboss/jca/performance/rars/connection/PerfResourceAdapter.java	2010-08-17 10:12:34 UTC (rev 107641)
@@ -175,24 +175,20 @@
    {
       log.info("call start");
 
-      String rarname = "conn_" + appserver + "_" + trans + "_" + count;
-      long l1 = System.nanoTime();
-      try
+      if (appserver.startsWith("JBJCA"))
       {
-         Class<?> workUnitClazz = Class.forName(testCase);
-         Object obj = workUnitClazz.getDeclaredConstructor(int.class, String.class)
-            .newInstance(count, rarname);
-         ((ConnectionUnit)obj).test();
+         try
+         {
+            Class<?> workUnitClazz = Class.forName(testCase);
+            Object obj = workUnitClazz.getDeclaredConstructor(int.class, String.class, String.class)
+               .newInstance(count, appserver, trans);
+            ((ConnectionTest)obj).test();
+         }
+         catch (Exception e)
+         {
+            e.printStackTrace();
+         }
       }
-      catch (Exception e)
-      {
-         e.printStackTrace();
-      }
-      long l2 = System.nanoTime();
-      long time = (l2 - l1) / 1000;
-
-      System.out.println("Stat: running " + trans + " " + count + 
-         " on as server " + appserver + " time: " + time + " us" );
    }
 
    /**

Added: projects/jboss-jca/branches/performance/rars/src/main/java/org/jboss/jca/performance/rars/connection/ejb/Connection.java
===================================================================
--- projects/jboss-jca/branches/performance/rars/src/main/java/org/jboss/jca/performance/rars/connection/ejb/Connection.java	                        (rev 0)
+++ projects/jboss-jca/branches/performance/rars/src/main/java/org/jboss/jca/performance/rars/connection/ejb/Connection.java	2010-08-17 10:12:34 UTC (rev 107641)
@@ -0,0 +1,34 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, 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.performance.rars.connection.ejb;
+
+import java.rmi.RemoteException;
+import javax.ejb.EJBObject;
+
+/**
+ * Connection
+ * @version $Revision: 1.1 $
+ */
+public interface Connection extends EJBObject
+{
+   public void getConnection(int count, String trans) throws RemoteException;
+}

Added: projects/jboss-jca/branches/performance/rars/src/main/java/org/jboss/jca/performance/rars/connection/ejb/ConnectionBean.java
===================================================================
--- projects/jboss-jca/branches/performance/rars/src/main/java/org/jboss/jca/performance/rars/connection/ejb/ConnectionBean.java	                        (rev 0)
+++ projects/jboss-jca/branches/performance/rars/src/main/java/org/jboss/jca/performance/rars/connection/ejb/ConnectionBean.java	2010-08-17 10:12:34 UTC (rev 107641)
@@ -0,0 +1,109 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, 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.performance.rars.connection.ejb;
+
+import java.rmi.RemoteException;
+import javax.ejb.SessionBean;
+import javax.ejb.SessionContext;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+
+import org.jboss.jca.performance.rars.connection.PerfConnection;
+import org.jboss.jca.performance.rars.connection.PerfConnectionFactory;
+
+public class ConnectionBean implements SessionBean
+{
+   /** The serialVersionUID */
+   private static final long serialVersionUID = 1L;
+   
+   private SessionContext sessionCtx;
+
+   public void ejbCreate()
+   {
+      System.out.println("ejbCreate: ");
+   }
+
+   public void ejbLoad()
+   {
+      System.out.println("ejbLoad");
+   }
+
+   public void ejbRemove()
+   {
+      System.out.println("ejbRemove");
+   }
+
+   public void ejbStore()
+   {
+      System.out.println("ejbStore");
+   }
+
+   public void setSessionContext(SessionContext context)
+   {
+      sessionCtx = context;
+      System.out.println("setSessionContext");
+   }
+
+   public void unsetSessionContext()
+   {
+      sessionCtx = null;
+      System.out.println("unsetSessionContext");
+   }
+
+   public void ejbActivate()
+   {
+      System.out.println("ejbActivate");
+   }
+
+   public void ejbPassivate()
+   {
+      System.out.println("ejbPassivate");
+   }
+
+   public void getConnection(int count, String trans)
+   {
+      try
+      {
+         Context context = new InitialContext();
+
+         PerfConnectionFactory pcf = (PerfConnectionFactory)context.lookup("java:connection_JBAS_" + trans);
+
+         long l1 = System.nanoTime();
+
+
+         for (int i = 0; i < count; i++)
+         {
+            PerfConnection pc = pcf.getConnection();
+            pc.callMe();
+         }
+         
+         long l2 = System.nanoTime();
+         long time = (l2 - l1) / 1000;
+
+         System.out.println("@@,connection,JBAS," + trans + "," + count + "," + time);
+      }
+      catch (Exception e)
+      {
+         e.printStackTrace();
+      }
+   }
+}
\ No newline at end of file

Added: projects/jboss-jca/branches/performance/rars/src/main/java/org/jboss/jca/performance/rars/connection/ejb/ConnectionClient.java
===================================================================
--- projects/jboss-jca/branches/performance/rars/src/main/java/org/jboss/jca/performance/rars/connection/ejb/ConnectionClient.java	                        (rev 0)
+++ projects/jboss-jca/branches/performance/rars/src/main/java/org/jboss/jca/performance/rars/connection/ejb/ConnectionClient.java	2010-08-17 10:12:34 UTC (rev 107641)
@@ -0,0 +1,74 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, 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.performance.rars.connection.ejb;
+
+import javax.naming.InitialContext;
+
+/**
+ * A ConnectionClient.
+ * 
+ * @author Jeff Zhang
+ * @version $Revision: $
+ */
+public class ConnectionClient
+{
+   /**
+    * main
+    *
+    * @param args param
+    */
+   public static void main(String[] args)
+   {
+      if (args.length < 2)
+         usage("Wrong number of arguments.");
+      try
+      {
+         int count = Integer.parseInt(args[0]);
+
+         InitialContext iniCtx = new InitialContext();
+         Object ref = iniCtx.lookup("ConnectionBean");
+         ConnectionHome home = (ConnectionHome) ref;
+         Connection ct = home.create();
+   
+         System.out.println("Created Connection");
+
+         ct.getConnection(count, args[1]);
+      }
+      catch (Exception e)
+      {
+         e.printStackTrace();
+      }
+
+   }
+   
+   /**
+    * print usage
+    *
+    * @param msg usage message
+    */
+   static void usage(String msg)
+   {
+      System.err.println(msg);
+      System.err.println("Usage: java " + ConnectionClient.class.getName() + " count transation");
+      System.exit(1);
+   }
+}

Added: projects/jboss-jca/branches/performance/rars/src/main/java/org/jboss/jca/performance/rars/connection/ejb/ConnectionHome.java
===================================================================
--- projects/jboss-jca/branches/performance/rars/src/main/java/org/jboss/jca/performance/rars/connection/ejb/ConnectionHome.java	                        (rev 0)
+++ projects/jboss-jca/branches/performance/rars/src/main/java/org/jboss/jca/performance/rars/connection/ejb/ConnectionHome.java	2010-08-17 10:12:34 UTC (rev 107641)
@@ -0,0 +1,36 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, 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.performance.rars.connection.ejb;
+
+import java.rmi.RemoteException;
+import javax.ejb.CreateException;
+import javax.ejb.EJBHome;
+
+/**
+ * ConnectionHome
+ * @version $Revision:$
+ */
+public interface ConnectionHome extends EJBHome
+{
+   public Connection create()
+      throws RemoteException, CreateException;
+}

Modified: projects/jboss-jca/branches/performance/rars/src/main/resources/connection/META-INF/ra.xml
===================================================================
--- projects/jboss-jca/branches/performance/rars/src/main/resources/connection/META-INF/ra.xml	2010-08-17 09:46:50 UTC (rev 107640)
+++ projects/jboss-jca/branches/performance/rars/src/main/resources/connection/META-INF/ra.xml	2010-08-17 10:12:34 UTC (rev 107641)
@@ -20,7 +20,7 @@
       <config-property>
          <config-property-name>testCase</config-property-name>
          <config-property-type>java.lang.String</config-property-type>
-         <config-property-value>org.jboss.jca.performance.rars.connection.ConnectionUnit</config-property-value>
+         <config-property-value>org.jboss.jca.performance.rars.connection.ConnectionTest</config-property-value>
       </config-property>
 
       <config-property>

Added: projects/jboss-jca/branches/performance/rars/src/main/resources/connection/ds/connection-no-ds.xml
===================================================================
--- projects/jboss-jca/branches/performance/rars/src/main/resources/connection/ds/connection-no-ds.xml	                        (rev 0)
+++ projects/jboss-jca/branches/performance/rars/src/main/resources/connection/ds/connection-no-ds.xml	2010-08-17 10:12:34 UTC (rev 107641)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<connection-factories>
+  <!-- JMS XA Resource adapter, use this to get transacted JMS in beans -->
+  <no-tx-connection-factory>
+    <jndi-name>connection_JBAS_NoTransaction</jndi-name>
+    <rar-name>connection_JBAS_NoTransaction_1.rar</rar-name>
+    <connection-definition>org.jboss.jca.performance.rars.connection.PerfConnectionFactory</connection-definition>
+    <!-- 
+    <use-java-context>false</use-java-context>
+    <security-domain-and-application>NoneRealm</security-domain-and-application>
+     -->
+  </no-tx-connection-factory>
+
+</connection-factories>
\ No newline at end of file

Added: projects/jboss-jca/branches/performance/rars/src/main/resources/connection/ds/connection-xa-ds.xml
===================================================================
--- projects/jboss-jca/branches/performance/rars/src/main/resources/connection/ds/connection-xa-ds.xml	                        (rev 0)
+++ projects/jboss-jca/branches/performance/rars/src/main/resources/connection/ds/connection-xa-ds.xml	2010-08-17 10:12:34 UTC (rev 107641)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<connection-factories>
+  <!-- JMS XA Resource adapter, use this to get transacted JMS in beans -->
+  <tx-connection-factory>
+    <jndi-name>connection_JBAS_XATransaction</jndi-name>
+    <xa-transaction/>
+    <rar-name>connection_JBAS_XATransaction_1.rar</rar-name>
+    <connection-definition>org.jboss.jca.performance.rars.connection.PerfConnectionFactory</connection-definition>
+    <!-- 
+    <use-java-context>false</use-java-context>
+    <security-domain-and-application>NoneRealm</security-domain-and-application>
+     -->
+  </tx-connection-factory>
+
+</connection-factories>
\ No newline at end of file

Added: projects/jboss-jca/branches/performance/rars/src/main/resources/connection/ds/jndi.properties
===================================================================
--- projects/jboss-jca/branches/performance/rars/src/main/resources/connection/ds/jndi.properties	                        (rev 0)
+++ projects/jboss-jca/branches/performance/rars/src/main/resources/connection/ds/jndi.properties	2010-08-17 10:12:34 UTC (rev 107641)
@@ -0,0 +1,4 @@
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
+java.naming.provider.url=jnp://localhost:1099
+

Added: projects/jboss-jca/branches/performance/rars/src/main/resources/connection/ejb/META-INF/ejb-jar.xml
===================================================================
--- projects/jboss-jca/branches/performance/rars/src/main/resources/connection/ejb/META-INF/ejb-jar.xml	                        (rev 0)
+++ projects/jboss-jca/branches/performance/rars/src/main/resources/connection/ejb/META-INF/ejb-jar.xml	2010-08-17 10:12:34 UTC (rev 107641)
@@ -0,0 +1,22 @@
+<?xml version="1.0"?>
+<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN"
+                         "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
+<ejb-jar>
+    <enterprise-beans>
+        <session>
+            <ejb-name>ConnectionBean</ejb-name>
+            <home>org.jboss.jca.performance.rars.connection.ejb.ConnectionHome</home>
+            <remote>org.jboss.jca.performance.rars.connection.ejb.Connection</remote>
+            <ejb-class>org.jboss.jca.performance.rars.connection.ejb.ConnectionBean</ejb-class>
+            <session-type>Stateless</session-type>
+            <transaction-type>Container</transaction-type>
+            <!-- 
+            <resource-ref>
+                <res-ref-name>ra/DirContextFactory</res-ref-name>
+                <res-type>org.jboss.book.jca.ex1.ra.DirContextFactory</res-type>
+                <res-auth>Container</res-auth>
+            </resource-ref>
+             -->
+        </session>
+    </enterprise-beans>
+</ejb-jar>

Added: projects/jboss-jca/branches/performance/rars/src/main/resources/connection/ejb/META-INF/jboss.xml
===================================================================
--- projects/jboss-jca/branches/performance/rars/src/main/resources/connection/ejb/META-INF/jboss.xml	                        (rev 0)
+++ projects/jboss-jca/branches/performance/rars/src/main/resources/connection/ejb/META-INF/jboss.xml	2010-08-17 10:12:34 UTC (rev 107641)
@@ -0,0 +1,14 @@
+<?xml version="1.0"?>
+<jboss>
+   <enterprise-beans>
+      <session>
+         <ejb-name>ConnectionBean</ejb-name>
+         <!-- 
+         <resource-ref>
+            <res-ref-name>ra/DirContextFactory</res-ref-name>
+            <jndi-name>java:/NoTransFS</jndi-name>
+         </resource-ref>
+          -->
+      </session>
+   </enterprise-beans>
+</jboss>

Modified: projects/jboss-jca/branches/performance/servers/build.xml
===================================================================
--- projects/jboss-jca/branches/performance/servers/build.xml	2010-08-17 09:46:50 UTC (rev 107640)
+++ projects/jboss-jca/branches/performance/servers/build.xml	2010-08-17 10:12:34 UTC (rev 107641)
@@ -448,6 +448,17 @@
     </sequential>
   </macrodef>
 
+  <macrodef name="run-connection-client">
+    <attribute name="count"/>
+    <attribute name="trans"/>
+    <sequential>
+      <java classname="org.jboss.jca.performance.rars.connection.ejb.ConnectionClient" dir="${build.dir}" fork="true">
+        <arg value="@{count}"/>
+        <arg value="@{trans}"/>
+        <classpath refid="connection.client.classpath"/>
+      </java>
+    </sequential>
+  </macrodef>
   <!-- ================================= 
        Target: benchmark
        ================================= -->
@@ -475,6 +486,59 @@
     <antcall target="copy-logging-xml"/>
   </target>
 
+  <target name="doBenchmark-jbas-connection">
+    <path id="connection.client.classpath">
+      <fileset dir="${target.dir}" includes="connection_ejb.jar"/>
+      <fileset dir="${target.dir}" includes="connection_JBAS_NoTransaction_1.rar"/>
+      <fileset dir="${jbas.home}/client" includes="jbossall-client.jar"/>
+      <pathelement path="${build.dir}/rars/jars/rars/ds"/>
+    </path>
+
+    <echo message="Deploying connection_JBAS_NoTransaction.rar"/>
+    <copy todir="${jbas.home}/server/default/deploy">
+      <fileset dir="${target.dir}" includes="connection_JBAS_NoTransaction_1.rar"/>
+      <fileset dir="${build.dir}/rars/jars/rars/ds" includes="connection-no-ds.xml"/>
+      <fileset dir="${target.dir}" includes="connection_ejb.jar"/>
+    </copy>
+
+    <sleep seconds="5"/>
+    <run-connection-client count="99" trans="NoTransaction"/>
+    <run-connection-client count="100000" trans="NoTransaction"/>
+    <run-connection-client count="10000" trans="NoTransaction"/>
+    <run-connection-client count="1000" trans="NoTransaction"/>
+    <run-connection-client count="100" trans="NoTransaction"/>
+    <run-connection-client count="10" trans="NoTransaction"/>
+    <run-connection-client count="1" trans="NoTransaction"/>
+
+    <delete>
+      <fileset dir="${jbas.home}/server/default/deploy" includes="connection_JBAS_NoTransaction_1.rar"/>
+      <fileset dir="${jbas.home}/server/default/deploy" includes="connection-no-ds.xml"/>
+      <fileset dir="${jbas.home}/server/default/deploy" includes="connection_ejb.jar"/>
+    </delete>
+
+    <echo message="Deploying connection_JBAS_XATransaction.rar"/>
+    <copy todir="${jbas.home}/server/default/deploy">
+      <fileset dir="${target.dir}" includes="connection_JBAS_XATransaction_1.rar"/>
+      <fileset dir="${build.dir}/rars/jars/rars/ds" includes="connection-xa-ds.xml"/>
+      <fileset dir="${target.dir}" includes="connection_ejb.jar"/>
+    </copy>
+
+    <sleep seconds="5"/>
+    <run-connection-client count="99" trans="XATransaction"/>
+    <run-connection-client count="100000" trans="XATransaction"/>
+    <run-connection-client count="10000" trans="XATransaction"/>
+    <run-connection-client count="1000" trans="XATransaction"/>
+    <run-connection-client count="100" trans="XATransaction"/>
+    <run-connection-client count="10" trans="XATransaction"/>
+    <run-connection-client count="1" trans="XATransaction"/>
+
+    <delete>
+      <fileset dir="${jbas.home}/server/default/deploy" includes="connection_JBAS_XATransaction_1.rar"/>
+      <fileset dir="${jbas.home}/server/default/deploy" includes="connection-xa-ds.xml"/>
+      <fileset dir="${jbas.home}/server/default/deploy" includes="connection_ejb.jar"/>
+    </delete>
+  </target>
+
   <target name="doBenchmark-jbas" depends="benchmark-prepare-jbas, jbas-config-benchmark">
     <propertyfile file="${root.dir}/configuration/${jbas.version}/benchmark/run_number.properties">
        <entry key="run.number" type="int" operation="+" value="1"/>
@@ -520,16 +584,19 @@
       <deploy-rar-jbas type="workmanager-block" count="1" as="JBAS" trans="NoTransaction" sleep="5"/>
       <deploy-rar-jbas type="workmanager-block" count="1" as="JBAS" trans="XATransaction" sleep="5"/>
 
+      <antcall target="doBenchmark-jbas-connection"/>
+
       <echo message="Stoping server..."/>
       <server:stop name="default"/>
+
     </sequential>
     </parallel>
-
+<!--
     <ant dir="../apps" inheritRefs="true" target="benchmark-report">
       <property name="kit.version" value="${jbas.version}"/>
       <property name="report.num" value="${run.number}"/>
     </ant>
-
+-->
   </target>
 
   <target name="benchmark-prepare-jbjca">
@@ -593,16 +660,31 @@
     <deploy-rar-jbjca type="workmanager-block" count="1" as="JBJCA" trans="NoTransaction" sleep="5"/>
     <deploy-rar-jbjca type="workmanager-block" count="1" as="JBJCA" trans="XATransaction" sleep="5"/>
 
+    <deploy-rar-jbjca type="connection" count="99" as="JBJCA" trans="NoTransaction" sleep="15"/>
+    <deploy-rar-jbjca type="connection" count="100000" as="JBJCA" trans="NoTransaction" sleep="6"/>
+    <deploy-rar-jbjca type="connection" count="100000" as="JBJCA" trans="XATransaction" sleep="6"/>
+    <deploy-rar-jbjca type="connection" count="10000" as="JBJCA" trans="NoTransaction" sleep="6"/>
+    <deploy-rar-jbjca type="connection" count="10000" as="JBJCA" trans="XATransaction" sleep="6"/>
+    <deploy-rar-jbjca type="connection" count="1000" as="JBJCA" trans="NoTransaction" sleep="6"/>
+    <deploy-rar-jbjca type="connection" count="1000" as="JBJCA" trans="XATransaction" sleep="6"/>
+    <deploy-rar-jbjca type="connection" count="100" as="JBJCA" trans="NoTransaction" sleep="5"/>
+    <deploy-rar-jbjca type="connection" count="100" as="JBJCA" trans="XATransaction" sleep="5"/>
+    <deploy-rar-jbjca type="connection" count="10" as="JBJCA" trans="NoTransaction" sleep="5"/>
+    <deploy-rar-jbjca type="connection" count="10" as="JBJCA" trans="XATransaction" sleep="5"/>
+    <deploy-rar-jbjca type="connection" count="1" as="JBJCA" trans="NoTransaction" sleep="5"/>
+    <deploy-rar-jbjca type="connection" count="1" as="JBJCA" trans="XATransaction" sleep="5"/>
+
     <echo message="Stoping server..."/>
     <sleep seconds="5"/>
     <exec dir="${jbjca.home}/bin" executable="${exec}">
       <arg line="shutdown.${ext}"/>
     </exec>
-
+<!--
     <ant dir="../apps" inheritRefs="true" target="benchmark-report">
       <property name="kit.version" value="${jbjca.version}"/>
       <property name="report.num" value="${run.number}"/>
     </ant>
+-->
   </target>
 
   <target name="benchmark" depends="os-check">
@@ -620,7 +702,6 @@
     <antcall target="doBenchmark-jbas">
       <param name="jbas.kit" value="${jbossas.5.version}"/>
     </antcall>
-
 <!--
     <antcall target="doBenchmark-jbas">
       <param name="jbas.kit" value="${jbossas.6.version}"/>



More information about the jboss-cvs-commits mailing list