tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dblev...@apache.org
Subject svn commit: r1056106 - in /openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/cdi: BeansDeployer.java CdiResourceInjectionService.java CdiScanner.java
Date Thu, 06 Jan 2011 22:45:34 GMT
Author: dblevins
Date: Thu Jan  6 22:45:34 2011
New Revision: 1056106

URL: http://svn.apache.org/viewvc?rev=1056106&view=rev
Log:
Changed related to OWB-503

Modified:
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/cdi/BeansDeployer.java
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/cdi/CdiResourceInjectionService.java
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/cdi/CdiScanner.java

Modified: openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/cdi/BeansDeployer.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/cdi/BeansDeployer.java?rev=1056106&r1=1056105&r2=1056106&view=diff
==============================================================================
--- openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/cdi/BeansDeployer.java
(original)
+++ openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/cdi/BeansDeployer.java
Thu Jan  6 22:45:34 2011
@@ -16,6 +16,7 @@
  */
 package org.apache.openejb.cdi;
 
+import org.apache.webbeans.annotation.AnnotationManager;
 import org.apache.webbeans.component.AbstractInjectionTargetBean;
 import org.apache.webbeans.component.AbstractProducerBean;
 import org.apache.webbeans.component.EnterpriseBeanMarker;
@@ -491,13 +492,15 @@ public class BeansDeployer {
 
         addDefaultStereoTypes();
 
+        final AnnotationManager annotationManager = WebBeansContext.getInstance().getAnnotationManager();
+
         Set<Class<?>> beanClasses = scanner.getBeanClasses();
         if (beanClasses != null && beanClasses.size() > 0) {
 
             for (Class<?> beanClass : beanClasses) {
                 if (beanClass.isAnnotation()) {
                     Class<? extends Annotation> stereoClass = (Class<? extends Annotation>)
beanClass;
-                    if (AnnotationUtil.isStereoTypeAnnotation(stereoClass)) {
+                    if (annotationManager.isStereoTypeAnnotation(stereoClass)) {
                         if (!WebBeansContext.getInstance().getxMLAnnotationTypeManager().hasStereoType(stereoClass))
{
                             WebBeansUtil.checkStereoTypeClass(stereoClass);
                             StereoTypeModel model = new StereoTypeModel(stereoClass);

Modified: openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/cdi/CdiResourceInjectionService.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/cdi/CdiResourceInjectionService.java?rev=1056106&r1=1056105&r2=1056106&view=diff
==============================================================================
--- openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/cdi/CdiResourceInjectionService.java
(original)
+++ openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/cdi/CdiResourceInjectionService.java
Thu Jan  6 22:45:34 2011
@@ -16,6 +16,15 @@
  */
 package org.apache.openejb.cdi;
 
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+import java.lang.annotation.Annotation;
+
+
+import javax.enterprise.inject.spi.Bean;
+
+
 import org.apache.openejb.Injection;
 import org.apache.openejb.InjectionProcessor;
 import org.apache.openejb.OpenEJBException;
@@ -169,4 +178,17 @@ public class CdiResourceInjectionService
         this.contexts.clear();
     }
 
+    /**
+     * delegation of serialization behavior
+     */
+    public <T> void writeExternal(Bean<T> bean, T actualResource, ObjectOutput
out) throws IOException{}
+
+    /**
+     * delegation of serialization behavior
+     */
+    public <T> T readExternal(Bean<T> bean, ObjectInput out) throws IOException,
+								    ClassNotFoundException {
+        return null;
+    }
+
 }

Modified: openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/cdi/CdiScanner.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/cdi/CdiScanner.java?rev=1056106&r1=1056105&r2=1056106&view=diff
==============================================================================
--- openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/cdi/CdiScanner.java
(original)
+++ openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/cdi/CdiScanner.java
Thu Jan  6 22:45:34 2011
@@ -31,6 +31,7 @@ import org.apache.openejb.assembler.clas
 import org.apache.openejb.assembler.classic.BeansInfo;
 import org.apache.openejb.assembler.classic.EjbJarInfo;
 import org.apache.openejb.assembler.classic.EnterpriseBeanInfo;
+import org.apache.webbeans.annotation.AnnotationManager;
 import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.decorator.DecoratorsManager;
 import org.apache.webbeans.exception.WebBeansConfigurationException;
@@ -69,6 +70,8 @@ public class CdiScanner implements Scann
             }
         }
 
+        final AnnotationManager annotationManager = WebBeansContext.getInstance().getAnnotationManager();
+        
         for (EjbJarInfo ejbJar : appInfo.ejbJars) {
             final BeansInfo beans = ejbJar.beans;
 
@@ -78,7 +81,8 @@ public class CdiScanner implements Scann
                 Class<?> clazz = load(className, "interceptor", classLoader);
 
                 // TODO: Move check to validation phase
-                if (AnnotationUtil.hasAnnotation(clazz.getDeclaredAnnotations(), Interceptor.class)
&& !AnnotationUtil.hasInterceptorBindingMetaAnnotation(clazz.getDeclaredAnnotations()))
{
+                if (AnnotationUtil.hasAnnotation(clazz.getDeclaredAnnotations(), Interceptor.class)
&& !annotationManager.hasInterceptorBindingMetaAnnotation(
+                    clazz.getDeclaredAnnotations())) {
                     throw new WebBeansConfigurationException("Interceptor class : " + clazz.getName()
+ " must have at least one @InterceptorBindingType");
                 }
 



Mime
View raw message