/** * <p> * Creates a new EJB module * </p> * * @return */ public Module createNewModule() { verifyOperationSupported(); if (isBinary()) { throwAttemptedBinaryEditModelAccess(); } return ((ApplicationPackage) EPackage.Registry.INSTANCE.getEPackage(ApplicationPackage.eNS_URI)).getApplicationFactory().createEjbModule(); }
public EObject createModelRoot() { verifyOperationSupported(); if (isBinary()) { throwAttemptedBinaryEditModelAccess(); } return createModelRoot(getJ2EEVersion()); }
/** * <p> * Obtains the EJBJar (@see EJBJar) root object from the EJBResource. If the root object does * not exist, then one is created (@link addEJBJarIfNecessary(getEJBJarXmiResource())). The root * object contains all other resource defined objects. * </p> * * @return EObject * */ public EObject getDeploymentDescriptorRoot() { verifyOperationSupported(); Resource res = getDeploymentDescriptorResource(); List contents = res.getContents(); if (contents.size() > 0) return (EObject) contents.get(0); if (isBinary()) { return null; } if (!WorkbenchResourceHelper.getFile(res).exists()) return null; addEJBJarIfNecessary((EJBResource) getDeploymentDescriptorResource()); return (EObject) contents.get(0); }
/** * <p> * Retrieves the underlying resource from the ArtifactEditModel using defined URI. * </p> * * @return Resource * */ public Resource getDeploymentDescriptorResource() { verifyOperationSupported(); if (isBinary()) { return getBinaryComponentHelper().getResource(J2EEConstants.EJBJAR_DD_URI_OBJ); } return getArtifactEditModel().getResource(J2EEConstants.EJBJAR_DD_URI_OBJ); }
public EObject createModelRoot(int version) { verifyOperationSupported(); if (isBinary()) { throwAttemptedBinaryEditModelAccess(); } EJBResource res = (EJBResource) getDeploymentDescriptorResource(); res.setModuleVersionID(version); addEJBJarIfNecessary(res); return ((EJBResource) getDeploymentDescriptorResource()).getRootObject(); }
public Archive asArchive(boolean includeSource, boolean includeClasspathComponents) throws OpenFailureException { if (isBinary()) { return ((EnterpriseBinaryComponentHelper) getBinaryComponentHelper()).accessArchive(); } else { EJBComponentLoadStrategyImpl loader = new EJBComponentLoadStrategyImpl(getComponent(), includeClasspathComponents); loader.setExportSource(includeSource); String uri = ModuleURIUtil.getHandleString(getComponent()); return CommonarchiveFactory.eINSTANCE.openEJBJarFile(loader, uri); } }
if (isBinary()) { throwAttemptedBinaryEditModelAccess();