Class StaticMembershipInterceptor
java.lang.Object
org.apache.catalina.tribes.group.ChannelInterceptorBase
org.apache.catalina.tribes.group.interceptors.StaticMembershipInterceptor
- All Implemented Interfaces:
ChannelInterceptor
,StaticMembershipInterceptorMBean
,Heartbeat
,MembershipListener
public class StaticMembershipInterceptor
extends ChannelInterceptorBase
implements StaticMembershipInterceptorMBean
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.catalina.tribes.ChannelInterceptor
ChannelInterceptor.InterceptorEvent
-
Field Summary
Modifier and TypeFieldDescriptionprotected Member
protected static final byte[]
protected static final byte[]
protected static final StringManager
Fields inherited from class org.apache.catalina.tribes.group.ChannelInterceptorBase
optionFlag
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addStaticMember
(Member member) protected ChannelInterceptor
getLocalMember
(boolean incAlive) Intercepts theChannel.getLocalMember(boolean)
methodIntercepts theChannel.getMember(Member)
methodMember[]
Intercepts theChannel.getMembers()
methodboolean
Intercepts theChannel.hasMembers()
methodvoid
ThemessageReceived
is invoked when a message is received.void
removeStaticMember
(Member member) protected void
sendLocalMember
(Member[] members) protected void
sendMemberMessage
(Member[] members, byte[] message) protected void
sendShutdown
(Member[] members) void
setLocalMember
(Member member) void
start
(int svc) Starts up the channel.void
stop
(int svc) Shuts down the channel.Methods inherited from class org.apache.catalina.tribes.group.ChannelInterceptorBase
fireInterceptorEvent, getChannel, getNext, getOptionFlag, getPrevious, heartbeat, memberAdded, memberDisappeared, okToProcess, sendMessage, setChannel, setNext, setOptionFlag, setPrevious
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.catalina.tribes.group.interceptors.StaticMembershipInterceptorMBean
getOptionFlag
-
Field Details
-
sm
-
MEMBER_START
protected static final byte[] MEMBER_START -
MEMBER_STOP
protected static final byte[] MEMBER_STOP -
members
-
localMember
-
-
Constructor Details
-
StaticMembershipInterceptor
public StaticMembershipInterceptor()
-
-
Method Details
-
addStaticMember
-
removeStaticMember
-
setLocalMember
-
messageReceived
Description copied from interface:ChannelInterceptor
ThemessageReceived
is invoked when a message is received.ChannelMessage.getAddress()
is the sender, or the reply-to address if it has been overwritten.- Specified by:
messageReceived
in interfaceChannelInterceptor
- Overrides:
messageReceived
in classChannelInterceptorBase
- Parameters:
msg
- ChannelMessage
-
hasMembers
public boolean hasMembers()Description copied from interface:ChannelInterceptor
Intercepts theChannel.hasMembers()
method- Specified by:
hasMembers
in interfaceChannelInterceptor
- Overrides:
hasMembers
in classChannelInterceptorBase
- Returns:
- boolean - if the channel has members in its membership group
- See Also:
-
getMembers
Description copied from interface:ChannelInterceptor
Intercepts theChannel.getMembers()
method- Specified by:
getMembers
in interfaceChannelInterceptor
- Overrides:
getMembers
in classChannelInterceptorBase
- Returns:
- the members
- See Also:
-
getMember
Description copied from interface:ChannelInterceptor
Intercepts theChannel.getMember(Member)
method- Specified by:
getMember
in interfaceChannelInterceptor
- Overrides:
getMember
in classChannelInterceptorBase
- Parameters:
mbr
- Member- Returns:
- Member - the actual member information, including stay alive
- See Also:
-
getLocalMember
Description copied from interface:ChannelInterceptor
Intercepts theChannel.getLocalMember(boolean)
method- Specified by:
getLocalMember
in interfaceChannelInterceptor
- Specified by:
getLocalMember
in interfaceStaticMembershipInterceptorMBean
- Overrides:
getLocalMember
in classChannelInterceptorBase
- Parameters:
incAlive
- boolean- Returns:
- the member that represents this node
- See Also:
-
start
Starts up the channel. This can be called multiple times for individual services to start The svc parameter can be the logical or value of any constantsSends notifications upwards.
- Specified by:
start
in interfaceChannelInterceptor
- Overrides:
start
in classChannelInterceptorBase
- Parameters:
svc
- one of:- Channel.DEFAULT - will start all services
- Channel.MBR_RX_SEQ - starts the membership receiver
- Channel.MBR_TX_SEQ - starts the membership broadcaster
- Channel.SND_TX_SEQ - starts the replication transmitter
- Channel.SND_RX_SEQ - starts the replication receiver
- Throws:
ChannelException
- if a startup error occurs or the service is already started.- See Also:
-
stop
Shuts down the channel. This can be called multiple times for individual services to shutdown The svc parameter can be the logical or value of any constantsSends local member shutdown.
- Specified by:
stop
in interfaceChannelInterceptor
- Overrides:
stop
in classChannelInterceptorBase
- Parameters:
svc
- one of:- Channel.DEFAULT - will shutdown all services
- Channel.MBR_RX_SEQ - stops the membership receiver
- Channel.MBR_TX_SEQ - stops the membership broadcaster
- Channel.SND_TX_SEQ - stops the replication transmitter
- Channel.SND_RX_SEQ - stops the replication receiver
- Throws:
ChannelException
- if a startup error occurs or the service is already started.- See Also:
-
sendLocalMember
-
sendShutdown
-
getfirstInterceptor
-
sendMemberMessage
- Throws:
ChannelException
-