+ for (int i = 0 ; i < MAX_RETRIES ; i++)
+ {
+ if (pingEnsembl(pingUrl))
+ {
+ if (i > 0)
+ {
+ Cache.log.info("Ensembl ping responded on attempt " + (i+1));
+ }
+ return true;
+ }
+ }
+ Cache.log.error("Ensembl ping failed after " + MAX_RETRIES + " retries");
+ return false;
+ }
+
+ /**
+ * Connects to Ensembl REST service's 'ping' URL and answers true if
+ * successful, false if no reply, or no reply within the 2 second timeout
+ *
+ * @param pingUrl
+ * @return
+ */
+ @SuppressWarnings("unchecked")
+ protected boolean pingEnsembl(String pingUrl)
+ {