openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r1678014 - in /openwebbeans/trunk: webbeans-impl/src/main/java/org/apache/webbeans/context/ webbeans-impl/src/main/java/org/apache/webbeans/corespi/se/ webbeans-spi/src/main/java/org/apache/webbeans/spi/
Date Wed, 06 May 2015 14:57:26 GMT
Author: struberg
Date: Wed May  6 14:57:26 2015
New Revision: 1678014

URL: http://svn.apache.org/r1678014
Log:
OWB-1068 remove unused SPI methods from ContextsService

the following ContextsService have been removed:
* activateContext
* deactivateContext
* supportsContxt

They have never really been used anyway.

Modified:
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/AbstractContextsService.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/corespi/se/DefaultContextsService.java
    openwebbeans/trunk/webbeans-spi/src/main/java/org/apache/webbeans/spi/ContextsService.java

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/AbstractContextsService.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/AbstractContextsService.java?rev=1678014&r1=1678013&r2=1678014&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/AbstractContextsService.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/AbstractContextsService.java
Wed May  6 14:57:26 2015
@@ -84,38 +84,6 @@ public abstract class AbstractContextsSe
     }
 
     @Override
-    public boolean supportsContext(Class<? extends Annotation> scopeType)
-    {        
-        return false;
-    }
-    
-    @Override
-    public void activateContext(Class<? extends Annotation> scopeType)
-    {
-        if(supportsContext(scopeType))
-        {
-            Context context = getCurrentContext(scopeType);
-            if(context instanceof AbstractContext)
-            {
-                ((AbstractContext)context).setActive(true);
-            }
-        }
-    }
-    
-    @Override
-    public void deActivateContext(Class<? extends Annotation> scopeType)
-    {
-        if(supportsContext(scopeType))
-        {
-            Context context = getCurrentContext(scopeType);
-            if(context instanceof AbstractContext)
-            {
-                ((AbstractContext)context).setActive(false);
-            }
-        }        
-    }
-
-    @Override
     public void removeThreadLocals()
     {
         // no ThreadLocals to clean up by default

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/corespi/se/DefaultContextsService.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/corespi/se/DefaultContextsService.java?rev=1678014&r1=1678013&r2=1678014&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/corespi/se/DefaultContextsService.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/corespi/se/DefaultContextsService.java
Wed May  6 14:57:26 2015
@@ -82,32 +82,29 @@ public class DefaultContextsService exte
     public void endContext(Class<? extends Annotation> scopeType, Object endParameters)
     {
         
-        if(supportsContext(scopeType))
+        if(scopeType.equals(RequestScoped.class))
         {
-            if(scopeType.equals(RequestScoped.class))
-            {
-                stopRequestContext(endParameters);
-            }
-            else if(scopeType.equals(SessionScoped.class))
-            {
-                stopSessionContext(endParameters);
-            }
-            else if(scopeType.equals(ApplicationScoped.class))
-            {
-                stopApplicationContext(endParameters);
-            }
-            else if(scopeType.equals(ConversationScoped.class))
-            {
-                stopConversationContext(endParameters);
-            }
-            else if(scopeType.equals(Dependent.class))
-            {
-                //Do nothing
-            }
-            else
-            {
-                stopSingletonContext(endParameters);
-            }
+            stopRequestContext(endParameters);
+        }
+        else if(scopeType.equals(SessionScoped.class))
+        {
+            stopSessionContext(endParameters);
+        }
+        else if(scopeType.equals(ApplicationScoped.class))
+        {
+            stopApplicationContext(endParameters);
+        }
+        else if(scopeType.equals(ConversationScoped.class))
+        {
+            stopConversationContext(endParameters);
+        }
+        else if(scopeType.equals(Dependent.class))
+        {
+            //Do nothing
+        }
+        else if(scopeType.equals(Singleton.class))
+        {
+            stopSingletonContext(endParameters);
         }
 
     }
@@ -192,23 +189,6 @@ public class DefaultContextsService exte
         }        
     }
 
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    public boolean supportsContext(Class<? extends Annotation> scopeType)
-    {
-        
-        return scopeType.equals(RequestScoped.class) ||
-               scopeType.equals(SessionScoped.class) ||
-               scopeType.equals(ApplicationScoped.class) ||
-               scopeType.equals(ConversationScoped.class) ||
-               scopeType.equals(Dependent.class) ||
-               scopeType.equals(Singleton.class);
-    }
-
-
     @Override
     public void destroy(Object destroyObject)
     {

Modified: openwebbeans/trunk/webbeans-spi/src/main/java/org/apache/webbeans/spi/ContextsService.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-spi/src/main/java/org/apache/webbeans/spi/ContextsService.java?rev=1678014&r1=1678013&r2=1678014&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-spi/src/main/java/org/apache/webbeans/spi/ContextsService.java
(original)
+++ openwebbeans/trunk/webbeans-spi/src/main/java/org/apache/webbeans/spi/ContextsService.java
Wed May  6 14:57:26 2015
@@ -43,13 +43,13 @@ public interface ContextsService
      * Initialize container contexts service.
      * @param initializeObject any initialize object
      */
-    public void init(Object initializeObject);
+    void init(Object initializeObject);
     
     /**
      * Destroys container contexts service.
      * @param destroyObject any destroy parameter
      */
-    public void destroy(Object destroyObject);
+    void destroy(Object destroyObject);
     
     /**
      * Gets current context with given scope type with
@@ -60,7 +60,7 @@ public interface ContextsService
      * @param scopeType context scope type
      * @return current context with given scope type
      */
-    public Context getCurrentContext(Class<? extends Annotation> scopeType);
+    Context getCurrentContext(Class<? extends Annotation> scopeType);
     
     /**
      * Gets current context with given scope type with
@@ -74,17 +74,9 @@ public interface ContextsService
      * @param createIfNotExists whether to create a new context if the underlying storage
is not yet initialized
      * @return current context with given scope type
      */
-    public Context getCurrentContext(Class<? extends Annotation> scopeType, boolean
createIfNotExists);
+    Context getCurrentContext(Class<? extends Annotation> scopeType, boolean createIfNotExists);
 
     /**
-     * If container supports the given scope type it returns
-     * true, otherwise it return false.
-     * @param scopeType scope type
-     * @return true if container supports given scope type false otherwise
-     */
-    public boolean supportsContext(Class<? extends Annotation> scopeType);
-    
-    /**
      * Starts the context with the given scope type. If 
      * given scope type is not supported, there is no action.
      * @param scopeType scope type
@@ -92,7 +84,7 @@ public interface ContextsService
      * @throws ContextException if any exception thrown by starting context,
      *         it is wrapped inside {@link ContextException} and thrown.
      */
-    public void startContext(Class<? extends Annotation> scopeType, Object startParameter)
throws ContextException;
+    void startContext(Class<? extends Annotation> scopeType, Object startParameter)
throws ContextException;
     
     /**
      * Ends the context with the given scope type. If 
@@ -102,30 +94,12 @@ public interface ContextsService
      * @param scopeType scope type
      * @param endParameters any end parameter
      */
-    public void endContext(Class<? extends Annotation> scopeType, Object endParameters);
-    
-    /**
-     * Activate the context with the given scope type. If 
-     * given scope type is not supported, there is no action.
-     * Any exception thrown by the operation is catched and 
-     * logged by the container.
-     * @param scopeType scope type
-     */
-    public void activateContext(Class<? extends Annotation> scopeType);
-    
-    /**
-     * Deactivates the context with the given scope type. If 
-     * given scope type is not supported, there is no action.
-     * Any exception thrown by the operation is catched and 
-     * logged by the container.
-     * @param scopeType scope type
-     */    
-    public void deActivateContext(Class<? extends Annotation> scopeType);
+    void endContext(Class<? extends Annotation> scopeType, Object endParameters);
 
     /**
      * Whenever a thread ends we need to remove any ThreadLocals from the ContextsService
      */
-    public void removeThreadLocals();
+    void removeThreadLocals();
 
     /**
      * This method can be used to disable conversation support in core CDI.
@@ -134,5 +108,5 @@ public interface ContextsService
      * "CDI Conversation Filter".
      * @param supportConversations whether converstaions should be supported
      */
-    public void setSupportConversations(boolean supportConversations);
+    void setSupportConversations(boolean supportConversations);
 }



Mime
View raw message