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

Gavin King gavin.king at jboss.com
Sun Oct 8 16:58:03 EDT 2006


  User: gavin   
  Date: 06/10/08 16:58:03

  Modified:    src/main/org/jboss/seam/contexts    Contexts.java
                        FacesApplicationContext.java Lifecycle.java
  Log:
  JBSEAM-178 delimited bundleNames
  temp fix for bug in new context events stuff
  
  Revision  Changes    Path
  1.42      +6 -4      jboss-seam/src/main/org/jboss/seam/contexts/Contexts.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: Contexts.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/contexts/Contexts.java,v
  retrieving revision 1.41
  retrieving revision 1.42
  diff -u -b -r1.41 -r1.42
  --- Contexts.java	29 Sep 2006 22:48:50 -0000	1.41
  +++ Contexts.java	8 Oct 2006 20:58:03 -0000	1.42
  @@ -16,7 +16,7 @@
    * 
    * @author Gavin King
    * @author <a href="mailto:theute at jboss.org">Thomas Heute</a>
  - * @version $Revision: 1.41 $
  + * @version $Revision: 1.42 $
    */
   public class Contexts {
   
  @@ -174,7 +174,8 @@
      
      public static void destroy(Context context)
      {
  -      Events.instance().raiseEvent("org.jboss.seam.preDestroyContext." + context.getType().toString());
  +      if ( Events.exists() ) Events.instance().raiseEvent("org.jboss.seam.preDestroyContext." + context.getType().toString());
  +      
         Lifecycle.startDestroying();
         try
         {
  @@ -183,7 +184,7 @@
               log.debug("destroying: " + name);
               if ( component!=null )
               {
  -               Events.instance().raiseEvent("org.jboss.seam.preDestroy." + name);
  +               if ( Events.exists() ) Events.instance().raiseEvent("org.jboss.seam.preDestroy." + name);
                  try
                  {
                     component.callDestroyMethod( context.get(name) );
  @@ -199,7 +200,8 @@
         {
            Lifecycle.stopDestroying();
         }
  -      Events.instance().raiseEvent("org.jboss.seam.postDestroyContext." + context.getType().toString());
  +      
  +      if ( Events.exists() ) Events.instance().raiseEvent("org.jboss.seam.postDestroyContext." + context.getType().toString());
      }
      
   }
  \ No newline at end of file
  
  
  
  1.6       +20 -20    jboss-seam/src/main/org/jboss/seam/contexts/FacesApplicationContext.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: FacesApplicationContext.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/contexts/FacesApplicationContext.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -b -r1.5 -r1.6
  --- FacesApplicationContext.java	29 Sep 2006 22:48:50 -0000	1.5
  +++ FacesApplicationContext.java	8 Oct 2006 20:58:03 -0000	1.6
  @@ -18,7 +18,7 @@
   /**
    * @author Gavin King
    * @author <a href="mailto:theute at jboss.org">Thomas Heute</a>
  - * @version $Revision: 1.5 $
  + * @version $Revision: 1.6 $
    */
   public class FacesApplicationContext implements Context {
   
  @@ -48,9 +48,9 @@
   	}
   
   	public void set(String name, Object value) {
  -      Events.instance().raiseEvent("org.jboss.seam.preSetVariable." + name);
  +      if ( Events.exists() ) Events.instance().raiseEvent("org.jboss.seam.preSetVariable." + name);
         externalContext.getApplicationMap().put( getKey(name), value );
  -      Events.instance().raiseEvent("org.jboss.seam.postSetVariable." + name);
  +      if ( Events.exists() ) Events.instance().raiseEvent("org.jboss.seam.postSetVariable." + name);
   	}
   
   	public boolean isSet(String name) {
  @@ -58,9 +58,9 @@
   	}
   
   	public void remove(String name) {
  -      Events.instance().raiseEvent("org.jboss.seam.preRemoveVariable." + name);
  +      if ( Events.exists() ) Events.instance().raiseEvent("org.jboss.seam.preRemoveVariable." + name);
         externalContext.getApplicationMap().remove( getKey(name) );
  -      Events.instance().raiseEvent("org.jboss.seam.postRemoveVariable." + name);
  +      if ( Events.exists() ) Events.instance().raiseEvent("org.jboss.seam.postRemoveVariable." + name);
   	}
   
       public String[] getNames() {
  
  
  
  1.55      +4 -2      jboss-seam/src/main/org/jboss/seam/contexts/Lifecycle.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: Lifecycle.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/contexts/Lifecycle.java,v
  retrieving revision 1.54
  retrieving revision 1.55
  diff -u -b -r1.54 -r1.55
  --- Lifecycle.java	4 Oct 2006 19:10:17 -0000	1.54
  +++ Lifecycle.java	8 Oct 2006 20:58:03 -0000	1.55
  @@ -30,7 +30,7 @@
   /**
    * @author Gavin King
    * @author <a href="mailto:theute at jboss.org">Thomas Heute</a>
  - * @version $Revision: 1.54 $
  + * @version $Revision: 1.55 $
    */
   public class Lifecycle
   {
  @@ -43,6 +43,7 @@
         Contexts.sessionContext.set( new WebSessionContext( ContextAdaptor.getSession(externalContext, true) ) );
         Contexts.applicationContext.set( new FacesApplicationContext(externalContext) );
         Contexts.conversationContext.set(null); //in case endRequest() was never called
  +      Events.instance(); //TODO: only for now, until we have a way to do EL outside of JSF!
         try
         {
           Authenticator.instance().beginRequest();
  @@ -118,7 +119,8 @@
   
      public static void endInitialization()
      {
  -      startup( Component.forName( Seam.getComponentName(Events.class) ) );
  +      //TODO: put this back in when we have non-JSF-dependent EL!
  +      //startup( Component.forName( Seam.getComponentName(Events.class) ) );
         
   	   //instantiate all application-scoped @Startup components
         Context context = Contexts.getApplicationContext();
  
  
  



More information about the jboss-cvs-commits mailing list