*/
package jalview.ws.rest;
+import jalview.bin.ApplicationSingletonProvider;
+import jalview.bin.ApplicationSingletonProvider.ApplicationSingletonI;
import jalview.bin.Cache;
import jalview.datamodel.AlignmentView;
import jalview.gui.AlignFrame;
*
*/
public class RestClient extends WSClient
- implements WSClientI, WSMenuEntryProviderI
+implements WSClientI, WSMenuEntryProviderI, ApplicationSingletonI
{
+
+private static RestClient getInstance()
+{
+return (RestClient) ApplicationSingletonProvider.getInstance(RestClient.class);
+}
+
+public static final String RSBS_SERVICES = "RSBS_SERVICES";
+
+
+ protected Vector<String> services = null;
+
+
RestServiceDescription service;
public RestClient(RestServiceDescription rsd)
return true;
}
- protected static Vector<String> services = null;
-
- public static final String RSBS_SERVICES = "RSBS_SERVICES";
-
public static RestClient[] getRestClients()
{
+ return getInstance().getClients();
+ }
+
+ private RestClient[] getClients()
+ {
if (services == null)
{
services = new Vector<String>();
{
if (rsbsUrls != null)
{
+
// TODO: consider validating services ?
- services = new Vector<String>(rsbsUrls);
+ getInstance().services = new Vector<String>(rsbsUrls);
StringBuffer sprop = new StringBuffer();
- for (String s : services)
+ for (String s : getInstance().services)
{
sprop.append(s);
}