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

Peter Muir peter at bleepbleep.org.uk
Fri Oct 26 08:32:31 EDT 2007


  User: pmuir   
  Date: 07/10/26 08:32:31

  Modified:    src/main/org/jboss/seam/mail  MailSession.java
  Log:
  Explicit scope
  
  Revision  Changes    Path
  1.16      +6 -1      jboss-seam/src/main/org/jboss/seam/mail/MailSession.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: MailSession.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/mail/MailSession.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -b -r1.15 -r1.16
  --- MailSession.java	9 Oct 2007 13:58:50 -0000	1.15
  +++ MailSession.java	26 Oct 2007 12:32:31 -0000	1.16
  @@ -18,6 +18,7 @@
   import org.jboss.seam.annotations.Scope;
   import org.jboss.seam.annotations.Unwrap;
   import org.jboss.seam.annotations.intercept.BypassInterceptors;
  +import org.jboss.seam.contexts.Contexts;
   import org.jboss.seam.core.AbstractMutable;
   import org.jboss.seam.log.LogProvider;
   import org.jboss.seam.log.Logging;
  @@ -301,7 +302,11 @@
   
       public static Session instance()
       {
  -        return (Session) Component.getInstance(MailSession.class);
  +        if (!Contexts.isApplicationContextActive())
  +        {
  +           throw new IllegalArgumentException("Application scope not active");
  +        }
  +        return (Session) Component.getInstance(MailSession.class, APPLICATION);
       }
   
   }
  
  
  



More information about the jboss-cvs-commits mailing list