[jboss-cvs] JBossAS SVN: r79296 - in projects/ejb3/trunk/testsuite: src/test/java/org/jboss/ejb3/test and 5 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Oct 9 06:10:14 EDT 2008


Author: alex.loubyansky at jboss.com
Date: 2008-10-09 06:10:14 -0400 (Thu, 09 Oct 2008)
New Revision: 79296

Added:
   projects/ejb3/trunk/testsuite/src/test/java/org/jboss/ejb3/test/singleton/
   projects/ejb3/trunk/testsuite/src/test/java/org/jboss/ejb3/test/singleton/SingletonBean.java
   projects/ejb3/trunk/testsuite/src/test/java/org/jboss/ejb3/test/singleton/SingletonLockInterceptor.java
   projects/ejb3/trunk/testsuite/src/test/java/org/jboss/ejb3/test/singleton/SingletonRemote.java
   projects/ejb3/trunk/testsuite/src/test/java/org/jboss/ejb3/test/singleton/pool/
   projects/ejb3/trunk/testsuite/src/test/java/org/jboss/ejb3/test/singleton/pool/SingletonPool.java
   projects/ejb3/trunk/testsuite/src/test/java/org/jboss/ejb3/test/singleton/pool/SingletonPoolFactory.java
   projects/ejb3/trunk/testsuite/src/test/java/org/jboss/ejb3/test/singleton/unit/
   projects/ejb3/trunk/testsuite/src/test/java/org/jboss/ejb3/test/singleton/unit/SingletonUnitTestCase.java
   projects/ejb3/trunk/testsuite/src/test/resources/test/singleton/
   projects/ejb3/trunk/testsuite/src/test/resources/test/singleton/aspectdomain-ejb3-interceptors-aop.xml
   projects/ejb3/trunk/testsuite/src/test/resources/test/singleton/singleton-jboss-beans.xml
Modified:
   projects/ejb3/trunk/testsuite/build-test.xml
Log:
EJBTHREE-1518 prototype for the pool and container managed concurrency for singletons (in the first impl, methods starting with 'get' considered to be read-only)

Modified: projects/ejb3/trunk/testsuite/build-test.xml
===================================================================
--- projects/ejb3/trunk/testsuite/build-test.xml	2008-10-09 07:26:17 UTC (rev 79295)
+++ projects/ejb3/trunk/testsuite/build-test.xml	2008-10-09 10:10:14 UTC (rev 79296)
@@ -2723,6 +2723,26 @@
       </copy>
    </target>
 
+   <target name="singleton" description="Builds jar files for the singleton unit.">
+      <mkdir dir="${build.lib}"/>
+      <jar jarfile="${build.lib}/singleton-test.jar">
+         <fileset dir="${build.classes}">
+            <include name="org/jboss/ejb3/test/singleton/*.class"/>
+         </fileset>
+         <fileset dir="${resources}/test/singleton">
+            <include name="aspectdomain-ejb3-interceptors-aop.xml"/>
+         </fileset>
+      </jar>
+      <jar jarfile="${build.lib}/singletonpool.jar">
+         <fileset dir="${build.classes}">
+            <include name="org/jboss/ejb3/test/singleton/pool/*.class"/>
+         </fileset>
+         <fileset dir="${resources}/test/singleton">
+            <include name="singleton-jboss-beans.xml"/>
+         </fileset>
+      </jar>
+   </target>
+
    <target name="relationships"
       description="Builds all jar files."
       >
@@ -4223,7 +4243,7 @@
       timer, benchmark, entity, joininheritance, singletable, tableperclass, dependent, mdb, manytomany, regression,
       composite, composite2, entitycallback, relationships, ssl, ssladvanced, clusteredsession, strictpool, jacc,
       localcall, interceptors, interceptors2, interceptors3, iiop, clientinterceptor,
-      statelesscreation, changexml, externalrefscoped"/>
+      statelesscreation, changexml, externalrefscoped, singleton"/>
 
    <target name="test" depends="init" if="test"
       description="Execute all tests in the given test directory.">
@@ -4785,6 +4805,9 @@
          <param name="test" value="strictpool"/>
       </antcall>
       <antcall target="test" inheritRefs="true">
+         <param name="test" value="singleton"/>
+      </antcall>
+      <antcall target="test" inheritRefs="true">
          <param name="test" value="stateless"/>
       </antcall>
 	  <antcall target="test" inheritRefs="true">

Added: projects/ejb3/trunk/testsuite/src/test/java/org/jboss/ejb3/test/singleton/SingletonBean.java
===================================================================
--- projects/ejb3/trunk/testsuite/src/test/java/org/jboss/ejb3/test/singleton/SingletonBean.java	                        (rev 0)
+++ projects/ejb3/trunk/testsuite/src/test/java/org/jboss/ejb3/test/singleton/SingletonBean.java	2008-10-09 10:10:14 UTC (rev 79296)
@@ -0,0 +1,95 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.ejb3.test.singleton;
+
+import javax.ejb.Remote;
+import javax.ejb.Stateless;
+
+import org.jboss.ejb3.annotation.AspectDomain;
+import org.jboss.ejb3.annotation.Pool;
+
+/**
+ * A SingletonBean.
+ * 
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+ at Stateless
+ at Remote(SingletonRemote.class)
+ at Pool (value="SingletonPool")
+ at AspectDomain(value = "Singleton Stateless Bean")
+public class SingletonBean implements SingletonRemote
+{
+   // counter for created instances
+   private static Integer instanceCount = 0;
+   
+   // these are static to catch not only threads in the same instance but also in other instances
+   // (if the singleton appears to be not a singleton)
+   private static Object instanceLock = new Object();
+   private static Thread lockerThread;
+   
+   // instance initialization
+   {
+      synchronized(instanceCount)
+      {
+         ++instanceCount;
+      }
+   }
+   
+   public int getInstanceCount()
+   {
+      return instanceCount;
+   }
+   
+   public void testWriteLock(long pause)
+   {
+      Thread currentThread = Thread.currentThread();
+      synchronized(instanceLock)
+      {
+         if(lockerThread == null)
+            lockerThread = currentThread;
+         else if(!lockerThread.equals(currentThread))
+         {
+            //System.out.println("Another thread is active in the instance: " + lockerThread + ", current thread: " + currentThread);
+            throw new IllegalStateException("Another thread is active in the instance: " + lockerThread + ", current thread: " + currentThread);
+         }
+      }
+
+      try
+      {
+         Thread.sleep(pause);
+      }
+      catch (InterruptedException e)
+      {
+      }
+      
+      synchronized(instanceLock)
+      {
+         if(!currentThread.equals(lockerThread))
+         {
+            //System.out.println("Another thread is active in the instance: " + lockerThread + ", current thread: " + currentThread);
+            throw new IllegalStateException("Another thread is/was active in the instance: " + lockerThread + ", current thread: " + currentThread);
+         }
+         lockerThread = null;
+      }
+   }
+}

Added: projects/ejb3/trunk/testsuite/src/test/java/org/jboss/ejb3/test/singleton/SingletonLockInterceptor.java
===================================================================
--- projects/ejb3/trunk/testsuite/src/test/java/org/jboss/ejb3/test/singleton/SingletonLockInterceptor.java	                        (rev 0)
+++ projects/ejb3/trunk/testsuite/src/test/java/org/jboss/ejb3/test/singleton/SingletonLockInterceptor.java	2008-10-09 10:10:14 UTC (rev 79296)
@@ -0,0 +1,197 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.ejb3.test.singleton;
+
+import org.jboss.aop.joinpoint.Invocation;
+import org.jboss.aop.joinpoint.MethodInvocation;
+import org.jboss.ejb3.aop.AbstractInterceptor;
+import org.jboss.logging.Logger;
+
+/**
+ * A SingletonLockInterceptor.
+ * 
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+public class SingletonLockInterceptor extends AbstractInterceptor
+{
+   private static final Logger log = Logger.getLogger(SingletonLockInterceptor.class);
+
+   // container/instance lock
+   private final Lock lock = new Lock();
+   
+   public String getName()
+   {
+      return "SingletonLockInterceptor";
+   }
+
+   public Object invoke(Invocation invocation) throws Throwable
+   {
+      /* way to get to the metadata and determine whether the method has READ or WRITE lock
+      EJBContainer container = getEJBContainer(invocation);
+      JBossEnterpriseBeanMetaData xml = container.getXml();
+      if(xml != null)
+         log.info("metadata is available");
+         */
+      
+      // for now consider methods starting with "get" as having READ lock
+      boolean isReadMethod = false;
+      MethodInvocation mi = (MethodInvocation) invocation;
+      if(mi.getMethod() != null)
+         isReadMethod = mi.getMethod().getName().startsWith("get");
+      
+      lock.sync();
+      try
+      {
+         boolean wait;
+         if(isReadMethod)
+            wait = lock.isWriteInProgress();
+         else
+            wait = lock.hasActiveThreads();
+         
+         while(wait)
+         {
+            synchronized (lock)
+            {
+               lock.releaseSync();
+
+               try
+               {
+                  lock.wait();
+               }
+               catch (InterruptedException e)
+               {
+               }
+            }
+            
+            lock.sync();
+            
+            if(isReadMethod)
+               wait = lock.isWriteInProgress();
+            else
+               wait = lock.hasActiveThreads();
+         }
+         
+         lock.increaseActiveThreads();
+         if(!isReadMethod)
+            lock.setWriteInProgress(true);
+      }
+      finally
+      {
+         lock.releaseSync();
+      }
+      
+      try
+      {
+         return invocation.invokeNext();
+      }
+      finally
+      {
+         lock.sync();
+         try
+         {
+            lock.decreaseActiveThreads();
+            if(!isReadMethod)
+               lock.setWriteInProgress(false);
+         }
+         finally
+         {
+            lock.releaseSync();
+         }
+      }
+   }
+   
+   private static class Lock
+   {
+      private int activeThreads;
+
+      private Thread synched;
+      private int synchedDepth;
+   
+      private boolean writeInProgress;
+      
+      public void increaseActiveThreads()
+      {
+         ++activeThreads;
+      }
+      
+      public void decreaseActiveThreads()
+      {
+         --activeThreads;
+      }
+      
+      public boolean hasActiveThreads()
+      {
+         return activeThreads > 0;
+      }
+      
+      public boolean isWriteInProgress()
+      {
+         return writeInProgress;
+      }
+      
+      public void setWriteInProgress(boolean writeInProgress)
+      {
+         this.writeInProgress = writeInProgress;
+      }
+      
+      /**
+       * A method that checks if the calling thread has the lock, and if it
+       * does not blocks until the lock is available. If there is no current owner
+       * of the lock, or the calling thread already owns the lock then the
+       * calling thread will immeadiately acquire the lock.
+       */ 
+      public void sync()
+      {
+         synchronized (this)
+         {
+            Thread thread = Thread.currentThread();
+            while (synched != null && !synched.equals(thread))
+            {
+               try
+               {
+                  this.wait();
+               }
+               catch (InterruptedException ex)
+               { /* ignore */
+               }
+            }
+
+            synched = thread;
+
+            if(synchedDepth > 0)
+               throw new IllegalStateException("At the moment synchedDepth shouldn't be more than 1");
+            ++synchedDepth;
+         }
+      }
+    
+      public void releaseSync()
+      {
+         synchronized(this)
+         {
+            if (--synchedDepth == 0)
+               synched = null;
+            this.notify();
+         }
+      }
+   }
+}

Added: projects/ejb3/trunk/testsuite/src/test/java/org/jboss/ejb3/test/singleton/SingletonRemote.java
===================================================================
--- projects/ejb3/trunk/testsuite/src/test/java/org/jboss/ejb3/test/singleton/SingletonRemote.java	                        (rev 0)
+++ projects/ejb3/trunk/testsuite/src/test/java/org/jboss/ejb3/test/singleton/SingletonRemote.java	2008-10-09 10:10:14 UTC (rev 79296)
@@ -0,0 +1,35 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.ejb3.test.singleton;
+
+/**
+ * A SingletonRemote.
+ * 
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+public interface SingletonRemote
+{
+   int getInstanceCount();
+
+   void testWriteLock(long pause);
+}

Added: projects/ejb3/trunk/testsuite/src/test/java/org/jboss/ejb3/test/singleton/pool/SingletonPool.java
===================================================================
--- projects/ejb3/trunk/testsuite/src/test/java/org/jboss/ejb3/test/singleton/pool/SingletonPool.java	                        (rev 0)
+++ projects/ejb3/trunk/testsuite/src/test/java/org/jboss/ejb3/test/singleton/pool/SingletonPool.java	2008-10-09 10:10:14 UTC (rev 79296)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.ejb3.test.singleton.pool;
+
+import org.jboss.ejb3.Container;
+import org.jboss.ejb3.pool.StrictMaxPool;
+
+/**
+ * A SingletonPool.
+ * 
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+public class SingletonPool extends StrictMaxPool
+{
+   @Override
+   public void initialize(Container container, int maxSize, long timeout)
+   {
+      super.initialize(container, 1, 11000);
+   }
+}

Added: projects/ejb3/trunk/testsuite/src/test/java/org/jboss/ejb3/test/singleton/pool/SingletonPoolFactory.java
===================================================================
--- projects/ejb3/trunk/testsuite/src/test/java/org/jboss/ejb3/test/singleton/pool/SingletonPoolFactory.java	                        (rev 0)
+++ projects/ejb3/trunk/testsuite/src/test/java/org/jboss/ejb3/test/singleton/pool/SingletonPoolFactory.java	2008-10-09 10:10:14 UTC (rev 79296)
@@ -0,0 +1,57 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.ejb3.test.singleton.pool;
+
+import org.jboss.ejb3.pool.Pool;
+import org.jboss.ejb3.pool.PoolFactory;
+import org.jboss.ejb3.pool.PoolFactoryRegistry;
+
+/**
+ * A SingletonPoolFactory.
+ * 
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+public class SingletonPoolFactory implements PoolFactory
+{
+   private static final String FACTORY_NAME = "SingletonPool";
+   
+   private PoolFactoryRegistry factoryRegistry;
+   
+   public void setFactoryRegistry(PoolFactoryRegistry registry)
+   {
+      this.factoryRegistry = registry;
+      if(factoryRegistry.getFactories().containsKey(FACTORY_NAME))
+         throw new IllegalStateException(FACTORY_NAME + " is already registered");
+      factoryRegistry.getFactories().put(FACTORY_NAME, getClass());
+   }
+   
+   public Pool createPool()
+   {
+      return new SingletonPool();
+   }
+   
+   public void destroy()
+   {
+      factoryRegistry.getFactories().remove(FACTORY_NAME);
+   }
+}

Added: projects/ejb3/trunk/testsuite/src/test/java/org/jboss/ejb3/test/singleton/unit/SingletonUnitTestCase.java
===================================================================
--- projects/ejb3/trunk/testsuite/src/test/java/org/jboss/ejb3/test/singleton/unit/SingletonUnitTestCase.java	                        (rev 0)
+++ projects/ejb3/trunk/testsuite/src/test/java/org/jboss/ejb3/test/singleton/unit/SingletonUnitTestCase.java	2008-10-09 10:10:14 UTC (rev 79296)
@@ -0,0 +1,126 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.ejb3.test.singleton.unit;
+
+
+import org.jboss.ejb3.test.singleton.SingletonRemote;
+import org.jboss.test.JBossTestCase;
+
+import junit.framework.Test;
+
+
+/**
+ * A SingletonUnitTestCase.
+ * 
+ * TODO:
+ * - A Singleton session bean must not implement the javax.ejb.SessionSynchronizationinterface or use the session synchronization annotations.
+ * - @Startup annotation
+ * - lifecycle
+ * - interceptor lifecycle and concurrency
+ * 
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+public class SingletonUnitTestCase extends JBossTestCase
+{
+   public static Test suite() throws Exception
+   {
+      return getDeploySetup(SingletonUnitTestCase.class, "singletonpool.jar");
+   }
+
+   public SingletonUnitTestCase(String name)
+   {
+      super(name);
+   }
+   
+   @Override
+   public void setUp() throws Exception
+   {
+      super.setUp();
+      deploy("singleton-test.jar");
+   }
+
+   @Override
+   public void tearDown() throws Exception
+   {
+      super.tearDown();
+      undeploy("singleton-test.jar");
+   }
+   
+   public void testWriteLock() throws Exception
+   {
+      final SingletonRemote remote = (SingletonRemote) getInitialContext().lookup("SingletonBean/remote");
+
+      final Throwable[] sawFailedThread = new Throwable[1];
+      final int[] finishedCount = new int[1];
+      final Thread[] threads = new Thread[10];
+      for(int i = 0; i < threads.length; ++i)
+      {
+         threads[i] = new Thread(new Runnable()
+         {
+            public void run()
+            {
+               try
+               {
+                  remote.testWriteLock((long) (1000*Math.random()));
+               }
+               catch(Throwable t)
+               {
+                  t.printStackTrace();
+                  sawFailedThread[0] = t;
+               }
+               finally
+               {
+                  synchronized (finishedCount)
+                  {
+                     ++finishedCount[0];
+                     if (finishedCount[0] == threads.length)
+                        finishedCount.notify();
+                  }
+               }
+            }
+         });
+      }
+      
+      for(Thread t : threads)
+      {
+         t.start();
+      }
+      
+      synchronized(finishedCount)
+      {
+         while(finishedCount[0] < threads.length)
+         {
+            try
+            {
+               finishedCount.wait();
+            }
+            catch(InterruptedException e)
+            {
+            }
+         }
+      }
+
+      assertNull("One of the threads failed: " + sawFailedThread[0], sawFailedThread[0]);
+      assertEquals(1, remote.getInstanceCount());
+   }
+}

Added: projects/ejb3/trunk/testsuite/src/test/resources/test/singleton/aspectdomain-ejb3-interceptors-aop.xml
===================================================================
--- projects/ejb3/trunk/testsuite/src/test/resources/test/singleton/aspectdomain-ejb3-interceptors-aop.xml	                        (rev 0)
+++ projects/ejb3/trunk/testsuite/src/test/resources/test/singleton/aspectdomain-ejb3-interceptors-aop.xml	2008-10-09 10:10:14 UTC (rev 79296)
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<aop xmlns="urn:jboss:aop-beans:1.0">
+   <interceptor class="org.jboss.ejb3.test.singleton.SingletonLockInterceptor" scope="PER_VM"/>
+
+   <domain name="Singleton Stateless Bean" extends="Intercepted Bean" inheritBindings="true">
+      <bind pointcut="execution(public * *->*(..))">
+         <interceptor-ref name="org.jboss.ejb3.asynchronous.AsynchronousInterceptor"/>
+         <interceptor-ref name="org.jboss.ejb3.ENCPropagationInterceptor"/>
+         <interceptor-ref name="org.jboss.ejb3.security.AuthenticationInterceptorFactory"/>
+      </bind>
+      <bind pointcut="execution(public * @org.jboss.ejb3.annotation.SecurityDomain->*(..))">
+         <interceptor-ref name="Basic Authorization"/>
+      </bind>
+      <bind pointcut="execution(public * *->*(..))">
+         <interceptor-ref name="org.jboss.ejb3.security.RunAsSecurityInterceptorFactory"/>
+      </bind>
+      <bind pointcut="execution(public * @org.jboss.ejb3.annotation.Clustered->*(..))">
+         <interceptor-ref name="org.jboss.ejb3.remoting.ReplicantsManagerInterceptorFactory"/>
+      </bind>
+      <bind pointcut="execution(public * *->*(..))">
+         <interceptor-ref name="org.jboss.aspects.tx.TxPropagationInterceptor"/>
+         <interceptor-ref name="org.jboss.ejb3.tx.CMTTxInterceptorFactory"/>
+         <interceptor-ref name="org.jboss.ejb3.test.singleton.SingletonLockInterceptor"/>
+         <interceptor-ref name="org.jboss.ejb3.stateless.StatelessInstanceInterceptor"/>
+         <interceptor-ref name="org.jboss.ejb3.tx.BMTTxInterceptorFactory"/>
+         <interceptor-ref name="org.jboss.ejb3.AllowedOperationsInterceptor"/>
+         <interceptor-ref name="org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor"/>
+         <!-- interceptor-ref name="org.jboss.ejb3.interceptor.EJB3InterceptorsFactory"/ -->
+         <stack-ref name="EJBInterceptors"/>
+      </bind>
+      <annotation expr="!class(@org.jboss.ejb3.annotation.Pool)">
+         @org.jboss.ejb3.annotation.Pool (value="ThreadlocalPool", maxSize=30, timeout=10000)
+      </annotation>
+   </domain>
+</aop>

Added: projects/ejb3/trunk/testsuite/src/test/resources/test/singleton/singleton-jboss-beans.xml
===================================================================
--- projects/ejb3/trunk/testsuite/src/test/resources/test/singleton/singleton-jboss-beans.xml	                        (rev 0)
+++ projects/ejb3/trunk/testsuite/src/test/resources/test/singleton/singleton-jboss-beans.xml	2008-10-09 10:10:14 UTC (rev 79296)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+    EJB3 Deployers
+-->
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+   <bean name="SingletonCacheFactory" class="org.jboss.ejb3.test.singleton.pool.SingletonPoolFactory">
+      <property name="factoryRegistry"><inject bean="EJB3PoolFactoryRegistry"/></property>
+   </bean>
+
+</deployment>




More information about the jboss-cvs-commits mailing list