Author: rmannibucau Date: Fri Apr 26 06:54:58 2013 New Revision: 1476073 URL: http://svn.apache.org/r1476073 Log: spring-data sample was using cdi without activating it + fixing an issue when creating a dynamic ejb
Added: tomee/tomee/trunk/examples/spring-data-proxy/src/main/resources/META-INF/beans.xml tomee/tomee/trunk/examples/spring-data-proxy/src/test/resources/ tomee/tomee/trunk/examples/spring-data-proxy/src/test/resources/META-INF/ tomee/tomee/trunk/examples/spring-data-proxy/src/test/resources/META-INF/beans.xml Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/BeanContext.java Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/BeanContext.java URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/BeanContext.java?rev=1476073&r1=1476072&r2=1476073&view=diff ============================================================================== --- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/BeanContext.java (original) +++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/BeanContext.java Fri Apr 26 06:54:58 2013 @@ -1411,9 +1411,11 @@ public class BeanContext extends Deploym final ThreadContext callContext = new ThreadContext(this, null, Operation.INJECTION); final ThreadContext oldContext = ThreadContext.enter(callContext); + final boolean dynamicallyImplemented = isDynamicallyImplemented(); + final WebBeansContext webBeansContext = getModuleContext().getAppContext().getWebBeansContext(); - if (isDynamicallyImplemented()) { + if (dynamicallyImplemented) { if (!InvocationHandler.class.isAssignableFrom(getProxyClass())) { throw new OpenEJBException("proxy class can only be InvocationHandler"); } @@ -1437,7 +1439,7 @@ public class BeanContext extends Deploym } Object rootInstance; - if (cdiEjbBean != null && CdiEjbBean.EjbInjectionTargetImpl.class.isInstance(cdiEjbBean.getInjectionTarget())) { + if (cdiEjbBean != null && !dynamicallyImplemented && CdiEjbBean.EjbInjectionTargetImpl.class.isInstance(cdiEjbBean.getInjectionTarget())) { rootInstance = CdiEjbBean.EjbInjectionTargetImpl.class.cast(cdiEjbBean.getInjectionTarget()).createNewPojo(creationalContext); } else { // not a cdi bean rootInstance = getManagedClass().newInstance(); @@ -1447,7 +1449,7 @@ public class BeanContext extends Deploym Object beanInstance; final InjectionProcessor injectionProcessor; - if (!isDynamicallyImplemented()) { + if (!dynamicallyImplemented) { injectionProcessor = new InjectionProcessor(rootInstance, getInjections(), InjectionProcessor.unwrap(ctx)); beanInstance = injectionProcessor.createInstance(); inject(beanInstance, creationalContext); Added: tomee/tomee/trunk/examples/spring-data-proxy/src/main/resources/META-INF/beans.xml URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/examples/spring-data-proxy/src/main/resources/META-INF/beans.xml?rev=1476073&view=auto ============================================================================== --- tomee/tomee/trunk/examples/spring-data-proxy/src/main/resources/META-INF/beans.xml (added) +++ tomee/tomee/trunk/examples/spring-data-proxy/src/main/resources/META-INF/beans.xml Fri Apr 26 06:54:58 2013 @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +--> +<beans 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/beans_1_0.xsd" /> Added: tomee/tomee/trunk/examples/spring-data-proxy/src/test/resources/META-INF/beans.xml URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/examples/spring-data-proxy/src/test/resources/META-INF/beans.xml?rev=1476073&view=auto ============================================================================== --- tomee/tomee/trunk/examples/spring-data-proxy/src/test/resources/META-INF/beans.xml (added) +++ tomee/tomee/trunk/examples/spring-data-proxy/src/test/resources/META-INF/beans.xml Fri Apr 26 06:54:58 2013 @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +--> +<beans 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/beans_1_0.xsd" />