Class JGroupsClusterManager

  • All Implemented Interfaces:
    IClusterManager, lumis.portal.cluster.multiserver.MessageReceiver.IProcessMessageCallback

    public class JGroupsClusterManager
    extends AbstractClusterManager
    implements lumis.portal.cluster.multiserver.MessageReceiver.IProcessMessageCallback
    A ClusterManager that uses the JGroups library for communication between the cluster nodes.
    Since:
    4.0.0
    Version:
    $Revision: 23772 $ $Date: 2020-04-22 14:36:34 -0300 (Wed, 22 Apr 2020) $
    • Constructor Detail

      • JGroupsClusterManager

        public JGroupsClusterManager()
    • Method Detail

      • init

        public void init()
        Description copied from interface: IClusterManager
        Initializes the cluster manager. This method should start the monitoring and connections necessary for the cluster manager to execute its communications.
        Specified by:
        init in interface IClusterManager
        Overrides:
        init in class AbstractClusterManager
      • call

        public <T extends Serializable> T call​(IClusterCommand<T> command)
                                        throws Exception
        Description copied from interface: IClusterManager
        Calls a cluster command execution and returns the result of the local execution.

        This method sends the command through the cluster and gives feedback on the local server execution, in the form of the return value and the raised exception.

        It is important to notice that the command will be sent over the cluster despite its execution outcome.

        The given command must have been created through IClusterManager.createClusterCommand(IClusterCallable).

        Specified by:
        call in interface IClusterManager
        Parameters:
        command - the command to execute through the cluster.
        Returns:
        the command execution outcome.
        Throws:
        Exception - the exception thrown during command execution or other unknown exception.
      • getMembers

        public Collection<IClusterMember> getMembers()
        Description copied from interface: IClusterManager
        Returns a collection with information about the current members of this cluster.
        Specified by:
        getMembers in interface IClusterManager
        Returns:
        a collection with information about the current members of this cluster.
      • getLocalMember

        public IClusterMember getLocalMember()
        Description copied from interface: IClusterManager
        Returns the current cluster member object. The object returned represents the member where this method is executed on.
        Specified by:
        getLocalMember in interface IClusterManager
        Returns:
        this server cluster member object.
      • getClusterConfig

        public IClusterConfig getClusterConfig​(ITransaction transaction)
                                        throws PortalException
        Description copied from interface: IClusterManager
        Returns a persistent cluster configuration object. The object contains the cluster configurations, and any changes will be applied on transaction commit.
        Specified by:
        getClusterConfig in interface IClusterManager
        Parameters:
        transaction - the transaction for persistence access.
        Returns:
        a persistent cluster configuration instance.
        Throws:
        PortalException
      • processAllPendingMessages

        public long processAllPendingMessages​(long lastTransmissionOrder)
        Description copied from interface: lumis.portal.cluster.multiserver.MessageReceiver.IProcessMessageCallback
        Processes all pending messages in the database.
        Specified by:
        processAllPendingMessages in interface lumis.portal.cluster.multiserver.MessageReceiver.IProcessMessageCallback
        Parameters:
        lastTransmissionOrder - the current last processed transmission order, or -1 if none was processed.
        Returns:
        the last processed transmission order, or, if none was processed (before and during the call to this method), -1 is returned.
      • processMessage

        public void processMessage​(org.jgroups.Message message)
        Description copied from interface: lumis.portal.cluster.multiserver.MessageReceiver.IProcessMessageCallback
        Processes a message.
        Specified by:
        processMessage in interface lumis.portal.cluster.multiserver.MessageReceiver.IProcessMessageCallback
        Parameters:
        message - the message.
      • updateAck

        public void updateAck​(long transmissionOrder)
        Description copied from interface: lumis.portal.cluster.multiserver.MessageReceiver.IProcessMessageCallback
        Updates the acknowledgment persisted as the specified last transmission order.
        Specified by:
        updateAck in interface lumis.portal.cluster.multiserver.MessageReceiver.IProcessMessageCallback