/*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9)
- * Copyright (C) 2015 The Jalview Authors
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
*
* This file is part of Jalview.
*
*/
package jalview.io.vamsas;
-import jalview.bin.Cache;
-import jalview.io.VamsasAppDatastore;
-import jalview.util.MessageManager;
-
import java.util.Enumeration;
import java.util.Hashtable;
import java.util.IdentityHashMap;
import java.util.Vector;
+import jalview.bin.Console;
+import jalview.io.VamsasAppDatastore;
+import jalview.log.JLoggerLog4j;
+import jalview.util.MessageManager;
import uk.ac.vamsas.client.IClientDocument;
import uk.ac.vamsas.client.Vobject;
import uk.ac.vamsas.client.VorbaId;
/**
* shared log instance
*/
- protected static org.apache.log4j.Logger log = org.apache.log4j.Logger
+ protected static JLoggerLog4j log = JLoggerLog4j
.getLogger(DatastoreItem.class);
/**
{
return cdoc.getObject((VorbaId) jv2vobj.get(jvobj));
}
- if (Cache.log.isDebugEnabled())
+ if (Console.isDebugEnabled())
{
- Cache.log.debug("Returning null VorbaID binding for jalview object "
- + jvobj);
+ Console.debug(
+ "Returning null VorbaID binding for jalview object " + jvobj);
}
return null;
}
if (id == null)
{
id = cdoc.registerObject(vobj);
- Cache.log
- .debug("Registering new object and returning null for getvObj2jv");
+ Console.debug(
+ "Registering new object and returning null for getvObj2jv");
return null;
}
if (vobj2jv.containsKey(vobj.getVorbaId()))
if (id == null || vobj.getVorbaId() == null
|| cdoc.getObject(id) != vobj)
{
- Cache.log.error("Failed to get id for "
+ Console.error("Failed to get id for "
+ (vobj.isRegisterable() ? "registerable"
- : "unregisterable") + " object " + vobj);
+ : "unregisterable")
+ + " object " + vobj);
}
}
if (vobj2jv.containsKey(vobj.getVorbaId())
&& !(vobj2jv.get(vobj.getVorbaId())).equals(jvobj))
{
- Cache.log
- .debug("Warning? Overwriting existing vamsas id binding for "
+ Console.debug(
+ "Warning? Overwriting existing vamsas id binding for "
+ vobj.getVorbaId(),
- new Exception(
- MessageManager
- .getString("exception.overwriting_vamsas_id_binding")));
+ new Exception(MessageManager.getString(
+ "exception.overwriting_vamsas_id_binding")));
}
else if (jv2vobj.containsKey(jvobj)
&& !((VorbaId) jv2vobj.get(jvobj)).equals(vobj.getVorbaId()))
{
- Cache.log
- .debug("Warning? Overwriting existing jalview object binding for "
+ Console.debug(
+ "Warning? Overwriting existing jalview object binding for "
+ jvobj,
- new Exception(
- MessageManager
- .getString("exception.overwriting_jalview_id_binding")));
+ new Exception(MessageManager.getString(
+ "exception.overwriting_jalview_id_binding")));
}
/*
- * Cache.log.error("Attempt to make conflicting object binding! "+vobj+" id "
+ * Cache.error("Attempt to make conflicting object binding! "+vobj+" id "
* +vobj.getVorbaId()+" already bound to "+getvObj2jv(vobj)+" and "+jvobj+"
* already bound to "+getjv2vObj(jvobj),new Exception("Excessive call to
* bindjvvobj")); }
*/
// we just update the hash's regardless!
- Cache.log.debug("Binding " + vobj.getVorbaId() + " to " + jvobj);
+ Console.debug("Binding " + vobj.getVorbaId() + " to " + jvobj);
vobj2jv.put(vobj.getVorbaId(), jvobj);
// JBPNote - better implementing a hybrid invertible hash.
jv2vobj.put(jvobj, vobj.getVorbaId());
{
if (this.jvobj != null && this.vobj != null)
{
- Cache.log.debug("updating dsobj registry. ("
- + this.getClass().getName() + ")");
+ Console.debug("updating dsobj registry. (" + this.getClass().getName()
+ + ")");
}
this.jvobj = jvobj;
this.vobj = vobj;
{
throw new Error(MessageManager.formatMessage(
"error.implementation_error_old_jalview_object_not_bound",
- new String[] { oldjvobject.toString() }));
+ new String[]
+ { oldjvobject.toString() }));
}
if (newjvobject != null)
{
tojalview = true;
if (jvobj != null && !(boundType.isAssignableFrom(jvobj.getClass())))
{
- throw new Error(
- MessageManager
- .formatMessage(
- "error.implementation_error_vamsas_doc_class_should_bind_to_type",
- new String[] { vobj.getClass().toString(),
- boundType.toString(),
- jvobj.getClass().toString() }));
+ throw new Error(MessageManager.formatMessage(
+ "error.implementation_error_vamsas_doc_class_should_bind_to_type",
+ new String[]
+ { vobj.getClass().toString(), boundType.toString(),
+ jvobj.getClass().toString() }));
}
dsReg.registerDsObj(this);
}
vobj = getjv2vObj(jvobj);
if (vobj != null && !(boundToType.isAssignableFrom(vobj.getClass())))
{
- throw new Error(
- MessageManager
- .formatMessage(
- "error.implementation_error_vamsas_doc_class_should_bind_to_type",
- new String[] { jvobj2.getClass().toString(),
- boundToType.toString(),
- vobj.getClass().toString() }));
+ throw new Error(MessageManager.formatMessage(
+ "error.implementation_error_vamsas_doc_class_should_bind_to_type",
+ new String[]
+ { jvobj2.getClass().toString(), boundToType.toString(),
+ vobj.getClass().toString() }));
}
dsReg.registerDsObj(this);
}
jalview.datamodel.Provenance jprov = new jalview.datamodel.Provenance();
for (int i = 0; i < prov.getEntryCount(); i++)
{
- jprov.addEntry(prov.getEntry(i).getUser(), prov.getEntry(i)
- .getAction(), prov.getEntry(i).getDate(), prov.getEntry(i)
- .getId());
+ jprov.addEntry(prov.getEntry(i).getUser(),
+ prov.getEntry(i).getAction(), prov.getEntry(i).getDate(),
+ prov.getEntry(i).getId());
}
return jprov;