5 Replies Latest reply on Mar 28, 2003 2:25 AM by slaboure

    HAPartition sample code?

    avidrissman

      I'm looking to write an MBean that's replicated and coordinates with other instances of itself using an HAPartition. Chapter 9 of the clustering PDF states:

      "If you have developed clustered services (MBEANs, etc.) that are very stable, you should most probably install a new HAPartition for your own usage and leave the default one for JBoss clustering features."

      But chapter 8 says:

      "You do not directly built an instance of a HAPartition. Instead you use an MBEAN definition (or equivalent)."

      It then goes on to discuss the HAPartition methods, but provides no sample code.

      I'm rather lost. How do I create a clustered MBean using an HAPartition? How do I create my own HAPartition? I looked at the JBoss source but didn't find anything similar to what I wanted to do. Is there any sample code out there?

      Thanks!

      Avi

        • 1. Re: HAPartition sample code?
          slaboure

          check deploy/cluster-service.xml

          it shows the creation of a HAPartition.

          Then you use it in your code either by looking it up in JNDI or by connecting to it directly through JMX.

          Cheers,


          sacha

          • 2. Re: HAPartition sample code?
            avidrissman

            Thank you!

            I'm trying to follow the advice to make my own partition. In the XML file I specify:




            But when I deploy I get:

            13:55:41,924 INFO [ClusterPartition] Started ClusterPartition: DefaultPartition

            and in the jmx console, I see that although it's attached to the name "MyClusterPartition", its name is "DefaultPartition". How should I fix this?

            • 3. Re: HAPartition sample code?
              avidrissman

              Thank you!

              I'm trying to follow the advice to make my own partition. In the XML file I specify:




              But when I deploy I get:

              13:55:41,924 INFO [ClusterPartition] Started ClusterPartition: DefaultPartition

              and in the jmx console, I see that although it's attached to the name "MyClusterPartition", its name is "DefaultPartition". How should I fix this?

              • 4. Re: HAPartition sample code?
                avidrissman

                Thank you!

                I'm trying to follow the advice to make my own partition. In the XML file I specify:




                But when I deploy I get:

                13:55:41,924 INFO [ClusterPartition] Started ClusterPartition: DefaultPartition

                and in the jmx console, I see that although it's attached to the name "MyClusterPartition", its name is "DefaultPartition". How should I fix this?

                • 5. Re: HAPartition sample code?
                  slaboure

                  Yes, don't forget to modify the PartitionName attribute as well!

                  DefaultPartition


                  AND USE 3.0.6!!!