1 | /** |
2 | * <copyright> |
3 | * </copyright> |
4 | * |
5 | * $Id$ |
6 | */ |
7 | package de.uka.ipd.sdq.pcm.resourcerepository.impl; |
8 | |
9 | import de.uka.ipd.sdq.featuremodel.featuremodelPackage; |
10 | |
11 | import de.uka.ipd.sdq.pcm.cost.costPackage; |
12 | |
13 | import de.uka.ipd.sdq.pcm.designdecision.GDoF.GDoFPackage; |
14 | |
15 | import de.uka.ipd.sdq.pcm.designdecision.GDoF.impl.GDoFPackageImpl; |
16 | |
17 | import de.uka.ipd.sdq.pcm.designdecision.QualityProperties.QualityPropertiesPackage; |
18 | |
19 | import de.uka.ipd.sdq.pcm.designdecision.QualityProperties.impl.QualityPropertiesPackageImpl; |
20 | |
21 | import de.uka.ipd.sdq.pcm.designdecision.designdecisionPackage; |
22 | |
23 | import de.uka.ipd.sdq.pcm.designdecision.impl.designdecisionPackageImpl; |
24 | |
25 | import de.uka.ipd.sdq.pcm.resourceenvironment.ResourceenvironmentPackage; |
26 | |
27 | import de.uka.ipd.sdq.pcm.resourcerepository.ResourceDescription; |
28 | import de.uka.ipd.sdq.pcm.resourcerepository.ResourceDescriptionRepository; |
29 | import de.uka.ipd.sdq.pcm.resourcerepository.resourcerepositoryFactory; |
30 | import de.uka.ipd.sdq.pcm.resourcerepository.resourcerepositoryPackage; |
31 | |
32 | import de.uka.ipd.sdq.pcm.resourcerepository.util.resourcerepositoryValidator; |
33 | |
34 | import de.uka.ipd.sdq.pcm.resultdecorator.ResultdecoratorPackage; |
35 | |
36 | import org.eclipse.emf.ecore.EClass; |
37 | import org.eclipse.emf.ecore.EGenericType; |
38 | import org.eclipse.emf.ecore.EOperation; |
39 | import org.eclipse.emf.ecore.EPackage; |
40 | import org.eclipse.emf.ecore.EReference; |
41 | import org.eclipse.emf.ecore.EValidator; |
42 | |
43 | import org.eclipse.emf.ecore.impl.EPackageImpl; |
44 | |
45 | /** |
46 | * <!-- begin-user-doc --> |
47 | * An implementation of the model <b>Package</b>. |
48 | * <!-- end-user-doc --> |
49 | * @generated |
50 | */ |
51 | public class resourcerepositoryPackageImpl extends EPackageImpl implements resourcerepositoryPackage { |
52 | /** |
53 | * <!-- begin-user-doc --> |
54 | * <!-- end-user-doc --> |
55 | * @generated |
56 | */ |
57 | private EClass resourceDescriptionRepositoryEClass = null; |
58 | |
59 | /** |
60 | * <!-- begin-user-doc --> |
61 | * <!-- end-user-doc --> |
62 | * @generated |
63 | */ |
64 | private EClass resourceDescriptionEClass = null; |
65 | |
66 | /** |
67 | * Creates an instance of the model <b>Package</b>, registered with |
68 | * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package |
69 | * package URI value. |
70 | * <p>Note: the correct way to create the package is via the static |
71 | * factory method {@link #init init()}, which also performs |
72 | * initialization of the package, or returns the registered package, |
73 | * if one already exists. |
74 | * <!-- begin-user-doc --> |
75 | * <!-- end-user-doc --> |
76 | * @see org.eclipse.emf.ecore.EPackage.Registry |
77 | * @see de.uka.ipd.sdq.pcm.resourcerepository.resourcerepositoryPackage#eNS_URI |
78 | * @see #init() |
79 | * @generated |
80 | */ |
81 | private resourcerepositoryPackageImpl() { |
82 | super(eNS_URI, resourcerepositoryFactory.eINSTANCE); |
83 | } |
84 | |
85 | /** |
86 | * <!-- begin-user-doc --> |
87 | * <!-- end-user-doc --> |
88 | * @generated |
89 | */ |
90 | private static boolean isInited = false; |
91 | |
92 | /** |
93 | * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends. |
94 | * |
95 | * <p>This method is used to initialize {@link resourcerepositoryPackage#eINSTANCE} when that field is accessed. |
96 | * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package. |
97 | * <!-- begin-user-doc --> |
98 | * <!-- end-user-doc --> |
99 | * @see #eNS_URI |
100 | * @see #createPackageContents() |
101 | * @see #initializePackageContents() |
102 | * @generated |
103 | */ |
104 | public static resourcerepositoryPackage init() { |
105 | if (isInited) return (resourcerepositoryPackage)EPackage.Registry.INSTANCE.getEPackage(resourcerepositoryPackage.eNS_URI); |
106 | |
107 | // Obtain or create and register package |
108 | resourcerepositoryPackageImpl theresourcerepositoryPackage = (resourcerepositoryPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof resourcerepositoryPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new resourcerepositoryPackageImpl()); |
109 | |
110 | isInited = true; |
111 | |
112 | // Initialize simple dependencies |
113 | costPackage.eINSTANCE.eClass(); |
114 | featuremodelPackage.eINSTANCE.eClass(); |
115 | ResultdecoratorPackage.eINSTANCE.eClass(); |
116 | |
117 | // Obtain or create and register interdependencies |
118 | designdecisionPackageImpl thedesigndecisionPackage = (designdecisionPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(designdecisionPackage.eNS_URI) instanceof designdecisionPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(designdecisionPackage.eNS_URI) : designdecisionPackage.eINSTANCE); |
119 | GDoFPackageImpl theGDoFPackage = (GDoFPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(GDoFPackage.eNS_URI) instanceof GDoFPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(GDoFPackage.eNS_URI) : GDoFPackage.eINSTANCE); |
120 | QualityPropertiesPackageImpl theQualityPropertiesPackage = (QualityPropertiesPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(QualityPropertiesPackage.eNS_URI) instanceof QualityPropertiesPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(QualityPropertiesPackage.eNS_URI) : QualityPropertiesPackage.eINSTANCE); |
121 | |
122 | // Create package meta-data objects |
123 | theresourcerepositoryPackage.createPackageContents(); |
124 | thedesigndecisionPackage.createPackageContents(); |
125 | theGDoFPackage.createPackageContents(); |
126 | theQualityPropertiesPackage.createPackageContents(); |
127 | |
128 | // Initialize created meta-data |
129 | theresourcerepositoryPackage.initializePackageContents(); |
130 | thedesigndecisionPackage.initializePackageContents(); |
131 | theGDoFPackage.initializePackageContents(); |
132 | theQualityPropertiesPackage.initializePackageContents(); |
133 | |
134 | // Register package validator |
135 | EValidator.Registry.INSTANCE.put |
136 | (theresourcerepositoryPackage, |
137 | new EValidator.Descriptor() { |
138 | public EValidator getEValidator() { |
139 | return resourcerepositoryValidator.INSTANCE; |
140 | } |
141 | }); |
142 | |
143 | // Mark meta-data to indicate it can't be changed |
144 | theresourcerepositoryPackage.freeze(); |
145 | |
146 | |
147 | // Update the registry and return the package |
148 | EPackage.Registry.INSTANCE.put(resourcerepositoryPackage.eNS_URI, theresourcerepositoryPackage); |
149 | return theresourcerepositoryPackage; |
150 | } |
151 | |
152 | /** |
153 | * <!-- begin-user-doc --> |
154 | * <!-- end-user-doc --> |
155 | * @generated |
156 | */ |
157 | public EClass getResourceDescriptionRepository() { |
158 | return resourceDescriptionRepositoryEClass; |
159 | } |
160 | |
161 | /** |
162 | * <!-- begin-user-doc --> |
163 | * <!-- end-user-doc --> |
164 | * @generated |
165 | */ |
166 | public EReference getResourceDescriptionRepository_AvailableProcessingResources_ResourceRepository() { |
167 | return (EReference)resourceDescriptionRepositoryEClass.getEStructuralFeatures().get(0); |
168 | } |
169 | |
170 | /** |
171 | * <!-- begin-user-doc --> |
172 | * <!-- end-user-doc --> |
173 | * @generated |
174 | */ |
175 | public EClass getResourceDescription() { |
176 | return resourceDescriptionEClass; |
177 | } |
178 | |
179 | /** |
180 | * <!-- begin-user-doc --> |
181 | * <!-- end-user-doc --> |
182 | * @generated |
183 | */ |
184 | public EReference getResourceDescription_FixedProcessingResourceCost_ResourceDescription() { |
185 | return (EReference)resourceDescriptionEClass.getEStructuralFeatures().get(0); |
186 | } |
187 | |
188 | /** |
189 | * <!-- begin-user-doc --> |
190 | * <!-- end-user-doc --> |
191 | * @generated |
192 | */ |
193 | public EReference getResourceDescription_ProcessingResourceSpecification_ResourceDescription() { |
194 | return (EReference)resourceDescriptionEClass.getEStructuralFeatures().get(1); |
195 | } |
196 | |
197 | /** |
198 | * <!-- begin-user-doc --> |
199 | * <!-- end-user-doc --> |
200 | * @generated |
201 | */ |
202 | public resourcerepositoryFactory getresourcerepositoryFactory() { |
203 | return (resourcerepositoryFactory)getEFactoryInstance(); |
204 | } |
205 | |
206 | /** |
207 | * <!-- begin-user-doc --> |
208 | * <!-- end-user-doc --> |
209 | * @generated |
210 | */ |
211 | private boolean isCreated = false; |
212 | |
213 | /** |
214 | * Creates the meta-model objects for the package. This method is |
215 | * guarded to have no affect on any invocation but its first. |
216 | * <!-- begin-user-doc --> |
217 | * <!-- end-user-doc --> |
218 | * @generated |
219 | */ |
220 | public void createPackageContents() { |
221 | if (isCreated) return; |
222 | isCreated = true; |
223 | |
224 | // Create classes and their features |
225 | resourceDescriptionRepositoryEClass = createEClass(RESOURCE_DESCRIPTION_REPOSITORY); |
226 | createEReference(resourceDescriptionRepositoryEClass, RESOURCE_DESCRIPTION_REPOSITORY__AVAILABLE_PROCESSING_RESOURCES_RESOURCE_REPOSITORY); |
227 | |
228 | resourceDescriptionEClass = createEClass(RESOURCE_DESCRIPTION); |
229 | createEReference(resourceDescriptionEClass, RESOURCE_DESCRIPTION__FIXED_PROCESSING_RESOURCE_COST_RESOURCE_DESCRIPTION); |
230 | createEReference(resourceDescriptionEClass, RESOURCE_DESCRIPTION__PROCESSING_RESOURCE_SPECIFICATION_RESOURCE_DESCRIPTION); |
231 | } |
232 | |
233 | /** |
234 | * <!-- begin-user-doc --> |
235 | * <!-- end-user-doc --> |
236 | * @generated |
237 | */ |
238 | private boolean isInitialized = false; |
239 | |
240 | /** |
241 | * Complete the initialization of the package and its meta-model. This |
242 | * method is guarded to have no affect on any invocation but its first. |
243 | * <!-- begin-user-doc --> |
244 | * <!-- end-user-doc --> |
245 | * @generated |
246 | */ |
247 | public void initializePackageContents() { |
248 | if (isInitialized) return; |
249 | isInitialized = true; |
250 | |
251 | // Initialize package |
252 | setName(eNAME); |
253 | setNsPrefix(eNS_PREFIX); |
254 | setNsURI(eNS_URI); |
255 | |
256 | // Obtain other dependent packages |
257 | costPackage thecostPackage = (costPackage)EPackage.Registry.INSTANCE.getEPackage(costPackage.eNS_URI); |
258 | ResourceenvironmentPackage theResourceenvironmentPackage = (ResourceenvironmentPackage)EPackage.Registry.INSTANCE.getEPackage(ResourceenvironmentPackage.eNS_URI); |
259 | |
260 | // Create type parameters |
261 | |
262 | // Set bounds for type parameters |
263 | |
264 | // Add supertypes to classes |
265 | |
266 | // Initialize classes and features; add operations and parameters |
267 | initEClass(resourceDescriptionRepositoryEClass, ResourceDescriptionRepository.class, "ResourceDescriptionRepository", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); |
268 | initEReference(getResourceDescriptionRepository_AvailableProcessingResources_ResourceRepository(), this.getResourceDescription(), null, "availableProcessingResources_ResourceRepository", null, 0, -1, ResourceDescriptionRepository.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); |
269 | |
270 | initEClass(resourceDescriptionEClass, ResourceDescription.class, "ResourceDescription", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); |
271 | initEReference(getResourceDescription_FixedProcessingResourceCost_ResourceDescription(), thecostPackage.getFixedProcessingResourceCost(), null, "fixedProcessingResourceCost_ResourceDescription", null, 1, 1, ResourceDescription.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); |
272 | initEReference(getResourceDescription_ProcessingResourceSpecification_ResourceDescription(), theResourceenvironmentPackage.getProcessingResourceSpecification(), null, "processingResourceSpecification_ResourceDescription", null, 1, 1, ResourceDescription.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); |
273 | |
274 | EOperation op = addEOperation(resourceDescriptionEClass, ecorePackage.getEBoolean(), "CostAndResourceMustMatch", 0, 1, IS_UNIQUE, IS_ORDERED); |
275 | addEParameter(op, ecorePackage.getEDiagnosticChain(), "diagnostics", 0, 1, IS_UNIQUE, IS_ORDERED); |
276 | EGenericType g1 = createEGenericType(ecorePackage.getEMap()); |
277 | EGenericType g2 = createEGenericType(ecorePackage.getEJavaObject()); |
278 | g1.getETypeArguments().add(g2); |
279 | g2 = createEGenericType(ecorePackage.getEJavaObject()); |
280 | g1.getETypeArguments().add(g2); |
281 | addEParameter(op, g1, "context", 0, 1, IS_UNIQUE, IS_ORDERED); |
282 | } |
283 | |
284 | } //resourcerepositoryPackageImpl |