1 2 package SOFA.SOFAnode.Made.TIR.Impl; 3 import java.io.IOException ; 4 import java.rmi.RemoteException ; 5 import java.rmi.server.UnicastRemoteObject ; 6 7 import SOFA.SOFAnode.Made.TIR.Container; 8 import SOFA.SOFAnode.Made.TIR.DefinitionKind; 9 import SOFA.SOFAnode.Made.TIR.ProtocolNullOperandDef; 10 import SOFA.SOFAnode.Made.TIR.ProtocolOperKind; 11 import SOFA.SOFAnode.Made.TIR.Repository; 12 import SOFA.SOFAnode.Made.TIR.StateKind; 13 import SOFA.SOFAnode.Made.TIR.TIRExceptCommit; 14 15 public class ProtocolNullOperandDefImpl extends UnicastRemoteObject implements ProtocolNullOperandDef, TIRImplObject, SProtocolOperDef { 16 ProtocolOperKind pok; 17 DefinitionKindImpl defKindImpl; 18 StateKindImpl stKindImpl; 19 20 public ProtocolNullOperandDefImpl(int statekind) throws RemoteException { 21 pok = new ProtocolOperKindImpl(ProtocolOperKind.pok_nulloperand); 22 defKindImpl = new DefinitionKindImpl(DefinitionKind.dk_ProtocolOper); 23 stKindImpl = new StateKindImpl(statekind); 24 } 25 26 public ProtocolOperKind get_po_kind() throws RemoteException { 27 return pok; 28 } 29 30 31 public DefinitionKind get_def_kind() throws RemoteException { 32 return (DefinitionKind) defKindImpl; 33 } 34 35 36 public StateKind get_state() throws RemoteException { 37 return (StateKind) stKindImpl; 38 } 39 40 public void save(Storage st) throws RemoteException , TIRExceptStorage { 41 try { 42 st.curOutFile.writeInt(pok.value()); 43 } catch (IOException e) { 44 throw new TIRExceptStorage("Can't write in directory "+st.current+"."); 45 } 46 } 47 48 public void load(Storage st) throws RemoteException , TIRExceptStorage { 49 56 } 57 58 public void postLoad(RepositoryImpl r) throws RemoteException , TIRExceptStorage { 59 } 60 61 public boolean isNew() { 62 return (stKindImpl.value()==StateKind.sk_work); 63 } 64 65 public void canCommit() throws RemoteException , TIRExceptCommit {;} 66 67 public void doCommit(Container in, Repository rep) throws RemoteException { 68 if (stKindImpl.value()==StateKind.sk_normal) 69 return; 70 stKindImpl.toNormal(); 71 } 72 73 public void doAbort(long workId) throws RemoteException {} 74 75 public String to_text() throws RemoteException { 76 return "NULL"; 77 } 78 } 79 | Popular Tags |