Class StaticMembershipProvider

java.lang.Object
org.apache.catalina.tribes.membership.MembershipProviderBase
org.apache.catalina.tribes.membership.StaticMembershipProvider
All Implemented Interfaces:
ChannelListener, RpcCallback, Heartbeat, MembershipProvider

public class StaticMembershipProvider extends MembershipProviderBase implements RpcCallback, ChannelListener, Heartbeat
  • Field Details

    • sm

      protected static final StringManager sm
    • channel

      protected Channel channel
    • rpcChannel

      protected RpcChannel rpcChannel
    • staticMembers

      protected ArrayList<StaticMember> staticMembers
    • sendOptions

      protected int sendOptions
    • expirationTime

      protected long expirationTime
    • connectTimeout

      protected int connectTimeout
    • rpcTimeout

      protected long rpcTimeout
    • startLevel

      protected int startLevel
    • useThread

      protected boolean useThread
    • pingInterval

      protected long pingInterval
    • running

      protected volatile boolean running
    • thread

  • Constructor Details

    • StaticMembershipProvider

      public StaticMembershipProvider()
  • Method Details

    • init

      public void init(Properties properties) throws Exception
      Description copied from interface: MembershipProvider
      Initialize the membership provider with the specified configuration.
      Specified by:
      init in interface MembershipProvider
      Overrides:
      init in class MembershipProviderBase
      Parameters:
      properties - configuration
      Throws:
      Exception - if an error occurs
    • start

      public void start(int level) throws Exception
      Description copied from interface: MembershipProvider
      Start the membership provider.
      Specified by:
      start in interface MembershipProvider
      Parameters:
      level - the readiness level
      Channel.DEFAULT - will start all services
      Channel.MBR_RX_SEQ - starts the membership receiver
      Channel.MBR_TX_SEQ - starts the membership broadcaster
      Throws:
      Exception - if an error occurs
    • stop

      public boolean stop(int level) throws Exception
      Description copied from interface: MembershipProvider
      Stop the membership provider.
      Specified by:
      stop in interface MembershipProvider
      Parameters:
      level - the readiness level
      Channel.DEFAULT - will stop all services
      Channel.MBR_RX_SEQ - stops the membership receiver
      Channel.MBR_TX_SEQ - stops the membership broadcaster
      Returns:
      true if successful
      Throws:
      Exception - if an error occurs
    • startMembership

      protected void startMembership(Member[] members) throws ChannelException
      Throws:
      ChannelException
    • setupMember

      protected Member setupMember(Member mbr)
    • memberAdded

      protected void memberAdded(Member member)
    • memberDisappeared

      protected void memberDisappeared(Member member)
    • memberAlive

      protected void memberAlive(Member member)
    • stopMembership

      protected void stopMembership(Member[] members)
    • messageReceived

      public void messageReceived(Serializable msg, Member sender)
      Description copied from interface: ChannelListener
      Receive a message from the channel
      Specified by:
      messageReceived in interface ChannelListener
      Parameters:
      msg - Serializable
      sender - - the source of the message
    • accept

      public boolean accept(Serializable msg, Member sender)
      Description copied from interface: ChannelListener
      Invoked by the channel to determine if the listener will process this message or not.
      Specified by:
      accept in interface ChannelListener
      Parameters:
      msg - Serializable
      sender - Member
      Returns:
      boolean
    • replyRequest

      public Serializable replyRequest(Serializable msg, Member sender)
      Description copied from interface: RpcCallback
      Allows sending a response to a received message.
      Specified by:
      replyRequest in interface RpcCallback
      Parameters:
      msg - The message
      sender - Member
      Returns:
      Serializable object, null if no reply should be sent
    • leftOver

      public void leftOver(Serializable msg, Member sender)
      Description copied from interface: RpcCallback
      If the reply has already been sent to the requesting thread, the rpc callback can handle any data that comes in after the fact.
      Specified by:
      leftOver in interface RpcCallback
      Parameters:
      msg - The message
      sender - Member
    • heartbeat

      public void heartbeat()
      Description copied from interface: Heartbeat
      Heartbeat invocation for resources cleanup etc
      Specified by:
      heartbeat in interface Heartbeat
    • ping

      protected void ping() throws ChannelException
      Throws:
      ChannelException
    • checkExpired

      protected void checkExpired()
    • setChannel

      public void setChannel(Channel channel)
    • setStaticMembers

      public void setStaticMembers(ArrayList<StaticMember> staticMembers)