1 Reply Latest reply on Nov 8, 2005 5:37 PM by gavin.king

    Seam operation in non-JSF environment.

    rdewell

      From what I can tell, Seam doesn't "degrade" into non-JSF contexts. For example, if I access a Seam component in a Message driven bean (Component.getInstance(xxx, true)), I get errors about inactive context, or no object at all.

      I'd like to see Seam handle non JSF "contexts". I don't see any reason that Seam components can't support the following scopes in a non-JSF context:

      - Stateless
      - Application
      - Session (just treat as EVENT scope, or maybe SESSION = JTA transaction in non-JSF context)
      - Event

      The only one that might not work would be CONVERSATION? In that case, Seam could throw an error... or maybe the JTA transaction works for that too?

      Basically, if I'm to generously "seam" all of my application components, then I do need them to work in non-JSF contexts, such as Message driven beans, timer beans, etc..

      Otherwise, what I'm ending up with is a lot inconsistent component lookup methods -- some of it has to lookup objects through JNDI instead of Component.getInstance, and some of it has to use @EJB and @PersistenceContext for injection instead of @In. I have to consider about when and where these objects will be used, JSF or not, which is something I don't think I should have to think about with Seam.

      What would be truly seamless is to have just one way to get at every component in my application, in every context my application runs in -- preferrably the richer "Seam way".

      Ryan