4 package uk.ac.vamsas.client;
6 import java.util.Hashtable;
8 import org.apache.commons.logging.Log;
9 import org.apache.commons.logging.LogFactory;
11 import uk.ac.vamsas.objects.core.VAMSAS;
14 * skeleton abstract class to allow client implementations
15 * access to vamsas.client.Vobject registry mechanism.
17 public abstract class ClientDocument implements IClientDocument {
18 static Log log = LogFactory.getLog(ClientDocument.class);
21 * collection of uk.ac.vamsas.client.Vobject references
23 protected Hashtable vamsasObjects;
24 protected IVorbaIdFactory vorbafactory;
26 protected ClientDocument(Hashtable objects, IVorbaIdFactory factory) {
27 vamsasObjects = objects;
28 vorbafactory = factory;
32 * @see IClientHandle.registerObject(Vobject unregistered)
34 protected VorbaId _registerObject(Vobject unregistered) {
35 // be ultra safe here because the user may be trying to mix different factories
36 if (unregistered.__vorba==null)
37 unregistered.__vorba = vorbafactory;
39 if (unregistered.__vorba!=vorbafactory) {
40 // LATER: decide if this is allowed - it isn't for the moment.
41 log.error("Attempt to overwrite info in a registered vorba Vobject (under a different IVorbaIdFactory) ! - Implementation fix needed.");
44 // probably didn't need to call registerObject.
45 log.debug("Redundant call to registerObject");
47 // TODO: add default provenance.
48 // TODO: decide if we need to do call __ensure_instance_ids here
49 // TODO: check if __ensure_instance_ids works correctly with new 'visit flag' mechanism
50 unregistered.__ensure_instance_ids(); // call cascade method here :
51 return unregistered.getVorbaId();