| 1 | /** |
| 2 | * Copyright 2005-2009 by SDQ, IPD, University of Karlsruhe, Germany |
| 3 | * |
| 4 | * $Id$ |
| 5 | */ |
| 6 | package de.uka.ipd.sdq.pcm.qosannotations.qos_performance.impl; |
| 7 | |
| 8 | import java.util.Map; |
| 9 | |
| 10 | import org.eclipse.emf.common.util.BasicDiagnostic; |
| 11 | import org.eclipse.emf.common.util.Diagnostic; |
| 12 | import org.eclipse.emf.common.util.DiagnosticChain; |
| 13 | import org.eclipse.emf.ecore.EClass; |
| 14 | import org.eclipse.emf.ecore.plugin.EcorePlugin; |
| 15 | import org.eclipse.emf.ecore.util.EObjectValidator; |
| 16 | import org.eclipse.ocl.ParserException; |
| 17 | import org.eclipse.ocl.ecore.Constraint; |
| 18 | import org.eclipse.ocl.ecore.OCL; |
| 19 | |
| 20 | import de.uka.ipd.sdq.pcm.qosannotations.qos_performance.Qos_performancePackage; |
| 21 | import de.uka.ipd.sdq.pcm.qosannotations.qos_performance.SystemSpecifiedExecutionTime; |
| 22 | import de.uka.ipd.sdq.pcm.qosannotations.qos_performance.util.Qos_performanceValidator; |
| 23 | |
| 24 | /** |
| 25 | * <!-- begin-user-doc --> |
| 26 | * An implementation of the model object '<em><b>System Specified Execution Time</b></em>'. |
| 27 | * <!-- end-user-doc --> |
| 28 | * <p> |
| 29 | * </p> |
| 30 | * |
| 31 | * @generated |
| 32 | */ |
| 33 | public class SystemSpecifiedExecutionTimeImpl extends SpecifiedExecutionTimeImpl implements SystemSpecifiedExecutionTime { |
| 34 | /** |
| 35 | * <!-- begin-user-doc --> |
| 36 | * <!-- end-user-doc --> |
| 37 | * @generated |
| 38 | */ |
| 39 | public static final String copyright = "Copyright 2005-2009 by SDQ, IPD, University of Karlsruhe, Germany"; |
| 40 | |
| 41 | /** |
| 42 | * <!-- begin-user-doc --> |
| 43 | * <!-- end-user-doc --> |
| 44 | * @generated |
| 45 | */ |
| 46 | protected SystemSpecifiedExecutionTimeImpl() { |
| 47 | super(); |
| 48 | } |
| 49 | |
| 50 | /** |
| 51 | * <!-- begin-user-doc --> |
| 52 | * <!-- end-user-doc --> |
| 53 | * @generated |
| 54 | */ |
| 55 | @Override |
| 56 | protected EClass eStaticClass() { |
| 57 | return Qos_performancePackage.Literals.SYSTEM_SPECIFIED_EXECUTION_TIME; |
| 58 | } |
| 59 | |
| 60 | /** |
| 61 | * The cached OCL expression body for the '{@link #SystemSpecifiedExecutionTimeMustReferenceRequiredRoleOfASystem(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) <em>System Specified Execution Time Must Reference Required Role Of ASystem</em>}' operation. |
| 62 | * <!-- begin-user-doc --> |
| 63 | * <!-- end-user-doc --> |
| 64 | * @see #SystemSpecifiedExecutionTimeMustReferenceRequiredRoleOfASystem(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) |
| 65 | * @generated |
| 66 | * @ordered |
| 67 | */ |
| 68 | protected static final String SYSTEM_SPECIFIED_EXECUTION_TIME_MUST_REFERENCE_REQUIRED_ROLE_OF_ASYSTEM__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP = "(self.role_SpecifiedQoSAnnotation.oclIsTypeOf(pcm::repository::OperationRequiredRole)) and (self.role_SpecifiedQoSAnnotation.oclAsType(pcm::repository::OperationRequiredRole).requiringEntity_RequiredRole.oclIsTypeOf(pcm::system::System))\n"+""; |
| 69 | |
| 70 | /** |
| 71 | * The cached OCL invariant for the '{@link #SystemSpecifiedExecutionTimeMustReferenceRequiredRoleOfASystem(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) <em>System Specified Execution Time Must Reference Required Role Of ASystem</em>}' invariant operation. |
| 72 | * <!-- begin-user-doc --> |
| 73 | * <!-- end-user-doc --> |
| 74 | * @see #SystemSpecifiedExecutionTimeMustReferenceRequiredRoleOfASystem(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) |
| 75 | * @generated |
| 76 | * @ordered |
| 77 | */ |
| 78 | protected static Constraint SYSTEM_SPECIFIED_EXECUTION_TIME_MUST_REFERENCE_REQUIRED_ROLE_OF_ASYSTEM__DIAGNOSTIC_CHAIN_MAP__EOCL_INV; |
| 79 | |
| 80 | /** |
| 81 | * <!-- begin-user-doc --> |
| 82 | * <!-- end-user-doc --> |
| 83 | * @generated |
| 84 | */ |
| 85 | public boolean SystemSpecifiedExecutionTimeMustReferenceRequiredRoleOfASystem(DiagnosticChain diagnostics, Map<Object, Object> context) { |
| 86 | if (SYSTEM_SPECIFIED_EXECUTION_TIME_MUST_REFERENCE_REQUIRED_ROLE_OF_ASYSTEM__DIAGNOSTIC_CHAIN_MAP__EOCL_INV == null) { |
| 87 | OCL.Helper helper = EOCL_ENV.createOCLHelper(); |
| 88 | helper.setContext(Qos_performancePackage.Literals.SYSTEM_SPECIFIED_EXECUTION_TIME); |
| 89 | try { |
| 90 | SYSTEM_SPECIFIED_EXECUTION_TIME_MUST_REFERENCE_REQUIRED_ROLE_OF_ASYSTEM__DIAGNOSTIC_CHAIN_MAP__EOCL_INV = helper.createInvariant(SYSTEM_SPECIFIED_EXECUTION_TIME_MUST_REFERENCE_REQUIRED_ROLE_OF_ASYSTEM__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP); |
| 91 | } |
| 92 | catch (ParserException pe) { |
| 93 | throw new UnsupportedOperationException(pe.getLocalizedMessage()); |
| 94 | } |
| 95 | } |
| 96 | if (!EOCL_ENV.createQuery(SYSTEM_SPECIFIED_EXECUTION_TIME_MUST_REFERENCE_REQUIRED_ROLE_OF_ASYSTEM__DIAGNOSTIC_CHAIN_MAP__EOCL_INV).check(this)) { |
| 97 | if (diagnostics != null) { |
| 98 | diagnostics.add |
| 99 | (new BasicDiagnostic |
| 100 | (Diagnostic.ERROR, |
| 101 | Qos_performanceValidator.DIAGNOSTIC_SOURCE, |
| 102 | Qos_performanceValidator.SYSTEM_SPECIFIED_EXECUTION_TIME__SYSTEM_SPECIFIED_EXECUTION_TIME_MUST_REFERENCE_REQUIRED_ROLE_OF_ASYSTEM, |
| 103 | EcorePlugin.INSTANCE.getString("_UI_GenericInvariant_diagnostic", new Object[] { "SystemSpecifiedExecutionTimeMustReferenceRequiredRoleOfASystem", EObjectValidator.getObjectLabel(this, context) }), |
| 104 | new Object [] { this })); |
| 105 | } |
| 106 | return false; |
| 107 | } |
| 108 | return true; |
| 109 | } |
| 110 | |
| 111 | /** |
| 112 | * The cached environment for evaluating OCL expressions. |
| 113 | * <!-- begin-user-doc --> |
| 114 | * <!-- end-user-doc --> |
| 115 | * @generated |
| 116 | * @ordered |
| 117 | */ |
| 118 | protected static final OCL EOCL_ENV = OCL.newInstance(); |
| 119 | |
| 120 | } //SystemSpecifiedExecutionTimeImpl |