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
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
protected class
-
Field Summary
Modifier and TypeFieldDescriptionprotected Channel
protected int
protected long
protected long
protected RpcChannel
protected long
protected boolean
protected int
protected static final StringManager
protected int
protected ArrayList
<StaticMember> protected StaticMembershipProvider.PingThread
protected boolean
Fields inherited from class org.apache.catalina.tribes.membership.MembershipProviderBase
executor, membership, membershipListener, service
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
accept
(Serializable msg, Member sender) Invoked by the channel to determine if the listener will process this message or not.protected void
void
Heartbeat invocation for resources cleanup etcvoid
init
(Properties properties) Initialize the membership provider with the specified configuration.void
leftOver
(Serializable msg, Member sender) If the reply has already been sent to the requesting thread, the rpc callback can handle any data that comes in after the fact.protected void
memberAdded
(Member member) protected void
memberAlive
(Member member) protected void
memberDisappeared
(Member member) void
messageReceived
(Serializable msg, Member sender) Receive a message from the channelprotected void
ping()
replyRequest
(Serializable msg, Member sender) Allows sending a response to a received message.void
setChannel
(Channel channel) void
setStaticMembers
(ArrayList<StaticMember> staticMembers) protected Member
setupMember
(Member mbr) void
start
(int level) Start the membership provider.protected void
startMembership
(Member[] members) boolean
stop
(int level) Stop the membership provider.protected void
stopMembership
(Member[] members) Methods inherited from class org.apache.catalina.tribes.membership.MembershipProviderBase
getMember, getMembers, hasMembers, setMembershipListener, setMembershipService
-
Field Details
-
sm
-
channel
-
rpcChannel
-
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
Description copied from interface:MembershipProvider
Initialize the membership provider with the specified configuration.- Specified by:
init
in interfaceMembershipProvider
- Overrides:
init
in classMembershipProviderBase
- Parameters:
properties
- configuration- Throws:
Exception
- if an error occurs
-
start
Description copied from interface:MembershipProvider
Start the membership provider.- Specified by:
start
in interfaceMembershipProvider
- 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
Description copied from interface:MembershipProvider
Stop the membership provider.- Specified by:
stop
in interfaceMembershipProvider
- 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
- Throws:
ChannelException
-
setupMember
-
memberAdded
-
memberDisappeared
-
memberAlive
-
stopMembership
-
messageReceived
Description copied from interface:ChannelListener
Receive a message from the channel- Specified by:
messageReceived
in interfaceChannelListener
- Parameters:
msg
- Serializablesender
- - the source of the message
-
accept
Description copied from interface:ChannelListener
Invoked by the channel to determine if the listener will process this message or not.- Specified by:
accept
in interfaceChannelListener
- Parameters:
msg
- Serializablesender
- Member- Returns:
- boolean
-
replyRequest
Description copied from interface:RpcCallback
Allows sending a response to a received message.- Specified by:
replyRequest
in interfaceRpcCallback
- Parameters:
msg
- The messagesender
- Member- Returns:
- Serializable object,
null
if no reply should be sent
-
leftOver
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 interfaceRpcCallback
- Parameters:
msg
- The messagesender
- Member
-
heartbeat
-
ping
- Throws:
ChannelException
-
checkExpired
protected void checkExpired() -
setChannel
-
setStaticMembers
-