[jboss-cvs] jboss-seam/src/main/org/jboss/seam ...

Gavin King gavin.king at jboss.com
Tue Oct 10 18:30:39 EDT 2006


  User: gavin   
  Date: 06/10/10 18:30:39

  Modified:    src/main/org/jboss/seam   Component.java ScopeType.java
  Log:
  got rid of StatelessContext, JBSEAM-368
  
  Revision  Changes    Path
  1.185     +16 -2     jboss-seam/src/main/org/jboss/seam/Component.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: Component.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/Component.java,v
  retrieving revision 1.184
  retrieving revision 1.185
  diff -u -b -r1.184 -r1.185
  --- Component.java	10 Oct 2006 19:37:37 -0000	1.184
  +++ Component.java	10 Oct 2006 22:30:39 -0000	1.185
  @@ -110,7 +110,7 @@
    *
    * @author <a href="mailto:theute at jboss.org">Thomas Heute</a>
    * @author Gavin King
  - * @version $Revision: 1.184 $
  + * @version $Revision: 1.185 $
    */
   @Scope(ScopeType.APPLICATION)
   public class Component
  @@ -1272,6 +1272,13 @@
                  }
               }
            }
  +         else if ( out.scope()==STATELESS )
  +         {
  +            throw new IllegalArgumentException(
  +                  "cannot specify explicit scope=STATELESS on @Out: " + 
  +                  getAttributeMessage(name)
  +               );
  +         }
   
            Context context = component==null ?
                  getOutContext( out.scope(), this ) :
  @@ -1443,7 +1450,7 @@
   
      public static Object getInstance(String name, ScopeType scope, boolean create)
      {
  -      Object result = scope.getContext().get(name);
  +      Object result = scope==STATELESS ? null : scope.getContext().get(name);
         result = getInstance(name, create, result);
         return result;
      }
  @@ -1675,6 +1682,13 @@
                     getAttributeMessage(name)
                  );
            }
  +         if ( in.scope()==STATELESS )
  +         {
  +            throw new IllegalArgumentException(
  +                  "cannot specify explicit scope=STATELESS on @In: " + 
  +                  getAttributeMessage(name)
  +               );
  +         }
            if ( log.isDebugEnabled() )
            {
               log.debug("trying to inject from specified context: " + name + ", scope: " + scope);
  
  
  
  1.9       +2 -2      jboss-seam/src/main/org/jboss/seam/ScopeType.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: ScopeType.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/ScopeType.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -b -r1.8 -r1.9
  --- ScopeType.java	9 Jan 2006 03:57:21 -0000	1.8
  +++ ScopeType.java	10 Oct 2006 22:30:39 -0000	1.9
  @@ -13,7 +13,7 @@
    * The available scopes (contexts).
    * 
    * @author <a href="mailto:theute at jboss.org">Thomas Heute</a>
  - * @version $Revision: 1.8 $
  + * @version $Revision: 1.9 $
    */
   public enum ScopeType 
   {
  @@ -69,7 +69,7 @@
         switch (this)
         {
            case STATELESS: 
  -            return Contexts.getStatelessContext();
  +            throw new UnsupportedOperationException("Stateless psuedo-scope does not have a Context object");
            case EVENT: 
               if ( !Contexts.isEventContextActive() )
               {
  
  
  



More information about the jboss-cvs-commits mailing list