class ServerSelector {

    public DasResult execute(DasRequest dasRequest) throws TException {
        if (currentClient.get() != null) {//stick mode
            DasService.Client client = currentClient.get().getClient();
            return client.execute(dasRequest);
        } else {
            DasServerInstanceWithStatus chosen = rule.chooseServer();
            if (chosen == null) {
                throw new RuntimeException("No available server from: " + serverInstances);
            } else {
                try {
                    ClientObject co = servers.get(chosen).get(Thread.currentThread().getName());
                    return co.getClient().execute(dasRequest);
                } catch (Exception e){
                    try {
                        servers.get(chosen).invalidate(Thread.currentThread().getName());
                    } catch (ExecutionException ee) {}
                    throw new TException(e);
                }
            }
        }
    }

    public  ServerSelector(String appId, List<DasServerInstance> serverInstances, String dasClientVersion, String ppdaiClientVersion, String clientAddress);

}