logger.debug("Skipping cluster node additions to EJB client context " + ejbClientContext + " since it can only handle local node");
continue;
}
// find a matching client mapping for our bind address
final List<ClientMapping> clientMappings = entry.getValue();
ClientMapping resolvedClientMapping = null;
for (final ClientMapping clientMapping : clientMappings) {
final InetAddress sourceNetworkAddress = clientMapping.getSourceNetworkAddress();
final int netMask = clientMapping.getSourceNetworkMaskBits();
final boolean match = NetworkUtil.belongsToNetwork(bindAddress, sourceNetworkAddress, (byte) (netMask & 0xff));
if (match) {
resolvedClientMapping = clientMapping;
logger.debug("Client mapping " + clientMapping + " matches client address " + bindAddress);
break;
}
}
if (resolvedClientMapping == null) {
EjbLogger.ROOT_LOGGER.cannotAddClusterNodeDueToUnresolvableClientMapping(addedNodeName, clusterName, bindAddress);
continue;
}
final ClusterNodeManager remotingClusterNodeManager = new RemotingConnectionClusterNodeManager(clusterContext, this.endpointInjectedValue.getValue(), addedNodeName, resolvedClientMapping.getDestinationAddress(), resolvedClientMapping.getDestinationPort());
clusterContext.addClusterNodes(remotingClusterNodeManager);
}
}