[jboss-cvs] JBossAS SVN: r80142 - in projects/ejb3/trunk/interceptors/src: test/java/org/jboss/ejb3/test/interceptors and 6 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Oct 28 08:48:02 EDT 2008
Author: wolfc
Date: 2008-10-28 08:48:02 -0400 (Tue, 28 Oct 2008)
New Revision: 80142
Added:
projects/ejb3/trunk/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/common/InterceptorChain.java
projects/ejb3/trunk/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/ejbthree1542/
projects/ejb3/trunk/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/ejbthree1542/AnnotatedMethodInterceptor.java
projects/ejb3/trunk/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/ejbthree1542/OrderedSLSB.java
projects/ejb3/trunk/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/ejbthree1542/XMLMethodInterceptor.java
projects/ejb3/trunk/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/ejbthree1542/unit/
projects/ejb3/trunk/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/ejbthree1542/unit/OverloadedMethodTestCase.java
projects/ejb3/trunk/interceptors/src/test/resources/ejbthree1542/
projects/ejb3/trunk/interceptors/src/test/resources/ejbthree1542/META-INF/
projects/ejb3/trunk/interceptors/src/test/resources/ejbthree1542/META-INF/ejb-jar.xml
Modified:
projects/ejb3/trunk/interceptors/src/main/java/org/jboss/ejb3/interceptors/metadata/BeanInterceptorMetaDataBridge.java
projects/ejb3/trunk/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/common/CommonInterceptor.java
Log:
EJBTHREE-1542: fixed CCE when both method interceptors and method interceptor order is defined in descriptor
Modified: projects/ejb3/trunk/interceptors/src/main/java/org/jboss/ejb3/interceptors/metadata/BeanInterceptorMetaDataBridge.java
===================================================================
--- projects/ejb3/trunk/interceptors/src/main/java/org/jboss/ejb3/interceptors/metadata/BeanInterceptorMetaDataBridge.java 2008-10-28 12:12:28 UTC (rev 80141)
+++ projects/ejb3/trunk/interceptors/src/main/java/org/jboss/ejb3/interceptors/metadata/BeanInterceptorMetaDataBridge.java 2008-10-28 12:48:02 UTC (rev 80142)
@@ -83,8 +83,8 @@
private ExcludeDefaultInterceptors excludeDefaultInterceptors;
//Method-level things
- private Map<DeclaredMethodSignature, Interceptors> methodInterceptors = new HashMap<DeclaredMethodSignature, Interceptors>();
- private Map<DeclaredMethodSignature, InterceptorOrder> methodInterceptorOrders = new HashMap<DeclaredMethodSignature, InterceptorOrder>();
+ private Map<DeclaredMethodSignature, InterceptorsImpl> methodInterceptors = new HashMap<DeclaredMethodSignature, InterceptorsImpl>();
+ private Map<DeclaredMethodSignature, InterceptorOrderImpl> methodInterceptorOrders = new HashMap<DeclaredMethodSignature, InterceptorOrderImpl>();
private Map<DeclaredMethodSignature, ExcludeDefaultInterceptors> methodExcludeDefaultInterceptors = new HashMap<DeclaredMethodSignature, ExcludeDefaultInterceptors>();
private Map<DeclaredMethodSignature, ExcludeClassInterceptors> methodExcludeClassInterceptors = new HashMap<DeclaredMethodSignature, ExcludeClassInterceptors>();
@@ -367,7 +367,7 @@
{
if (bindings != null && bindings.size() > 0)
{
- this.methodInterceptors = new HashMap<DeclaredMethodSignature, Interceptors>();
+ this.methodInterceptors = new HashMap<DeclaredMethodSignature, InterceptorsImpl>();
for (InterceptorBindingMetaData binding : bindings)
{
NamedMethodMetaData method = binding.getMethod();
@@ -380,7 +380,7 @@
{
if(!matches(refMethod, method))
continue;
- InterceptorsImpl interceptors = (InterceptorsImpl)methodInterceptors.get(refMethod);
+ InterceptorsImpl interceptors = methodInterceptors.get(refMethod);
if (interceptors == null)
{
interceptors = new InterceptorsImpl();
@@ -397,7 +397,7 @@
{
if (bindings != null && bindings.size() > 0)
{
- this.methodInterceptorOrders = new HashMap<DeclaredMethodSignature, InterceptorOrder>();
+ this.methodInterceptorOrders = new HashMap<DeclaredMethodSignature, InterceptorOrderImpl>();
for (InterceptorBindingMetaData binding : bindings)
{
NamedMethodMetaData method = binding.getMethod();
@@ -410,7 +410,7 @@
{
if(!matches(refMethod, method))
continue;
- InterceptorOrderImpl interceptors = (InterceptorOrderImpl)methodInterceptors.get(refMethod);
+ InterceptorOrderImpl interceptors = methodInterceptorOrders.get(refMethod);
if (interceptors == null)
{
interceptors = new InterceptorOrderImpl();
Modified: projects/ejb3/trunk/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/common/CommonInterceptor.java
===================================================================
--- projects/ejb3/trunk/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/common/CommonInterceptor.java 2008-10-28 12:12:28 UTC (rev 80141)
+++ projects/ejb3/trunk/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/common/CommonInterceptor.java 2008-10-28 12:48:02 UTC (rev 80142)
@@ -42,6 +42,7 @@
public void preDestroy(InvocationContext ctx) throws Exception
{
log.debug("preDestroy " + ctx);
+ InterceptorChain.add(getClass());
preDestroys++;
ctx.proceed();
}
@@ -51,6 +52,7 @@
log.debug("postConstruct " + ctx);
if(ctx.getTarget() == null)
throw new IllegalStateException("target is null");
+ InterceptorChain.add(getClass());
postConstructs++;
ctx.proceed();
}
@@ -58,6 +60,7 @@
public Object aroundInvoke(InvocationContext ctx) throws Exception
{
log.debug("aroundInvoke " + ctx);
+ InterceptorChain.add(getClass());
aroundInvokes++;
return ctx.proceed();
}
Added: projects/ejb3/trunk/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/common/InterceptorChain.java
===================================================================
--- projects/ejb3/trunk/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/common/InterceptorChain.java (rev 0)
+++ projects/ejb3/trunk/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/common/InterceptorChain.java 2008-10-28 12:48:02 UTC (rev 80142)
@@ -0,0 +1,50 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ejb3.test.interceptors.common;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:cdewolf at redhat.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+public class InterceptorChain
+{
+ private static List<Class<?>> chain = new ArrayList<Class<?>>();
+
+ public static void add(Class<?> cls)
+ {
+ chain.add(cls);
+ }
+
+ public static void clear()
+ {
+ chain.clear();
+ }
+
+ public static List<Class<?>> getChain()
+ {
+ return Collections.unmodifiableList(chain);
+ }
+}
Added: projects/ejb3/trunk/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/ejbthree1542/AnnotatedMethodInterceptor.java
===================================================================
--- projects/ejb3/trunk/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/ejbthree1542/AnnotatedMethodInterceptor.java (rev 0)
+++ projects/ejb3/trunk/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/ejbthree1542/AnnotatedMethodInterceptor.java 2008-10-28 12:48:02 UTC (rev 80142)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ejb3.test.interceptors.ejbthree1542;
+
+import javax.interceptor.AroundInvoke;
+import javax.interceptor.InvocationContext;
+
+import org.jboss.ejb3.test.interceptors.common.CommonInterceptor;
+
+/**
+ * @author <a href="mailto:cdewolf at redhat.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+public class AnnotatedMethodInterceptor extends CommonInterceptor
+{
+ @AroundInvoke
+ public Object intercept(InvocationContext ctx) throws Exception
+ {
+ return super.aroundInvoke(ctx);
+ }
+}
Added: projects/ejb3/trunk/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/ejbthree1542/OrderedSLSB.java
===================================================================
--- projects/ejb3/trunk/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/ejbthree1542/OrderedSLSB.java (rev 0)
+++ projects/ejb3/trunk/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/ejbthree1542/OrderedSLSB.java 2008-10-28 12:48:02 UTC (rev 80142)
@@ -0,0 +1,39 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ejb3.test.interceptors.ejbthree1542;
+
+import javax.ejb.Stateless;
+import javax.interceptor.Interceptors;
+
+/**
+ * @author <a href="mailto:cdewolf at redhat.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+ at Stateless
+public class OrderedSLSB
+{
+ @Interceptors(AnnotatedMethodInterceptor.class)
+ public void overLoadedMethod(String s)
+ {
+
+ }
+}
Added: projects/ejb3/trunk/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/ejbthree1542/XMLMethodInterceptor.java
===================================================================
--- projects/ejb3/trunk/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/ejbthree1542/XMLMethodInterceptor.java (rev 0)
+++ projects/ejb3/trunk/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/ejbthree1542/XMLMethodInterceptor.java 2008-10-28 12:48:02 UTC (rev 80142)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ejb3.test.interceptors.ejbthree1542;
+
+import javax.interceptor.AroundInvoke;
+import javax.interceptor.InvocationContext;
+
+import org.jboss.ejb3.test.interceptors.common.CommonInterceptor;
+
+/**
+ * @author <a href="mailto:cdewolf at redhat.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+public class XMLMethodInterceptor extends CommonInterceptor
+{
+ @AroundInvoke
+ public Object intercept(InvocationContext ctx) throws Exception
+ {
+ return super.aroundInvoke(ctx);
+ }
+}
Added: projects/ejb3/trunk/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/ejbthree1542/unit/OverloadedMethodTestCase.java
===================================================================
--- projects/ejb3/trunk/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/ejbthree1542/unit/OverloadedMethodTestCase.java (rev 0)
+++ projects/ejb3/trunk/interceptors/src/test/java/org/jboss/ejb3/test/interceptors/ejbthree1542/unit/OverloadedMethodTestCase.java 2008-10-28 12:48:02 UTC (rev 80142)
@@ -0,0 +1,178 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ejb3.test.interceptors.ejbthree1542.unit;
+
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import junit.framework.TestCase;
+
+import org.jboss.aop.AspectManager;
+import org.jboss.aspects.common.AOPDeployer;
+import org.jboss.ejb3.interceptors.container.BeanContext;
+import org.jboss.ejb3.interceptors.direct.AbstractDirectContainer;
+import org.jboss.ejb3.interceptors.metadata.BeanInterceptorMetaDataBridge;
+import org.jboss.ejb3.interceptors.metadata.InterceptorComponentMetaDataLoaderFactory;
+import org.jboss.ejb3.interceptors.metadata.InterceptorMetaDataBridge;
+import org.jboss.ejb3.metadata.MetaDataBridge;
+import org.jboss.ejb3.metadata.annotation.AnnotationRepositoryToMetaData;
+import org.jboss.ejb3.test.interceptors.common.CommonInterceptor;
+import org.jboss.ejb3.test.interceptors.common.InterceptorChain;
+import org.jboss.ejb3.test.interceptors.ejbthree1542.OrderedSLSB;
+import org.jboss.ejb3.test.interceptors.ejbthree1542.XMLMethodInterceptor;
+import org.jboss.logging.Logger;
+import org.jboss.metadata.ejb.jboss.JBoss50MetaData;
+import org.jboss.metadata.ejb.jboss.JBossEnterpriseBeanMetaData;
+import org.jboss.metadata.ejb.spec.EjbJar30MetaData;
+import org.jboss.metadata.ejb.spec.InterceptorMetaData;
+import org.jboss.xb.binding.Unmarshaller;
+import org.jboss.xb.binding.UnmarshallerFactory;
+import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.SchemaBindingResolver;
+import org.jboss.xb.builder.JBossXBBuilder;
+import org.w3c.dom.ls.LSInput;
+
+/**
+ * Make sure there is no CCE in BeanInterceptorMetaDataBridge.
+ *
+ * @author <a href="mailto:cdewolf at redhat.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+public class OverloadedMethodTestCase extends TestCase
+{
+ private static final Logger log = Logger.getLogger(OverloadedMethodTestCase.class);
+
+ private class MyContainer<T> extends AbstractDirectContainer<T, MyContainer<T>>
+ {
+ public MyContainer(String name, String domainName, Class<? extends T> beanClass, JBossEnterpriseBeanMetaData beanMetaData)
+ {
+ super();
+
+ ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
+ AnnotationRepositoryToMetaData annotations = new AnnotationRepositoryToMetaData(beanClass, beanMetaData, name, classLoader);
+ List<MetaDataBridge<InterceptorMetaData>> interceptorBridges = new ArrayList<MetaDataBridge<InterceptorMetaData>>();
+ interceptorBridges.add(new InterceptorMetaDataBridge());
+ annotations.addComponentMetaDataLoaderFactory(new InterceptorComponentMetaDataLoaderFactory(interceptorBridges));
+ annotations.addMetaDataBridge(new BeanInterceptorMetaDataBridge(beanClass, classLoader, beanMetaData));
+
+ initializeAdvisor(name, getDomain(domainName), beanClass, annotations);
+ }
+
+ public void testAdvisor()
+ {
+ MyContainer<?> container = getAdvisor().getContainer();
+ assertNotNull("container not set in managed object advisor", container);
+ assertTrue(container == this);
+ }
+ }
+
+ protected static SchemaBindingResolver schemaResolverForClass(final Class<?> root)
+ {
+ return new SchemaBindingResolver()
+ {
+ public String getBaseURI()
+ {
+ return null;
+ }
+
+ public SchemaBinding resolve(String nsUri, String baseURI, String schemaLocation)
+ {
+ return JBossXBBuilder.build(root);
+ }
+
+ public LSInput resolveAsLSInput(String nsUri, String baseUri, String schemaLocation)
+ {
+ return null;
+ }
+
+ public void setBaseURI(String baseURI)
+ {
+ }
+ };
+ }
+
+ // FIXME: use the right jboss-aop.xml
+ AOPDeployer deployer = new AOPDeployer("proxy/jboss-aop.xml");
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ log.info(deployer.deploy());
+ CommonInterceptor.aroundInvokes = 0;
+ CommonInterceptor.postConstructs = 0;
+ CommonInterceptor.preDestroys = 0;
+ }
+
+ @Override
+ protected void tearDown() throws Exception
+ {
+ log.info(deployer.undeploy());
+ }
+
+ public void test() throws Throwable
+ {
+ AspectManager.verbose = true;
+
+ // To make surefire happy
+ Thread.currentThread().setContextClassLoader(OrderedSLSB.class.getClassLoader());
+
+ // Bootstrap metadata
+ UnmarshallerFactory unmarshallerFactory = UnmarshallerFactory.newInstance();
+ Unmarshaller unmarshaller = unmarshallerFactory.newUnmarshaller();
+ URL url = Thread.currentThread().getContextClassLoader().getResource("ejbthree1542/META-INF/ejb-jar.xml");
+ EjbJar30MetaData metaData = (EjbJar30MetaData) unmarshaller.unmarshal(url.toString(), schemaResolverForClass(EjbJar30MetaData.class));
+ JBoss50MetaData jbossMetaData = new JBoss50MetaData();
+ jbossMetaData.merge(null, metaData);
+
+ JBossEnterpriseBeanMetaData beanMetaData = jbossMetaData.getEnterpriseBean("OrderedSLSB");
+ assertNotNull(beanMetaData);
+
+ assertEquals(0, CommonInterceptor.postConstructs);
+
+ MyContainer<OrderedSLSB> container = new MyContainer<OrderedSLSB>("OrderedSLSB", "Test", OrderedSLSB.class, beanMetaData);
+ container.testAdvisor();
+
+ BeanContext<OrderedSLSB> bean = container.construct();
+
+ // If we get here, the CCE hasn't happened, let's just test our settings.
+
+ {
+ Class<?> c[] = { CommonInterceptor.class };
+ List<Class<?>> expected = Arrays.asList(c);
+ assertEquals(expected, InterceptorChain.getChain());
+
+ InterceptorChain.clear();
+ }
+
+ container.invoke(bean, "overLoadedMethod", "Hello world");
+
+ {
+ Class<?> c[] = { XMLMethodInterceptor.class, CommonInterceptor.class };
+ List<Class<?>> expected = Arrays.asList(c);
+ assertEquals(expected, InterceptorChain.getChain());
+
+ InterceptorChain.clear();
+ }
+ }
+}
Added: projects/ejb3/trunk/interceptors/src/test/resources/ejbthree1542/META-INF/ejb-jar.xml
===================================================================
--- projects/ejb3/trunk/interceptors/src/test/resources/ejbthree1542/META-INF/ejb-jar.xml (rev 0)
+++ projects/ejb3/trunk/interceptors/src/test/resources/ejbthree1542/META-INF/ejb-jar.xml 2008-10-28 12:48:02 UTC (rev 80142)
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ejb-jar xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
+ http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd"
+ version="3.0">
+ <display-name>EJBTHREE-1542</display-name>
+ <!-- We don't merge annotation with metadata, so defining bean here also -->
+ <enterprise-beans>
+ <session>
+ <ejb-name>OrderedSLSB</ejb-name>
+ </session>
+ </enterprise-beans>
+ <!-- Only needed for common interceptor -->
+ <interceptors>
+ <interceptor>
+ <interceptor-class>org.jboss.ejb3.test.interceptors.common.CommonInterceptor</interceptor-class>
+ <around-invoke>
+ <method-name>aroundInvoke</method-name>
+ </around-invoke>
+ <post-construct>
+ <lifecycle-callback-method>postConstruct</lifecycle-callback-method>
+ </post-construct>
+ <pre-destroy>
+ <lifecycle-callback-method>preDestroy</lifecycle-callback-method>
+ </pre-destroy>
+ </interceptor>
+ </interceptors>
+ <assembly-descriptor>
+ <!-- Add a common interceptor -->
+ <interceptor-binding>
+ <ejb-name>*</ejb-name>
+ <interceptor-class>org.jboss.ejb3.test.interceptors.common.CommonInterceptor</interceptor-class>
+ </interceptor-binding>
+ <!-- Override the annotated method interceptor, so methodInterceptors gets filled -->
+ <!-- This is not in ejb3-testsuite, but when running in AS it's a result of annotation metadata view -->
+ <interceptor-binding>
+ <ejb-name>OrderedSLSB</ejb-name>
+ <interceptor-class>org.jboss.ejb3.test.interceptors.ejbthree1542.XMLMethodInterceptor</interceptor-class>
+ <method>
+ <method-name>overLoadedMethod</method-name>
+ <method-params>
+ <method-param>java.lang.String</method-param>
+ </method-params>
+ </method>
+ </interceptor-binding>
+ <!-- Change the order which results in the CCE -->
+ <interceptor-binding>
+ <ejb-name>OrderedSLSB</ejb-name>
+ <interceptor-order>
+ <interceptor-class>org.jboss.ejb3.test.interceptors.ejbthree1542.XMLMethodInterceptor</interceptor-class>
+ <interceptor-class>org.jboss.ejb3.test.interceptors.common.CommonInterceptor</interceptor-class>
+ </interceptor-order>
+ <method>
+ <method-name>overLoadedMethod</method-name>
+ <method-params>
+ <method-param>java.lang.String</method-param>
+ </method-params>
+ </method>
+ </interceptor-binding>
+ </assembly-descriptor>
+</ejb-jar>
\ No newline at end of file
More information about the jboss-cvs-commits
mailing list