/******************************************************************************* * Copyright (c) 2001, 2006 IBM Corporation 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 Corporation - initial API and implementation *******************************************************************************/ package org.eclipse.jst.j2ee.webservice.wscommon.internal.impl; import org.eclipse.emf.ecore.EAttribute; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EPackage; import org.eclipse.emf.ecore.EReference; import org.eclipse.emf.ecore.EcorePackage; import org.eclipse.emf.ecore.impl.EPackageImpl; import org.eclipse.jem.java.JavaRefPackage; import org.eclipse.jst.j2ee.common.CommonPackage; import org.eclipse.jst.j2ee.core.internal.plugin.J2EECorePlugin; import org.eclipse.jst.j2ee.internal.J2EEInit; import org.eclipse.jst.j2ee.webservice.wscommon.DescriptionType; import org.eclipse.jst.j2ee.webservice.wscommon.DisplayNameType; import org.eclipse.jst.j2ee.webservice.wscommon.InitParam; import org.eclipse.jst.j2ee.webservice.wscommon.PortName; import org.eclipse.jst.j2ee.webservice.wscommon.SOAPHeader; import org.eclipse.jst.j2ee.webservice.wscommon.SOAPRole; import org.eclipse.jst.j2ee.webservice.wscommon.WscommonFactory; import org.eclipse.jst.j2ee.webservice.wscommon.WscommonPackage; /** * <!-- begin-user-doc --> * An implementation of the model <b>Package</b>. * <!-- end-user-doc --> * @generated */ public class WscommonPackageImpl extends EPackageImpl implements WscommonPackage { /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ private EClass initParamEClass = null; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ private EClass soapHeaderEClass = null; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ private EClass soapRoleEClass = null; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ private EClass portNameEClass = null; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ private EClass descriptionTypeEClass = null; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ private EClass displayNameTypeEClass = null; /** * Creates an instance of the model <b>Package</b>, registered with * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package * package URI value. * <p>Note: the correct way to create the package is via the static * factory method {@link #init init()}, which also performs * initialization of the package, or returns the registered package, * if one already exists. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see org.eclipse.emf.ecore.EPackage.Registry * @see org.eclipse.jst.j2ee.webservice.wscommon.WscommonPackage#eNS_URI * @see #init() * @generated */ private WscommonPackageImpl() { super(eNS_URI, WscommonFactory.eINSTANCE); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ private volatile static boolean isInited = false; /** * Creates, registers, and initializes the <b>Package</b> for this * model, and for any others upon which it depends. Simple * dependencies are satisfied by calling this method on all * dependent packages before doing anything else. This method drives * initialization for interdependent packages directly, in parallel * with this package, itself. * <p>Of this package and its interdependencies, all packages which * have not yet been registered by their URI values are first created * and registered. The packages are then initialized in two steps: * meta-model objects for all of the packages are created before any * are initialized, since one package's meta-model objects may refer to * those of another. * <p>Invocation of this method will not affect any packages that have * already been initialized. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #eNS_URI * @see #createPackageContents() * @see #initializePackageContents() * @generated */ public static WscommonPackage init() { if (isInited) return (WscommonPackage)EPackage.Registry.INSTANCE.getEPackage(WscommonPackage.eNS_URI); // Obtain or create and register package WscommonPackageImpl theWscommonPackage = (WscommonPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof WscommonPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new WscommonPackageImpl()); isInited = true; // Initialize simple dependencies EcorePackage.eINSTANCE.eClass(); JavaRefPackage.eINSTANCE.eClass(); // Create package meta-data objects theWscommonPackage.createPackageContents(); // Initialize created meta-data theWscommonPackage.initializePackageContents(); // Mark meta-data to indicate it can't be changed theWscommonPackage.freeze(); // Update the registry and return the package EPackage.Registry.INSTANCE.put(WscommonPackage.eNS_URI, theWscommonPackage); J2EEInit.initEMFModels(); return theWscommonPackage; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EClass getInitParam() { return initParamEClass; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EAttribute getInitParam_ParamName() { return (EAttribute)initParamEClass.getEStructuralFeatures().get(0); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EAttribute getInitParam_ParamValue() { return (EAttribute)initParamEClass.getEStructuralFeatures().get(1); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EAttribute getInitParam_Description() { return (EAttribute)initParamEClass.getEStructuralFeatures().get(2); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EReference getInitParam_DescriptionTypes() { return (EReference)initParamEClass.getEStructuralFeatures().get(3); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EClass getSOAPHeader() { return soapHeaderEClass; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EClass getSOAPRole() { return soapRoleEClass; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EAttribute getSOAPRole_SoapRole() { return (EAttribute)soapRoleEClass.getEStructuralFeatures().get(0); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EClass getPortName() { return portNameEClass; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EAttribute getPortName_PortName() { return (EAttribute)portNameEClass.getEStructuralFeatures().get(0); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EClass getDescriptionType() { return descriptionTypeEClass; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EClass getDisplayNameType() { return displayNameTypeEClass; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public WscommonFactory getWscommonFactory() { return (WscommonFactory)getEFactoryInstance(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ private volatile boolean isCreated = false; /** * Creates the meta-model objects for the package. This method is * guarded to have no affect on any invocation but its first. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void createPackageContents() { if (isCreated) return; isCreated = true; // Create classes and their features initParamEClass = createEClass(INIT_PARAM); createEAttribute(initParamEClass, INIT_PARAM__PARAM_NAME); createEAttribute(initParamEClass, INIT_PARAM__PARAM_VALUE); createEAttribute(initParamEClass, INIT_PARAM__DESCRIPTION); createEReference(initParamEClass, INIT_PARAM__DESCRIPTION_TYPES); soapHeaderEClass = createEClass(SOAP_HEADER); soapRoleEClass = createEClass(SOAP_ROLE); createEAttribute(soapRoleEClass, SOAP_ROLE__SOAP_ROLE); portNameEClass = createEClass(PORT_NAME); createEAttribute(portNameEClass, PORT_NAME__PORT_NAME); descriptionTypeEClass = createEClass(DESCRIPTION_TYPE); displayNameTypeEClass = createEClass(DISPLAY_NAME_TYPE); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ private volatile boolean isInitialized = false; /** * Complete the initialization of the package and its meta-model. This * method is guarded to have no affect on any invocation but its first. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void initializePackageContents() { if (isInitialized) return; isInitialized = true; // Initialize package setName(eNAME); setNsPrefix(eNS_PREFIX); setNsURI(eNS_URI); // Obtain other dependent packages CommonPackage theCommonPackage = (CommonPackage)EPackage.Registry.INSTANCE.getEPackage(CommonPackage.eNS_URI); boolean hasLock = false; try { hasLock = J2EEInit.aquireInitializePackageContentsLock(); } catch (InterruptedException e) { J2EECorePlugin.logError(e); } try{ // Add supertypes to classes initParamEClass.getESuperTypes().add(theCommonPackage.getJ2EEEObject()); soapHeaderEClass.getESuperTypes().add(theCommonPackage.getQName()); soapRoleEClass.getESuperTypes().add(theCommonPackage.getJ2EEEObject()); portNameEClass.getESuperTypes().add(theCommonPackage.getJ2EEEObject()); descriptionTypeEClass.getESuperTypes().add(theCommonPackage.getDescription()); displayNameTypeEClass.getESuperTypes().add(theCommonPackage.getDisplayName()); // Initialize classes and features; add operations and parameters initEClass(initParamEClass, InitParam.class, "InitParam", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ initEAttribute(getInitParam_ParamName(), ecorePackage.getEString(), "paramName", null, 0, 1, InitParam.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ initEAttribute(getInitParam_ParamValue(), ecorePackage.getEString(), "paramValue", null, 0, 1, InitParam.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ initEAttribute(getInitParam_Description(), ecorePackage.getEString(), "description", null, 0, 1, InitParam.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ initEReference(getInitParam_DescriptionTypes(), this.getDescriptionType(), null, "descriptionTypes", null, 0, -1, InitParam.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ initEClass(soapHeaderEClass, SOAPHeader.class, "SOAPHeader", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ initEClass(soapRoleEClass, SOAPRole.class, "SOAPRole", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ initEAttribute(getSOAPRole_SoapRole(), ecorePackage.getEString(), "soapRole", null, 0, 1, SOAPRole.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ initEClass(portNameEClass, PortName.class, "PortName", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ initEAttribute(getPortName_PortName(), ecorePackage.getEString(), "portName", null, 0, 1, PortName.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ initEClass(descriptionTypeEClass, DescriptionType.class, "DescriptionType", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ initEClass(displayNameTypeEClass, DisplayNameType.class, "DisplayNameType", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ // Create resource createResource(eNS_URI); }finally{ if( hasLock ) J2EEInit.releaseInitializePackageContentsLock(); } } @Override public void freeze() { // since EClassImpl.freeze() does a clear() on all of the subClasses, we need to protect initializePackageContents() against it. boolean hasLock = false; try { hasLock = J2EEInit.aquireInitializePackageContentsLock(); } catch (InterruptedException e) { J2EECorePlugin.logError(e); } finally { super.freeze(); if( hasLock ) J2EEInit.releaseInitializePackageContentsLock(); } } } //WscommonPackageImpl