Class StaticMembershipService

    • Constructor Detail

      • StaticMembershipService

        public StaticMembershipService()
    • Method Detail

      • start

        public void start​(int level)
                   throws java.lang.Exception
        Description copied from interface: MembershipService
        Starts the membership service. If a membership listeners is added the listener will start to receive membership events.
        Specified by:
        start in interface MembershipService
        Parameters:
        level - - level MBR_RX starts listening for members, level MBR_TX starts broad casting the server
        Throws:
        java.lang.Exception - if the service fails to start.
        java.lang.IllegalArgumentException - if the level is incorrect.
      • buildMembershipProvider

        protected StaticMembershipProvider buildMembershipProvider()
                                                            throws java.lang.Exception
        Throws:
        java.lang.Exception
      • stop

        public void stop​(int level)
        Description copied from interface: MembershipService
        Starts the membership service. If a membership listeners is added the listener will start to receive membership events.
        Specified by:
        stop in interface MembershipService
        Parameters:
        level - - level MBR_RX stops listening for members, level MBR_TX stops broad casting the server
      • getLocalMember

        public Member getLocalMember​(boolean incAliveTime)
        Description copied from interface: MembershipService
        Get the local member.
        Specified by:
        getLocalMember in interface MembershipService
        Parameters:
        incAliveTime - true to set the alive time on the local member
        Returns:
        the member object that defines this member
      • setLocalMemberProperties

        public void setLocalMemberProperties​(java.lang.String listenHost,
                                             int listenPort,
                                             int securePort,
                                             int udpPort)
        Description copied from interface: MembershipService
        Sets the local member properties for broadcasting.
        Specified by:
        setLocalMemberProperties in interface MembershipService
        Parameters:
        listenHost - Listen to host
        listenPort - Listen to port
        securePort - Use a secure port
        udpPort - Use UDP
      • setPayload

        public void setPayload​(byte[] payload)
        Description copied from interface: MembershipService
        Set a payload to be broadcasted with each membership broadcast.
        Specified by:
        setPayload in interface MembershipService
        Parameters:
        payload - byte[]
      • getStaticMembers

        public java.util.ArrayList<StaticMember> getStaticMembers()
      • addStaticMember

        public void addStaticMember​(StaticMember member)
      • removeStaticMember

        public void removeStaticMember​(StaticMember member)
      • setLocalMember

        public void setLocalMember​(StaticMember member)
      • setExpirationTime

        public void setExpirationTime​(long expirationTime)
      • setConnectTimeout

        public void setConnectTimeout​(int connectTimeout)
      • setRpcTimeout

        public void setRpcTimeout​(long rpcTimeout)
      • setUseThread

        public void setUseThread​(boolean useThread)
      • setPingInterval

        public void setPingInterval​(long pingInterval)
      • setProperties

        public void setProperties​(java.util.Properties properties)
        Description copied from class: MembershipServiceBase
        Sets the properties for the membership service. This must be called before the start() method is called. The properties are implementation specific.
        Specified by:
        setProperties in interface MembershipService
        Overrides:
        setProperties in class MembershipServiceBase
        Parameters:
        properties - - to be used to configure the membership service.
      • setDefaults

        protected void setDefaults​(java.util.Properties properties)