/** * Return true if the other bundle descriptor comes from the same module * @param other the other bundle descriptor * @return true if co-packaged in the same module */ public boolean isPackagedAsSingleModule(BundleDescriptor other) { return getModuleDescriptor().equals(other.getModuleDescriptor()); }
/** * Return true if the other bundle descriptor comes from the same module * @param other the other bundle descriptor * @return true if co-packaged in the same module */ public boolean isPackagedAsSingleModule(BundleDescriptor other) { return getModuleDescriptor().equals(other.getModuleDescriptor()); }
/** * Add a bundle descriptor to this application. * * @param bundleDescriptor the bundle descriptor to add */ public void addBundleDescriptor(BundleDescriptor bundleDescriptor) { ModuleDescriptor newModule = bundleDescriptor.getModuleDescriptor(); addModule(newModule); }
/** * Add a web bundle descriptor to this application. * * @param bundleDescriptor the web bundle descriptor to add */ public void addBundleDescriptor(BundleDescriptor bundleDescriptor) { ModuleDescriptor newModule = bundleDescriptor.getModuleDescriptor(); addModule(newModule); }
/** * creates a new module descriptor for this archivist * * @return the new module descriptor */ public ModuleDescriptor createModuleDescriptor(T descriptor) { ModuleDescriptor newModule = descriptor.getModuleDescriptor(); setDescriptor(descriptor); return newModule; }
/** * Get the uri of a target based on a source module and a a relative uri * from the perspective of that source module. * * @param origin bundle descriptor within an application * @param relativeTargetUri relative uri from the given bundle * descriptor * @return target uri */ private String getTargetUri(BundleDescriptor origin, String relativeTargetUri) { try { String archiveUri = origin.getModuleDescriptor().getArchiveUri(); return new URI(archiveUri).resolve(relativeTargetUri).getPath(); } catch (URISyntaxException use) { throw new RuntimeException(use); } }
public String getAppJndiName() { String modName = enclosingBundle.getModuleDescriptor().getModuleName(); StringBuffer javaAppPrefix = new StringBuffer("java:app/"); javaAppPrefix.append(modName); javaAppPrefix.append("/"); // If the managed bean is named, use the name for the final component // of the managed bean global name. Otherwise, use a derived internal // name since we'll still need a way to register and lookup the bean // from within the container. String componentName = isNamed() ? name : "___internal_managed_bean_" + beanClassName; javaAppPrefix.append(componentName); return javaAppPrefix.toString(); }
/** * Get the uri of a target based on a source module and a a relative uri * from the perspective of that source module. * * @param origin bundle descriptor within an application * @param relativeTargetUri relative uri from the given bundle * descriptor * @return target uri */ private String getTargetUri(BundleDescriptor origin, String relativeTargetUri) { try { String archiveUri = origin.getModuleDescriptor().getArchiveUri(); return new URI(archiveUri).resolve(relativeTargetUri).getPath(); } catch (URISyntaxException use) { throw new RuntimeException(use); } }
public String getAppJndiName() { if (enclosingBundle == null) return null; String modName = enclosingBundle.getModuleDescriptor().getModuleName(); StringBuffer javaAppPrefix = new StringBuffer("java:app/"); javaAppPrefix.append(modName); javaAppPrefix.append("/"); // If the managed bean is named, use the name for the final component // of the managed bean global name. Otherwise, use a derived internal // name since we'll still need a way to register and lookup the bean // from within the container. String componentName = isNamed() ? name : "___internal_managed_bean_" + beanClassName; javaAppPrefix.append(componentName); return javaAppPrefix.toString(); }
public void addManagedBean(ManagedBeanDescriptor managedBeanDesc) { BundleDescriptor bundleDesc = (BundleDescriptor) ((BundleDescriptor) descriptor).getModuleDescriptor().getDescriptor(); bundleDesc.addManagedBean(managedBeanDesc); }
public void addManagedBean(ManagedBeanDescriptor managedBeanDesc) { BundleDescriptor bundleDesc = (BundleDescriptor) ((BundleDescriptor) descriptor).getModuleDescriptor().getDescriptor(); bundleDesc.addManagedBean(managedBeanDesc); }
public boolean isJCDIEnabled(BundleDescriptor bundle) { // Get the top-level bundle descriptor from the given bundle. // E.g. allows EjbBundleDescriptor from a .war to be handled correctly. BundleDescriptor topLevelBundleDesc = (BundleDescriptor) bundle.getModuleDescriptor().getDescriptor(); return weldDeployer.is299Enabled(topLevelBundleDesc); }
/** * @return the module ID for this module descriptor */ public String getModuleID() { if (moduleID == null) { moduleID = getModuleDescriptor().getArchiveUri(); } if (getModuleDescriptor().isStandalone()) { return moduleID; } if (application != null && !application.isVirtual()) { return application.getRegistrationName() + "#" + getModuleDescriptor().getArchiveUri(); } else { return moduleID; } }
/** * @return the module ID for this module descriptor */ public String getModuleID() { if (moduleID == null) { moduleID = getModuleDescriptor().getArchiveUri(); } if (getModuleDescriptor().isStandalone()) { return moduleID; } if (application != null && !application.isVirtual()) { return application.getRegistrationName() + "#" + getModuleDescriptor().getArchiveUri(); } else { return moduleID; } }
public static List<URI> getLibraryJarURIs(BundleDescriptor bundleDesc, ReadableArchive archive) throws Exception { if (bundleDesc == null) { return Collections.emptyList(); } ModuleDescriptor moduleDesc = ((BundleDescriptor)bundleDesc).getModuleDescriptor(); Application app = ((BundleDescriptor)moduleDesc.getDescriptor()).getApplication(); return getLibraryJarURIs(app, archive); }
public String getUniqueName() { if(uniqueName == null) { BundleDescriptor bundle = getEjbBundleDescriptor(); Application application = bundle.getApplication(); // Add ejb name and application name. StringBuffer rc = new StringBuffer(). append(getName()). append(NAME_CONCATENATOR). append(application.getRegistrationName()); // If it's not just a module, add a module name. if (!application.isVirtual()) { rc.append(NAME_CONCATENATOR). append(bundle.getModuleDescriptor().getArchiveUri()); } uniqueName = getBaseName(getEjbClassName()) + getUniqueNumber(rc.toString()); } return uniqueName; }
public String getGeneratedWsdlFilePath() { if (hasWsdlFile()) { String xmlDir = getBundleDescriptor().getApplication().getGeneratedXMLDirectory(); if(!getBundleDescriptor().getModuleDescriptor().isStandalone()) { String uri = getBundleDescriptor().getModuleDescriptor().getArchiveUri(); xmlDir = xmlDir + File.separator + uri.replaceAll("\\.", "_"); } if(xmlDir == null) { return null; } return xmlDir + File.separator + wsdlFileUri; } else { return getWsdlFileUrl().getPath(); } }
public String getGeneratedWsdlFilePath() { if (hasWsdlFile()) { String xmlDir = getBundleDescriptor().getApplication().getGeneratedXMLDirectory(); if(!getBundleDescriptor().getModuleDescriptor().isStandalone()) { String uri = getBundleDescriptor().getModuleDescriptor().getArchiveUri(); xmlDir = xmlDir + File.separator + uri.replaceAll("\\.", "_"); } if(xmlDir == null) { return null; } return xmlDir + File.separator + wsdlFileUri; } else { return getWsdlFileUrl().getPath(); } }
public String getModuleName() { String moduleName = null; // for standalone jars, return its registration name // for applications, return the module uri if (getApplication().isVirtual()) { moduleName = getApplication().getRegistrationName(); } else { moduleName = getModuleDescriptor().getArchiveUri(); } return moduleName; }
public String getModuleName() { String moduleName = null; // for standalone jars, return its registration name // for applications, return the module uri if (getApplication().isVirtual()) { moduleName = getApplication().getRegistrationName(); } else { moduleName = getModuleDescriptor().getArchiveUri(); } return moduleName; }