7 Replies Latest reply on Oct 26, 2006 5:39 PM by Zhong Zhang

    All injections are disinjected when used in a component with

    Zhong Zhang Newbie

      When I use @In and @Unwrap in the same seam component, all the injections are null (at least in the @unwrap method).

      Seems in BijectionInterceptor class, all be disinjected just after inject to the component.

      @AroundInvoke
      public Object bijectTargetComponent(InvocationContext invocation) throws Exception
      {
      if ( getComponent().needsInjection() ) //only needed to hush the log message
      {
      if ( log.isTraceEnabled() )
      {
      log.trace("injecting dependencies of: " + getComponent().getName());
      }
      getComponent().inject( invocation.getTarget(), !isLifecycleMethod( invocation.getMethod() ) );
      }

      Object result = invocation.proceed();

      if ( getComponent().needsOutjection() ) //only needed to hush the log message
      {
      if ( log.isTraceEnabled() )
      {
      log.trace("outjecting dependencies of: " + getComponent().getName());
      }
      getComponent().outject( invocation.getTarget(), !isLifecycleMethod( invocation.getMethod() ) );
      }

      if ( getComponent().needsInjection() ) //only needed to hush the log message
      {
      if ( log.isTraceEnabled() )
      {
      log.trace("disinjecting dependencies of: " + getComponent().getName());
      }
      getComponent().disinject( invocation.getTarget() );
      }

      return result;
      }

      It works fine with components which do not have @Unwrap. Does anyone have idea about this? Thanks a lot.