Class ClusterMessageXStreamReceiver

java.lang.Object
com.atlassian.bamboo.cluster.clustermessage.ClusterMessageXStreamReceiver
All Implemented Interfaces:
ClusterMessageReceiver

public class ClusterMessageXStreamReceiver extends Object implements ClusterMessageReceiver
Receives a raw message from the cluster, deserializes it, and sends it locally via the EventPublisher. To finally consume the event, all you need is an EventListener that will capture it. As a result, a single EventListener is enough to consume the events sent from both the local node and other cluster nodes.
  • Constructor Details

    • ClusterMessageXStreamReceiver

      @Inject public ClusterMessageXStreamReceiver(@NotNull @NotNull XStreamManager xStreamManager, @NotNull @NotNull com.atlassian.event.api.EventPublisher eventPublisher)
  • Method Details

    • receive

      public <T extends ClusterMessage> void receive(@Nullable @Nullable String rawMessage, @Nullable @Nullable String senderNodeId)
      Description copied from interface: ClusterMessageReceiver
      Receives a raw message. Implementations of this method are responsible for deserializing the raw message and handling the deserialized message appropriately.
      Specified by:
      receive in interface ClusterMessageReceiver
      Type Parameters:
      T - the type of the deserialized message, which must extend ClusterMessage
      Parameters:
      rawMessage - the raw message received, can be null
      senderNodeId - the node id of the node we received the message from
    • setLastLogTime

      protected void setLastLogTime(long lastLogTime)