1 26 27 package org.objectweb.ccm.IDL3; 28 29 37 38 abstract public class ForwardScopeImpl 39 extends ScopeImpl 40 implements ForwardScope 41 { 42 48 51 private boolean forward_; 52 53 56 private boolean completed_; 57 58 64 69 protected 70 ForwardScopeImpl(Repository rep, ScopeImpl parent) 71 { 72 super(rep, parent); 74 75 forward_ = false; 77 completed_ = false; 78 } 79 80 86 89 abstract protected void 90 createContainer(); 91 92 95 abstract protected void 96 completeContainer(); 97 98 104 107 public void 108 create() 109 { 110 if (getContainer() == null) 111 { 112 createContainer(); 113 if (the_parent_!=null) 114 the_parent_.addDecl(this); 115 116 completed_ = !forward_; 117 } 118 else 119 { 120 if(forward_) 121 return; 122 123 if(completed_) 124 { 125 throw new org.omg.CORBA.BAD_PARAM ( 126 org.objectweb.openccm.ir3.SystemExceptionMinorValues.NameAlreadyUsed, 127 org.omg.CORBA.CompletionStatus.COMPLETED_NO); 128 } 129 else 130 { 131 completeContainer(); 132 completed_ = true; 133 134 getContained().move(the_parent_.getContainer(), getName(), getVersion()); 136 } 137 } 138 } 139 140 146 151 public boolean 152 isForward() 153 { 154 return forward_; 155 } 156 157 163 public void 164 setForward(boolean f) 165 { 166 forward_ = f; 167 } 168 169 174 public boolean 175 isCompleted() 176 { 177 return completed_; 178 } 179 } 180 | Popular Tags |