import java.util.concurrent.TimeUnit;
import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.util.ArrayUtils;
import jalview.util.MathUtils;
import jalview.ws.params.ArgumentI;
job.setStatus(JobStatus.CANCELLED);
} catch (IOException e)
{
- Cache.log.error(format("failed to cancel job %s", job.getServerJob()), e);
+ Console.error(format("failed to cancel job %s", job.getServerJob()), e);
}
}
}
import jalview.analysis.SeqsetUtils.SequenceInfo;
import jalview.api.AlignViewportI;
import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.datamodel.AlignedCodonFrame;
import jalview.datamodel.Alignment;
import jalview.datamodel.AlignmentI;
@Override
protected List<AlignmentJob> prepare() throws ServiceInputInvalidException
{
- Cache.log.info(format("starting alignment service %s:%s",
+ Console.info(format("starting alignment service %s:%s",
client.getClientName(), action.getName()));
SequenceI[][] conmsa = msa.getVisibleContigs(gapChar);
if (conmsa == null)
import jalview.api.FeatureColourI;
import jalview.api.PollableAlignCalcWorkerI;
import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.AnnotatedCollectionI;
{
if (this.taskStatus != status)
{
- Cache.log.debug(String.format("%s status change to %s", this, status.name()));
+ Console.debug(String.format("%s status change to %s", this, status.name()));
this.taskStatus = status;
eventHandler.fireTaskStatusChanged(status);
}
job.setStatus(JobStatus.CANCELLED);
} catch (IOException e)
{
- Cache.log.error(String.format(
+ Console.error(String.format(
"failed to cancel job %s", job.getServerJob()), e);
}
}
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);
}
}
}
import com.stevesoft.pat.NotImplementedError;
import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.ws.params.ArgumentI;
import jalview.ws.params.ParamDatastoreI;
import jalview.ws.params.ParamManager;
url = service.getUrl().toURL();
} catch (MalformedURLException e)
{
- Cache.log.warn("Invalid service url " + service.getUrl(), e);
+ Console.warn("Invalid service url " + service.getUrl(), e);
}
List<WsParamSetI> presets = new ArrayList<>(service.getPresets().size());
for (var preset : service.getPresets())
builder.setDetailsUrl(service.getUrl().toURL());
} catch (MalformedURLException e)
{
- Cache.log.warn("invalid service url " + service.getUrl(), e);
+ Console.warn("invalid service url " + service.getUrl(), e);
}
}
}
\ No newline at end of file
import jalview.api.FeatureColourI;
import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.datamodel.Alignment;
import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.AlignmentI;
}
if (format == null)
{
- Cache.log.warn(String.format(
+ Console.warn(String.format(
"Unknown input format %s, assuming fasta.",
fileParam.getMediaType()));
format = FileFormat.Fasta;
public void cancel(WebServiceJobHandle job)
throws IOException, UnsupportedOperationException
{
- Cache.log.warn(
+ Console.warn(
"slivka client does not support job cancellation");
}
}
return new FormatAdapter().readFile(f.getContentUrl().toString(),
DataSourceType.URL, format);
}
- Cache.log.warn("No alignment found on the server");
+ Console.warn("No alignment found on the server");
throw new IOException("no alignment found");
}
aln, service.getId(), f.getContentUrl().toString(),
DataSourceType.URL);
if (annotPresent)
- Cache.log.debug(format("loaded annotations for %s", service.getId()));
+ Console.debug(format("loaded annotations for %s", service.getId()));
}
else if (fmt.equalsIgnoreCase("jalview-features"))
{
DataSourceType.URL);
featPresent = ff.parse(aln, colours, true);
if (featPresent)
- Cache.log.debug(format("loaded features for %s", service.getId()));
+ Console.debug(format("loaded features for %s", service.getId()));
}
}
if (!annotPresent)
- Cache.log.debug(format("no annotations found for %s", service.getId()));
+ Console.debug(format("no annotations found for %s", service.getId()));
if (!featPresent)
- Cache.log.debug(format("no features found for %s", service.getId()));
+ Console.debug(format("no features found for %s", service.getId()));
return aln.getAlignmentAnnotation() != null ? Arrays.asList(aln.getAlignmentAnnotation())
: Collections.emptyList();
}
import java.util.List;
import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.ws.params.ParamManager;
import jalview.ws2.actions.alignment.AlignmentAction;
import jalview.ws2.actions.annotation.AnnotationAction;
return services.isEmpty() ? STATUS_NO_SERVICES : STATUS_OK;
} catch (IOException e)
{
- Cache.log.error("slivka could not retrieve services from " + url, e);
+ Console.error("slivka could not retrieve services from " + url, e);
return STATUS_INVALID;
}
}
import javax.swing.SwingUtilities;
import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.datamodel.Alignment;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.AlignmentOrder;
@Override
public void taskException(TaskI<AlignmentResult> source, Exception e)
{
- Cache.log.error(String.format("Service %s raised an exception.", service.getName()), e);
+ Console.error(String.format("Service %s raised an exception.", service.getName()), e);
infoPanel.appendProgressText(e.getMessage());
}
import javax.xml.bind.Unmarshaller;
import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.util.MessageManager;
import jalview.ws.params.ArgumentI;
import jalview.ws.params.ParamDatastoreI;
else
{
userPresets.add(new SimpleParamSet(paramSet));
- Cache.log.warn(String.format(
+ Console.warn(String.format(
"Parameter set instance type %s is not applicable to service"
+ "at %s.", paramSet.getClass(), serviceUrl));
}
}
else
{
- Cache.log.warn("Implementation error: no preset to delete");
+ Console.warn("Implementation error: no preset to delete");
}
}