| 1 9 package org.ozoneDB.core.DbRemote; 10 11 import org.ozoneDB.OzoneProxy; 12 import org.ozoneDB.core.*; 13 14 import java.io.*; 15 16 17 21 public final class DbCreateObj extends DbCommand { 22 23 private String className; 24 25 private int access; 26 27 private String objName; 28 29 private String sig; 30 31 private Object [] args; 32 33 34 public DbCreateObj() { 35 } 36 37 38 public DbCreateObj( String _className, int _access, String _objName, String _sig, Object [] _args ) { 39 className = _className; 40 access = _access; 41 objName = _objName; 42 sig = _sig; 43 args = _args; 44 } 45 46 47 public void perform( Transaction ta ) throws Exception { 48 ObjectContainer container = ta.createObject( className, access, objName, sig, args, null ); 50 51 try { 52 OzoneProxy resultingProxy = container.ozoneProxy(); 53 54 getProxyObjectGate().addObjectReferencedByClient(resultingProxy); 55 56 if (Env.selfCheck) { 57 if (resultingProxy==null) { throw new Error ("Found during DbCreateObj.perform(): container="+container+",resultingProxy="+resultingProxy+"."); 59 } 60 } 61 62 result = resultingProxy; 63 } finally { 64 container.unpin(); 65 } 66 } 67 68 69 public void writeExternal( ObjectOutput out ) throws IOException { 70 out.writeObject( className ); 71 out.writeInt( access ); 72 out.writeObject( objName ); 73 out.writeObject( sig ); 74 out.writeObject( args ); 75 } 76 77 78 public void readExternal( ObjectInput in ) throws IOException, ClassNotFoundException { 79 className = (String )in.readObject(); 80 access = in.readInt(); 81 objName = (String )in.readObject(); 82 sig = (String )in.readObject(); 83 args = (Object [])in.readObject(); 84 } 85 86 87 public String toString() { 88 return super.toString(); 89 } 90 91 } 92 | Popular Tags |