KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > SOFA > SOFAnode > Made > TIR > Impl > ParamModeImpl


1 /* $Id: ParamModeImpl.java,v 1.2 2004/05/20 14:23:52 bures Exp $ */
2 package SOFA.SOFAnode.Made.TIR.Impl;
3 import java.io.IOException JavaDoc;
4 import java.rmi.RemoteException JavaDoc;
5 import java.rmi.server.UnicastRemoteObject JavaDoc;
6
7 import SOFA.SOFAnode.Made.TIR.Container;
8 import SOFA.SOFAnode.Made.TIR.ParamMode;
9 import SOFA.SOFAnode.Made.TIR.Repository;
10 import SOFA.SOFAnode.Made.TIR.TIRExceptCommit;
11
12 public class ParamModeImpl extends UnicastRemoteObject JavaDoc implements ParamMode, TIRImplObject {
13   int m;
14   
15   public ParamModeImpl(int mode) throws RemoteException JavaDoc {
16     m = mode;
17   }
18
19   public ParamModeImpl() throws RemoteException JavaDoc {
20     m = 0;
21   }
22
23   public int value() throws RemoteException JavaDoc {
24     return m;
25   }
26
27   /*from interface TIRImplObject */
28   public void load(Storage st) throws RemoteException JavaDoc, TIRExceptStorage {
29     try {
30       m = st.curInFile.readInt();
31     } catch (IOException JavaDoc e) {
32       throw new TIRExceptStorage("Can't read in file "+st.currentFile+".");
33     }
34   }
35
36   /*from interface TIRImplObject */
37   public void save(Storage st) throws RemoteException JavaDoc, TIRExceptStorage {
38     try {
39       st.curOutFile.writeInt(m);
40     } catch (IOException JavaDoc e) {
41       throw new TIRExceptStorage("Can't write in file "+st.currentFile+".");
42     }
43   }
44   
45   public void postLoad(RepositoryImpl r) throws RemoteException JavaDoc, TIRExceptStorage {
46     ;
47   }
48
49   public boolean isNew() { return false;}
50   public void canCommit() throws RemoteException JavaDoc, TIRExceptCommit {;}
51   public void doCommit(Container in, Repository rep) throws RemoteException JavaDoc {;}
52   public void doAbort(long workId) throws RemoteException JavaDoc {}
53 }
54
Popular Tags