Search in sources :

Example 6 with SocketInfo

use of com.sun.corba.ee.spi.folb.SocketInfo in project Payara by payara.

the class RoundRobinPolicy method filterSocketInfos.

// Copy list, changing any type that does not start with SSL to CLEAR_TEXT.
private List<SocketInfo> filterSocketInfos(List<SocketInfo> sis) {
    final List<SocketInfo> result = new ArrayList<SocketInfo>();
    for (SocketInfo si : sis) {
        final String newType = si.type().startsWith(SSL) ? si.type() : CLEAR_TEXT;
        final SocketInfo siCopy = new SocketInfo(newType, si.host(), si.port());
        result.add(siCopy);
    }
    return result;
}
Also used : SocketInfo(com.sun.corba.ee.spi.folb.SocketInfo) ArrayList(java.util.ArrayList)

Example 7 with SocketInfo

use of com.sun.corba.ee.spi.folb.SocketInfo 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;
}
Also used : ArrayList(java.util.ArrayList) SocketInfo(com.sun.corba.ee.spi.folb.SocketInfo) ClusterInstanceInfo(com.sun.corba.ee.spi.folb.ClusterInstanceInfo)

Aggregations

SocketInfo (com.sun.corba.ee.spi.folb.SocketInfo)7 ClusterInstanceInfo (com.sun.corba.ee.spi.folb.ClusterInstanceInfo)5 ArrayList (java.util.ArrayList)5 TransportAddress (com.sun.corba.ee.org.omg.CSIIOP.TransportAddress)1 Node (com.sun.enterprise.config.serverbeans.Node)1 UnknownHostException (java.net.UnknownHostException)1 IiopListener (org.glassfish.orb.admin.config.IiopListener)1 IiopService (org.glassfish.orb.admin.config.IiopService)1