2 Replies Latest reply on May 18, 2009 2:33 AM by deruelle_jean

    API modifications for better extensibility ?

    deruelle_jean

      Hi all,

      I'm starting to work on the task of providing clustering and failover capabilities to our Mobicents Sip Servlets container working on top of JBoss AS 5.1.CR1. See http://code.google.com/p/mobicents/issues/detail?id=521

      I took the AS 5.1.CR1 as a basis for my work and the corresponding 2.0.0.GA tags for the different HA sub projects.

      the initial import of my code is located here :
      http://code.google.com/p/mobicents/source/detail?r=6013

      This is not working yet but as I extended the JBoss cluster classes I noticed that few API changes would make my life a lot easier and would provide better integration, so here are my requests, please comment or tell me if I need to open one or multiple JIRA issues if you do agree with the changes :

      JBossCacheManager

      * initSnapshotManager to be made protected so that it can be overriden (so that we can set our own converged snapshotManager)
      * getSnapshotManager() and setSnapshotManager() public methods or snapShotManager_ field to be made protected
      * installValves and installValve methods to be made protected so that they can be overriden (we need that to install our custom JVMRouteValve)
      * Ideally, methods such as start/stopEmbedded and UnEmbedded and the methods they use internally should be made protected too

      AbstractJBossCacheService

      * make the storeSessionOwners protected so that we can reuse it

      IntervalSnapshotManager

      * make the fields protected

        • 1. Re: API modifications for better extensibility ?
          brian.stansberry

          Hi Jean,

          The code freeze for AS 5.1.0.GA is tomorrow and I'm on vacation, so the following is significantly colored by that. I can think about this more in a couple weeks when I get back, but once 5.1.0.GA is done there may not be a 5.2 as we move on to AS 6.

          For AS 6 please open a JIRA to have another look at this design. I'm not comfortable with all these protected methods.

          "deruelle_jean" wrote:

          * initSnapshotManager to be made protected so that it can be overriden (so that we can set our own converged snapshotManager)


          Done.


          * getSnapshotManager() and setSnapshotManager() public methods or snapShotManager_ field to be made protected


          Added a protected getter/setter. I don't want it public.


          * installValves and installValve methods to be made protected so that they can be overriden (we need that to install our custom JVMRouteValve)


          Done.


          * Ideally, methods such as start/stopEmbedded and UnEmbedded and the methods they use internally should be made protected too


          I renamed initCacheProxy() to initDistributedCacheManager() and made it protected. Also made initClusteredSessionNotificationPolicy() and initializeUnloadedSessions() protected.

          Also added protected void startExtensions() and stopExtensions() which are a hook into the start/stop process for subclasses.

          I do not want to expose startUnembedded. That is to support running in standalone Tomcat, which was a JIRA started in 2005 and never officially finished, not significantly tested in years etc. I don't want to make it part of this API. Does Mobicents run in standalone Tomcat?

          Would prefer not exposing startEmbedded either.

          If you *really need* start(Un)Embedded exposed, go ahead on Monday, but assume that there would be some change in AS 6; i.e. you and I will redesign this. And please be extremely careful as it's the code cutoff. :)


          AbstractJBossCacheService

          * make the storeSessionOwners protected so that we can reuse it


          Feel free to make this a protected static method. However this change will not be in AS 5.1.0.GA as this would require a component update and we are past the deadline for component updates. A later Mobicents release of course could replace this jar with a later version. Which is why it's a separate jar. :)


          IntervalSnapshotManager

          * make the fields protected


          This is a simple enough class, and you now have the hooks to install whatever SnapshotManager you like, so please just keep your own version.


          The above changes are svn r88986 in Branch_5_x. Not ported to trunk yet.

          • 2. Re: API modifications for better extensibility ?
            deruelle_jean

             

            "bstansberry@jboss.com" wrote:
            Hi Jean,

            The code freeze for AS 5.1.0.GA is tomorrow and I'm on vacation, so the following is significantly colored by that. I can think about this more in a couple weeks when I get back, but once 5.1.0.GA is done there may not be a 5.2 as we move on to AS 6.

            For AS 6 please open a JIRA to have another look at this design. I'm not comfortable with all these protected methods.


            Thanks Brian ! Here it is https://64.74.196.157/jira/browse/JBAS-6933

            "bstansberry@jboss.com" wrote:

            I do not want to expose startUnembedded. That is to support running in standalone Tomcat, which was a JIRA started in 2005 and never officially finished, not significantly tested in years etc. I don't want to make it part of this API. Does Mobicents run in standalone Tomcat?

            Would prefer not exposing startEmbedded either.

            If you *really need* start(Un)Embedded exposed, go ahead on Monday, but assume that there would be some change in AS 6; i.e. you and I will redesign this. And please be extremely careful as it's the code cutoff. :)


            We run in standalone Tomcat indeed, but clustering is not advertised as supported or tested for it only for JBoss versions so we are fine and let it as is then.

            "bstansberry@jboss.com" wrote:

            AbstractJBossCacheService

            * make the storeSessionOwners protected so that we can reuse it

            Feel free to make this a protected static method. However this change will not be in AS 5.1.0.GA as this would require a component update and we are past the deadline for component updates. A later Mobicents release of course could replace this jar with a later version. Which is why it's a separate jar. :)


            Actually, I needed a different signature for this method for Mobicents so this is not needed anymore (sorry about the noise here)

            "bstansberry@jboss.com" wrote:
            The above changes are svn r88986 in Branch_5_x. Not ported to trunk yet.

            Thanks :-)