1 Reply Latest reply on Jul 4, 2009 11:26 PM by blabno

    Outjection not firing?

    asookazian

      Seam 2.0.2-FP


      I have the following Seam component and local interface for the SFSB:


      @Local
      public interface ManageEquipmentLocal {
        public void setSerialNumber(String serialNumber);
      }



      @Stateful
      @Name("manageEquipment")
      @Scope(ScopeType.CONVERSATION)
      @SuppressWarnings("unchecked")
      public class ManageEquipmentAction implements ManageEquipmentLocal 
      {
      
      @Out(required=false)
      private String serialNumber;
      
      public void searchSerialNumber() 
      {...}
      
      @Begin(join=true)
      public void setSerialNumber(String serialNumber)
      {
           this.serialNumber = serialNumber;
      }



      I am expecting serialNumber to be available in the conversation context after setSerialNumber() method completes.  Then I access debug.seam page and it's not in the conversation context.


      The outjection in Seam defaults to the scope of the component, in this case it's CONVERSATION.  So why is the outjection not occurring?  I need the value to be available for serialNumber property when the EJB interceptor fires.  The value of serialNumber is null when searchSerialNumber() method starts.  This method is executed after the setter is executed. 


      Why is the outjection not working?  Is the temporary conversation being promoted to LRC too late for outjection to occur for the setter method?


      @Name("profilingInterceptor")
      @Scope(ScopeType.CONVERSATION)
      public class ProfilingInterceptor {
           
           Log log = Logging.getLog(ProfilingInterceptor.class); 
           
           @In private String serialNumber;
      
          @AroundInvoke
          public Object profile(InvocationContext ic) throws Exception {
               
               log.info("*** Entering method: " + ic.getMethod().getName());         
               log.info("*** serialNumber = " + serialNumber);
               
              long startTime = 0;
              long endTime = 0;
              try {
                  startTime = System.currentTimeMillis();            
                  return ic.proceed();
              } finally {
                  endTime = System.currentTimeMillis();
                  log.info("*** Method " + ic.getClass() + "." + ic.getMethod() + " executed in " + (endTime - startTime) + "ms ***");
              }
          }
      }

        • 1. Re: Outjection not firing?
          blabno

          No searchSerialNumber in interface - so where do you call it from (show it).
          My guess is you do not execute this method via EL nor through injected component nor Component.getInstance(...), so there is no interception (and thus bijection).