Skip to content

Commit

Permalink
WFLY-13132 Expose remoting connection associated with a ClusterTopolo…
Browse files Browse the repository at this point in the history
…gyListener. (#460)
  • Loading branch information
pferraro authored May 22, 2020
1 parent 556023b commit 86c6be6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1183,6 +1183,7 @@ final class ClusterTopologyWriter implements ClusterTopologyListener {
ClusterTopologyWriter() {
}

@Override
public void clusterTopology(final List<ClusterInfo> clusterInfoList) {
try (MessageOutputStream os = messageTracker.openMessageUninterruptibly()) {
os.writeByte(Protocol.CLUSTER_TOPOLOGY_COMPLETE);
Expand Down Expand Up @@ -1214,6 +1215,7 @@ public void clusterTopology(final List<ClusterInfo> clusterInfoList) {
}
}

@Override
public void clusterRemoval(final List<String> clusterNames) {
try (MessageOutputStream os = messageTracker.openMessageUninterruptibly()) {
os.writeByte(Protocol.CLUSTER_TOPOLOGY_REMOVAL);
Expand All @@ -1227,6 +1229,7 @@ public void clusterRemoval(final List<String> clusterNames) {
}
}

@Override
public void clusterNewNodesAdded(final ClusterInfo clusterInfo) {
try (MessageOutputStream os = messageTracker.openMessageUninterruptibly()) {
os.writeByte(Protocol.CLUSTER_TOPOLOGY_ADDITION);
Expand Down Expand Up @@ -1256,6 +1259,7 @@ public void clusterNewNodesAdded(final ClusterInfo clusterInfo) {
}
}

@Override
public void clusterNodesRemoved(final List<ClusterRemovalInfo> clusterRemovalInfoList) {
try (MessageOutputStream os = messageTracker.openMessageUninterruptibly()) {
os.writeByte(Protocol.CLUSTER_TOPOLOGY_NODE_REMOVAL);
Expand All @@ -1273,6 +1277,11 @@ public void clusterNodesRemoved(final List<ClusterRemovalInfo> clusterRemovalInf
Logs.REMOTING.trace("EJB cluster message write failed", e);
}
}

@Override
public Connection getConnection() {
return EJBServerChannel.this.channel.getConnection();
}
}

final class ModuleAvailabilityWriter implements ModuleAvailabilityListener {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
import java.net.InetAddress;
import java.util.List;

import org.jboss.remoting3.Connection;

/**
* A legacy cluster topology notification client.
*
Expand All @@ -36,6 +38,12 @@ public interface ClusterTopologyListener {

void clusterNodesRemoved(List<ClusterRemovalInfo> clusterRemovalInfoList);

/**
* Returns the remoting connection associated with this listener
* @return a remoting connection
*/
Connection getConnection();

final class ClusterInfo {
private final String clusterName;
private final List<NodeInfo> nodeInfoList;
Expand Down

0 comments on commit 86c6be6

Please sign in to comment.