4 Replies Latest reply on Dec 18, 2009 12:37 PM by sait

    Destroy POJO

    sait

      Hi,


      I need to destroy some POJOs when I want. I think that callDestroy Method can be used. But I can not find any example about how to use this method? Can anyone know?


       

        • 1. Re: Destroy POJO
          blabno

          Please tell us why do you need to destroy the component ? Maybe you just need to remove it from the context.

          • 2. Re: Destroy POJO
            sait

            For example, a session scoped-bean which occupies huge memory is created. After a while, this beans need to be destroyed in a method. How can I destroy this bean or removed from the context?

            • 3. Re: Destroy POJO
              blabno

              Removing from context :


              org.jboss.seam.contexts.Contexts.removeFromAllContexts(componentName)



              Note that component removal should be done automatically whe context ends. If you need to remove it manually there is a big chance that you have placed it in to broad context. Reconcider your decision.

              • 4. Re: Destroy POJO
                sait

                Thank you Bernard.