/** * @return the module type for this bundle descriptor */ public ArchiveType getModuleType() { return DOLUtils.rarType(); }
private List<ModuleDescriptor> sortModules(Application app) { List<ModuleDescriptor> sortedModules = new ArrayList<ModuleDescriptor>(); sortedModules.addAll(app.getModuleDescriptorsByType(DOLUtils.rarType())); sortedModules.addAll(app.getModuleDescriptorsByType(DOLUtils.ejbType())); sortedModules.addAll(app.getModuleDescriptorsByType(DOLUtils.warType())); sortedModules.addAll(app.getModuleDescriptorsByType(DOLUtils.carType())); return sortedModules; }
bundles.removeAll(doOnAllTypedBundles(application, DOLUtils.rarType(), runnable));
private static String getTypeFromModuleType(ArchiveType moduleType) { if (moduleType.equals(DOLUtils.warType())) { return "web"; } else if (moduleType.equals(DOLUtils.ejbType())) { return "ejb"; } else if (moduleType.equals(DOLUtils.carType())) { return "appclient"; } else if (moduleType.equals(DOLUtils.rarType())) { return "connector"; } return null; }
/** * @ return true for following cases: * a. ejb module and schema version earlier than 3.0; * b. web module and schema version earlier than 2.5; * c. appclient module and schema version earlier than 5.0. * d. connector module and schema version earlier than 1.6 */ public boolean isDDWithNoAnnotationAllowed() { ArchiveType mType = getModuleType(); if (mType == null) return false; double specVersion = Double.parseDouble(getSpecVersion()); // we do not process annotations for earlier versions of DD if ( (mType.equals(DOLUtils.ejbType()) && specVersion < ANNOTATION_EJB_VER) || (mType.equals(DOLUtils.warType()) && specVersion < ANNOTATION_WAR_VER) || (mType.equals(DOLUtils.carType()) && specVersion < ANNOTATION_CAR_VER) || (mType.equals(DOLUtils.rarType()) && specVersion < ANNOTATION_RAR_VER)) { return true; } else { return false; } }
/** * receives notification of the value for a particular tag * * @param element the xml element * @param value it's associated value */ public void setElementValue(XMLElement element, String value) { ModuleDescriptor descriptor = (ModuleDescriptor) getDescriptor(); if (element.getQName().equals(ApplicationTagNames.WEB_URI)) { descriptor.setModuleType(DOLUtils.warType()); descriptor.setArchiveUri(value); } else if (element.getQName().equals(ApplicationTagNames.EJB)) { descriptor.setModuleType(DOLUtils.ejbType()); descriptor.setArchiveUri(value); } else if (element.getQName().equals(ApplicationTagNames.CONNECTOR)) { descriptor.setModuleType(DOLUtils.rarType()); descriptor.setArchiveUri(value); } else if (element.getQName().equals(ApplicationTagNames.APPLICATION_CLIENT)) { descriptor.setModuleType(DOLUtils.carType()); descriptor.setArchiveUri(value); } else if (element.getQName().equals(ApplicationTagNames.WEB)) { descriptor.setModuleType(DOLUtils.warType()); } else super.setElementValue(element, value); }
ModuleDescriptor<BundleDescriptor> md = new ModuleDescriptor<BundleDescriptor>(); md.setArchiveUri(uri); md.setModuleType(DOLUtils.rarType()); app.addModule(md); } else if ((!directory && name.endsWith(".jar"))
/** * check whether the archive is a JavaEE archive * @param archive archive to be tested * @param context deployment context * @param habitat * @return whether the archive is a JavaEE archive */ public static boolean isJavaEE(ReadableArchive archive, DeploymentContext context, ServiceLocator habitat) { if (DeploymentUtils.isArchiveOfType(archive,DOLUtils.earType(), context, habitat) || DeploymentUtils.isArchiveOfType(archive, DOLUtils.warType(), context, habitat) || DeploymentUtils.isArchiveOfType(archive, DOLUtils.carType(), context, habitat) || DeploymentUtils.isArchiveOfType(archive, DOLUtils.rarType(), context, habitat) || DeploymentUtils.isArchiveOfType(archive, DOLUtils.ejbType(), context, habitat)) { return true; } return false; } }
} else if (md.getModuleType().equals(DOLUtils.rarType())) { embeddedConnCl.addDelegate( (DelegatingClassLoader.ClassFinder)subCl);
private ArchiveHandler getArchiveHandlerFromModuleType(ArchiveType type) { if (type.equals(DOLUtils.warType())) { return habitat.getService(ArchiveHandler.class, WarDetector.ARCHIVE_TYPE); } else if (type.equals(DOLUtils.rarType())) { return habitat.getService(ArchiveHandler.class, RarDetector.ARCHIVE_TYPE); } else if (type.equals(DOLUtils.ejbType())) { return habitat.getService(ArchiveHandler.class, EjbJarDetector.ARCHIVE_TYPE); } else if (type.equals(DOLUtils.carType())) { return habitat.getService(ArchiveHandler.class, CarDetector.ARCHIVE_TYPE); } else { return null; } }
private String getModuleType(ModuleDescriptor modDesc) { String type = null; if (modDesc.getModuleType().equals(DOLUtils.ejbType())) { type = "EJBModule"; } else if (modDesc.getModuleType().equals(DOLUtils.warType())) { type = "WebModule"; } else if (modDesc.getModuleType().equals(DOLUtils.carType())) { type = "AppClientModule"; } else if (modDesc.getModuleType().equals(DOLUtils.rarType())) { type = "ConnectorModule"; } return type; } }
public final static String [] getDescriptorsList (ArchiveType moduleType) { if (moduleType == null) return null; if (moduleType.equals(DOLUtils.earType())) { return (String[])earList.clone(); } else if (moduleType.equals(DOLUtils.ejbType())) { return (String[])ejbList.clone(); } else if (moduleType.equals(DOLUtils.warType())) { return (String[])warList.clone(); } else if (moduleType.equals(DOLUtils.rarType())) { return (String[])rarList.clone(); } else if (moduleType.equals(DOLUtils.carType())) { return (String[])carList.clone(); } return null; } }
for (BundleDescriptor cd : application.getBundleDescriptorsOfType(DOLUtils.rarType())) { cd.visit(getSubDescriptorVisitor(cd));
@Override public void accept (BundleDescriptor descriptor) { if (descriptor instanceof Application) { Application application = (Application)descriptor; accept(application); for (BundleDescriptor ebd : application.getBundleDescriptorsOfType(DOLUtils.ejbType())) { ebd.visit(getSubDescriptorVisitor(ebd)); } for (BundleDescriptor wbd : application.getBundleDescriptorsOfType(DOLUtils.warType())) { // This might be null in the case of an appclient // processing a client stubs .jar whose original .ear contained // a .war. This will be fixed correctly in the deployment // stage but until then adding a non-null check will prevent // the validation step from bombing. if (wbd != null) { wbd.visit(getSubDescriptorVisitor(wbd)); } } for (BundleDescriptor cd : application.getBundleDescriptorsOfType(DOLUtils.rarType())) { cd.visit(getSubDescriptorVisitor(cd)); } for (BundleDescriptor acd : application.getBundleDescriptorsOfType(DOLUtils.carType())) { acd.visit(getSubDescriptorVisitor(acd)); } super.accept(descriptor); } else { super.accept(descriptor); } }
/** * write the descriptor class to a DOM tree and return it * * @param parent node in the DOM tree * @param node name for the root element of this xml fragment * @param the descriptor to write * @return the DOM tree top node */ public Node writeDescriptor(Node parent, String nodeName, ModuleDescriptor descriptor) { Node module = appendChild(parent, nodeName); if (DOLUtils.warType().equals(descriptor.getModuleType())) { Node modType = appendChild(module, ApplicationTagNames.WEB); appendTextChild(modType, ApplicationTagNames.WEB_URI, descriptor.getArchiveUri()); forceAppendTextChild(modType, ApplicationTagNames.CONTEXT_ROOT, descriptor.getContextRoot()); } else { // default initialization if ejb... String type = ApplicationTagNames.EJB; if (DOLUtils.carType().equals(descriptor.getModuleType())) { type = ApplicationTagNames.APPLICATION_CLIENT; } else if (DOLUtils.rarType().equals(descriptor.getModuleType())) { type = ApplicationTagNames.CONNECTOR; } appendTextChild(module, type, descriptor.getArchiveUri()); } appendTextChild(module,ApplicationTagNames.ALTERNATIVE_DD, descriptor.getAlternateDescriptor()); return module; } }