Class DomainFilterInterceptor
java.lang.Object
org.apache.catalina.tribes.group.ChannelInterceptorBase
org.apache.catalina.tribes.group.interceptors.DomainFilterInterceptor
- All Implemented Interfaces:
ChannelInterceptor
,DomainFilterInterceptorMBean
,Heartbeat
,MembershipListener
public class DomainFilterInterceptor
extends ChannelInterceptorBase
implements DomainFilterInterceptorMBean
Filters membership based on domain.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.catalina.tribes.ChannelInterceptor
ChannelInterceptor.InterceptorEvent
-
Field Summary
Modifier and TypeFieldDescriptionprotected byte[]
protected int
protected Membership
protected static final StringManager
Fields inherited from class org.apache.catalina.tribes.group.ChannelInterceptorBase
optionFlag
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbyte[]
getLocalMember
(boolean incAlive) Intercepts theChannel.getLocalMember(boolean)
methodint
Intercepts theChannel.getMember(Member)
methodMember[]
Intercepts theChannel.getMembers()
methodboolean
Intercepts theChannel.hasMembers()
methodvoid
memberAdded
(Member member) A member was added to the groupvoid
memberDisappeared
(Member member) A member was removed from the group
If the member left voluntarily, the Member.getCommand will contain the Member.SHUTDOWN_PAYLOAD datavoid
ThemessageReceived
is invoked when a message is received.void
setDomain
(byte[] domain) void
void
setLogInterval
(int logInterval) protected void
Methods inherited from class org.apache.catalina.tribes.group.ChannelInterceptorBase
fireInterceptorEvent, getChannel, getNext, getOptionFlag, getPrevious, heartbeat, okToProcess, sendMessage, setChannel, setNext, setOptionFlag, setPrevious, start, stop
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.DomainFilterInterceptorMBean
getOptionFlag
-
Field Details
-
sm
-
membership
-
domain
protected byte[] domain -
logInterval
protected int logInterval
-
-
Constructor Details
-
DomainFilterInterceptor
public DomainFilterInterceptor()
-
-
Method Details
-
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
-
memberAdded
Description copied from interface:MembershipListener
A member was added to the group- Specified by:
memberAdded
in interfaceMembershipListener
- Overrides:
memberAdded
in classChannelInterceptorBase
- Parameters:
member
- Member - the member that was added
-
memberDisappeared
Description copied from interface:MembershipListener
A member was removed from the group
If the member left voluntarily, the Member.getCommand will contain the Member.SHUTDOWN_PAYLOAD data- Specified by:
memberDisappeared
in interfaceMembershipListener
- Overrides:
memberDisappeared
in classChannelInterceptorBase
- Parameters:
member
- Member- See Also:
-
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
- Overrides:
getLocalMember
in classChannelInterceptorBase
- Parameters:
incAlive
- boolean- Returns:
- the member that represents this node
- See Also:
-
setupMembership
protected void setupMembership() -
getDomain
public byte[] getDomain()- Specified by:
getDomain
in interfaceDomainFilterInterceptorMBean
-
setDomain
public void setDomain(byte[] domain) -
setDomain
-
getLogInterval
public int getLogInterval()- Specified by:
getLogInterval
in interfaceDomainFilterInterceptorMBean
-
setLogInterval
public void setLogInterval(int logInterval) - Specified by:
setLogInterval
in interfaceDomainFilterInterceptorMBean
-