1 26 27 package org.objectweb.openccm.ast.lib; 28 29 40 41 abstract public class ForwardScopeImpl 42 extends ScopeImpl 43 implements org.objectweb.openccm.ast.api.ForwardScope 44 { 45 51 52 private boolean forward_; 53 54 55 private boolean completed_; 56 57 63 69 protected 70 ForwardScopeImpl(Repository rep, 71 ScopeImpl parent) 72 { 73 super(rep, parent); 75 76 forward_ = false; 78 completed_ = false; 79 } 80 81 87 92 protected void 93 load(org.omg.CORBA.Contained contained) 94 { 95 completed_ = true; 96 super.load(contained); 97 } 98 99 104 protected void 105 loadAsMapping(org.omg.CORBA.Contained contained) 106 { 107 completed_ = true; 108 super.loadAsMapping(contained); 109 } 110 111 117 122 abstract public boolean 123 isForwardCreated(); 124 125 128 abstract public void 129 createForward(); 130 131 134 abstract public void 135 completeForward(); 136 137 143 149 152 public void 153 create() 154 { 155 if (!isForwardCreated()) 156 { 157 if (the_parent_!=null) 158 the_parent_.addDecl(this); 159 160 completed_ = false; 161 162 createForward(); 163 164 } 167 else 168 { 169 if(forward_) 170 return; 171 172 if(completed_) 173 { 174 throw new org.omg.CORBA.BAD_PARAM ( 175 org.objectweb.openccm.ir3.SystemExceptionMinorValues.NameAlreadyUsed, 176 org.omg.CORBA.CompletionStatus.COMPLETED_NO); 177 } 178 else 179 { 180 completeForward(); 181 completed_ = true; 182 } 183 } 184 } 185 186 192 198 203 public boolean 204 isForward() 205 { 206 return forward_; 207 } 208 209 215 public void 216 setForward(boolean f) 217 { 218 forward_ = f; 219 } 220 221 226 public boolean 227 isCompleted() 228 { 229 return completed_; 230 } 231 } 232 | Popular Tags |