1 | /** |
2 | * <copyright> |
3 | * </copyright> |
4 | * |
5 | * $Id$ |
6 | */ |
7 | package de.uka.ipd.sdq.spa.resourcemodel.impl; |
8 | |
9 | import static de.uka.ipd.sdq.spa.resourcemodel.ResourceModelPackage.RESOURCE; |
10 | |
11 | import org.eclipse.emf.ecore.EAttribute; |
12 | import org.eclipse.emf.ecore.EClass; |
13 | import org.eclipse.emf.ecore.EPackage; |
14 | import org.eclipse.emf.ecore.EReference; |
15 | import org.eclipse.emf.ecore.impl.EPackageImpl; |
16 | |
17 | import de.uka.ipd.sdq.probfunction.ProbfunctionPackage; |
18 | import de.uka.ipd.sdq.spa.resourcemodel.AbstractResourceUsage; |
19 | import de.uka.ipd.sdq.spa.resourcemodel.ActiveResource; |
20 | import de.uka.ipd.sdq.spa.resourcemodel.AlternativeResourceUsage; |
21 | import de.uka.ipd.sdq.spa.resourcemodel.ContentionResource; |
22 | import de.uka.ipd.sdq.spa.resourcemodel.DelayResource; |
23 | import de.uka.ipd.sdq.spa.resourcemodel.Option; |
24 | import de.uka.ipd.sdq.spa.resourcemodel.PassiveResource; |
25 | import de.uka.ipd.sdq.spa.resourcemodel.ProcessingResource; |
26 | import de.uka.ipd.sdq.spa.resourcemodel.Resource; |
27 | import de.uka.ipd.sdq.spa.resourcemodel.ResourceModelFactory; |
28 | import de.uka.ipd.sdq.spa.resourcemodel.ResourceModelPackage; |
29 | import de.uka.ipd.sdq.spa.resourcemodel.ResourceUsage; |
30 | import de.uka.ipd.sdq.spa.resourcemodel.SequentialResourceUsage; |
31 | |
32 | /** |
33 | * <!-- begin-user-doc --> |
34 | * An implementation of the model <b>Package</b>. |
35 | * <!-- end-user-doc --> |
36 | * @generated |
37 | */ |
38 | public class ResourceModelPackageImpl extends EPackageImpl implements ResourceModelPackage { |
39 | /** |
40 | * <!-- begin-user-doc --> |
41 | * <!-- end-user-doc --> |
42 | * @generated |
43 | */ |
44 | private EClass sequentialResourceUsageEClass = null; |
45 | |
46 | /** |
47 | * <!-- begin-user-doc --> |
48 | * <!-- end-user-doc --> |
49 | * @generated |
50 | */ |
51 | private EClass abstractResourceUsageEClass = null; |
52 | |
53 | /** |
54 | * <!-- begin-user-doc --> |
55 | * <!-- end-user-doc --> |
56 | * @generated |
57 | */ |
58 | private EClass resourceEClass = null; |
59 | |
60 | /** |
61 | * <!-- begin-user-doc --> |
62 | * <!-- end-user-doc --> |
63 | * @generated |
64 | */ |
65 | private EClass alternativeResourceUsageEClass = null; |
66 | |
67 | /** |
68 | * <!-- begin-user-doc --> |
69 | * <!-- end-user-doc --> |
70 | * @generated |
71 | */ |
72 | private EClass resourceUsageEClass = null; |
73 | |
74 | /** |
75 | * <!-- begin-user-doc --> |
76 | * <!-- end-user-doc --> |
77 | * @generated |
78 | */ |
79 | private EClass passiveResourceEClass = null; |
80 | |
81 | /** |
82 | * <!-- begin-user-doc --> |
83 | * <!-- end-user-doc --> |
84 | * @generated |
85 | */ |
86 | private EClass contentionResourceEClass = null; |
87 | |
88 | /** |
89 | * <!-- begin-user-doc --> |
90 | * <!-- end-user-doc --> |
91 | * @generated |
92 | */ |
93 | private EClass processingResourceEClass = null; |
94 | |
95 | /** |
96 | * <!-- begin-user-doc --> |
97 | * <!-- end-user-doc --> |
98 | * @generated |
99 | */ |
100 | private EClass activeResourceEClass = null; |
101 | |
102 | /** |
103 | * <!-- begin-user-doc --> |
104 | * <!-- end-user-doc --> |
105 | * @generated |
106 | */ |
107 | private EClass delayResourceEClass = null; |
108 | |
109 | /** |
110 | * <!-- begin-user-doc --> |
111 | * <!-- end-user-doc --> |
112 | * @generated |
113 | */ |
114 | private EClass optionEClass = null; |
115 | |
116 | /** |
117 | * Creates an instance of the model <b>Package</b>, registered with |
118 | * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package |
119 | * package URI value. |
120 | * <p>Note: the correct way to create the package is via the static |
121 | * factory method {@link #init init()}, which also performs |
122 | * initialization of the package, or returns the registered package, |
123 | * if one already exists. |
124 | * <!-- begin-user-doc --> |
125 | * <!-- end-user-doc --> |
126 | * @see org.eclipse.emf.ecore.EPackage.Registry |
127 | * @see de.uka.ipd.sdq.spa.resourcemodel.ResourceModelPackage#eNS_URI |
128 | * @see #init() |
129 | * @generated |
130 | */ |
131 | private ResourceModelPackageImpl() { |
132 | super(eNS_URI, ResourceModelFactory.eINSTANCE); |
133 | } |
134 | |
135 | /** |
136 | * <!-- begin-user-doc --> |
137 | * <!-- end-user-doc --> |
138 | * @generated |
139 | */ |
140 | private static boolean isInited = false; |
141 | |
142 | /** |
143 | * Creates, registers, and initializes the <b>Package</b> for this |
144 | * model, and for any others upon which it depends. Simple |
145 | * dependencies are satisfied by calling this method on all |
146 | * dependent packages before doing anything else. This method drives |
147 | * initialization for interdependent packages directly, in parallel |
148 | * with this package, itself. |
149 | * <p>Of this package and its interdependencies, all packages which |
150 | * have not yet been registered by their URI values are first created |
151 | * and registered. The packages are then initialized in two steps: |
152 | * meta-model objects for all of the packages are created before any |
153 | * are initialized, since one package's meta-model objects may refer to |
154 | * those of another. |
155 | * <p>Invocation of this method will not affect any packages that have |
156 | * already been initialized. |
157 | * <!-- begin-user-doc --> |
158 | * <!-- end-user-doc --> |
159 | * @see #eNS_URI |
160 | * @see #createPackageContents() |
161 | * @see #initializePackageContents() |
162 | * @generated |
163 | */ |
164 | public static ResourceModelPackage init() { |
165 | if (isInited) return (ResourceModelPackage)EPackage.Registry.INSTANCE.getEPackage(ResourceModelPackage.eNS_URI); |
166 | |
167 | // Obtain or create and register package |
168 | ResourceModelPackageImpl theResourceModelPackage = (ResourceModelPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof ResourceModelPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new ResourceModelPackageImpl()); |
169 | |
170 | isInited = true; |
171 | |
172 | // Initialize simple dependencies |
173 | ProbfunctionPackage.eINSTANCE.eClass(); |
174 | |
175 | // Create package meta-data objects |
176 | theResourceModelPackage.createPackageContents(); |
177 | |
178 | // Initialize created meta-data |
179 | theResourceModelPackage.initializePackageContents(); |
180 | |
181 | // Mark meta-data to indicate it can't be changed |
182 | theResourceModelPackage.freeze(); |
183 | |
184 | return theResourceModelPackage; |
185 | } |
186 | |
187 | /** |
188 | * <!-- begin-user-doc --> |
189 | * <!-- end-user-doc --> |
190 | * @generated |
191 | */ |
192 | public EClass getSequentialResourceUsage() { |
193 | return sequentialResourceUsageEClass; |
194 | } |
195 | |
196 | /** |
197 | * <!-- begin-user-doc --> |
198 | * <!-- end-user-doc --> |
199 | * @generated |
200 | */ |
201 | public EReference getSequentialResourceUsage_ResourceUsages() { |
202 | return (EReference)sequentialResourceUsageEClass.getEStructuralFeatures().get(0); |
203 | } |
204 | |
205 | /** |
206 | * <!-- begin-user-doc --> |
207 | * <!-- end-user-doc --> |
208 | * @generated |
209 | */ |
210 | public EClass getAbstractResourceUsage() { |
211 | return abstractResourceUsageEClass; |
212 | } |
213 | |
214 | /** |
215 | * <!-- begin-user-doc --> |
216 | * <!-- end-user-doc --> |
217 | * @generated |
218 | */ |
219 | public EClass getResource() { |
220 | return resourceEClass; |
221 | } |
222 | |
223 | /** |
224 | * <!-- begin-user-doc --> |
225 | * <!-- end-user-doc --> |
226 | * @generated |
227 | */ |
228 | public EAttribute getResource_Name() { |
229 | return (EAttribute)resourceEClass.getEStructuralFeatures().get(0); |
230 | } |
231 | |
232 | /** |
233 | * <!-- begin-user-doc --> |
234 | * <!-- end-user-doc --> |
235 | * @generated |
236 | */ |
237 | public EAttribute getResource_NumberOfServers() { |
238 | return (EAttribute)resourceEClass.getEStructuralFeatures().get(1); |
239 | } |
240 | |
241 | /** |
242 | * <!-- begin-user-doc --> |
243 | * <!-- end-user-doc --> |
244 | * @generated |
245 | */ |
246 | public EClass getAlternativeResourceUsage() { |
247 | return alternativeResourceUsageEClass; |
248 | } |
249 | |
250 | /** |
251 | * <!-- begin-user-doc --> |
252 | * <!-- end-user-doc --> |
253 | * @generated |
254 | */ |
255 | public EReference getAlternativeResourceUsage_Options() { |
256 | return (EReference)alternativeResourceUsageEClass.getEStructuralFeatures().get(0); |
257 | } |
258 | |
259 | /** |
260 | * <!-- begin-user-doc --> |
261 | * <!-- end-user-doc --> |
262 | * @generated |
263 | */ |
264 | public EClass getResourceUsage() { |
265 | return resourceUsageEClass; |
266 | } |
267 | |
268 | /** |
269 | * <!-- begin-user-doc --> |
270 | * <!-- end-user-doc --> |
271 | * @generated |
272 | */ |
273 | public EReference getResourceUsage_UsageTime() { |
274 | return (EReference)resourceUsageEClass.getEStructuralFeatures().get(0); |
275 | } |
276 | |
277 | /** |
278 | * <!-- begin-user-doc --> |
279 | * <!-- end-user-doc --> |
280 | * @generated |
281 | */ |
282 | public EReference getResourceUsage_Resource() { |
283 | return (EReference)resourceUsageEClass.getEStructuralFeatures().get(1); |
284 | } |
285 | |
286 | /** |
287 | * <!-- begin-user-doc --> |
288 | * <!-- end-user-doc --> |
289 | * @generated |
290 | */ |
291 | public EClass getPassiveResource() { |
292 | return passiveResourceEClass; |
293 | } |
294 | |
295 | /** |
296 | * <!-- begin-user-doc --> |
297 | * <!-- end-user-doc --> |
298 | * @generated |
299 | */ |
300 | public EClass getContentionResource() { |
301 | return contentionResourceEClass; |
302 | } |
303 | |
304 | /** |
305 | * <!-- begin-user-doc --> |
306 | * <!-- end-user-doc --> |
307 | * @generated |
308 | */ |
309 | public EAttribute getContentionResource_NumReplicas() { |
310 | return (EAttribute)contentionResourceEClass.getEStructuralFeatures().get(0); |
311 | } |
312 | |
313 | /** |
314 | * <!-- begin-user-doc --> |
315 | * <!-- end-user-doc --> |
316 | * @generated |
317 | */ |
318 | public EClass getProcessingResource() { |
319 | return processingResourceEClass; |
320 | } |
321 | |
322 | /** |
323 | * <!-- begin-user-doc --> |
324 | * <!-- end-user-doc --> |
325 | * @generated |
326 | */ |
327 | public EClass getActiveResource() { |
328 | return activeResourceEClass; |
329 | } |
330 | |
331 | /** |
332 | * <!-- begin-user-doc --> |
333 | * <!-- end-user-doc --> |
334 | * @generated |
335 | */ |
336 | public EClass getDelayResource() { |
337 | return delayResourceEClass; |
338 | } |
339 | |
340 | /** |
341 | * <!-- begin-user-doc --> |
342 | * <!-- end-user-doc --> |
343 | * @generated |
344 | */ |
345 | public EClass getOption() { |
346 | return optionEClass; |
347 | } |
348 | |
349 | /** |
350 | * <!-- begin-user-doc --> |
351 | * <!-- end-user-doc --> |
352 | * @generated |
353 | */ |
354 | public EAttribute getOption_Probability() { |
355 | return (EAttribute)optionEClass.getEStructuralFeatures().get(0); |
356 | } |
357 | |
358 | /** |
359 | * <!-- begin-user-doc --> |
360 | * <!-- end-user-doc --> |
361 | * @generated |
362 | */ |
363 | public EReference getOption_ResourceUsage() { |
364 | return (EReference)optionEClass.getEStructuralFeatures().get(1); |
365 | } |
366 | |
367 | /** |
368 | * <!-- begin-user-doc --> |
369 | * <!-- end-user-doc --> |
370 | * @generated |
371 | */ |
372 | public ResourceModelFactory getResourceModelFactory() { |
373 | return (ResourceModelFactory)getEFactoryInstance(); |
374 | } |
375 | |
376 | /** |
377 | * <!-- begin-user-doc --> |
378 | * <!-- end-user-doc --> |
379 | * @generated |
380 | */ |
381 | private boolean isCreated = false; |
382 | |
383 | /** |
384 | * Creates the meta-model objects for the package. This method is |
385 | * guarded to have no affect on any invocation but its first. |
386 | * <!-- begin-user-doc --> |
387 | * <!-- end-user-doc --> |
388 | * @generated |
389 | */ |
390 | public void createPackageContents() { |
391 | if (isCreated) return; |
392 | isCreated = true; |
393 | |
394 | // Create classes and their features |
395 | sequentialResourceUsageEClass = createEClass(SEQUENTIAL_RESOURCE_USAGE); |
396 | createEReference(sequentialResourceUsageEClass, SEQUENTIAL_RESOURCE_USAGE__RESOURCE_USAGES); |
397 | |
398 | abstractResourceUsageEClass = createEClass(ABSTRACT_RESOURCE_USAGE); |
399 | |
400 | resourceEClass = createEClass(RESOURCE); |
401 | createEAttribute(resourceEClass, RESOURCE__NAME); |
402 | createEAttribute(resourceEClass, RESOURCE__NUMBER_OF_SERVERS); |
403 | |
404 | alternativeResourceUsageEClass = createEClass(ALTERNATIVE_RESOURCE_USAGE); |
405 | createEReference(alternativeResourceUsageEClass, ALTERNATIVE_RESOURCE_USAGE__OPTIONS); |
406 | |
407 | resourceUsageEClass = createEClass(RESOURCE_USAGE); |
408 | createEReference(resourceUsageEClass, RESOURCE_USAGE__USAGE_TIME); |
409 | createEReference(resourceUsageEClass, RESOURCE_USAGE__RESOURCE); |
410 | |
411 | passiveResourceEClass = createEClass(PASSIVE_RESOURCE); |
412 | |
413 | contentionResourceEClass = createEClass(CONTENTION_RESOURCE); |
414 | createEAttribute(contentionResourceEClass, CONTENTION_RESOURCE__NUM_REPLICAS); |
415 | |
416 | processingResourceEClass = createEClass(PROCESSING_RESOURCE); |
417 | |
418 | activeResourceEClass = createEClass(ACTIVE_RESOURCE); |
419 | |
420 | delayResourceEClass = createEClass(DELAY_RESOURCE); |
421 | |
422 | optionEClass = createEClass(OPTION); |
423 | createEAttribute(optionEClass, OPTION__PROBABILITY); |
424 | createEReference(optionEClass, OPTION__RESOURCE_USAGE); |
425 | } |
426 | |
427 | /** |
428 | * <!-- begin-user-doc --> |
429 | * <!-- end-user-doc --> |
430 | * @generated |
431 | */ |
432 | private boolean isInitialized = false; |
433 | |
434 | /** |
435 | * Complete the initialization of the package and its meta-model. This |
436 | * method is guarded to have no affect on any invocation but its first. |
437 | * <!-- begin-user-doc --> |
438 | * <!-- end-user-doc --> |
439 | * @generated |
440 | */ |
441 | public void initializePackageContents() { |
442 | if (isInitialized) return; |
443 | isInitialized = true; |
444 | |
445 | // Initialize package |
446 | setName(eNAME); |
447 | setNsPrefix(eNS_PREFIX); |
448 | setNsURI(eNS_URI); |
449 | |
450 | // Obtain other dependent packages |
451 | ProbfunctionPackage theProbfunctionPackage = (ProbfunctionPackage)EPackage.Registry.INSTANCE.getEPackage(ProbfunctionPackage.eNS_URI); |
452 | |
453 | // Add supertypes to classes |
454 | sequentialResourceUsageEClass.getESuperTypes().add(this.getAbstractResourceUsage()); |
455 | alternativeResourceUsageEClass.getESuperTypes().add(this.getAbstractResourceUsage()); |
456 | resourceUsageEClass.getESuperTypes().add(this.getAbstractResourceUsage()); |
457 | passiveResourceEClass.getESuperTypes().add(this.getContentionResource()); |
458 | contentionResourceEClass.getESuperTypes().add(this.getResource()); |
459 | processingResourceEClass.getESuperTypes().add(this.getContentionResource()); |
460 | processingResourceEClass.getESuperTypes().add(this.getActiveResource()); |
461 | activeResourceEClass.getESuperTypes().add(this.getResource()); |
462 | delayResourceEClass.getESuperTypes().add(this.getActiveResource()); |
463 | |
464 | // Initialize classes and features; add operations and parameters |
465 | initEClass(sequentialResourceUsageEClass, SequentialResourceUsage.class, "SequentialResourceUsage", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); |
466 | initEReference(getSequentialResourceUsage_ResourceUsages(), this.getAbstractResourceUsage(), null, "resourceUsages", null, 0, -1, SequentialResourceUsage.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
467 | |
468 | initEClass(abstractResourceUsageEClass, AbstractResourceUsage.class, "AbstractResourceUsage", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); |
469 | |
470 | initEClass(resourceEClass, Resource.class, "Resource", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); |
471 | initEAttribute(getResource_Name(), ecorePackage.getEString(), "name", "", 1, 1, Resource.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
472 | initEAttribute(getResource_NumberOfServers(), ecorePackage.getEInt(), "numberOfServers", null, 1, 1, Resource.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
473 | |
474 | initEClass(alternativeResourceUsageEClass, AlternativeResourceUsage.class, "AlternativeResourceUsage", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); |
475 | initEReference(getAlternativeResourceUsage_Options(), this.getOption(), null, "options", null, 0, -1, AlternativeResourceUsage.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
476 | |
477 | initEClass(resourceUsageEClass, ResourceUsage.class, "ResourceUsage", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); |
478 | initEReference(getResourceUsage_UsageTime(), theProbfunctionPackage.getProbabilityDensityFunction(), null, "usageTime", null, 1, 1, ResourceUsage.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
479 | initEReference(getResourceUsage_Resource(), this.getActiveResource(), null, "resource", null, 1, 1, ResourceUsage.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
480 | |
481 | initEClass(passiveResourceEClass, PassiveResource.class, "PassiveResource", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); |
482 | |
483 | initEClass(contentionResourceEClass, ContentionResource.class, "ContentionResource", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); |
484 | initEAttribute(getContentionResource_NumReplicas(), ecorePackage.getEInt(), "numReplicas", null, 1, 1, ContentionResource.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
485 | |
486 | initEClass(processingResourceEClass, ProcessingResource.class, "ProcessingResource", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); |
487 | |
488 | initEClass(activeResourceEClass, ActiveResource.class, "ActiveResource", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); |
489 | |
490 | initEClass(delayResourceEClass, DelayResource.class, "DelayResource", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); |
491 | |
492 | initEClass(optionEClass, Option.class, "Option", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); |
493 | initEAttribute(getOption_Probability(), ecorePackage.getEDouble(), "probability", null, 1, 1, Option.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
494 | initEReference(getOption_ResourceUsage(), this.getAbstractResourceUsage(), null, "resourceUsage", null, 1, 1, Option.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
495 | |
496 | // Create resource |
497 | createResource(eNS_URI); |
498 | } |
499 | |
500 | } //ResourceModelPackageImpl |