1 26 27 package org.objectweb.ccm.IDL3; 28 29 37 38 public class ModuleDeclImpl 39 extends ForwardScopeImpl 40 implements ModuleDecl 41 { 42 48 51 private org.omg.CORBA.ComponentIR.ModuleDef component_module_def_; 52 53 56 private boolean completed_; 57 58 64 69 protected 70 ModuleDeclImpl(Repository rep, ScopeImpl parent) 71 { 72 super(rep, parent); 74 75 component_module_def_ = null; 77 the_declaration_kind_ = DeclarationKind._dk_module; 78 completed_ = false; 79 } 80 81 87 92 protected void 93 load(org.omg.CORBA.Contained contained) 94 { 95 component_module_def_ = org.omg.CORBA.ComponentIR.ModuleDefHelper.narrow(contained); 96 super.load(contained); 97 } 98 99 104 protected void 105 loadAsMapping(org.omg.CORBA.Contained contained) 106 { 107 component_module_def_ = org.omg.CORBA.ComponentIR.ModuleDefHelper.narrow(contained); 108 super.loadAsMapping(contained); 109 } 110 111 117 120 public void 121 create() 122 { 123 if (getContainer() == null) 124 { 125 createContainer(); 126 if (the_parent_!=null) 127 the_parent_.addDecl(this); 128 } 129 else if (!completed_) 130 completeContainer(); 131 } 132 133 140 public Declaration[] 141 getDependencies() 142 { 143 if (dependencies_!=null) 144 return dependencies_; 145 146 Declaration[] decls = getContents(true, org.objectweb.ccm.IDL3.DeclarationKind._dk_all); 147 Declaration[] depend = null; 148 org.objectweb.ccm.util.Vector module_depend = new org.objectweb.ccm.util.Vector(); 149 150 for (int i=0;i<decls.length;i++) 152 { 153 depend = decls[i].getDependencies(); 154 for (int j=0;j<depend.length;j++) 155 { 156 if ((!containsDecl(depend[j])) && 157 (module_depend.indexOf(depend[j])==-1)) 158 module_depend.add(depend[j]); 159 } 160 } 161 162 dependencies_ = (Declaration[])module_depend.toArray(new Declaration[0]); 163 return dependencies_; 164 } 165 166 172 177 protected org.omg.CORBA.Contained 178 getContained() 179 { 180 return component_module_def_; 181 } 182 183 189 192 protected void 193 createContainer() 194 { 195 if (component_module_def_==null) 197 { 198 component_module_def_ = 200 the_parent_.getComponentContainer().create_component_module(getId(), getName(), getVersion()); 201 } 202 } 203 204 207 protected void 208 completeContainer() 209 { 210 completed_ = true; 211 } 212 213 219 224 protected org.omg.CORBA.Container 225 getContainer() 226 { 227 return component_module_def_; 228 } 229 230 235 protected org.omg.CORBA.ComponentIR.Container 236 getComponentContainer() 237 { 238 return component_module_def_; 239 } 240 } 241 | Popular Tags |