public class StaticMembershipInterceptor extends ChannelInterceptorBase
ChannelInterceptor.InterceptorEvent
Modifier and Type | Field and Description |
---|---|
protected Member |
localMember |
protected static byte[] |
MEMBER_START |
protected static byte[] |
MEMBER_STOP |
protected ArrayList<Member> |
members |
optionFlag
Constructor and Description |
---|
StaticMembershipInterceptor() |
Modifier and Type | Method and Description |
---|---|
void |
addStaticMember(Member member) |
protected ChannelInterceptor |
getfirstInterceptor() |
Member |
getLocalMember(boolean incAlive)
Return the member that represents this node.
|
Member |
getMember(Member mbr)
Intercepts the
Channel.getMember(Member) method |
Member[] |
getMembers()
Get all current cluster members
|
boolean |
hasMembers()
has members
|
void |
messageReceived(ChannelMessage msg)
the
messageReceived 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)
Send notifications upwards
|
void |
stop(int svc)
Shuts down the channel.
|
accept, fireInterceptorEvent, getChannel, getNext, getOptionFlag, getPrevious, heartbeat, memberAdded, memberDisappeared, okToProcess, sendMessage, setChannel, setNext, setOptionFlag, setPrevious
protected static final byte[] MEMBER_START
protected static final byte[] MEMBER_STOP
protected Member localMember
public void addStaticMember(Member member)
public void removeStaticMember(Member member)
public void setLocalMember(Member member)
public void messageReceived(ChannelMessage msg)
ChannelInterceptor
messageReceived
is invoked when a message is received.
ChannelMessage.getAddress()
is the sender, or the reply-to address
if it has been overwritten.messageReceived
in interface ChannelInterceptor
messageReceived
in class ChannelInterceptorBase
msg
- ChannelMessagepublic boolean hasMembers()
hasMembers
in interface ChannelInterceptor
hasMembers
in class ChannelInterceptorBase
Channel.hasMembers()
public Member[] getMembers()
getMembers
in interface ChannelInterceptor
getMembers
in class ChannelInterceptorBase
Channel.getMembers()
public Member getMember(Member mbr)
ChannelInterceptor
Channel.getMember(Member)
methodgetMember
in interface ChannelInterceptor
getMember
in class ChannelInterceptorBase
mbr
- MemberChannel.getMember(Member)
public Member getLocalMember(boolean incAlive)
getLocalMember
in interface ChannelInterceptor
getLocalMember
in class ChannelInterceptorBase
incAlive
- booleanChannel.getLocalMember(boolean)
public void start(int svc) throws ChannelException
start
in interface ChannelInterceptor
start
in class ChannelInterceptorBase
svc
- intChannelException
Channel
public void stop(int svc) throws ChannelException
Sends local member shutdown.
stop
in interface ChannelInterceptor
stop
in class ChannelInterceptorBase
svc
- int value of ChannelException
- if a startup error occurs or the service is already started.Channel
protected void sendLocalMember(Member[] members)
protected void sendShutdown(Member[] members)
protected ChannelInterceptor getfirstInterceptor()
protected void sendMemberMessage(Member[] members, byte[] message) throws ChannelException
ChannelException
Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.