7 Replies Latest reply on Nov 9, 2004 1:11 AM by camel

    Has TreeCacheView Been Updated?

    jiwils

      Has anyone else noticed that the TreeCacheView class/application does not always correctly reflect cache access/changes?

      I figured that part of the problem might be related to how the GUI and cache are connected, so to prove that was the case, I implemented the TreeCacheListener interface to print cache access/changes to the console, and ran that inside another VM. That testing indicated that the cache was correctly getting all of the changes I thought it should.

      In the future, I would be happy to look at the TreeCacheView class/application to try to figure out what is wrong, but I was curious if some of these issues have already been fixed.

        • 1. Re: Has TreeCacheView Been Updated?
          belaban

          You are right; the reason is that I'm not a good GUI developer... :-)

          If anyone volunteers fixing the GUI, I'd be more than happy !
          Maybe even write a better GUI that what we currently have...

          Bela

          • 2. Re: Has TreeCacheView Been Updated?
            jiwils

            I may look into making some changes to the TreeCacheView application/class, and if I improve it, I will e-mail those changes to you.

            • 3. Re: Has TreeCacheView Been Updated?

              Just want to add one comment. Have you checked out TreeCacheView2? It's a bit up to date than TreeCacheView since it's used in the simple GUI.

              -Ben

              • 4. Re: Has TreeCacheView Been Updated?
                belaban

                Great ! Okay, there are 2 classes: TreeCacheView (the MBean, supposed to run inside JBoss) and TreeCacheView2, the standalone GUI. Then, there is also TreeCacheViewAop.

                We need to merge those 3 classes into 1, for obvious reasons. We could start by dumping TreeCacheView, b/c the MBean view is not really important for now.

                Bela

                • 5. Re: Has TreeCacheView Been Updated?
                  camel

                  Bela,
                  I looked at the TreeCacheView2.java source. One reason the GUI may not be updating correctly is because TreeCacheListener events are causing the GUI to be updated on a non-Swing event queue thread. It's easy to fix, for each method of the TreeCacheListener interface, wrap the code with:

                  // Example, nodeCreated method:
                  public void nodeCreated(Fqn fqn) {
                   EventQueue.invokeLater(new Runnable() {
                   public void run() {
                   // Original code goes here
                   }
                   });
                  }
                  



                  "bela" wrote:
                  You are right; the reason is that I'm not a good GUI developer... :-)

                  If anyone volunteers fixing the GUI, I'd be more than happy !
                  Maybe even write a better GUI that what we currently have...

                  Bela


                  • 6. Re: Has TreeCacheView Been Updated?
                    belaban

                     

                    "camel" wrote:
                    Bela,
                    I looked at the TreeCacheView2.java source. One reason the GUI may not be updating correctly is because TreeCacheListener events are causing the GUI to be updated on a non-Swing event queue thread. It's easy to fix, for each method of the TreeCacheListener interface, wrap the code with:
                    // Example, nodeCreated method:
                    public void nodeCreated(Fqn fqn) {
                     EventQueue.invokeLater(new Runnable() {
                     public void run() {
                     // Original code goes here
                     }
                     });
                    }
                    


                    Did you verify this works ? I'll do it right away once you let me know whether you have tested it.
                    Bela


                    "bela" wrote:
                    You are right; the reason is that I'm not a good GUI developer... :-)

                    If anyone volunteers fixing the GUI, I'd be more than happy !
                    Maybe even write a better GUI that what we currently have...

                    Bela


                    • 7. Re: Has TreeCacheView Been Updated?
                      camel

                       


                      Did you verify this works ? I'll do it right away once you let me know whether you have tested it.


                      I haven't tried to reproduce the original problem (in fact I don't have JBossCache running yet, other than the demo). As with most threading issues, it's probably hard to reproduce; does anyone have a testcase that causes the problem?

                      -Chris