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 org.eclipse.emf.common.notify.Notification; |
9 | import org.eclipse.emf.common.notify.NotificationChain; |
10 | import org.eclipse.emf.ecore.EClass; |
11 | import org.eclipse.emf.ecore.InternalEObject; |
12 | import org.eclipse.emf.ecore.impl.ENotificationImpl; |
13 | |
14 | import de.uka.ipd.sdq.pcm.reliability.ReliabilityPackage; |
15 | import de.uka.ipd.sdq.pcm.reliability.ResourceTimeoutFailureType; |
16 | import de.uka.ipd.sdq.pcm.repository.PassiveResource; |
17 | import de.uka.ipd.sdq.pcm.repository.RepositoryPackage; |
18 | |
19 | /** |
20 | * <!-- begin-user-doc --> |
21 | * An implementation of the model object '<em><b>Resource Timeout Failure Type</b></em>'. |
22 | * <!-- end-user-doc --> |
23 | * <p> |
24 | * The following features are implemented: |
25 | * <ul> |
26 | * <li>{@link de.uka.ipd.sdq.pcm.reliability.impl.ResourceTimeoutFailureTypeImpl#getPassiveResource__ResourceTimeoutFailureType <em>Passive Resource Resource Timeout Failure Type</em>}</li> |
27 | * </ul> |
28 | * </p> |
29 | * |
30 | * @generated |
31 | */ |
32 | public class ResourceTimeoutFailureTypeImpl extends SoftwareInducedFailureTypeImpl implements ResourceTimeoutFailureType { |
33 | /** |
34 | * <!-- begin-user-doc --> |
35 | * <!-- end-user-doc --> |
36 | * @generated |
37 | */ |
38 | public static final String copyright = "Copyright 2005-2009 by SDQ, IPD, University of Karlsruhe, Germany"; |
39 | |
40 | /** |
41 | * The cached value of the '{@link #getPassiveResource__ResourceTimeoutFailureType() <em>Passive Resource Resource Timeout Failure Type</em>}' reference. |
42 | * <!-- begin-user-doc --> |
43 | * <!-- end-user-doc --> |
44 | * @see #getPassiveResource__ResourceTimeoutFailureType() |
45 | * @generated |
46 | * @ordered |
47 | */ |
48 | protected PassiveResource passiveResource__ResourceTimeoutFailureType; |
49 | |
50 | /** |
51 | * <!-- begin-user-doc --> |
52 | * <!-- end-user-doc --> |
53 | * @generated |
54 | */ |
55 | protected ResourceTimeoutFailureTypeImpl() { |
56 | super(); |
57 | } |
58 | |
59 | /** |
60 | * <!-- begin-user-doc --> |
61 | * <!-- end-user-doc --> |
62 | * @generated |
63 | */ |
64 | @Override |
65 | protected EClass eStaticClass() { |
66 | return ReliabilityPackage.Literals.RESOURCE_TIMEOUT_FAILURE_TYPE; |
67 | } |
68 | |
69 | /** |
70 | * <!-- begin-user-doc --> |
71 | * <!-- end-user-doc --> |
72 | * @generated |
73 | */ |
74 | public PassiveResource getPassiveResource__ResourceTimeoutFailureType() { |
75 | if (passiveResource__ResourceTimeoutFailureType != null && passiveResource__ResourceTimeoutFailureType.eIsProxy()) { |
76 | InternalEObject oldPassiveResource__ResourceTimeoutFailureType = (InternalEObject)passiveResource__ResourceTimeoutFailureType; |
77 | passiveResource__ResourceTimeoutFailureType = (PassiveResource)eResolveProxy(oldPassiveResource__ResourceTimeoutFailureType); |
78 | if (passiveResource__ResourceTimeoutFailureType != oldPassiveResource__ResourceTimeoutFailureType) { |
79 | if (eNotificationRequired()) |
80 | eNotify(new ENotificationImpl(this, Notification.RESOLVE, ReliabilityPackage.RESOURCE_TIMEOUT_FAILURE_TYPE__PASSIVE_RESOURCE_RESOURCE_TIMEOUT_FAILURE_TYPE, oldPassiveResource__ResourceTimeoutFailureType, passiveResource__ResourceTimeoutFailureType)); |
81 | } |
82 | } |
83 | return passiveResource__ResourceTimeoutFailureType; |
84 | } |
85 | |
86 | /** |
87 | * <!-- begin-user-doc --> |
88 | * <!-- end-user-doc --> |
89 | * @generated |
90 | */ |
91 | public PassiveResource basicGetPassiveResource__ResourceTimeoutFailureType() { |
92 | return passiveResource__ResourceTimeoutFailureType; |
93 | } |
94 | |
95 | /** |
96 | * <!-- begin-user-doc --> |
97 | * <!-- end-user-doc --> |
98 | * @generated |
99 | */ |
100 | public NotificationChain basicSetPassiveResource__ResourceTimeoutFailureType(PassiveResource newPassiveResource__ResourceTimeoutFailureType, NotificationChain msgs) { |
101 | PassiveResource oldPassiveResource__ResourceTimeoutFailureType = passiveResource__ResourceTimeoutFailureType; |
102 | passiveResource__ResourceTimeoutFailureType = newPassiveResource__ResourceTimeoutFailureType; |
103 | if (eNotificationRequired()) { |
104 | ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ReliabilityPackage.RESOURCE_TIMEOUT_FAILURE_TYPE__PASSIVE_RESOURCE_RESOURCE_TIMEOUT_FAILURE_TYPE, oldPassiveResource__ResourceTimeoutFailureType, newPassiveResource__ResourceTimeoutFailureType); |
105 | if (msgs == null) msgs = notification; else msgs.add(notification); |
106 | } |
107 | return msgs; |
108 | } |
109 | |
110 | /** |
111 | * <!-- begin-user-doc --> |
112 | * <!-- end-user-doc --> |
113 | * @generated |
114 | */ |
115 | public void setPassiveResource__ResourceTimeoutFailureType(PassiveResource newPassiveResource__ResourceTimeoutFailureType) { |
116 | if (newPassiveResource__ResourceTimeoutFailureType != passiveResource__ResourceTimeoutFailureType) { |
117 | NotificationChain msgs = null; |
118 | if (passiveResource__ResourceTimeoutFailureType != null) |
119 | msgs = ((InternalEObject)passiveResource__ResourceTimeoutFailureType).eInverseRemove(this, RepositoryPackage.PASSIVE_RESOURCE__RESOURCE_TIMEOUT_FAILURE_TYPE_PASSIVE_RESOURCE, PassiveResource.class, msgs); |
120 | if (newPassiveResource__ResourceTimeoutFailureType != null) |
121 | msgs = ((InternalEObject)newPassiveResource__ResourceTimeoutFailureType).eInverseAdd(this, RepositoryPackage.PASSIVE_RESOURCE__RESOURCE_TIMEOUT_FAILURE_TYPE_PASSIVE_RESOURCE, PassiveResource.class, msgs); |
122 | msgs = basicSetPassiveResource__ResourceTimeoutFailureType(newPassiveResource__ResourceTimeoutFailureType, msgs); |
123 | if (msgs != null) msgs.dispatch(); |
124 | } |
125 | else if (eNotificationRequired()) |
126 | eNotify(new ENotificationImpl(this, Notification.SET, ReliabilityPackage.RESOURCE_TIMEOUT_FAILURE_TYPE__PASSIVE_RESOURCE_RESOURCE_TIMEOUT_FAILURE_TYPE, newPassiveResource__ResourceTimeoutFailureType, newPassiveResource__ResourceTimeoutFailureType)); |
127 | } |
128 | |
129 | /** |
130 | * <!-- begin-user-doc --> |
131 | * <!-- end-user-doc --> |
132 | * @generated |
133 | */ |
134 | @Override |
135 | public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
136 | switch (featureID) { |
137 | case ReliabilityPackage.RESOURCE_TIMEOUT_FAILURE_TYPE__PASSIVE_RESOURCE_RESOURCE_TIMEOUT_FAILURE_TYPE: |
138 | if (passiveResource__ResourceTimeoutFailureType != null) |
139 | msgs = ((InternalEObject)passiveResource__ResourceTimeoutFailureType).eInverseRemove(this, RepositoryPackage.PASSIVE_RESOURCE__RESOURCE_TIMEOUT_FAILURE_TYPE_PASSIVE_RESOURCE, PassiveResource.class, msgs); |
140 | return basicSetPassiveResource__ResourceTimeoutFailureType((PassiveResource)otherEnd, msgs); |
141 | } |
142 | return super.eInverseAdd(otherEnd, featureID, msgs); |
143 | } |
144 | |
145 | /** |
146 | * <!-- begin-user-doc --> |
147 | * <!-- end-user-doc --> |
148 | * @generated |
149 | */ |
150 | @Override |
151 | public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
152 | switch (featureID) { |
153 | case ReliabilityPackage.RESOURCE_TIMEOUT_FAILURE_TYPE__PASSIVE_RESOURCE_RESOURCE_TIMEOUT_FAILURE_TYPE: |
154 | return basicSetPassiveResource__ResourceTimeoutFailureType(null, msgs); |
155 | } |
156 | return super.eInverseRemove(otherEnd, featureID, msgs); |
157 | } |
158 | |
159 | /** |
160 | * <!-- begin-user-doc --> |
161 | * <!-- end-user-doc --> |
162 | * @generated |
163 | */ |
164 | @Override |
165 | public Object eGet(int featureID, boolean resolve, boolean coreType) { |
166 | switch (featureID) { |
167 | case ReliabilityPackage.RESOURCE_TIMEOUT_FAILURE_TYPE__PASSIVE_RESOURCE_RESOURCE_TIMEOUT_FAILURE_TYPE: |
168 | if (resolve) return getPassiveResource__ResourceTimeoutFailureType(); |
169 | return basicGetPassiveResource__ResourceTimeoutFailureType(); |
170 | } |
171 | return super.eGet(featureID, resolve, coreType); |
172 | } |
173 | |
174 | /** |
175 | * <!-- begin-user-doc --> |
176 | * <!-- end-user-doc --> |
177 | * @generated |
178 | */ |
179 | @Override |
180 | public void eSet(int featureID, Object newValue) { |
181 | switch (featureID) { |
182 | case ReliabilityPackage.RESOURCE_TIMEOUT_FAILURE_TYPE__PASSIVE_RESOURCE_RESOURCE_TIMEOUT_FAILURE_TYPE: |
183 | setPassiveResource__ResourceTimeoutFailureType((PassiveResource)newValue); |
184 | return; |
185 | } |
186 | super.eSet(featureID, newValue); |
187 | } |
188 | |
189 | /** |
190 | * <!-- begin-user-doc --> |
191 | * <!-- end-user-doc --> |
192 | * @generated |
193 | */ |
194 | @Override |
195 | public void eUnset(int featureID) { |
196 | switch (featureID) { |
197 | case ReliabilityPackage.RESOURCE_TIMEOUT_FAILURE_TYPE__PASSIVE_RESOURCE_RESOURCE_TIMEOUT_FAILURE_TYPE: |
198 | setPassiveResource__ResourceTimeoutFailureType((PassiveResource)null); |
199 | return; |
200 | } |
201 | super.eUnset(featureID); |
202 | } |
203 | |
204 | /** |
205 | * <!-- begin-user-doc --> |
206 | * <!-- end-user-doc --> |
207 | * @generated |
208 | */ |
209 | @Override |
210 | public boolean eIsSet(int featureID) { |
211 | switch (featureID) { |
212 | case ReliabilityPackage.RESOURCE_TIMEOUT_FAILURE_TYPE__PASSIVE_RESOURCE_RESOURCE_TIMEOUT_FAILURE_TYPE: |
213 | return passiveResource__ResourceTimeoutFailureType != null; |
214 | } |
215 | return super.eIsSet(featureID); |
216 | } |
217 | |
218 | } //ResourceTimeoutFailureTypeImpl |