[jboss-cvs] JBossAS SVN: r64546 - in branches/JBPAPP_4_2/ejb3: src/main/org/jboss/ejb3 and 5 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Aug 10 14:13:02 EDT 2007


Author: bdecoste
Date: 2007-08-10 14:13:02 -0400 (Fri, 10 Aug 2007)
New Revision: 64546

Added:
   branches/JBPAPP_4_2/ejb3/src/resources/test/defaultremotebindings/
   branches/JBPAPP_4_2/ejb3/src/resources/test/defaultremotebindings/default-ejb3-interceptors-aop.xml
   branches/JBPAPP_4_2/ejb3/src/test/org/jboss/ejb3/test/defaultremotebindings/
   branches/JBPAPP_4_2/ejb3/src/test/org/jboss/ejb3/test/defaultremotebindings/StatelessBean.java
   branches/JBPAPP_4_2/ejb3/src/test/org/jboss/ejb3/test/defaultremotebindings/StatelessRemote.java
   branches/JBPAPP_4_2/ejb3/src/test/org/jboss/ejb3/test/defaultremotebindings/unit/
   branches/JBPAPP_4_2/ejb3/src/test/org/jboss/ejb3/test/defaultremotebindings/unit/DefaultRemoteBindingsTestCase.java
Modified:
   branches/JBPAPP_4_2/ejb3/build-test.xml
   branches/JBPAPP_4_2/ejb3/src/main/org/jboss/ejb3/SessionContainer.java
Log:
[JBPAPP-263] merge of [EJBTHREE-942]

Modified: branches/JBPAPP_4_2/ejb3/build-test.xml
===================================================================
--- branches/JBPAPP_4_2/ejb3/build-test.xml	2007-08-10 17:58:36 UTC (rev 64545)
+++ branches/JBPAPP_4_2/ejb3/build-test.xml	2007-08-10 18:13:02 UTC (rev 64546)
@@ -2753,6 +2753,22 @@
    	
 	  <copy file="${build.lib}/stateless-test.jar" tofile="${build.lib}/stateless-test.ejb3"/>
    </target>
+	
+   <target name="defaultremotebindings"
+      description="Builds all jar files."
+      depends="compile-classes">
+
+      <mkdir dir="${build.lib}"/>
+
+      <jar jarfile="${build.lib}/defaultremotebindings-test.jar">
+         <fileset dir="${build.classes}">
+            <include name="org/jboss/ejb3/test/defaultremotebindings/*.class"/>
+         </fileset>
+         <fileset dir="${resources}/test/defaultremotebindings">
+            <include name="*.xml"/>
+         </fileset>
+      </jar>
+   </target>
    
    <target name="concurrentnaming"
       description="Builds all jar files."
@@ -3218,7 +3234,7 @@
 	  </copy>
    </target>
    
-   <target name="jars" depends="entityoptimisticlocking, concurrentnaming, propertyreplacement, persistenceunits, invalidtxmdb, descriptortypo, libdeployment, homeinterface, timestampentity, servicexmbean, arjuna, mdbtransactions, unauthenticatedprincipal, clusteredservice, invoker, classloader, 
+   <target name="jars" depends="defaultremotebindings, entityoptimisticlocking, concurrentnaming, propertyreplacement, persistenceunits, invalidtxmdb, descriptortypo, libdeployment, homeinterface, timestampentity, servicexmbean, arjuna, mdbtransactions, unauthenticatedprincipal, clusteredservice, invoker, classloader, 
       circulardependency, jsp, timerdependency, servicedependency, servlet, stateless14, webservices, ear, ejbthree440, 
       ejbthree454, ejbthree653, ejbthree670, ejbthree712, ejbthree724, ejbthree751, ejbthree832, ejbthree921,
       ejbthree959, ejbthree963,
@@ -3642,6 +3658,9 @@
       <antcall target="test" inheritRefs="true">
          <param name="test" value="stateless"/>
       </antcall>
+	  <antcall target="test" inheritRefs="true">
+         <param name="test" value="defaultremotebindings"/>
+      </antcall>
       <antcall target="test" inheritRefs="true">
          <param name="test" value="concurrentnaming"/>
       </antcall>

Modified: branches/JBPAPP_4_2/ejb3/src/main/org/jboss/ejb3/SessionContainer.java
===================================================================
--- branches/JBPAPP_4_2/ejb3/src/main/org/jboss/ejb3/SessionContainer.java	2007-08-10 17:58:36 UTC (rev 64545)
+++ branches/JBPAPP_4_2/ejb3/src/main/org/jboss/ejb3/SessionContainer.java	2007-08-10 18:13:02 UTC (rev 64546)
@@ -110,8 +110,8 @@
    public void instantiated()
    {
       super.instantiated();
-      proxyDeployer.initializeRemoteBindingMetadata();
-      proxyDeployer.initializeLocalBindingMetadata();
+ //     proxyDeployer.initializeRemoteBindingMetadata();
+ //     proxyDeployer.initializeLocalBindingMetadata();
    }
 
    @Override
@@ -119,6 +119,15 @@
    {
       super.processMetadata(dependencyPolicy);
    }
+   
+   public void create() throws Exception
+   {
+      super.create();
+      
+      // moved from instantiated so AspectDomain is processed before proxy metadata
+      proxyDeployer.initializeRemoteBindingMetadata();
+      proxyDeployer.initializeLocalBindingMetadata();
+   }
 
    public void start() throws Exception
    {

Added: branches/JBPAPP_4_2/ejb3/src/resources/test/defaultremotebindings/default-ejb3-interceptors-aop.xml
===================================================================
--- branches/JBPAPP_4_2/ejb3/src/resources/test/defaultremotebindings/default-ejb3-interceptors-aop.xml	                        (rev 0)
+++ branches/JBPAPP_4_2/ejb3/src/resources/test/defaultremotebindings/default-ejb3-interceptors-aop.xml	2007-08-10 18:13:02 UTC (rev 64546)
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE aop PUBLIC
+   "-//JBoss//DTD JBOSS AOP 1.0//EN"
+   "http://labs.jboss.com/portal/jbossaop/dtd/jboss-aop_1_0.dtd">
+
+<aop>
+   <!--interceptor class="org.jboss.ejb3.asynchronous.AsynchronousInterceptor" scope="PER_CLASS"/>
+   <interceptor class="org.jboss.ejb3.ENCPropagationInterceptor" scope="PER_VM"/>
+   <interceptor factory="org.jboss.ejb3.security.AuthenticationInterceptorFactory" scope="PER_CLASS"/>
+   <interceptor name="Basic Authorization" factory="org.jboss.ejb3.security.RoleBasedAuthorizationInterceptorFactory" scope="PER_CLASS"/>
+   <interceptor factory="org.jboss.ejb3.security.RunAsSecurityInterceptorFactory" scope="PER_CLASS"/>
+   <interceptor factory="org.jboss.ejb3.remoting.ReplicantsManagerInterceptorFactory" scope="PER_CLASS"/>
+   <interceptor class="org.jboss.ejb3.stateless.StatelessInstanceInterceptor" scope="PER_VM"/>
+   <interceptor class="org.jboss.aspects.tx.ClientTxPropagationInterceptor" scope="PER_VM"/>
+   <interceptor factory="org.jboss.ejb3.tx.TxInterceptorFactory" scope="PER_CLASS_JOINPOINT"/>
+   <interceptor class="org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor" scope="PER_VM"/>
+   <interceptor factory="org.jboss.ejb3.interceptor.EJB3InterceptorsFactory" scope="PER_CLASS_JOINPOINT"/-->
+   
+   <domain name="Test Stateless Bean">
+      <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.annotation.security.SecurityDomain->*(..))">
+         <interceptor-ref name="Basic Authorization"/>
+      </bind>
+      <bind pointcut="execution(public * @javax.annotation.security.RunAs->*(..))">
+         <interceptor-ref name="org.jboss.ejb3.security.RunAsSecurityInterceptorFactory"/>
+      </bind>
+      <bind pointcut="execution(public * @org.jboss.annotation.ejb.Clustered->*(..))">
+         <interceptor-ref name="org.jboss.ejb3.remoting.ReplicantsManagerInterceptorFactory"/>
+      </bind>
+      <bind pointcut="execution(public * *->*(..))">
+         <interceptor-ref name="org.jboss.ejb3.stateless.StatelessInstanceInterceptor"/>
+         <interceptor-ref name="org.jboss.aspects.tx.TxPropagationInterceptor"/>
+         <interceptor-ref name="org.jboss.ejb3.tx.TxInterceptorFactory"/>
+         <interceptor-ref name="org.jboss.ejb3.AllowedOperationsInterceptor"/>
+         <interceptor-ref name="org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor"/>
+         <interceptor-ref name="org.jboss.ejb3.interceptor.EJB3InterceptorsFactory"/>
+      </bind>
+      <annotation expr="!class(@org.jboss.annotation.ejb.PoolClass)">
+         @org.jboss.annotation.ejb.PoolClass (value=org.jboss.ejb3.ThreadlocalPool.class, maxSize=30, timeout=10000)
+      </annotation>
+      <annotation expr="!class(@org.jboss.annotation.ejb.RemoteBinding)">
+         @org.jboss.annotation.ejb.RemoteBinding (jndiBinding="DefaultedStateless", factory = org.jboss.ejb3.remoting.RemoteProxyFactory.class, interceptorStack="", clientBindUrl = "")
+      </annotation>
+   </domain>
+</aop>
\ No newline at end of file

Added: branches/JBPAPP_4_2/ejb3/src/test/org/jboss/ejb3/test/defaultremotebindings/StatelessBean.java
===================================================================
--- branches/JBPAPP_4_2/ejb3/src/test/org/jboss/ejb3/test/defaultremotebindings/StatelessBean.java	                        (rev 0)
+++ branches/JBPAPP_4_2/ejb3/src/test/org/jboss/ejb3/test/defaultremotebindings/StatelessBean.java	2007-08-10 18:13:02 UTC (rev 64546)
@@ -0,0 +1,43 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, 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.ejb3.test.defaultremotebindings;
+
+import javax.ejb.Stateless;
+import javax.ejb.Remote;
+
+import org.jboss.annotation.ejb.AspectDomain;
+import org.jboss.logging.Logger;
+
+/**
+ * @author <a href="mailto:bdecoste at jboss.com">William DeCoste</a>
+ */
+ at Stateless
+ at Remote(StatelessRemote.class)
+ at AspectDomain("Test Stateless Bean")
+public class StatelessBean implements StatelessRemote
+{
+   private static final Logger log = Logger.getLogger(StatelessBean.class);
+   
+   public void test()
+   {
+   }
+}

Added: branches/JBPAPP_4_2/ejb3/src/test/org/jboss/ejb3/test/defaultremotebindings/StatelessRemote.java
===================================================================
--- branches/JBPAPP_4_2/ejb3/src/test/org/jboss/ejb3/test/defaultremotebindings/StatelessRemote.java	                        (rev 0)
+++ branches/JBPAPP_4_2/ejb3/src/test/org/jboss/ejb3/test/defaultremotebindings/StatelessRemote.java	2007-08-10 18:13:02 UTC (rev 64546)
@@ -0,0 +1,30 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, 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.ejb3.test.defaultremotebindings;
+
+/**
+ * @author <a href="mailto:bdecoste at jboss.com">William DeCoste</a>
+ */
+public interface StatelessRemote
+{
+   void test();
+}

Added: branches/JBPAPP_4_2/ejb3/src/test/org/jboss/ejb3/test/defaultremotebindings/unit/DefaultRemoteBindingsTestCase.java
===================================================================
--- branches/JBPAPP_4_2/ejb3/src/test/org/jboss/ejb3/test/defaultremotebindings/unit/DefaultRemoteBindingsTestCase.java	                        (rev 0)
+++ branches/JBPAPP_4_2/ejb3/src/test/org/jboss/ejb3/test/defaultremotebindings/unit/DefaultRemoteBindingsTestCase.java	2007-08-10 18:13:02 UTC (rev 64546)
@@ -0,0 +1,68 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, 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.ejb3.test.defaultremotebindings.unit;
+
+import javax.ejb.EJBAccessException;
+
+import org.jboss.ejb3.test.defaultremotebindings.StatelessRemote;
+import org.jboss.logging.Logger;
+import org.jboss.test.JBossTestCase;
+import junit.framework.Test;
+
+/**
+ * @author <a href="mailto:bdecoste at jboss.com">William DeCoste</a>
+ */
+public class DefaultRemoteBindingsTestCase extends JBossTestCase
+{
+   private static final Logger log = Logger.getLogger(DefaultRemoteBindingsTestCase.class);
+
+   static boolean deployed = false;
+   static int test = 0;
+
+   public DefaultRemoteBindingsTestCase(String name)
+   {
+      super(name);
+   }
+ 
+   public void testDefault() throws Exception
+   {
+      try
+      {
+         StatelessRemote slsb = (StatelessRemote) getInitialContext().lookup("StatelessBean/remote");
+         fail("Default binding not used");
+      }
+      catch (javax.naming.NamingException e)
+      {
+         
+      }
+      
+      StatelessRemote slsb = (StatelessRemote) getInitialContext().lookup("DefaultedStateless");
+      assertNotNull(slsb);
+      
+      slsb.test();
+   }
+   
+   public static Test suite() throws Exception
+   {
+      return getDeploySetup(DefaultRemoteBindingsTestCase.class, "defaultremotebindings-test.jar");
+   }
+}
\ No newline at end of file




More information about the jboss-cvs-commits mailing list