6 Replies Latest reply on Nov 30, 2007 6:48 AM by ekobir

    Hot Deployment -Object Cache

      Hi

      How can I develop a small cache without losing hot deployment functionality of JBOSS ? Ans suggestion will be appreciated.

      I'm planing to write code similar to following but it will not assure hot deployment will work properly.... (Example is written by me.. And I know it can written better :) )

      import java.lang.ref.SoftReference;
      import java.util.concurrent.ConcurrentHashMap;

      abstract class BaseClass {
      public abstract String test();
      }

      class AClass extends BaseClass{
      public String test(){
      return "A";
      }
      }

      class BClass extends BaseClass {
      public String test(){
      return "B";
      }
      }


      public class SmallCache{
      private static ConcurrentHashMap<Integer,SoftReference> testMap = new ConcurrentHashMap<Integer, SoftReference>();

      public static BaseClass getInstance(int type){
      SoftReference sf = testMap.get(type);
      if(sf == null)
      {
      switch(type)
      {
      case 1: testMap.put(type, new SoftReference(new AClass()));
      break;
      case 2: testMap.put(type, new SoftReference(new BClass()));
      break;
      default:
      System.out.println("Ignore it for now");
      }
      }

      return sf.get();
      }

      }

        • 1. Re: Hot Deployment -Object Cache
          galder.zamarreno

          And maybe, just maybe, you could stop using the Design forum to ask questions about usage of JBoss Cache :)

          This forum is used to discuss the design of JBoss Cache itself. Please, use the JBoss Cache User Forum instead.

          • 2. Re: Hot Deployment -Object Cache
            galder.zamarreno

            In fact, your post is not even about JBoss Cache usage itself. Please visit the Sun's Java forums :)

            • 3. Re: Hot Deployment -Object Cache

              Sorry to bother you Galder.

              I just thought somebody can reply from here as it is an open community...

              • 4. Re: Hot Deployment -Object Cache
                galder.zamarreno

                It is an open community in the sense that we discuss "stuff", as long as "stuff" is related to the forum where is posted, i.e.

                We freely help people with issues using JBoss Cache in the JBoss Cache Users Forum

                We help people with issues/queries developing features or fixing bugs in JBoss Cache in the JBoss Cache Design Forum

                Your post does is not fall in either of these categories, so we're not able to help your further at this point.

                • 5. Re: Hot Deployment -Object Cache
                  manik

                  I agree with Galder. WHat you are asking has nothing to do with either (a) the design of JBoss Cache or, (b) the usage of JBoss Cache. Join a JUG or something. Please read the title of each forum before you decide to post to it, just to make sure your post is relevant and you're not polluting the forum wih irrelevance.


                  • 6. Re: Hot Deployment -Object Cache

                    Imagine a scenario like following :

                    Hot deployable objects are cached by using JBoss cache. And Whenever a new sar file is deployed, class loader which is responsible from hot deployment should send a notification to cache in order to invalidate objects so instance of new version of classes can be filled into JBoss cache again.

                    Does it make sense now ? Are you planing to suggest me to restart JBoss ?