You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwebbeans.apache.org by st...@apache.org on 2009/07/20 23:37:00 UTC

svn commit: r796029 - in /incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans: deployment/StereoTypeModel.java deployment/stereotype/IStereoTypeModel.java util/WebBeansUtil.java

Author: struberg
Date: Mon Jul 20 21:37:00 2009
New Revision: 796029

URL: http://svn.apache.org/viewvc?rev=796029&view=rev
Log:
OWB-123 remove StereoType restrictions

Modified:
    incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/deployment/StereoTypeModel.java
    incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/deployment/stereotype/IStereoTypeModel.java
    incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java

Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/deployment/StereoTypeModel.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/deployment/StereoTypeModel.java?rev=796029&r1=796028&r2=796029&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/deployment/StereoTypeModel.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/deployment/StereoTypeModel.java Mon Jul 20 21:37:00 2009
@@ -40,10 +40,6 @@
 
     private String defaultName = null;
 
-    private Set<Class<? extends Annotation>> supportedScopes = null;
-
-    private Set<Class<?>> restrictedTypes = null;
-
     private Set<Annotation> interceptorBindingTypes = new HashSet<Annotation>();
 
     private Set<Annotation> inherits = new HashSet<Annotation>();
@@ -113,25 +109,6 @@
 
         }
 
-        configureScopes(clazz);
-        configureTypes(clazz);
-    }
-
-    private void configureScopes(Class<?> clazz)
-    {
-        Asserts.nullCheckForClass(clazz);
-        Stereotype type = clazz.getAnnotation(Stereotype.class);
-
-        Class<? extends Annotation>[] supportedScopes = type.supportedScopes();
-        this.supportedScopes = new HashSet<Class<? extends Annotation>>(Arrays.asList(supportedScopes));
-
-    }
-
-    private void configureTypes(Class<?> clazz)
-    {
-        Asserts.nullCheckForClass(clazz);
-        Stereotype type = clazz.getAnnotation(Stereotype.class);
-        this.restrictedTypes = new HashSet<Class<?>>(Arrays.asList(type.requiredTypes()));
     }
 
     /**
@@ -181,22 +158,6 @@
         return this.inherits;
     }
 
-    /**
-     * @return the supportedScopes
-     */
-    public Set<Class<? extends Annotation>> getSupportedScopes()
-    {
-        return Collections.unmodifiableSet(this.supportedScopes);
-    }
-
-    /**
-     * @return the restrictedTypes
-     */
-    public Set<Class<?>> getRestrictedTypes()
-    {
-        return Collections.unmodifiableSet(this.restrictedTypes);
-    }
-
     /*
      * (non-Javadoc)
      * @see java.lang.Object#equals(java.lang.Object)

Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/deployment/stereotype/IStereoTypeModel.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/deployment/stereotype/IStereoTypeModel.java?rev=796029&r1=796028&r2=796029&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/deployment/stereotype/IStereoTypeModel.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/deployment/stereotype/IStereoTypeModel.java Mon Jul 20 21:37:00 2009
@@ -39,16 +39,6 @@
     public Annotation getDefaultScopeType();
 
     /**
-     * @return the supportedScopes
-     */
-    public Set<Class<? extends Annotation>> getSupportedScopes();
-
-    /**
-     * @return the restrictedTypes
-     */
-    public Set<Class<?>> getRestrictedTypes();
-
-    /**
      * @return
      */
     public Set<Annotation> getInterceptorBindingTypes();

Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java?rev=796029&r1=796028&r2=796029&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java Mon Jul 20 21:37:00 2009
@@ -1428,56 +1428,6 @@
         return beans;
     }
     
-    /**
-     * Stereotype runtime requirements are dropped from the specification.
-     * 
-     * @param component
-     * @param anns
-     * @param errorMessage
-     * @deprecated
-     */
-    public static void checkSteroTypeRequirements(BaseBean<?> component, Annotation[] anns, String errorMessage)
-    {
-        Set<Class<? extends Annotation>> allSupportedScopes = new HashSet<Class<? extends Annotation>>();
-        Annotation[] stereoTypes = getComponentStereoTypes(component);        
-        for (Annotation stereoType : stereoTypes)
-        {
-            IStereoTypeModel model = StereoTypeManager.getInstance().getStereoTypeModel(stereoType.annotationType().getName());
-            Set<Class<?>> rtypes = model.getRestrictedTypes();
-
-            if (rtypes != null)
-            {
-                Iterator<Class<?>> itTypes = rtypes.iterator();
-                while (itTypes.hasNext())
-                {
-                    if (!component.getTypes().contains(itTypes.next()))
-                    {
-                        throw new WebBeansConfigurationException(errorMessage + " must contains all supported api types in the @Stereotype annotation " + model.getName());
-
-                    }
-                }
-            }
-
-            Set<Class<? extends Annotation>> suppScopes = model.getSupportedScopes();
-            if (suppScopes != null)
-            {
-                if (!suppScopes.isEmpty())
-                {
-                    allSupportedScopes.addAll(suppScopes);
-                }
-            }
-        }
-        
-        if(allSupportedScopes.size() > 0)
-        {
-            if (!allSupportedScopes.contains(component.getScopeType()))
-            {
-                throw new WebBeansConfigurationException(errorMessage + " must contains at least one required scope types in its @Stereotype annotations");
-            }            
-        }        
-
-    }
-
     public static void checkUnproxiableApiType(Bean<?> bean, ScopeType scopeType)
     {
         Asserts.assertNotNull("bean", "bean parameter can not be null");