Package org.apache.catalina.tribes.group
Interface GroupChannelMBean
-
- All Known Implementing Classes:
GroupChannel
public interface GroupChannelMBeanMBean interface for managing a GroupChannel.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddChannelListener(ChannelListener listener)Adds a channel listener to receive incoming messages.voidaddMembershipListener(MembershipListener listener)Adds a membership listener to receive membership change notifications.booleangetHeartbeat()Returns whether the internal heartbeat is enabled.longgetHeartbeatSleeptime()Returns the heartbeat sleep interval in milliseconds.MembergetLocalMember(boolean incAlive)Returns the local member of the channel.Member[]getMembers()Returns the current members of the channel.booleangetOptionCheck()Returns whether option flag checking is enabled.booleanhasMembers()Returns whether the channel has any members.voidremoveChannelListener(ChannelListener listener)Removes a previously registered channel listener.voidremoveMembershipListener(MembershipListener listener)Removes a previously registered membership listener.UniqueIdsend(Member[] destination, java.io.Serializable msg, int options)Sends a message to the specified destination members.UniqueIdsend(Member[] destination, java.io.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 Detail
-
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
void start(int svc) throws ChannelExceptionStarts the channel with the given service type.- Parameters:
svc- The service type- Throws:
ChannelException- if an error occurs during start
-
stop
void stop(int svc) throws ChannelException
Stops the channel with the given service type.- Parameters:
svc- The service type- Throws:
ChannelException- if an error occurs during stop
-
send
UniqueId send(Member[] destination, java.io.Serializable msg, int options) throws ChannelException
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, java.io.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
void addMembershipListener(MembershipListener listener)
Adds a membership listener to receive membership change notifications.- Parameters:
listener- The membership listener to add
-
addChannelListener
void addChannelListener(ChannelListener listener)
Adds a channel listener to receive incoming messages.- Parameters:
listener- The channel listener to add
-
removeMembershipListener
void removeMembershipListener(MembershipListener listener)
Removes a previously registered membership listener.- Parameters:
listener- The membership listener to remove
-
removeChannelListener
void removeChannelListener(ChannelListener listener)
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
Member[] getMembers()
Returns the current members of the channel.- Returns:
- Array of current members
-
getLocalMember
Member getLocalMember(boolean incAlive)
Returns the local member of the channel.- Parameters:
incAlive- Whether to update the alive timestamp- Returns:
- The local member
-
-