5 Replies Latest reply on Nov 5, 2009 2:21 PM by holgerprause

    search all conversations for a bean

      Hello, what i need to do is to iterate all Conversations and lookup for a certain bean.
      Can anyone give me a hint where to start?


      Thx very much,


      Holger

        • 1. Re: search all conversations for a bean

          Why?

          • 2. Re: search all conversations for a bean

            I want to display a fine grained working space list, each entry in the list is a coupled with a nean instance in a conversation.


            • 3. Re: search all conversations for a bean
              kragoth

              Why don't you just register the bean on creation in a known location?


              use the @Create annotation, register these beans you want in some list (Session scoped list maybe?). Remove them from the list when a conversation/bean is destroyed.


              Looking inside a conversation that is not your currently active conversation is a bit difficult... it probably can be done but I'd try to avoid it if I were you.  If you really really want to do this, you'll have to look at how Seam stores conversations and the beans that are in them and see if you can get access to that list/map. But, really... it would be best not to :P

              • 4. Re: search all conversations for a bean

                Hello Tim



                Why don't you just register the bean on creation in a known location

                That was my first idea, but the beans are all conversation scoped.
                If i register the conversation scoped beans in a session scoped bean(in a internal list) and the conversation(s) get(s) timed out,i am afraid the beans are still in the list.



                Hmm maybe i could react on conversation timeout, not sure about this, maybe u can give me a hint?
                Thats my only concern, otherwise the idea is good and would work for me.


                Thx very much,


                Holger


                • 5. Re: search all conversations for a bean

                  Hi, after doing some research and the hint with the @Create annotation i found a @Destroy annotation.
                  In that method i could remove the conversation bean from the session scoped list?


                  Would be very easy if it would works this way.
                  Ill give it a try, thx very much!!!


                  Bye,
                  Holger