/*
* Copyright (c) 2005, 2017 IBM Corporation, Embarcadero Technologies, CEA, and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM - initial API and implementation
* Kenn Hussey (Embarcadero Technologies) - 204200
* Kenn Hussey - 286329, 323181, 519572
* Kenn Hussey (CEA) - 327039, 351774, 418466, 451350, 485756
*
*/
package org.eclipse.uml2.uml.internal.impl;
import java.lang.reflect.InvocationTargetException;
import java.util.Collection;
import java.util.Map;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.common.util.DiagnosticChain;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EAnnotation;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.emf.ecore.util.InternalEList;
import org.eclipse.uml2.uml.AggregationKind;
import org.eclipse.uml2.uml.Artifact;
import org.eclipse.uml2.uml.Classifier;
import org.eclipse.uml2.uml.CollaborationUse;
import org.eclipse.uml2.uml.Comment;
import org.eclipse.uml2.uml.Constraint;
import org.eclipse.uml2.uml.Deployment;
import org.eclipse.uml2.uml.DeploymentSpecification;
import org.eclipse.uml2.uml.Element;
import org.eclipse.uml2.uml.ElementImport;
import org.eclipse.uml2.uml.Generalization;
import org.eclipse.uml2.uml.GeneralizationSet;
import org.eclipse.uml2.uml.Manifestation;
import org.eclipse.uml2.uml.NamedElement;
import org.eclipse.uml2.uml.Namespace;
import org.eclipse.uml2.uml.Operation;
import org.eclipse.uml2.uml.PackageImport;
import org.eclipse.uml2.uml.PackageableElement;
import org.eclipse.uml2.uml.ParameterableElement;
import org.eclipse.uml2.uml.Property;
import org.eclipse.uml2.uml.RedefinableElement;
import org.eclipse.uml2.uml.Stereotype;
import org.eclipse.uml2.uml.StringExpression;
import org.eclipse.uml2.uml.Substitution;
import org.eclipse.uml2.uml.TemplateBinding;
import org.eclipse.uml2.uml.TemplateParameter;
import org.eclipse.uml2.uml.TemplateSignature;
import org.eclipse.uml2.uml.Type;
import org.eclipse.uml2.uml.UMLPackage;
import org.eclipse.uml2.uml.UseCase;
import org.eclipse.uml2.uml.VisibilityKind;
import org.eclipse.uml2.uml.internal.operations.DeploymentSpecificationOperations;
/**
*
* An implementation of the model object 'Deployment Specification'.
*
*
* The following features are implemented:
*
*
* - {@link org.eclipse.uml2.uml.internal.impl.DeploymentSpecificationImpl#getOwner Owner}
* - {@link org.eclipse.uml2.uml.internal.impl.DeploymentSpecificationImpl#getDeploymentLocation Deployment Location}
* - {@link org.eclipse.uml2.uml.internal.impl.DeploymentSpecificationImpl#getExecutionLocation Execution Location}
* - {@link org.eclipse.uml2.uml.internal.impl.DeploymentSpecificationImpl#getDeployment Deployment}
*
*
* @generated
*/
public class DeploymentSpecificationImpl
extends ArtifactImpl
implements DeploymentSpecification {
/**
* The default value of the '{@link #getDeploymentLocation() Deployment Location}' attribute.
*
*
* @see #getDeploymentLocation()
* @generated
* @ordered
*/
protected static final String DEPLOYMENT_LOCATION_EDEFAULT = null;
/**
* The cached value of the '{@link #getDeploymentLocation() Deployment Location}' attribute.
*
*
* @see #getDeploymentLocation()
* @generated
* @ordered
*/
protected String deploymentLocation = DEPLOYMENT_LOCATION_EDEFAULT;
/**
* The flag representing whether the Deployment Location attribute has been set.
*
*
* @generated
* @ordered
*/
protected static final int DEPLOYMENT_LOCATION_ESETFLAG = 1 << 16;
/**
* The default value of the '{@link #getExecutionLocation() Execution Location}' attribute.
*
*
* @see #getExecutionLocation()
* @generated
* @ordered
*/
protected static final String EXECUTION_LOCATION_EDEFAULT = null;
/**
* The cached value of the '{@link #getExecutionLocation() Execution Location}' attribute.
*
*
* @see #getExecutionLocation()
* @generated
* @ordered
*/
protected String executionLocation = EXECUTION_LOCATION_EDEFAULT;
/**
* The flag representing whether the Execution Location attribute has been set.
*
*
* @generated
* @ordered
*/
protected static final int EXECUTION_LOCATION_ESETFLAG = 1 << 17;
/**
*
*
* @generated
*/
protected DeploymentSpecificationImpl() {
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return UMLPackage.Literals.DEPLOYMENT_SPECIFICATION;
}
/**
*
*
* @generated
*/
@Override
public Element getOwner() {
Element owner = basicGetOwner();
return owner != null && owner.eIsProxy()
? (Element) eResolveProxy((InternalEObject) owner)
: owner;
}
/**
*
*
* @generated
*/
@Override
public Element basicGetOwner() {
Deployment deployment = basicGetDeployment();
if (deployment != null) {
return deployment;
}
return super.basicGetOwner();
}
/**
*
*
* @generated
*/
public String getDeploymentLocation() {
return deploymentLocation;
}
/**
*
*
* @generated
*/
public void setDeploymentLocation(String newDeploymentLocation) {
String oldDeploymentLocation = deploymentLocation;
deploymentLocation = newDeploymentLocation;
boolean oldDeploymentLocationESet = (eFlags
& DEPLOYMENT_LOCATION_ESETFLAG) != 0;
eFlags |= DEPLOYMENT_LOCATION_ESETFLAG;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET,
UMLPackage.DEPLOYMENT_SPECIFICATION__DEPLOYMENT_LOCATION,
oldDeploymentLocation, deploymentLocation,
!oldDeploymentLocationESet));
}
/**
*
*
* @generated
*/
public void unsetDeploymentLocation() {
String oldDeploymentLocation = deploymentLocation;
boolean oldDeploymentLocationESet = (eFlags
& DEPLOYMENT_LOCATION_ESETFLAG) != 0;
deploymentLocation = DEPLOYMENT_LOCATION_EDEFAULT;
eFlags &= ~DEPLOYMENT_LOCATION_ESETFLAG;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.UNSET,
UMLPackage.DEPLOYMENT_SPECIFICATION__DEPLOYMENT_LOCATION,
oldDeploymentLocation, DEPLOYMENT_LOCATION_EDEFAULT,
oldDeploymentLocationESet));
}
/**
*
*
* @generated
*/
public boolean isSetDeploymentLocation() {
return (eFlags & DEPLOYMENT_LOCATION_ESETFLAG) != 0;
}
/**
*
*
* @generated
*/
public String getExecutionLocation() {
return executionLocation;
}
/**
*
*
* @generated
*/
public void setExecutionLocation(String newExecutionLocation) {
String oldExecutionLocation = executionLocation;
executionLocation = newExecutionLocation;
boolean oldExecutionLocationESet = (eFlags
& EXECUTION_LOCATION_ESETFLAG) != 0;
eFlags |= EXECUTION_LOCATION_ESETFLAG;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET,
UMLPackage.DEPLOYMENT_SPECIFICATION__EXECUTION_LOCATION,
oldExecutionLocation, executionLocation,
!oldExecutionLocationESet));
}
/**
*
*
* @generated
*/
public void unsetExecutionLocation() {
String oldExecutionLocation = executionLocation;
boolean oldExecutionLocationESet = (eFlags
& EXECUTION_LOCATION_ESETFLAG) != 0;
executionLocation = EXECUTION_LOCATION_EDEFAULT;
eFlags &= ~EXECUTION_LOCATION_ESETFLAG;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.UNSET,
UMLPackage.DEPLOYMENT_SPECIFICATION__EXECUTION_LOCATION,
oldExecutionLocation, EXECUTION_LOCATION_EDEFAULT,
oldExecutionLocationESet));
}
/**
*
*
* @generated
*/
public boolean isSetExecutionLocation() {
return (eFlags & EXECUTION_LOCATION_ESETFLAG) != 0;
}
/**
*
*
* @generated
*/
public Deployment getDeployment() {
if (eContainerFeatureID() != UMLPackage.DEPLOYMENT_SPECIFICATION__DEPLOYMENT)
return null;
return (Deployment) eContainer();
}
/**
*
*
* @generated
*/
public Deployment basicGetDeployment() {
if (eContainerFeatureID() != UMLPackage.DEPLOYMENT_SPECIFICATION__DEPLOYMENT)
return null;
return (Deployment) eInternalContainer();
}
/**
*
*
* @generated
*/
public NotificationChain basicSetDeployment(Deployment newDeployment,
NotificationChain msgs) {
msgs = eBasicSetContainer((InternalEObject) newDeployment,
UMLPackage.DEPLOYMENT_SPECIFICATION__DEPLOYMENT, msgs);
return msgs;
}
/**
*
*
* @generated
*/
public void setDeployment(Deployment newDeployment) {
if (newDeployment != eInternalContainer()
|| (eContainerFeatureID() != UMLPackage.DEPLOYMENT_SPECIFICATION__DEPLOYMENT
&& newDeployment != null)) {
if (EcoreUtil.isAncestor(this, newDeployment))
throw new IllegalArgumentException(
"Recursive containment not allowed for " + toString()); //$NON-NLS-1$
NotificationChain msgs = null;
if (eInternalContainer() != null)
msgs = eBasicRemoveFromContainer(msgs);
if (newDeployment != null)
msgs = ((InternalEObject) newDeployment).eInverseAdd(this,
UMLPackage.DEPLOYMENT__CONFIGURATION, Deployment.class,
msgs);
msgs = basicSetDeployment(newDeployment, msgs);
if (msgs != null)
msgs.dispatch();
} else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET,
UMLPackage.DEPLOYMENT_SPECIFICATION__DEPLOYMENT, newDeployment,
newDeployment));
}
/**
*
*
* @generated
*/
public boolean validateDeployedElements(DiagnosticChain diagnostics,
Map