StaticMembershipService (Apache Tomcat 10.1.48 API Documentation)
Description: declaration: package: org.apache.catalina.tribes.membership, class: StaticMembershipService

# 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 Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected static final StringManager`
  `sm`
  `protected final ArrayList<StaticMember>`
  `staticMembers`

  ### Fields inherited from class MembershipServiceBase

  `channel, listener, properties`

  ### Fields inherited from interface MembershipService

  `MBR_RX, MBR_TX`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `StaticMembershipService()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addStaticMember(StaticMember member)`
  `protected StaticMembershipProvider`
  `buildMembershipProvider()`
  `int`
  `getConnectTimeout()`
  `long`
  `getExpirationTime()`
  `Member`
  `getLocalMember(boolean incAliveTime)`
  Get the local member.
  `MembershipProvider`
  `getMembershipProvider()`
  Get the MembershipProvider
  `long`
  `getPingInterval()`
  `long`
  `getRpcTimeout()`
  `ArrayList<StaticMember>`
  `getStaticMembers()`
  `boolean`
  `getUseThread()`
  `void`
  `removeStaticMember(StaticMember member)`
  `void`
  `setConnectTimeout(int connectTimeout)`
  `protected void`
  `setDefaults(Properties properties)`
  `void`
  `setDomain(byte[] domain)`
  Set the associated domain.
  `void`
  `setExpirationTime(long expirationTime)`
  `void`
  `setLocalMember(StaticMember member)`
  `void`
  `setLocalMemberProperties(String listenHost, int listenPort, int securePort, int udpPort)`
  Sets the local member properties for broadcasting.
  `void`
  `setPayload(byte[] payload)`
  Set a payload to be broadcasted with each membership broadcast.
  `void`
  `setPingInterval(long pingInterval)`
  `void`
  `setProperties(Properties properties)`
  Sets the properties for the membership service.
  `void`
  `setRpcTimeout(long rpcTimeout)`
  `void`
  `setUseThread(boolean useThread)`
  `void`
  `start(int level)`
  Starts the membership service.
  `void`
  `stop(int level)`
  Stops the membership service.

  ### Methods inherited from class MembershipServiceBase

  `broadcast, findMemberByName, getChannel, getMember, getMembers, getMembersByName, getProperties, hasMembers, memberAdded, memberDisappeared, removeMembershipListener, setChannel, setMembershipListener, start`

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

  ### Methods inherited from interface StaticMembershipServiceMBean

  `findMemberByName, getMembersByName, getProperties, hasMembers`

- ## Field Details

  - ### sm

    protected static final StringManager sm

  - ### staticMembers

    protected final ArrayList<StaticMember> staticMembers

- ## 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 broadcasting the server
    Throws:
      `Exception` - if the service fails to start.

  - ### 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 broadcasting 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)