Interface IClusterManager

    • Method Detail

      • init

        void init()
        Initializes the cluster manager. This method should start the monitoring and connections necessary for the cluster manager to execute its communications.
      • destroy

        void destroy()
        Destroys the cluster manager. This method should close all resources used by the cluster manager.
      • call

        <T extends Serializable> T call​(IClusterCommand<T> command)
                                 throws Exception
        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 createClusterCommand(IClusterCallable).

        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.
        Since:
        8.0.0
      • getMembers

        Collection<IClusterMember> getMembers()
                                       throws PortalException
        Returns a collection with information about the current members of this cluster.
        Returns:
        a collection with information about the current members of this cluster.
        Throws:
        PortalException
        Since:
        4.0.11
      • getLocalMember

        IClusterMember getLocalMember()
        Returns the current cluster member object. The object returned represents the member where this method is executed on.
        Returns:
        this server cluster member object.
        Since:
        4.2.0
      • createClusterMessage

        IClusterMessage createClusterMessage​(String group,
                                             Serializable data)
        Creates a cluster message instance and returns it.
        Parameters:
        group - the destination group for the message.
        data - the data sent in the message.
        Returns:
        the cluster message created.
        Since:
        4.1.0
        See Also:
        IClusterMessage
      • createClusterCommand

        <T extends SerializableIClusterCommand<T> createClusterCommand​(IClusterCallable<T> callable)
        Creates a cluster command instance and returns it.
        Parameters:
        callable - the IClusterCallable that contains the command's execution. It must be serializable.
        Returns:
        the created cluster command.
        Since:
        8.0.0
      • getClusterConfig

        IClusterConfig getClusterConfig​(ITransaction transaction)
                                 throws PortalException
        Returns a persistent cluster configuration object. The object contains the cluster configurations, and any changes will be applied on transaction commit.
        Parameters:
        transaction - the transaction for persistence access.
        Returns:
        a persistent cluster configuration instance.
        Throws:
        PortalException
        Since:
        4.1.0