public void WriteObject(Type type, object val)
{
ObjectPath path;
BusObject bobj = val as BusObject;
if (bobj == null && val is MarshalByRefObject) {
bobj = ((MarshalByRefObject)val).GetLifetimeService () as BusObject;
}
if (bobj == null)
throw new Exception ("No object reference to write");
path = bobj.Path;
Write (path);
}