public interface MembershipService
MembershipService
interface is the membership component
at the bottom layer, the IO layer (for layers see the javadoc for the Channel
interface).Modifier and Type | Method and Description |
---|---|
void |
broadcast(ChannelMessage message)
Broadcasts a message to all members
|
Member |
findMemberByName(String name)
Return the member by name
|
Member |
getLocalMember(boolean incAliveTime)
Returns the member object that defines this member
|
Member |
getMember(Member mbr) |
Member[] |
getMembers()
Returns a list of all the members in the cluster.
|
String[] |
getMembersByName()
Return all members by name
|
Properties |
getProperties()
Returns the properties for the configuration used.
|
boolean |
hasMembers() |
void |
removeMembershipListener()
removes the membership listener.
|
void |
setDomain(byte[] domain) |
void |
setLocalMemberProperties(String listenHost,
int listenPort,
int securePort,
int udpPort)
Sets the local member properties for broadcasting
|
void |
setMembershipListener(MembershipListener listener)
Sets the membership listener, only one listener can be added.
|
void |
setPayload(byte[] payload)
Set a payload to be broadcasted with each membership
broadcast.
|
void |
setProperties(Properties properties)
Sets the properties for the membership service.
|
void |
start()
Starts the membership service.
|
void |
start(int level)
Starts the membership service.
|
void |
stop(int level)
Starts the membership service.
|
static final int MBR_RX
static final int MBR_TX
void setProperties(Properties properties)
start()
method is called.
The properties are implementation specific.properties
- - to be used to configure the membership service.Properties getProperties()
void start() throws Exception
Exception
- if the service fails to start.void start(int level) throws Exception
level
- - level MBR_RX starts listening for members, level MBR_TX
starts broad casting the serverException
- if the service fails to start.IllegalArgumentException
- if the level is incorrect.void stop(int level)
level
- - level MBR_RX stops listening for members, level MBR_TX
stops broad casting the serverIllegalArgumentException
- if the level is incorrect.boolean hasMembers()
Member[] getMembers()
Member getLocalMember(boolean incAliveTime)
String[] getMembersByName()
void setLocalMemberProperties(String listenHost, int listenPort, int securePort, int udpPort)
void setMembershipListener(MembershipListener listener)
listener
- The listenervoid removeMembershipListener()
void setPayload(byte[] payload)
payload
- byte[]void setDomain(byte[] domain)
void broadcast(ChannelMessage message) throws ChannelException
message
- ChannelException
Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.