Package com.atlassian.jira.cluster
Class DatabaseClusterMessagingService
java.lang.Object
com.atlassian.jira.cluster.DatabaseClusterMessagingService
- All Implemented Interfaces:
ClusterMessagingService
Provides an implementation for the
ClusterMessagingService that wraps an existing
MessageHandlerService in order to provide an API that can be consumed by plugins.- Since:
- v6.3
-
Constructor Summary
ConstructorsConstructorDescriptionDatabaseClusterMessagingService(MessageHandlerService messageHandlerService) -
Method Summary
Modifier and TypeMethodDescriptionvoidregisterListener(String channel, ClusterMessageConsumer consumer) Register a ClusterMessageConsumer to receive messages sent to the nominated channel.voidsendRemote(String channel, String message) Sends an inter-node message to registered listeners, listeners on the node the message was raised will not be notified.voidunregisterListener(ClusterMessageConsumer consumer) Removes a ClusterMessageConsumer from all channels.voidunregisterListener(String channel, ClusterMessageConsumer consumer) Removes a ClusterMessageConsumer from the channel.
-
Constructor Details
-
DatabaseClusterMessagingService
-
-
Method Details
-
registerListener
Description copied from interface:ClusterMessagingServiceRegister a ClusterMessageConsumer to receive messages sent to the nominated channel.The receive method of the ClusterMessageConsumer will be invoked when a message is sent to a channel it is listening to. Registering a new listener for a channel will not remove any existing listeners on that channel. Listeners are weakly referenced, it is the responsibility of the caller to ensure that listeners are not prematurely garbage collected.
- Specified by:
registerListenerin interfaceClusterMessagingService- Parameters:
channel- The name of the channelconsumer- The consumer that will receive messages
-
unregisterListener
Description copied from interface:ClusterMessagingServiceRemoves a ClusterMessageConsumer from the channel.The ClusterMessageConsumer will no longer receive messages that are sent to the nominated channel.
- Specified by:
unregisterListenerin interfaceClusterMessagingService- Parameters:
channel- The name of the channelconsumer- The consumer to be unregistered
-
unregisterListener
Description copied from interface:ClusterMessagingServiceRemoves a ClusterMessageConsumer from all channels.The ClusterMessageConsumer will no longer receive any messages.
- Specified by:
unregisterListenerin interfaceClusterMessagingService- Parameters:
consumer- The consumer to be unregistered
-
sendRemote
Description copied from interface:ClusterMessagingServiceSends an inter-node message to registered listeners, listeners on the node the message was raised will not be notified.- Specified by:
sendRemotein interfaceClusterMessagingService- Parameters:
channel- The name of the channel (up to 20 alphanumeric characters in length)message- The message to send (up to 200 characters in length)
-