1 2 package SOFA.SOFAnode.Made.TIR.Impl; 3 import java.rmi.RemoteException ; 4 import java.rmi.server.UnicastRemoteObject ; 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 implements WstringDef, TIRImplObject { 15 ExprOperDef bd; 16 DefinitionKindImpl defKindImpl; 17 StateKindImpl stKindImpl; 18 19 public WstringDefImpl(ExprOperDef bound) throws RemoteException { 20 bd = bound; 21 defKindImpl = new DefinitionKindImpl(DefinitionKind.dk_Wstring); 22 stKindImpl = new StateKindImpl(StateKind.sk_work); 23 } 24 25 public WstringDefImpl() throws RemoteException { 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 { 32 return bd; 33 } 34 35 36 public DefinitionKind get_def_kind() throws RemoteException { 37 return (DefinitionKind) defKindImpl; 38 } 39 40 41 public StateKind get_state() throws RemoteException { 42 return (StateKind) stKindImpl; 43 } 44 45 public void load(Storage st) throws RemoteException , TIRExceptStorage { 46 ; 47 } 48 49 public void save(Storage st) throws RemoteException , TIRExceptStorage { 50 ; 51 } 52 53 public void postLoad(RepositoryImpl r) throws RemoteException , 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 , TIRExceptCommit {;} 62 63 public void doCommit(Container in, Repository rep) throws RemoteException { 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 {} 73 } 74 | Popular Tags |