Interface GroupChannelMBean
- All Known Implementing Classes:
GroupChannel
public interface GroupChannelMBean
MBean interface for managing a GroupChannel.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddChannelListener(ChannelListener listener) Adds a channel listener to receive incoming messages.voidaddMembershipListener(MembershipListener listener) Adds a membership listener to receive membership change notifications.booleanReturns whether the internal heartbeat is enabled.longReturns the heartbeat sleep interval in milliseconds.getLocalMember(boolean incAlive) Returns the local member of the channel.Member[]Returns the current members of the channel.booleanReturns whether option flag checking is enabled.booleanReturns whether the channel has any members.voidremoveChannelListener(ChannelListener listener) Removes a previously registered channel listener.voidremoveMembershipListener(MembershipListener listener) Removes a previously registered membership listener.send(Member[] destination, Serializable msg, int options) Sends a message to the specified destination members.send(Member[] destination, Serializable msg, int options, ErrorHandler handler) Sends a message to the specified destination members with an error handler.voidstart(int svc) Starts the channel with the given service type.voidstop(int svc) Stops the channel with the given service type.
-
Method Details
-
getOptionCheck
boolean getOptionCheck()Returns whether option flag checking is enabled.- Returns:
trueif option checking is enabled
-
getHeartbeat
boolean getHeartbeat()Returns whether the internal heartbeat is enabled.- Returns:
trueif heartbeat is enabled
-
getHeartbeatSleeptime
long getHeartbeatSleeptime()Returns the heartbeat sleep interval in milliseconds.- Returns:
- the heartbeat sleep time in milliseconds
-
start
Starts the channel with the given service type.- Parameters:
svc- The service type- Throws:
ChannelException- if an error occurs during start
-
stop
Stops the channel with the given service type.- Parameters:
svc- The service type- Throws:
ChannelException- if an error occurs during stop
-
send
Sends a message to the specified destination members.- Parameters:
destination- The destination membersmsg- The message to sendoptions- Send options flags- Returns:
- UniqueId for the sent message
- Throws:
ChannelException- if an error occurs during send
-
send
UniqueId send(Member[] destination, Serializable msg, int options, ErrorHandler handler) throws ChannelException Sends a message to the specified destination members with an error handler.- Parameters:
destination- The destination membersmsg- The message to sendoptions- Send options flagshandler- Error handler for the send operation- Returns:
- UniqueId for the sent message
- Throws:
ChannelException- if an error occurs during send
-
addMembershipListener
Adds a membership listener to receive membership change notifications.- Parameters:
listener- The membership listener to add
-
addChannelListener
Adds a channel listener to receive incoming messages.- Parameters:
listener- The channel listener to add
-
removeMembershipListener
Removes a previously registered membership listener.- Parameters:
listener- The membership listener to remove
-
removeChannelListener
Removes a previously registered channel listener.- Parameters:
listener- The channel listener to remove
-
hasMembers
boolean hasMembers()Returns whether the channel has any members.- Returns:
trueif there are members in the channel
-
getMembers
-
getLocalMember
Returns the local member of the channel.- Parameters:
incAlive- Whether to update the alive timestamp- Returns:
- The local member
-