1 19 20 package org.apache.cayenne.remote.hessian.service; 21 22 import java.io.IOException ; 23 import java.util.Iterator ; 24 import java.util.Map ; 25 26 import org.apache.cayenne.DataRow; 27 28 import com.caucho.hessian.io.AbstractHessianOutput; 29 import com.caucho.hessian.io.AbstractSerializer; 30 31 36 class ServerDataRowSerializer extends AbstractSerializer { 37 38 public void writeObject(Object object, AbstractHessianOutput out) throws IOException { 39 if (out.addRef(object)) { 40 return; 41 } 42 43 DataRow row = (DataRow) object; 44 45 out.writeMapBegin(DataRow.class.getName()); 46 47 out.writeInt(row.size()); 48 out.writeLong(row.getVersion()); 49 out.writeLong(row.getReplacesVersion()); 50 51 Iterator it = row.entrySet().iterator(); 52 while (it.hasNext()) { 53 Map.Entry entry = (Map.Entry ) it.next(); 54 out.writeObject(entry.getKey()); 55 out.writeObject(entry.getValue()); 56 } 57 58 out.writeMapEnd(); 59 } 60 61 } 62 | Popular Tags |