1 2 3 Previous Next 33 Replies Latest reply on Dec 28, 2005 10:00 PM by ben.wang Go to original post
      • 30. Re: Exposing JBossCache Management Attributes

        After discussion with Bela (and earlier comments from Ben), I'm going to implement a base interceptor mbean that contains some common methods/attributes. We want to use this mbean for any interceptor that doesn't provide its own mbean. This will allow us to display all interceptors in the mbean hierarchy, even if they don't provide their own mbean.

        I intended to use the existing Interceptor class in conjunction with a new InterceptorMBean interface to provide this common functionality. However I can't instantiate Interceptor and use it in this manner as it's an abstract class. So I can either make it a concrete class or I can introduce a concrete BaseInterceptor class into the interceptor hierarchy.

        Any thoughts?

        • 31. Re: Exposing JBossCache Management Attributes

          Replying to my previous post -

          I can easily leave the existing Interceptor class as abstract and also leave the interceptor hierarchy intact. All that's necessary is to create a dummy interceptor class (e.g., BaseMBeanInterceptor) that extends Interceptor and does nothing else. This class can then be be instantiated to implement the InterceptorMBean interface for any interceptor that doesn't provide its own mbean.

          This seems to work well in prototyping so I won't change Interceptor in this regard unless there are other opinions.

          To summarize where this is right now ...

          A new interface named InterceptorMBean is being introduced. This mbean currently defines one common attribute (statisticsEnabled) and one common method (resetStatistics). The existing Interceptor class implements this interface and provides empty implementations of these methods.

          A new concrete class named BaseMBeanInterceptor (or something like that) will extend Interceptor. This class provides no functionality whatsoever except what's provided via Interceptor.

          When TreeCache is instantiated and the interceptor chain is established, processing is as follows.

          For each interceptor in the stack, an attempt is made to instantiate an mbean of the corresponding name (e.g., ReplicationInterceptorMBean for ReplicationInterceptor). If the mbean exists, the interceptor is registered as an mbean. If the mbean doesn't exist, the BaseMBeanInterceptor is registered as the mbean for the interceptor. Consequently each interceptor in the stack will have a registered mbean, even if the mbean doesn't expose any meaningful functionality.

          A more formal description will be provided once this work is checked in.

          • 32. Re: Exposing JBossCache Management Attributes
            belaban

            Looks good, let us know when we fire up JDK5, create a standalone TreeCache and connect to the JDK with jconsole to browse JBossCache...

            • 33. Re: Exposing JBossCache Management Attributes

              The frameowork is almost complete. Maybe, we can scope out what managment attributes that we want to put into 1.3 and 1.4, respectively?

              Another forum thread? :-)

              1 2 3 Previous Next