use of com.sun.corba.ee.spi.folb.ClusterInstanceInfo in project Payara by payara.
the class RoundRobinPolicy method filterClusterInfo.
private List<ClusterInstanceInfo> filterClusterInfo(List<ClusterInstanceInfo> info) {
boolean isw = isWeighted();
ArrayList<ClusterInstanceInfo> newList = new ArrayList<ClusterInstanceInfo>();
totalWeight = 0;
for (ClusterInstanceInfo clinfo : info) {
final int newWeight = isw ? clinfo.weight() : default_weight;
final List<SocketInfo> newEndpoints = filterSocketInfos(clinfo.endpoints());
final ClusterInstanceInfo newClinfo = new ClusterInstanceInfo(clinfo.name(), newWeight, newEndpoints);
newList.add(newClinfo);
totalWeight += newWeight;
}
return newList;
}
use of com.sun.corba.ee.spi.folb.ClusterInstanceInfo in project Payara by payara.
the class RoundRobinPolicy method toString.
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("RoundRobinPolicy[");
boolean first = true;
for (ClusterInstanceInfo endpoint : endpointsList) {
if (first) {
first = false;
} else {
sb.append(' ');
}
sb.append(endpoint.toString());
}
sb.append(']');
return sb.toString();
}
use of com.sun.corba.ee.spi.folb.ClusterInstanceInfo in project Payara by payara.
the class CSIv2SSLTaggedComponentHandlerImpl method insert.
// //////////////////////////////////////////////////
//
// CSIv2SSLTaggedComponentHandler
//
@Override
public TaggedComponent insert(IORInfo iorInfo, List<ClusterInstanceInfo> clusterInstanceInfo) {
TaggedComponent result = null;
try {
if (_logger.isLoggable(Level.FINE)) {
_logger.log(Level.FINE, "{0}.insert->:", baseMsg);
}
List<com.sun.corba.ee.spi.folb.SocketInfo> socketInfos = new ArrayList<com.sun.corba.ee.spi.folb.SocketInfo>();
for (ClusterInstanceInfo clInstInfo : clusterInstanceInfo) {
for (com.sun.corba.ee.spi.folb.SocketInfo sinfo : clInstInfo.endpoints()) {
if (sinfo.type().equals("SSL") || sinfo.type().equals("SSL_MUTUALAUTH")) {
socketInfos.add(sinfo);
}
}
}
IIOPSSLUtil sslUtil = null;
if (Globals.getDefaultHabitat() != null) {
sslUtil = Globals.getDefaultHabitat().getService(IIOPSSLUtil.class);
return sslUtil.createSSLTaggedComponent(iorInfo, socketInfos);
} else {
return null;
}
} finally {
if (_logger.isLoggable(Level.FINE)) {
_logger.log(Level.FINE, "{0}.insert<-: {1}", new Object[] { baseMsg, result });
}
}
}
Aggregations