openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r898417 - /openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/ExtensionLoader.java
Date Tue, 12 Jan 2010 16:55:31 GMT
Author: struberg
Date: Tue Jan 12 16:55:31 2010
New Revision: 898417

URL: http://svn.apache.org/viewvc?rev=898417&view=rev
Log:
OWB-226 add a way to add CDI Extensions for a unit test

Modified:
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/ExtensionLoader.java

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/ExtensionLoader.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/ExtensionLoader.java?rev=898417&r1=898416&r2=898417&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/ExtensionLoader.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/ExtensionLoader.java
Tue Jan 12 16:55:31 2010
@@ -72,10 +72,7 @@
             Extension ext = iterator.next();
             try
             {
-                Bean<?> bean = WebBeansUtil.createExtensionComponent(ext.getClass());
               
-                this.extensions.put(bean, ext);
-                
-                BeanManagerImpl.getManager().addBean(bean);
+                addExtension(ext);
             }
             catch (Exception e)
             {
@@ -102,7 +99,20 @@
         
         return null;
     }
-    
+
+
+    /**
+     * Add a CDI Extension to our internal list.
+     * @param ext
+     */
+    public void addExtension(Extension ext)
+    {
+        Bean<?> bean = WebBeansUtil.createExtensionComponent(ext.getClass());     
          
+        this.extensions.put(bean, ext);
+        
+        BeanManagerImpl.getManager().addBean(bean);
+    }
+
     /**
      * Clear service list.
      */



Mime
View raw message