openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gerdo...@apache.org
Subject svn commit: r757193 - in /incubator/openwebbeans/trunk/webbeans-impl/src/main: java/org/apache/webbeans/config/ java/org/apache/webbeans/container/ java/org/apache/webbeans/ejb/ java/org/apache/webbeans/jsf/ java/org/apache/webbeans/spi/deployer/ java/...
Date Sun, 22 Mar 2009 14:48:00 GMT
Author: gerdogdu
Date: Sun Mar 22 14:47:59 2009
New Revision: 757193

URL: http://svn.apache.org/viewvc?rev=757193&view=rev
Log:
Reflecting changes while updating the guess sample.

Removed:
    incubator/openwebbeans/trunk/webbeans-impl/src/main/resources/org/
Modified:
    incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/WebBeansContainerDeployer.java
    incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/ManagerImpl.java
    incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/ejb/EJBUtil.java
    incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/jsf/WebBeansPhaseListener.java
    incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/spi/deployer/AbstractMetaDataDiscovery.java
    incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/spi/ee/deployer/WarMetaDataDiscoveryImpl.java
    incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/spi/se/deployer/MetaDataDiscoveryStandard.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/config/WebBeansContainerDeployer.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/WebBeansContainerDeployer.java?rev=757193&r1=757192&r2=757193&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/WebBeansContainerDeployer.java
(original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/WebBeansContainerDeployer.java
Sun Mar 22 14:47:59 2009
@@ -32,6 +32,7 @@
 import javax.inject.manager.InjectionPoint;
 import javax.inject.manager.Manager;
 import javax.interceptor.Interceptor;
+import javax.webbeans.Model;
 
 import org.apache.webbeans.annotation.DeployedManagerLiteral;
 import org.apache.webbeans.annotation.InitializedManagerLiteral;
@@ -420,6 +421,8 @@
     {
         logger.info("Checking StereoTypes constraints is started");
 
+        addDefaultStereoTypes();
+        
         Map<String, Set<String>> stereotypeMap = scanner.getANNOTATION_DB().getClassIndex();
         if (stereotypeMap != null && stereotypeMap.size() > 0)
         {
@@ -446,6 +449,18 @@
         logger.info("Checking StereoTypes constraints is ended");
     }
 
+    protected void addDefaultStereoTypes()
+    {
+        StereoTypeModel model = new StereoTypeModel(Model.class);
+        StereoTypeManager.getInstance().addStereoTypeModel(model);
+        
+        model = new StereoTypeModel(Decorator.class);
+        StereoTypeManager.getInstance().addStereoTypeModel(model);
+        
+        model = new StereoTypeModel(Interceptor.class);
+        StereoTypeManager.getInstance().addStereoTypeModel(model);        
+    }
+    
     protected <T> void defineSimpleWebBeans(Class<T> clazz)
     {
         ComponentImpl<T> component = null;

Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/ManagerImpl.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/ManagerImpl.java?rev=757193&r1=757192&r2=757193&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/ManagerImpl.java
(original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/ManagerImpl.java
Sun Mar 22 14:47:59 2009
@@ -100,7 +100,10 @@
     public static ManagerImpl getManager()
     {
         ActivityManager activityManager = ActivityManager.getInstance();
-        return activityManager.getRootActivity();
+        
+        ManagerImpl currentManager = activityManager.getCurrentActivity();
+        
+        return currentManager;
     }
 
     public void setXMLConfigurator(WebBeansXMLConfigurator xmlConfigurator)

Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/ejb/EJBUtil.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/ejb/EJBUtil.java?rev=757193&r1=757192&r2=757193&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/ejb/EJBUtil.java
(original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/ejb/EJBUtil.java
Sun Mar 22 14:47:59 2009
@@ -47,7 +47,6 @@
      * @param clazz class instance
      * @return true or false
      */
-    // TODO Look EJB Specification for more concrete definition
     public static boolean isEJBSessionClass(Class<?> clazz)
     {
         return (AnnotationUtil.isAnnotationExistOnClass(clazz, Stateless.class) || AnnotationUtil.isAnnotationExistOnClass(clazz,
Stateful.class));
@@ -58,6 +57,13 @@
         return (AnnotationUtil.isAnnotationExistOnClass(clazz, Stateful.class));
     }
     
+    //TODO EJB 3.1
+    public static boolean isEJBSingletonClass(Class<?> clazz)
+    {
+        return false;
+    }
+    
+    
     public static boolean isEJBSessionStateless(Class<?> clazz)
     {
         return (AnnotationUtil.isAnnotationExistOnClass(clazz, Stateless.class));

Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/jsf/WebBeansPhaseListener.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/jsf/WebBeansPhaseListener.java?rev=757193&r1=757192&r2=757193&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/jsf/WebBeansPhaseListener.java
(original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/jsf/WebBeansPhaseListener.java
Sun Mar 22 14:47:59 2009
@@ -34,8 +34,6 @@
 
     private static ConversationManager conversationManager = ConversationManager.getInstance();
 
-    private static ManagerImpl manager = ManagerImpl.getManager();
-
     private ConversationImpl conversation = null;
 
     public void afterPhase(PhaseEvent phaseEvent)
@@ -126,7 +124,7 @@
     {
         if (phaseEvent.getPhaseId().equals(PhaseId.APPLY_REQUEST_VALUES))
         {
-            ConversationContext context = (ConversationContext) manager.getContext(ConversationScoped.class);
+            ConversationContext context = (ConversationContext) ManagerImpl.getManager().getContext(ConversationScoped.class);
 
             if (JSFUtil.isPostBack())
             {
@@ -139,7 +137,7 @@
 
         else if (phaseEvent.getPhaseId().equals(PhaseId.RENDER_RESPONSE))
         {
-            ConversationContext context = (ConversationContext) manager.getContext(ConversationScoped.class);
+            ConversationContext context = (ConversationContext) ManagerImpl.getManager().getContext(ConversationScoped.class);
 
             if (!JSFUtil.isPostBack())
             {

Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/spi/deployer/AbstractMetaDataDiscovery.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/spi/deployer/AbstractMetaDataDiscovery.java?rev=757193&r1=757192&r2=757193&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/spi/deployer/AbstractMetaDataDiscovery.java
(original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/spi/deployer/AbstractMetaDataDiscovery.java
Sun Mar 22 14:47:59 2009
@@ -47,7 +47,6 @@
                 ANNOTATION_DB.setScanFieldAnnotations(false);
                 ANNOTATION_DB.setScanMethodAnnotations(false);
                 ANNOTATION_DB.setScanParameterAnnotations(false);
-
             }            
             
         }

Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/spi/ee/deployer/WarMetaDataDiscoveryImpl.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/spi/ee/deployer/WarMetaDataDiscoveryImpl.java?rev=757193&r1=757192&r2=757193&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/spi/ee/deployer/WarMetaDataDiscoveryImpl.java
(original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/spi/ee/deployer/WarMetaDataDiscoveryImpl.java
Sun Mar 22 14:47:59 2009
@@ -121,6 +121,12 @@
         return listURL;
     }
 
+    /**
+     * Returns <code>URL</code> of the web application class path.
+     * 
+     * @return <code>URL</code> of the web application class path
+     * @throws Exception if any exception occurs
+     */
     private URL createURLFromWARFile() throws Exception
     {
         URL url = this.servletContext.getResource("/WEB-INF/beans.xml");

Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/spi/se/deployer/MetaDataDiscoveryStandard.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/spi/se/deployer/MetaDataDiscoveryStandard.java?rev=757193&r1=757192&r2=757193&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/spi/se/deployer/MetaDataDiscoveryStandard.java
(original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/spi/se/deployer/MetaDataDiscoveryStandard.java
Sun Mar 22 14:47:59 2009
@@ -16,11 +16,10 @@
 import java.io.IOException;
 
 import java.net.URL;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
 import java.util.Enumeration;
 
 import org.apache.webbeans.spi.deployer.AbstractMetaDataDiscovery;
+import org.apache.webbeans.util.WebBeansUtil;
 
 import org.scannotation.ClasspathUrlFinder;
 
@@ -38,32 +37,10 @@
 
     private void configureAnnotationDB() throws Exception
     {
-        ClassLoader loader = null;
-
-        loader = AccessController.doPrivileged(new PrivilegedAction<ClassLoader>()
-        {
-
-            public ClassLoader run()
-            {
-                try
-                {
-                    return Thread.currentThread().getContextClassLoader();
-
-                }
-                catch (Exception e)
-                {
-                    return null;
-                }
-            }
-
-        });
-
-        if (loader == null)
-        {
-            loader = this.getClass().getClassLoader();
-        }
+        ClassLoader loader = WebBeansUtil.getCurrentClassLoader();
 
         URL[] urls = ClasspathUrlFinder.findResourceBases("META-INF/beans.xml", loader);
+        
         this.ANNOTATION_DB.scanArchives(urls);
 
         configureXML();

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=757193&r1=757192&r2=757193&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
Sun Mar 22 14:47:59 2009
@@ -23,6 +23,8 @@
 import java.lang.reflect.Type;
 import java.lang.reflect.TypeVariable;
 import java.lang.reflect.WildcardType;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collections;
@@ -138,7 +140,30 @@
      */
     public static ClassLoader getCurrentClassLoader()
     {
-        return Thread.currentThread().getContextClassLoader();
+        ClassLoader loader = AccessController.doPrivileged(new PrivilegedAction<ClassLoader>()
+        {
+
+            public ClassLoader run()
+            {
+                try
+                {
+                    return Thread.currentThread().getContextClassLoader();
+
+                }
+                catch (Exception e)
+                {
+                    return null;
+                }
+            }
+
+        });
+
+        if (loader == null)
+        {
+            loader = WebBeansUtil.class.getClassLoader();
+        }
+
+        return loader;
     }
 
     /**
@@ -1813,4 +1838,17 @@
         
         return component;
     }      
+    
+    public static boolean isDeploymentTypeEnabled(Class<? extends Annotation> deploymentType)
+    {
+        Asserts.assertNotNull(deploymentType, "deplymentType parameter can not be null");
+        
+        if (!DeploymentTypeManager.getInstance().isDeploymentTypeEnabled(deploymentType))
+        {
+            return false;
+        }
+        
+        return true;
+        
+    }
  }
\ No newline at end of file



Mime
View raw message