1 package org.myoodb.core.command; 25 26 import java.io.*; 27 28 import org.myoodb.core.*; 29 30 public final class CreateCommand extends AbstractCommand implements Externalizable 31 { 32 private String m_className; 33 private String m_rootName; 34 private String m_sig; 35 private Object [] m_args; 36 37 public CreateCommand() 38 { 39 } 40 41 public CreateCommand(String className, String rootName, String sig, Object [] args) 42 { 43 m_className = className; 44 m_rootName = rootName; 45 m_sig = sig; 46 m_args = args; 47 } 48 49 public void process(AbstractTransaction tx) throws Exception 50 { 51 m_result = tx.create(m_className, m_rootName, m_sig, m_args).getProxy(); 52 } 53 54 public void writeExternal(ObjectOutput out) throws IOException 55 { 56 out.writeObject(m_className); 57 out.writeObject(m_rootName); 58 out.writeObject(m_sig); 59 out.writeObject(m_args); 60 } 61 62 public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException 63 { 64 m_className = (String ) in.readObject(); 65 m_rootName = (String ) in.readObject(); 66 m_sig = (String ) in.readObject(); 67 m_args = (Object []) in.readObject(); 68 } 69 } 70 | Popular Tags |