/** * @return the module type for this bundle descriptor */ @Override public ArchiveType getModuleType() { return DOLUtils.ejbType(); }
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; }
public boolean supportsModuleType(ArchiveType moduleType) { return (DOLUtils.warType().equals(moduleType) || DOLUtils.ejbType().equals(moduleType)); }
private Collection<ModuleDescriptor<BundleDescriptor>> getSubModuleListForEar(com.sun.enterprise.deployment.Application application, String type) { Collection<ModuleDescriptor<BundleDescriptor>> modules = new ArrayList<ModuleDescriptor<BundleDescriptor>>(); if (type == null) { modules = application.getModules(); } else if (type.equals("servlets")) { modules = application.getModuleDescriptorsByType( DOLUtils.warType()); } else if (type.equals("ejbs")) { modules = application.getModuleDescriptorsByType( DOLUtils.ejbType()); // ejb in war case Collection<ModuleDescriptor<BundleDescriptor>> webModules = application.getModuleDescriptorsByType(DOLUtils.warType()); for (ModuleDescriptor webModule : webModules) { if (webModule.getDescriptor().getExtensionsDescriptors(EjbBundleDescriptor.class).size() > 0) { modules.add(webModule); } } } return modules; }
@Override public boolean supportsModuleType(ArchiveType moduleType) { // Reads persitence.xml for ejb jars return moduleType != null && (moduleType.equals(DOLUtils.ejbType()) || // Or App client modules if running inside server (moduleType.equals(DOLUtils.carType()) && env.getProcessType().isServer())); }
bundles.removeAll(doOnAllTypedBundles(application, DOLUtils.ejbType(), 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; } }
if(DOLUtils.ejbType().equals(ref.getBundleDescriptor().getModuleType())) { EjbBundleDescriptor ejbBundle = (EjbBundleDescriptor) ref.getBundleDescriptor(); Iterator<? extends EjbDescriptor> ejbsIter = ejbBundle.getEjbs().iterator();
/** * 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); }
if (md.getModuleType().equals(DOLUtils.ejbType())) {
/** * 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; } }
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; } }
/** * Returns true if the passed file or directory is recognized by this * sniffer. * * @param context deployment context * @return true if the location is recognized by this sniffer */ @Override public boolean handles(DeploymentContext context) { ArchiveType archiveType = habitat.getService(ArchiveType.class, context.getArchiveHandler().getArchiveType()); if (archiveType != null && !supportsArchiveType(archiveType)) { return false; } if (archiveType != null && (archiveType.equals(DOLUtils.warType()) || archiveType.equals(DOLUtils.earType()) || archiveType.equals(DOLUtils.ejbType()))) return true; return handles(context.getSource()); }
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 ebd : application.getBundleDescriptorsOfType(DOLUtils.ejbType())) { ebd.visit(getSubDescriptorVisitor(ebd));
@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); } }