1 26 27 package org.objectweb.openccm.packaging; 28 29 30 36 public class CCMIdRefsSingleton 37 { 38 44 45 private static CCMIdRefsSingleton instance = null; 46 47 48 private java.util.List assemblies_list ; 49 50 51 private java.util.List packages_list ; 52 53 59 62 public 63 CCMIdRefsSingleton() 64 { 65 assemblies_list = new java.util.LinkedList (); 67 packages_list = new java.util.LinkedList (); 68 } 69 70 76 81 public void 82 addAssembly(org.objectweb.openccm.descriptor.componentassembly.beans.ComponentassemblyBean ass) 83 { 84 this.assemblies_list.add(ass); 85 } 86 87 92 public void 93 addPackage(org.objectweb.openccm.descriptor.softpkg.beans.SoftpkgBean softpkg) 94 { 95 this.packages_list.add(softpkg); 96 } 97 98 103 public java.util.List 104 getComponentInstList() 105 { 106 java.util.List componentinst_list = new java.util.LinkedList (); 107 108 for (java.util.Iterator k = assemblies_list.iterator() ; k.hasNext() ; ) 109 { 110 org.objectweb.openccm.descriptor.componentassembly.beans.ComponentassemblyBean 112 assembly_instance 113 = (org.objectweb.openccm.descriptor.componentassembly.beans.ComponentassemblyBean) 114 k.next(); 115 116 117 java.util.List homeplacements 118 = new java.util.LinkedList (); 119 120 homeplacements.addAll( 121 assembly_instance.getPartitioning().getHomeplacementList() 122 ); 123 124 java.util.List processcollocations 125 = assembly_instance.getPartitioning().getProcesscollocationList(); 126 127 for (java.util.Iterator i = processcollocations.iterator() ; i.hasNext() ; ) 128 { 129 org.objectweb.openccm.descriptor.componentassembly.beans.ProcesscollocationBean 130 element 131 = (org.objectweb.openccm.descriptor.componentassembly.beans.ProcesscollocationBean) 132 i.next(); 133 134 homeplacements.addAll( 135 element.getHomeplacementList() 136 ); 137 } 138 139 java.util.List hostcollocations 140 = assembly_instance.getPartitioning().getHostcollocationList(); 141 142 for (java.util.Iterator i = hostcollocations.iterator() ; i.hasNext() ; ) 143 { 144 org.objectweb.openccm.descriptor.componentassembly.beans.HostcollocationBean 145 element 146 = (org.objectweb.openccm.descriptor.componentassembly.beans.HostcollocationBean) 147 i.next(); 148 149 processcollocations 150 = element.getProcesscollocationList(); 151 152 for (java.util.Iterator j = processcollocations.iterator() ; j.hasNext() ; ) 153 { 154 org.objectweb.openccm.descriptor.componentassembly.beans.ProcesscollocationBean 155 subelement 156 = (org.objectweb.openccm.descriptor.componentassembly.beans.ProcesscollocationBean) 157 j.next(); 158 159 homeplacements.addAll( 160 subelement.getHomeplacementList() 161 ); 162 } 163 164 homeplacements.addAll( 165 element.getHomeplacementList() 166 ); 167 } 168 169 for (java.util.Iterator i = homeplacements.iterator() ; i.hasNext() ; ) 170 { 171 org.objectweb.openccm.descriptor.componentassembly.beans.HomeplacementBean 172 element 173 = (org.objectweb.openccm.descriptor.componentassembly.beans.HomeplacementBean) 174 i.next(); 175 176 for ( 177 java.util.Iterator j = element.getComponentinstantiationList().iterator() 178 ; j.hasNext() 179 ; ) 180 { 181 org.objectweb.openccm.descriptor.componentassembly.beans.ComponentinstantiationBean 182 instance_element 183 = (org.objectweb.openccm.descriptor.componentassembly.beans.ComponentinstantiationBean) 184 j.next(); 185 186 componentinst_list.add( 187 instance_element.getId() 188 ); 189 } 190 } 191 } 192 193 return componentinst_list; 194 } 195 196 201 public java.util.List 202 getComponentImplList() 203 { 204 java.util.List componentimpl_list = new java.util.LinkedList (); 205 206 for (java.util.Iterator i = packages_list.iterator() ; i.hasNext() ; ) 207 { 208 org.objectweb.openccm.descriptor.softpkg.beans.SoftpkgBean 210 software_instance 211 = (org.objectweb.openccm.descriptor.softpkg.beans.SoftpkgBean) 212 i.next(); 213 214 java.util.List componentimplems 216 = software_instance.getImplementationList(); 217 218 for (java.util.Iterator j = componentimplems.iterator() ; j.hasNext() ; ) 220 { 221 org.objectweb.openccm.descriptor.softpkg.beans.ImplementationBean 222 element 223 = (org.objectweb.openccm.descriptor.softpkg.beans.ImplementationBean) 224 j.next(); 225 226 componentimpl_list.add(element.getId()); 228 } 229 } 230 231 return componentimpl_list; 232 } 233 234 239 public java.util.List 240 getComponentFilesList() 241 { 242 java.util.List componentfiles_list = new java.util.LinkedList (); 243 244 for (java.util.Iterator i = assemblies_list.iterator() ; i.hasNext() ; ) 245 { 246 org.objectweb.openccm.descriptor.componentassembly.beans.ComponentassemblyBean 248 assembly_instance 249 = (org.objectweb.openccm.descriptor.componentassembly.beans.ComponentassemblyBean) 250 i.next(); 251 252 java.util.List componentfiles 254 = assembly_instance.getComponentfiles().getComponentfileList(); 255 256 for (java.util.Iterator j = componentfiles.iterator() ; j.hasNext() ; ) 258 { 259 org.objectweb.openccm.descriptor.componentassembly.beans.ComponentfileBean 260 element 261 = (org.objectweb.openccm.descriptor.componentassembly.beans.ComponentfileBean) 262 j.next(); 263 264 componentfiles_list.add(element.getId()); 266 } 267 } 268 269 return componentfiles_list; 270 } 271 272 278 282 public static CCMIdRefsSingleton 283 getInstance() 284 { 285 if (instance == null) 286 { 287 instance = new CCMIdRefsSingleton(); 288 } 289 290 return instance; 291 } 292 } 293 | Popular Tags |