KickJava   Java API By Example, From Geeks To Geeks.

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


1 /* $Id: WstringDefImpl.java,v 1.2 2004/05/20 14:23:52 bures Exp $ */
2 package SOFA.SOFAnode.Made.TIR.Impl;
3 import java.rmi.RemoteException JavaDoc;
4 import java.rmi.server.UnicastRemoteObject JavaDoc;
5
6 import SOFA.SOFAnode.Made.TIR.Container;
7 import SOFA.SOFAnode.Made.TIR.DefinitionKind;
8 import SOFA.SOFAnode.Made.TIR.ExprOperDef;
9 import SOFA.SOFAnode.Made.TIR.Repository;
10 import SOFA.SOFAnode.Made.TIR.StateKind;
11 import SOFA.SOFAnode.Made.TIR.TIRExceptCommit;
12 import SOFA.SOFAnode.Made.TIR.WstringDef;
13
14 public class WstringDefImpl extends UnicastRemoteObject JavaDoc implements WstringDef, TIRImplObject {
15   ExprOperDef bd;
16   DefinitionKindImpl defKindImpl;
17   StateKindImpl stKindImpl;
18
19   public WstringDefImpl(ExprOperDef bound) throws RemoteException JavaDoc {
20     bd = bound;
21     defKindImpl = new DefinitionKindImpl(DefinitionKind.dk_Wstring);
22     stKindImpl = new StateKindImpl(StateKind.sk_work);
23   }
24
25   public WstringDefImpl() throws RemoteException JavaDoc {
26     bd = null;
27     defKindImpl = new DefinitionKindImpl(DefinitionKind.dk_Wstring);
28     stKindImpl = new StateKindImpl(StateKind.sk_normal);
29   }
30
31   public ExprOperDef bound() throws RemoteException JavaDoc {
32     return bd;
33   }
34
35   /* from interface TIRObject */
36   public DefinitionKind get_def_kind() throws RemoteException JavaDoc {
37     return (DefinitionKind) defKindImpl;
38   }
39
40   /* from interface TIRObject */
41   public StateKind get_state() throws RemoteException JavaDoc {
42     return (StateKind) stKindImpl;
43   }
44
45   public void load(Storage st) throws RemoteException JavaDoc, TIRExceptStorage {
46     ;
47   }
48
49   public void save(Storage st) throws RemoteException JavaDoc, TIRExceptStorage {
50     ;
51   }
52
53   public void postLoad(RepositoryImpl r) throws RemoteException JavaDoc, TIRExceptStorage {
54     ((TIRImplObject) bd).postLoad(r);
55   }
56
57   public boolean isNew() {
58     return (stKindImpl.value()==StateKind.sk_work);
59   }
60
61   public void canCommit() throws RemoteException JavaDoc, TIRExceptCommit {;}
62
63   public void doCommit(Container in, Repository rep) throws RemoteException JavaDoc {
64     if (stKindImpl.value()==StateKind.sk_normal)
65       return;
66     if (isNew()) {
67       stKindImpl.toNormal();
68       ((TIRImplObject)bd).doCommit(in,rep);
69     }
70   }
71
72   public void doAbort(long workId) throws RemoteException JavaDoc {}
73 }
74
Popular Tags