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

Gavin King gavin.king at jboss.com
Fri Sep 29 18:48:50 EDT 2006


  User: gavin   
  Date: 06/09/29 18:48:50

  Modified:    src/main/org/jboss/seam  Component.java
  Log:
  JBSEAM-28 context events
  
  Revision  Changes    Path
  1.168     +15 -4     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.167
  retrieving revision 1.168
  diff -u -b -r1.167 -r1.168
  --- Component.java	28 Sep 2006 22:38:45 -0000	1.167
  +++ Component.java	29 Sep 2006 22:48:49 -0000	1.168
  @@ -72,6 +72,7 @@
   import org.jboss.seam.annotations.datamodel.DataModel;
   import org.jboss.seam.contexts.Context;
   import org.jboss.seam.contexts.Contexts;
  +import org.jboss.seam.core.Events;
   import org.jboss.seam.core.Init;
   import org.jboss.seam.core.ResourceBundle;
   import org.jboss.seam.databinding.DataBinder;
  @@ -104,7 +105,7 @@
    *
    * @author <a href="mailto:theute at jboss.org">Thomas Heute</a>
    * @author Gavin King
  - * @version $Revision: 1.167 $
  + * @version $Revision: 1.168 $
    */
   @Scope(ScopeType.APPLICATION)
   public class Component
  @@ -1526,6 +1527,7 @@
         {
            getScope().getContext().set(name, instance); //put it in the context _before_ calling the create method
            callCreateMethod(instance);
  +         if ( Events.exists() ) Events.instance().raiseEvent("org.jboss.seam.postCreate." + name);
         }
   
         return instance;
  @@ -1621,14 +1623,20 @@
         Object result;
         if ( name.startsWith("#") )
         {
  +         if ( log.isDebugEnabled() )
  +         {
            log.debug("trying to inject with EL expression: " + name);
  +         }
            FacesContext facesCtx = FacesContext.getCurrentInstance();
            Application application = facesCtx.getApplication();
            result = application.createValueBinding(name).getValue(facesCtx);
         }
         else if ( in.scope()==UNSPECIFIED )
         {
  +         if ( log.isDebugEnabled() )
  +         {
            log.debug("trying to inject with hierarchical context search: " + name);
  +         }
            result = getInstance( name, in.create() );
         }
         else
  @@ -1640,7 +1648,10 @@
                     getAttributeMessage(name)
                  );
            }
  -         log.debug("trying to inject from context: " + name + ", scope: " + scope);
  +         if ( log.isDebugEnabled() )
  +         {
  +            log.debug("trying to inject from specified context: " + name + ", scope: " + scope);
  +         }
            result = in.scope().getContext().get(name);
         }
   
  
  
  



More information about the jboss-cvs-commits mailing list