1 | /** |
2 | * Copyright 2005-2009 by SDQ, IPD, University of Karlsruhe, Germany |
3 | * |
4 | * $Id$ |
5 | */ |
6 | package de.uka.ipd.sdq.pcm.reliability.impl; |
7 | |
8 | import de.uka.ipd.sdq.pcm.reliability.*; |
9 | import org.eclipse.emf.ecore.EClass; |
10 | import org.eclipse.emf.ecore.EObject; |
11 | import org.eclipse.emf.ecore.EPackage; |
12 | import org.eclipse.emf.ecore.impl.EFactoryImpl; |
13 | import org.eclipse.emf.ecore.plugin.EcorePlugin; |
14 | |
15 | import de.uka.ipd.sdq.pcm.reliability.ExternalFailureOccurrenceDescription; |
16 | import de.uka.ipd.sdq.pcm.reliability.HardwareInducedFailureType; |
17 | import de.uka.ipd.sdq.pcm.reliability.InternalFailureOccurrenceDescription; |
18 | import de.uka.ipd.sdq.pcm.reliability.NetworkInducedFailureType; |
19 | import de.uka.ipd.sdq.pcm.reliability.ReliabilityFactory; |
20 | import de.uka.ipd.sdq.pcm.reliability.ReliabilityPackage; |
21 | import de.uka.ipd.sdq.pcm.reliability.ResourceTimeoutFailureType; |
22 | import de.uka.ipd.sdq.pcm.reliability.SoftwareInducedFailureType; |
23 | |
24 | /** |
25 | * <!-- begin-user-doc --> |
26 | * An implementation of the model <b>Factory</b>. |
27 | * <!-- end-user-doc --> |
28 | * @generated |
29 | */ |
30 | public class ReliabilityFactoryImpl extends EFactoryImpl implements ReliabilityFactory { |
31 | /** |
32 | * <!-- begin-user-doc --> |
33 | * <!-- end-user-doc --> |
34 | * @generated |
35 | */ |
36 | public static final String copyright = "Copyright 2005-2009 by SDQ, IPD, University of Karlsruhe, Germany"; |
37 | |
38 | /** |
39 | * Creates the default factory implementation. |
40 | * <!-- begin-user-doc --> |
41 | * <!-- end-user-doc --> |
42 | * @generated |
43 | */ |
44 | public static ReliabilityFactory init() { |
45 | try { |
46 | ReliabilityFactory theReliabilityFactory = (ReliabilityFactory)EPackage.Registry.INSTANCE.getEFactory("http://sdq.ipd.uka.de/PalladioComponentModel/Reliability/4.0"); |
47 | if (theReliabilityFactory != null) { |
48 | return theReliabilityFactory; |
49 | } |
50 | } |
51 | catch (Exception exception) { |
52 | EcorePlugin.INSTANCE.log(exception); |
53 | } |
54 | return new ReliabilityFactoryImpl(); |
55 | } |
56 | |
57 | /** |
58 | * Creates an instance of the factory. |
59 | * <!-- begin-user-doc --> |
60 | * <!-- end-user-doc --> |
61 | * @generated |
62 | */ |
63 | public ReliabilityFactoryImpl() { |
64 | super(); |
65 | } |
66 | |
67 | /** |
68 | * <!-- begin-user-doc --> |
69 | * <!-- end-user-doc --> |
70 | * @generated |
71 | */ |
72 | @Override |
73 | public EObject create(EClass eClass) { |
74 | switch (eClass.getClassifierID()) { |
75 | case ReliabilityPackage.HARDWARE_INDUCED_FAILURE_TYPE: return createHardwareInducedFailureType(); |
76 | case ReliabilityPackage.SOFTWARE_INDUCED_FAILURE_TYPE: return createSoftwareInducedFailureType(); |
77 | case ReliabilityPackage.INTERNAL_FAILURE_OCCURRENCE_DESCRIPTION: return createInternalFailureOccurrenceDescription(); |
78 | case ReliabilityPackage.NETWORK_INDUCED_FAILURE_TYPE: return createNetworkInducedFailureType(); |
79 | case ReliabilityPackage.EXTERNAL_FAILURE_OCCURRENCE_DESCRIPTION: return createExternalFailureOccurrenceDescription(); |
80 | case ReliabilityPackage.RESOURCE_TIMEOUT_FAILURE_TYPE: return createResourceTimeoutFailureType(); |
81 | default: |
82 | throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); |
83 | } |
84 | } |
85 | |
86 | /** |
87 | * <!-- begin-user-doc --> |
88 | * <!-- end-user-doc --> |
89 | * @generated |
90 | */ |
91 | public HardwareInducedFailureType createHardwareInducedFailureType() { |
92 | HardwareInducedFailureTypeImpl hardwareInducedFailureType = new HardwareInducedFailureTypeImpl(); |
93 | return hardwareInducedFailureType; |
94 | } |
95 | |
96 | /** |
97 | * <!-- begin-user-doc --> |
98 | * <!-- end-user-doc --> |
99 | * @generated |
100 | */ |
101 | public ExternalFailureOccurrenceDescription createExternalFailureOccurrenceDescription() { |
102 | ExternalFailureOccurrenceDescriptionImpl externalFailureOccurrenceDescription = new ExternalFailureOccurrenceDescriptionImpl(); |
103 | return externalFailureOccurrenceDescription; |
104 | } |
105 | |
106 | /** |
107 | * <!-- begin-user-doc --> |
108 | * <!-- end-user-doc --> |
109 | * @generated |
110 | */ |
111 | public ResourceTimeoutFailureType createResourceTimeoutFailureType() { |
112 | ResourceTimeoutFailureTypeImpl resourceTimeoutFailureType = new ResourceTimeoutFailureTypeImpl(); |
113 | return resourceTimeoutFailureType; |
114 | } |
115 | |
116 | /** |
117 | * <!-- begin-user-doc --> |
118 | * <!-- end-user-doc --> |
119 | * @generated |
120 | */ |
121 | public NetworkInducedFailureType createNetworkInducedFailureType() { |
122 | NetworkInducedFailureTypeImpl networkInducedFailureType = new NetworkInducedFailureTypeImpl(); |
123 | return networkInducedFailureType; |
124 | } |
125 | |
126 | /** |
127 | * <!-- begin-user-doc --> |
128 | * <!-- end-user-doc --> |
129 | * @generated |
130 | */ |
131 | public InternalFailureOccurrenceDescription createInternalFailureOccurrenceDescription() { |
132 | InternalFailureOccurrenceDescriptionImpl internalFailureOccurrenceDescription = new InternalFailureOccurrenceDescriptionImpl(); |
133 | return internalFailureOccurrenceDescription; |
134 | } |
135 | |
136 | /** |
137 | * <!-- begin-user-doc --> |
138 | * <!-- end-user-doc --> |
139 | * @generated |
140 | */ |
141 | public SoftwareInducedFailureType createSoftwareInducedFailureType() { |
142 | SoftwareInducedFailureTypeImpl softwareInducedFailureType = new SoftwareInducedFailureTypeImpl(); |
143 | return softwareInducedFailureType; |
144 | } |
145 | |
146 | /** |
147 | * <!-- begin-user-doc --> |
148 | * <!-- end-user-doc --> |
149 | * @generated |
150 | */ |
151 | public ReliabilityPackage getReliabilityPackage() { |
152 | return (ReliabilityPackage)getEPackage(); |
153 | } |
154 | |
155 | /** |
156 | * <!-- begin-user-doc --> |
157 | * <!-- end-user-doc --> |
158 | * @deprecated |
159 | * @generated |
160 | */ |
161 | @Deprecated |
162 | public static ReliabilityPackage getPackage() { |
163 | return ReliabilityPackage.eINSTANCE; |
164 | } |
165 | |
166 | } //ReliabilityFactoryImpl |