import java.util.concurrent.atomic.AtomicInteger;
import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.ws2.actions.api.ActionI;
import jalview.ws2.api.WebService;
valid.add(new URL(url));
} catch (MalformedURLException e)
{
- Cache.log.warn(String.format(
+ Console.warn(String.format(
"Problem whilst trying to make a URL from '%s'. " +
"This was probably due to malformed comma-separated-list " +
"in the %s entry of ${HOME}/.jalview-properties",
Objects.toString(url, "<null>"), key));
- Cache.log.debug("Exception occurred while reading url list", e);
+ Console.debug("Exception occurred while reading url list", e);
}
}
return valid;
@Override
public synchronized final CompletableFuture<List<WebService<?>>> startDiscoverer()
{
- Cache.log.debug("Requesting service discovery");
+ Console.debug("Requesting service discovery");
while (true)
{
if (state.get() == AGAIN)
}
if (state.compareAndSet(END, BEGIN) || state.compareAndSet(BEGIN, AGAIN))
{
- Cache.log.debug("State changed to " + state.get());
+ Console.debug("State changed to " + state.get());
final var oldTask = discoveryTask;
CompletableFuture<List<WebService<?>>> task = oldTask
.handleAsync((_r, _e) -> {
- Cache.log.info("Reloading services for " + this);
+ Console.info("Reloading services for " + this);
fireServicesChanged(services = Collections.emptyList());
var allServices = new ArrayList<WebService<?>>();
for (var url : getUrls())
{
- Cache.log.info("Fetching list of services from " + url);
+ Console.info("Fetching list of services from " + url);
try
{
allServices.addAll(fetchServices(url));
}
catch (IOException e)
{
- Cache.log.error("Failed to get services from " + url, e);
+ Console.error("Failed to get services from " + url, e);
}
}
return services = allServices;
// should never happen, throw exception to break the loop just in case
throw new AssertionError();
if (state.compareAndSet(BEGIN, END) || state.compareAndSet(AGAIN, BEGIN))
- Cache.log.debug("Discovery ended, state is " + state.get());
+ Console.debug("Discovery ended, state is " + state.get());
break;
}
if (services != null)
fireServicesChanged(services);
return null;
});
- Cache.log.debug("Spawned task " + task);
- Cache.log.debug("Killing task " + oldTask);
+ Console.debug("Spawned task " + task);
+ Console.debug("Killing task " + oldTask);
oldTask.cancel(false);
return discoveryTask = task;
}
}
catch (Exception e)
{
- Cache.log.warn(e);
+ Console.warn(e.toString(), e);
}
}
}