Class StaticMembershipService

java.lang.Object
org.apache.catalina.tribes.membership.MembershipServiceBase
org.apache.catalina.tribes.membership.StaticMembershipService
All Implemented Interfaces:
StaticMembershipServiceMBean, MembershipListener, MembershipService

public class StaticMembershipService extends MembershipServiceBase implements StaticMembershipServiceMBean
  • Field Details

  • Constructor Details

    • StaticMembershipService

      public StaticMembershipService()
  • Method Details

    • start

      public void start(int level) throws 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:
      Exception - if the service fails to start.
      IllegalArgumentException - if the level is incorrect.
    • buildMembershipProvider

      protected StaticMembershipProvider buildMembershipProvider() throws Exception
      Throws:
      Exception
    • stop

      public void stop(int level)
      Description copied from interface: MembershipService
      Stops 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(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[]
    • setDomain

      public void setDomain(byte[] domain)
      Description copied from interface: MembershipService
      Set the associated domain.
      Specified by:
      setDomain in interface MembershipService
      Parameters:
      domain - the domain
    • getMembershipProvider

      public MembershipProvider getMembershipProvider()
      Description copied from interface: MembershipService
      Get the MembershipProvider
      Specified by:
      getMembershipProvider in interface MembershipService
      Returns:
      MembershipProvider
    • getStaticMembers

      public ArrayList<StaticMember> getStaticMembers()
    • addStaticMember

      public void addStaticMember(StaticMember member)
    • removeStaticMember

      public void removeStaticMember(StaticMember member)
    • setLocalMember

      public void setLocalMember(StaticMember member)
    • getExpirationTime

      public long getExpirationTime()
      Specified by:
      getExpirationTime in interface StaticMembershipServiceMBean
    • setExpirationTime

      public void setExpirationTime(long expirationTime)
    • getConnectTimeout

      public int getConnectTimeout()
      Specified by:
      getConnectTimeout in interface StaticMembershipServiceMBean
    • setConnectTimeout

      public void setConnectTimeout(int connectTimeout)
    • getRpcTimeout

      public long getRpcTimeout()
      Specified by:
      getRpcTimeout in interface StaticMembershipServiceMBean
    • setRpcTimeout

      public void setRpcTimeout(long rpcTimeout)
    • getUseThread

      public boolean getUseThread()
      Specified by:
      getUseThread in interface StaticMembershipServiceMBean
    • setUseThread

      public void setUseThread(boolean useThread)
    • getPingInterval

      public long getPingInterval()
      Specified by:
      getPingInterval in interface StaticMembershipServiceMBean
    • setPingInterval

      public void setPingInterval(long pingInterval)
    • setProperties

      public void setProperties(Properties properties)
      Description copied from interface: MembershipService
      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(Properties properties)