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.InstMode; 9 import SOFA.SOFAnode.Made.TIR.Repository; 10 import SOFA.SOFAnode.Made.TIR.TIRExceptCommit; 11 12 public class InstModeImpl extends UnicastRemoteObject implements InstMode, TIRImplObject { 13 int m; 14 15 public InstModeImpl(int mode) throws RemoteException { 16 m = mode; 17 } 18 19 public InstModeImpl() throws RemoteException { 20 m = 0; 21 } 22 23 public int value() throws RemoteException { 24 return m; 25 } 26 27 28 public void load(Storage st) throws RemoteException , TIRExceptStorage { 29 try { 30 m = st.curInFile.readInt(); 31 } catch (IOException e) { 32 throw new TIRExceptStorage("Can't read in file "+st.currentFile+"."); 33 } 34 } 35 36 37 public void save(Storage st) throws RemoteException , TIRExceptStorage { 38 try { 39 st.curOutFile.writeInt(m); 40 } catch (IOException e) { 41 throw new TIRExceptStorage("Can't write in file "+st.currentFile+"."); 42 } 43 } 44 45 public void postLoad(RepositoryImpl r) throws RemoteException , TIRExceptStorage { 46 ; 47 } 48 49 public boolean isNew() { 50 return false; 51 } 52 53 public void canCommit() throws RemoteException , TIRExceptCommit {;} 54 public void doCommit(Container in, Repository rep) throws RemoteException {;} 55 public void doAbort(long workId) throws RemoteException {} 56 } 57 | Popular Tags |