@Override public boolean supportsModuleType(ArchiveType moduleType) { return moduleType != null && moduleType.equals(DOLUtils.warType()); }
@Override public boolean supportsModuleType(ArchiveType moduleType) { return moduleType != null && moduleType.equals(DOLUtils.warType()); }
/** * @return the location of the DeploymentDescriptor file for a * particular type of J2EE Archive */ public String getDeploymentDescriptorPath() { return DOLUtils.warType().equals(getArchiveType()) ? DescriptorConstants.S1AS_EJB_IN_WAR_ENTRY : DescriptorConstants.S1AS_EJB_JAR_ENTRY; }
/** * @return the location of the DeploymentDescriptor file for a * particular type of J2EE Archive */ public String getDeploymentDescriptorPath() { return DOLUtils.warType().equals(getArchiveType()) ? DescriptorConstants.GF_EJB_IN_WAR_ENTRY : DescriptorConstants.GF_EJB_JAR_ENTRY; }
/** * @return the location of the DeploymentDescriptor file for a * particular type of J2EE Archive */ public String getDeploymentDescriptorPath() { return DOLUtils.warType().equals(getArchiveType()) ? DescriptorConstants.EJB_IN_WAR_ENTRY : DescriptorConstants.EJB_JAR_ENTRY; }
private void retrieveResourcesXMLFromArchive(Map<String, String> fileNames, ReadableArchive archive, String actualArchiveName) { if(ResourceUtil.hasResourcesXML(archive, locator)){ String archivePath = archive.getURI().getPath(); String fileName ; if(DeploymentUtils.isArchiveOfType(archive, DOLUtils.warType(), locator)){ fileName = archivePath + RESOURCES_XML_WEB_INF; }else{ fileName = archivePath + RESOURCES_XML_META_INF; } if(_logger.isLoggable(Level.FINEST)){ _logger.finest("GlassFish-Resources Deployer - fileName : " + fileName + " - parent : " + archive.getName()); } fileNames.put(actualArchiveName, fileName); } }
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; }
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; }
public WLSWebServicesDeploymentDescriptorFile(RootDeploymentDescriptor desc) { if (desc instanceof WebServicesDescriptor) { descriptorPath = (((WebServicesDescriptor)desc).getBundleDescriptor().getModuleType().equals(DOLUtils.warType())) ? WLDescriptorConstants.WL_WEB_WEBSERVICES_JAR_ENTRY : WLDescriptorConstants.WL_EJB_WEBSERVICES_JAR_ENTRY; } else if (desc instanceof WebBundleDescriptor) { descriptorPath = WLDescriptorConstants.WL_WEB_WEBSERVICES_JAR_ENTRY; } else if (desc instanceof EjbBundleDescriptor) { descriptorPath = WLDescriptorConstants.WL_EJB_WEBSERVICES_JAR_ENTRY; } }
public boolean supportsModuleType(ArchiveType moduleType) { return (DOLUtils.warType().equals(moduleType) || DOLUtils.ejbType().equals(moduleType)); }
private List<String> getSubModulesForEar(com.sun.enterprise.deployment.Application application, String type) { List<String> moduleInfoList = new ArrayList<String>(); Collection<ModuleDescriptor<BundleDescriptor>> modules = getSubModuleListForEar(application, type); for (ModuleDescriptor moduleDesc : modules) { String moduleInfo = moduleDesc.getArchiveUri() + ":" + moduleDesc.getModuleType(); if (moduleDesc.getModuleType().equals(DOLUtils.warType())) { moduleInfo = moduleInfo + ":" + moduleDesc.getContextRoot(); } moduleInfoList.add(moduleInfo); } return moduleInfoList; }
/** * Returns true if the passed file or directory is recognized by this * instance. * * @param location the file or directory to explore * @return true if this sniffer handles this application type */ @Override public boolean handles(ReadableArchive location) { return (DeploymentUtils.isArchiveOfType(location, DOLUtils.warType(), habitat) || DeploymentUtils.isArchiveOfType(location, DOLUtils.earType(), habitat) || isJar(location)); }
@Override protected boolean postHandles(ReadableArchive abstractArchive) throws IOException { AnnotationDetector detector = new AnnotationDetector(new EjbComponentAnnotationScanner()); return (!DeploymentUtils.isArchiveOfType(abstractArchive, DOLUtils.warType(), locator)) && detector.hasAnnotationInArchiveWithNoScanning(abstractArchive); } }
/** * 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); }
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; }
/** * 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; } }