1 Reply Latest reply on Sep 27, 2008 11:10 AM by Arbi Sookazian

    How to identify partition startup/shutdown

    Arun Nellanat Newbie

      Are there any callbacks/notifications issued by JBoss when a partition is started/closed i.e. when the 'first' node joins the partition and the 'last' node leaves the partition? How can my application receive/subscribe to them?

      My application is deployed as a JAR in a cluster of JBoss nodes. It has to to perform some system-wide initialization when a node joins the partition, only if it is the first node of the partition. However, this must not repeat, say when other nodes join the partition or when the 'first' node fails.

      Similarly, I must perform some system-wide cleanup only when the last node in the partition shuts down or fails.

        • 1. Re: How to identify partition startup/shutdown
          Arbi Sookazian Master

           

          "anellanat" wrote:
          Are there any callbacks/notifications issued by JBoss when a partition is started/closed i.e. when the 'first' node joins the partition and the 'last' node leaves the partition? How can my application receive/subscribe to them?

          My application is deployed as a JAR in a cluster of JBoss nodes. It has to to perform some system-wide initialization when a node joins the partition, only if it is the first node of the partition. However, this must not repeat, say when other nodes join the partition or when the 'first' node fails.

          Similarly, I must perform some system-wide cleanup only when the last node in the partition shuts down or fails.


          check out Ch. 3 API of http://www.jgroups.org/javagroupsnew/docs/manual/pdf/manual.pdf

          I haven't actually used this functionality, but it sounds like what you may need is to create a class that implements MembershipListener interface.

          The MembershipListener interface is similar to the MessageListener interface above: every time a new view, a
          suspicion message, or a block event is received, the corresponding method of the class implementing Membership-
          Listener will be called.