1 | /** |
2 | * <copyright> |
3 | * </copyright> |
4 | * |
5 | * $Id$ |
6 | */ |
7 | package scheduler.configuration.impl; |
8 | |
9 | import org.eclipse.emf.ecore.EClass; |
10 | import org.eclipse.emf.ecore.EDataType; |
11 | import org.eclipse.emf.ecore.EObject; |
12 | import org.eclipse.emf.ecore.EPackage; |
13 | |
14 | import org.eclipse.emf.ecore.impl.EFactoryImpl; |
15 | |
16 | import org.eclipse.emf.ecore.plugin.EcorePlugin; |
17 | |
18 | import scheduler.configuration.*; |
19 | |
20 | /** |
21 | * <!-- begin-user-doc --> |
22 | * An implementation of the model <b>Factory</b>. |
23 | * <!-- end-user-doc --> |
24 | * @generated |
25 | */ |
26 | public class ConfigurationFactoryImpl extends EFactoryImpl implements ConfigurationFactory { |
27 | /** |
28 | * Creates the default factory implementation. |
29 | * <!-- begin-user-doc --> |
30 | * <!-- end-user-doc --> |
31 | * @generated |
32 | */ |
33 | public static ConfigurationFactory init() { |
34 | try { |
35 | ConfigurationFactory theConfigurationFactory = (ConfigurationFactory)EPackage.Registry.INSTANCE.getEFactory("http://sdq.ipd.uka.de/scheduler/configuration/1.0"); |
36 | if (theConfigurationFactory != null) { |
37 | return theConfigurationFactory; |
38 | } |
39 | } |
40 | catch (Exception exception) { |
41 | EcorePlugin.INSTANCE.log(exception); |
42 | } |
43 | return new ConfigurationFactoryImpl(); |
44 | } |
45 | |
46 | /** |
47 | * Creates an instance of the factory. |
48 | * <!-- begin-user-doc --> |
49 | * <!-- end-user-doc --> |
50 | * @generated |
51 | */ |
52 | public ConfigurationFactoryImpl() { |
53 | super(); |
54 | } |
55 | |
56 | /** |
57 | * <!-- begin-user-doc --> |
58 | * <!-- end-user-doc --> |
59 | * @generated |
60 | */ |
61 | @Override |
62 | public EObject create(EClass eClass) { |
63 | switch (eClass.getClassifierID()) { |
64 | case ConfigurationPackage.DYNAMIC_PRIORITY_BOOST_CONFIGURATIOIN: return createDynamicPriorityBoostConfiguratioin(); |
65 | case ConfigurationPackage.LOAD_BALANCING: return createLoadBalancing(); |
66 | case ConfigurationPackage.MULTIPLE_QUEUE_CONFIGURATION: return createMultipleQueueConfiguration(); |
67 | case ConfigurationPackage.QUANTUM_TIME_SLICE_CONFIGURATION: return createQuantumTimeSliceConfiguration(); |
68 | case ConfigurationPackage.PREEMPTION_CONFIGURATION: return createPreemptionConfiguration(); |
69 | case ConfigurationPackage.PRIORITY_CONFIGURATION: return createPriorityConfiguration(); |
70 | case ConfigurationPackage.PRIORITY_RANGE: return createPriorityRange(); |
71 | case ConfigurationPackage.PRIORITY_DEPENDENT_TIME_SLICE_CONFIGURATION: return createPriorityDependentTimeSliceConfiguration(); |
72 | case ConfigurationPackage.ACTIVE_RESOURCE_CONFIGURATION: return createActiveResourceConfiguration(); |
73 | case ConfigurationPackage.PASSIVE_RESOURCE_CONFIGURATION: return createPassiveResourceConfiguration(); |
74 | case ConfigurationPackage.STATIC_PRIORITY_BOOST: return createStaticPriorityBoost(); |
75 | case ConfigurationPackage.PROCESS_CONFIGURATION: return createProcessConfiguration(); |
76 | case ConfigurationPackage.SINGLE_QUEUE_CONFIGURATION: return createSingleQueueConfiguration(); |
77 | case ConfigurationPackage.STATIC_PRIORITY_BOOST_CONFIGURATION: return createStaticPriorityBoostConfiguration(); |
78 | case ConfigurationPackage.SCHEDULER_CONFIGURATION: return createSchedulerConfiguration(); |
79 | case ConfigurationPackage.STARVATION_BOOST: return createStarvationBoost(); |
80 | default: |
81 | throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); |
82 | } |
83 | } |
84 | |
85 | /** |
86 | * <!-- begin-user-doc --> |
87 | * <!-- end-user-doc --> |
88 | * @generated |
89 | */ |
90 | @Override |
91 | public Object createFromString(EDataType eDataType, String initialValue) { |
92 | switch (eDataType.getClassifierID()) { |
93 | case ConfigurationPackage.INSTANCE_TO_BALANCE: |
94 | return createInstanceToBalanceFromString(eDataType, initialValue); |
95 | case ConfigurationPackage.LOAD_BALANCING_TYPE: |
96 | return createLoadBalancingTypeFromString(eDataType, initialValue); |
97 | case ConfigurationPackage.PREFERRED_WAITING_TIME: |
98 | return createPreferredWaitingTimeFromString(eDataType, initialValue); |
99 | case ConfigurationPackage.PREFERRED_PRIORITY: |
100 | return createPreferredPriorityFromString(eDataType, initialValue); |
101 | case ConfigurationPackage.RESOURCE_INSTANCE_SELECTION: |
102 | return createResourceInstanceSelectionFromString(eDataType, initialValue); |
103 | case ConfigurationPackage.RUN_QUEUE_TYPE: |
104 | return createRunQueueTypeFromString(eDataType, initialValue); |
105 | case ConfigurationPackage.PRIORITY_CLASS: |
106 | return createPriorityClassFromString(eDataType, initialValue); |
107 | case ConfigurationPackage.PRIORITY_DEGRADATION: |
108 | return createPriorityDegradationFromString(eDataType, initialValue); |
109 | case ConfigurationPackage.PROCESS_SELECTION: |
110 | return createProcessSelectionFromString(eDataType, initialValue); |
111 | case ConfigurationPackage.PASSIVE_RESOURCE_TYPE: |
112 | return createPassiveResourceTypeFromString(eDataType, initialValue); |
113 | default: |
114 | throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); |
115 | } |
116 | } |
117 | |
118 | /** |
119 | * <!-- begin-user-doc --> |
120 | * <!-- end-user-doc --> |
121 | * @generated |
122 | */ |
123 | @Override |
124 | public String convertToString(EDataType eDataType, Object instanceValue) { |
125 | switch (eDataType.getClassifierID()) { |
126 | case ConfigurationPackage.INSTANCE_TO_BALANCE: |
127 | return convertInstanceToBalanceToString(eDataType, instanceValue); |
128 | case ConfigurationPackage.LOAD_BALANCING_TYPE: |
129 | return convertLoadBalancingTypeToString(eDataType, instanceValue); |
130 | case ConfigurationPackage.PREFERRED_WAITING_TIME: |
131 | return convertPreferredWaitingTimeToString(eDataType, instanceValue); |
132 | case ConfigurationPackage.PREFERRED_PRIORITY: |
133 | return convertPreferredPriorityToString(eDataType, instanceValue); |
134 | case ConfigurationPackage.RESOURCE_INSTANCE_SELECTION: |
135 | return convertResourceInstanceSelectionToString(eDataType, instanceValue); |
136 | case ConfigurationPackage.RUN_QUEUE_TYPE: |
137 | return convertRunQueueTypeToString(eDataType, instanceValue); |
138 | case ConfigurationPackage.PRIORITY_CLASS: |
139 | return convertPriorityClassToString(eDataType, instanceValue); |
140 | case ConfigurationPackage.PRIORITY_DEGRADATION: |
141 | return convertPriorityDegradationToString(eDataType, instanceValue); |
142 | case ConfigurationPackage.PROCESS_SELECTION: |
143 | return convertProcessSelectionToString(eDataType, instanceValue); |
144 | case ConfigurationPackage.PASSIVE_RESOURCE_TYPE: |
145 | return convertPassiveResourceTypeToString(eDataType, instanceValue); |
146 | default: |
147 | throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); |
148 | } |
149 | } |
150 | |
151 | /** |
152 | * <!-- begin-user-doc --> |
153 | * <!-- end-user-doc --> |
154 | * @generated |
155 | */ |
156 | public DynamicPriorityBoostConfiguratioin createDynamicPriorityBoostConfiguratioin() { |
157 | DynamicPriorityBoostConfiguratioinImpl dynamicPriorityBoostConfiguratioin = new DynamicPriorityBoostConfiguratioinImpl(); |
158 | return dynamicPriorityBoostConfiguratioin; |
159 | } |
160 | |
161 | /** |
162 | * <!-- begin-user-doc --> |
163 | * <!-- end-user-doc --> |
164 | * @generated |
165 | */ |
166 | public LoadBalancing createLoadBalancing() { |
167 | LoadBalancingImpl loadBalancing = new LoadBalancingImpl(); |
168 | return loadBalancing; |
169 | } |
170 | |
171 | /** |
172 | * <!-- begin-user-doc --> |
173 | * <!-- end-user-doc --> |
174 | * @generated |
175 | */ |
176 | public MultipleQueueConfiguration createMultipleQueueConfiguration() { |
177 | MultipleQueueConfigurationImpl multipleQueueConfiguration = new MultipleQueueConfigurationImpl(); |
178 | return multipleQueueConfiguration; |
179 | } |
180 | |
181 | /** |
182 | * <!-- begin-user-doc --> |
183 | * <!-- end-user-doc --> |
184 | * @generated |
185 | */ |
186 | public QuantumTimeSliceConfiguration createQuantumTimeSliceConfiguration() { |
187 | QuantumTimeSliceConfigurationImpl quantumTimeSliceConfiguration = new QuantumTimeSliceConfigurationImpl(); |
188 | return quantumTimeSliceConfiguration; |
189 | } |
190 | |
191 | /** |
192 | * <!-- begin-user-doc --> |
193 | * <!-- end-user-doc --> |
194 | * @generated |
195 | */ |
196 | public PreemptionConfiguration createPreemptionConfiguration() { |
197 | PreemptionConfigurationImpl preemptionConfiguration = new PreemptionConfigurationImpl(); |
198 | return preemptionConfiguration; |
199 | } |
200 | |
201 | /** |
202 | * <!-- begin-user-doc --> |
203 | * <!-- end-user-doc --> |
204 | * @generated |
205 | */ |
206 | public PriorityConfiguration createPriorityConfiguration() { |
207 | PriorityConfigurationImpl priorityConfiguration = new PriorityConfigurationImpl(); |
208 | return priorityConfiguration; |
209 | } |
210 | |
211 | /** |
212 | * <!-- begin-user-doc --> |
213 | * <!-- end-user-doc --> |
214 | * @generated |
215 | */ |
216 | public PriorityRange createPriorityRange() { |
217 | PriorityRangeImpl priorityRange = new PriorityRangeImpl(); |
218 | return priorityRange; |
219 | } |
220 | |
221 | /** |
222 | * <!-- begin-user-doc --> |
223 | * <!-- end-user-doc --> |
224 | * @generated |
225 | */ |
226 | public PriorityDependentTimeSliceConfiguration createPriorityDependentTimeSliceConfiguration() { |
227 | PriorityDependentTimeSliceConfigurationImpl priorityDependentTimeSliceConfiguration = new PriorityDependentTimeSliceConfigurationImpl(); |
228 | return priorityDependentTimeSliceConfiguration; |
229 | } |
230 | |
231 | /** |
232 | * <!-- begin-user-doc --> |
233 | * <!-- end-user-doc --> |
234 | * @generated |
235 | */ |
236 | public ActiveResourceConfiguration createActiveResourceConfiguration() { |
237 | ActiveResourceConfigurationImpl activeResourceConfiguration = new ActiveResourceConfigurationImpl(); |
238 | return activeResourceConfiguration; |
239 | } |
240 | |
241 | /** |
242 | * <!-- begin-user-doc --> |
243 | * <!-- end-user-doc --> |
244 | * @generated |
245 | */ |
246 | public PassiveResourceConfiguration createPassiveResourceConfiguration() { |
247 | PassiveResourceConfigurationImpl passiveResourceConfiguration = new PassiveResourceConfigurationImpl(); |
248 | return passiveResourceConfiguration; |
249 | } |
250 | |
251 | /** |
252 | * <!-- begin-user-doc --> |
253 | * <!-- end-user-doc --> |
254 | * @generated |
255 | */ |
256 | public StaticPriorityBoost createStaticPriorityBoost() { |
257 | StaticPriorityBoostImpl staticPriorityBoost = new StaticPriorityBoostImpl(); |
258 | return staticPriorityBoost; |
259 | } |
260 | |
261 | /** |
262 | * <!-- begin-user-doc --> |
263 | * <!-- end-user-doc --> |
264 | * @generated |
265 | */ |
266 | public ProcessConfiguration createProcessConfiguration() { |
267 | ProcessConfigurationImpl processConfiguration = new ProcessConfigurationImpl(); |
268 | return processConfiguration; |
269 | } |
270 | |
271 | /** |
272 | * <!-- begin-user-doc --> |
273 | * <!-- end-user-doc --> |
274 | * @generated |
275 | */ |
276 | public SingleQueueConfiguration createSingleQueueConfiguration() { |
277 | SingleQueueConfigurationImpl singleQueueConfiguration = new SingleQueueConfigurationImpl(); |
278 | return singleQueueConfiguration; |
279 | } |
280 | |
281 | /** |
282 | * <!-- begin-user-doc --> |
283 | * <!-- end-user-doc --> |
284 | * @generated |
285 | */ |
286 | public StaticPriorityBoostConfiguration createStaticPriorityBoostConfiguration() { |
287 | StaticPriorityBoostConfigurationImpl staticPriorityBoostConfiguration = new StaticPriorityBoostConfigurationImpl(); |
288 | return staticPriorityBoostConfiguration; |
289 | } |
290 | |
291 | /** |
292 | * <!-- begin-user-doc --> |
293 | * <!-- end-user-doc --> |
294 | * @generated |
295 | */ |
296 | public SchedulerConfiguration createSchedulerConfiguration() { |
297 | SchedulerConfigurationImpl schedulerConfiguration = new SchedulerConfigurationImpl(); |
298 | return schedulerConfiguration; |
299 | } |
300 | |
301 | /** |
302 | * <!-- begin-user-doc --> |
303 | * <!-- end-user-doc --> |
304 | * @generated |
305 | */ |
306 | public StarvationBoost createStarvationBoost() { |
307 | StarvationBoostImpl starvationBoost = new StarvationBoostImpl(); |
308 | return starvationBoost; |
309 | } |
310 | |
311 | /** |
312 | * <!-- begin-user-doc --> |
313 | * <!-- end-user-doc --> |
314 | * @generated |
315 | */ |
316 | public InstanceToBalance createInstanceToBalanceFromString(EDataType eDataType, String initialValue) { |
317 | InstanceToBalance result = InstanceToBalance.get(initialValue); |
318 | if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); |
319 | return result; |
320 | } |
321 | |
322 | /** |
323 | * <!-- begin-user-doc --> |
324 | * <!-- end-user-doc --> |
325 | * @generated |
326 | */ |
327 | public String convertInstanceToBalanceToString(EDataType eDataType, Object instanceValue) { |
328 | return instanceValue == null ? null : instanceValue.toString(); |
329 | } |
330 | |
331 | /** |
332 | * <!-- begin-user-doc --> |
333 | * <!-- end-user-doc --> |
334 | * @generated |
335 | */ |
336 | public LoadBalancingType createLoadBalancingTypeFromString(EDataType eDataType, String initialValue) { |
337 | LoadBalancingType result = LoadBalancingType.get(initialValue); |
338 | if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); |
339 | return result; |
340 | } |
341 | |
342 | /** |
343 | * <!-- begin-user-doc --> |
344 | * <!-- end-user-doc --> |
345 | * @generated |
346 | */ |
347 | public String convertLoadBalancingTypeToString(EDataType eDataType, Object instanceValue) { |
348 | return instanceValue == null ? null : instanceValue.toString(); |
349 | } |
350 | |
351 | /** |
352 | * <!-- begin-user-doc --> |
353 | * <!-- end-user-doc --> |
354 | * @generated |
355 | */ |
356 | public PreferredWaitingTime createPreferredWaitingTimeFromString(EDataType eDataType, String initialValue) { |
357 | PreferredWaitingTime result = PreferredWaitingTime.get(initialValue); |
358 | if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); |
359 | return result; |
360 | } |
361 | |
362 | /** |
363 | * <!-- begin-user-doc --> |
364 | * <!-- end-user-doc --> |
365 | * @generated |
366 | */ |
367 | public String convertPreferredWaitingTimeToString(EDataType eDataType, Object instanceValue) { |
368 | return instanceValue == null ? null : instanceValue.toString(); |
369 | } |
370 | |
371 | /** |
372 | * <!-- begin-user-doc --> |
373 | * <!-- end-user-doc --> |
374 | * @generated |
375 | */ |
376 | public PreferredPriority createPreferredPriorityFromString(EDataType eDataType, String initialValue) { |
377 | PreferredPriority result = PreferredPriority.get(initialValue); |
378 | if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); |
379 | return result; |
380 | } |
381 | |
382 | /** |
383 | * <!-- begin-user-doc --> |
384 | * <!-- end-user-doc --> |
385 | * @generated |
386 | */ |
387 | public String convertPreferredPriorityToString(EDataType eDataType, Object instanceValue) { |
388 | return instanceValue == null ? null : instanceValue.toString(); |
389 | } |
390 | |
391 | /** |
392 | * <!-- begin-user-doc --> |
393 | * <!-- end-user-doc --> |
394 | * @generated |
395 | */ |
396 | public ResourceInstanceSelection createResourceInstanceSelectionFromString(EDataType eDataType, String initialValue) { |
397 | ResourceInstanceSelection result = ResourceInstanceSelection.get(initialValue); |
398 | if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); |
399 | return result; |
400 | } |
401 | |
402 | /** |
403 | * <!-- begin-user-doc --> |
404 | * <!-- end-user-doc --> |
405 | * @generated |
406 | */ |
407 | public String convertResourceInstanceSelectionToString(EDataType eDataType, Object instanceValue) { |
408 | return instanceValue == null ? null : instanceValue.toString(); |
409 | } |
410 | |
411 | /** |
412 | * <!-- begin-user-doc --> |
413 | * <!-- end-user-doc --> |
414 | * @generated |
415 | */ |
416 | public RunQueueType createRunQueueTypeFromString(EDataType eDataType, String initialValue) { |
417 | RunQueueType result = RunQueueType.get(initialValue); |
418 | if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); |
419 | return result; |
420 | } |
421 | |
422 | /** |
423 | * <!-- begin-user-doc --> |
424 | * <!-- end-user-doc --> |
425 | * @generated |
426 | */ |
427 | public String convertRunQueueTypeToString(EDataType eDataType, Object instanceValue) { |
428 | return instanceValue == null ? null : instanceValue.toString(); |
429 | } |
430 | |
431 | /** |
432 | * <!-- begin-user-doc --> |
433 | * <!-- end-user-doc --> |
434 | * @generated |
435 | */ |
436 | public PriorityClass createPriorityClassFromString(EDataType eDataType, String initialValue) { |
437 | PriorityClass result = PriorityClass.get(initialValue); |
438 | if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); |
439 | return result; |
440 | } |
441 | |
442 | /** |
443 | * <!-- begin-user-doc --> |
444 | * <!-- end-user-doc --> |
445 | * @generated |
446 | */ |
447 | public String convertPriorityClassToString(EDataType eDataType, Object instanceValue) { |
448 | return instanceValue == null ? null : instanceValue.toString(); |
449 | } |
450 | |
451 | /** |
452 | * <!-- begin-user-doc --> |
453 | * <!-- end-user-doc --> |
454 | * @generated |
455 | */ |
456 | public PriorityDegradation createPriorityDegradationFromString(EDataType eDataType, String initialValue) { |
457 | PriorityDegradation result = PriorityDegradation.get(initialValue); |
458 | if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); |
459 | return result; |
460 | } |
461 | |
462 | /** |
463 | * <!-- begin-user-doc --> |
464 | * <!-- end-user-doc --> |
465 | * @generated |
466 | */ |
467 | public String convertPriorityDegradationToString(EDataType eDataType, Object instanceValue) { |
468 | return instanceValue == null ? null : instanceValue.toString(); |
469 | } |
470 | |
471 | /** |
472 | * <!-- begin-user-doc --> |
473 | * <!-- end-user-doc --> |
474 | * @generated |
475 | */ |
476 | public ProcessSelection createProcessSelectionFromString(EDataType eDataType, String initialValue) { |
477 | ProcessSelection result = ProcessSelection.get(initialValue); |
478 | if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); |
479 | return result; |
480 | } |
481 | |
482 | /** |
483 | * <!-- begin-user-doc --> |
484 | * <!-- end-user-doc --> |
485 | * @generated |
486 | */ |
487 | public String convertProcessSelectionToString(EDataType eDataType, Object instanceValue) { |
488 | return instanceValue == null ? null : instanceValue.toString(); |
489 | } |
490 | |
491 | /** |
492 | * <!-- begin-user-doc --> |
493 | * <!-- end-user-doc --> |
494 | * @generated |
495 | */ |
496 | public PassiveResourceType createPassiveResourceTypeFromString(EDataType eDataType, String initialValue) { |
497 | PassiveResourceType result = PassiveResourceType.get(initialValue); |
498 | if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); |
499 | return result; |
500 | } |
501 | |
502 | /** |
503 | * <!-- begin-user-doc --> |
504 | * <!-- end-user-doc --> |
505 | * @generated |
506 | */ |
507 | public String convertPassiveResourceTypeToString(EDataType eDataType, Object instanceValue) { |
508 | return instanceValue == null ? null : instanceValue.toString(); |
509 | } |
510 | |
511 | /** |
512 | * <!-- begin-user-doc --> |
513 | * <!-- end-user-doc --> |
514 | * @generated |
515 | */ |
516 | public ConfigurationPackage getConfigurationPackage() { |
517 | return (ConfigurationPackage)getEPackage(); |
518 | } |
519 | |
520 | /** |
521 | * <!-- begin-user-doc --> |
522 | * <!-- end-user-doc --> |
523 | * @deprecated |
524 | * @generated |
525 | */ |
526 | @Deprecated |
527 | public static ConfigurationPackage getPackage() { |
528 | return ConfigurationPackage.eINSTANCE; |
529 | } |
530 | |
531 | } //ConfigurationFactoryImpl |