final EJBClientClusterConfig clusterConfig = new EJBClientClusterConfig(clusterMetadata, classLoader, serviceRegistry);
// add it to the client configuration
ejbClientConfig.addClusterConfiguration(clusterConfig);
for (final EJBClientDescriptorMetaData.ClusterNodeConfig nodeMetadata : clusterMetadata.getClusterNodeConfigs()) {
final EJBClientClusterNodeConfig clusterNodeConfig = new EJBClientClusterNodeConfig(nodeMetadata, classLoader, serviceRegistry);
clusterConfig.addClusterNode(clusterNodeConfig);
}
}
return ejbClientConfig;