2 Replies Latest reply on Mar 22, 2006 8:31 AM by Keith Counsell

    Injection in interceptors

    Keith Counsell Newbie

      Is it possible to use bijection in interceptors?

      I would like to use the @In annotation to get a reference to the built-in actor component in an interceptor derived from the LoggedInInterceptor used in the examples. I have tried a few combinations of interception annotations in the interceptor class without any luck.

      This does not inject, but Actor.instance() works when the interceptor is called:

      @Around({BijectionInterceptor.class,
       ValidationInterceptor.class,
       ConversationInterceptor.class,
       BusinessProcessInterceptor.class})
      @Within(RemoveInterceptor.class)

      Removing the @Around and @Within annotations produces the same behavior.

      This prevents the interceptor from being called:
      @Around({ValidationInterceptor.class,
       ConversationInterceptor.class,
       BusinessProcessInterceptor.class})
      @Within({BijectionInterceptor.class,
       RemoveInterceptor.class})


      I am trying to inject actor with this code in all cases:
      @In(create=true)
      Actor actor = null;


      Actor.instance() does provide the correct reference so this is not a show-stopper for me, but I would be grateful for any tips on where I am going wrong. Is bijection even a reasonable thing to attempt in an interceptor?

      Many thanks,
      Keith