Refine search
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; }
/** * * This API is used to help determine if the sniffer should recognize * the current archive. * If the sniffer does not support the archive type associated with * the current deployment, the sniffer should not recognize the archive. * * @param archiveType the archive type to check * @return whether the sniffer supports the archive type * */ public boolean supportsArchiveType(ArchiveType archiveType) { if (archiveType.equals(ejbType) || archiveType.toString().equals(ModuleType.WAR.toString())) { return true; } return false; }
if (aModule.getArchiveUri().indexOf(" ") != -1) { throw new IllegalArgumentException(localStrings.getLocalString("enterprise.deployment.unsupporturi", "Unsupported module URI {0}, it contains space(s)", new Object[]{aModule.getArchiveUri()})); if(DOLUtils.getDefaultLogger().isLoggable(Level.FINE)) { DOLUtils.getDefaultLogger().fine("Opening sub-module " + aModule); Archivist newArchivist = archivistFactory.get().getArchivist(aModule.getModuleType()); newArchivist.initializeContext(this); newArchivist.setRuntimeXMLValidation(this.getRuntimeXMLValidation()); DOLUtils.setExtensionArchivistForSubArchivist(habitat, embeddedArchive, aModule, app, newArchivist); if (aModule.getAlternateDescriptor()!=null) { if (aModule.getModuleType().equals(DOLUtils.warType())) { WebBundleDescriptor wbd = (WebBundleDescriptor) descriptor; if (wbd.getContextRoot() != null && !wbd.getContextRoot().equals(""))
/** * 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; } }
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; }
@Override protected void accept(EjbReference ejbRef) { if (DOLUtils.getDefaultLogger().isLoggable(Level.FINE)) { DOLUtils.getDefaultLogger().fine("Visiting Ref" + ejbRef); if (DOLUtils.getDefaultLogger().isLoggable(Level.FINE)) { DOLUtils.getDefaultLogger().fine("Ref " + ejbRef.getName() + " is bound to Ejb with JNDI Name " + ejbRef.getJndiName()); relativeUri = targetModule.getModuleDescriptor().getArchiveUri(); } else { } else { final ArchiveType moduleType = ejbRef.getReferringBundleDescriptor().getModuleType(); if(moduleType != null && moduleType.equals(DOLUtils.carType())) { || ( (getApplication() == null) && (referringBundle.getModuleType() != null && referringBundle.getModuleType().equals(DOLUtils.warType())) ) ) {
String moduleUri = md.getArchiveUri(); try { sub = archive.getSubArchive(moduleUri); context.getModuleArchiveHandlers().get(moduleUri); if (handler == null) { handler = getArchiveHandlerFromModuleType(md.getModuleType()); if (handler == null) { handler = deployment.getArchiveHandler(sub); if (md.getModuleType().equals(DOLUtils.ejbType())) { } else if (md.getModuleType().equals(DOLUtils.rarType())) { embeddedConnCl.addDelegate( (DelegatingClassLoader.ClassFinder)subCl);
/** * 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()); }
} else if (element.getQName().equals(RuntimeTagNames.UNIQUE_ID)) { DOLUtils.getDefaultLogger().finer("Ignoring unique id"); return; } else if (md.getModuleType().equals(DOLUtils.warType())) { md.setContextRoot(value); } else { throw new RuntimeException(currentWebUri + " uri does not point to a web bundle");
private static Collection<Sniffer> getSniffersForModule(ServiceLocator habitat, ReadableArchive archive, ModuleDescriptor md, Application app) throws Exception { ArchiveHandler handler = habitat.getService(ArchiveHandler.class, md.getModuleType().toString()); SnifferManager snifferManager = habitat.getService(SnifferManager.class); List<URI> classPathURIs = handler.getClassPathURIs(archive); classPathURIs.addAll(getLibraryJarURIs(app, archive)); Types types = archive.getParentArchive().getExtraData(Types.class); DeployCommandParameters parameters = archive.getParentArchive().getArchiveMetaData(DeploymentProperties.COMMAND_PARAMS, DeployCommandParameters.class); Collection<Sniffer> sniffers = snifferManager.getSniffers(context, classPathURIs, types); context.postDeployClean(true); String type = getTypeFromModuleType(md.getModuleType()); Sniffer mainSniffer = null; for (Sniffer sniffer : sniffers) { List<String> allIncompatTypes = addAdditionalIncompatTypes(mainSniffer, incompatibleTypes); INCOMPATIBLE_TYPE, new Object[] { type, md.getArchiveUri(), incompatType });
@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())); }
module.getModuleName().equals(module2.getModuleName())) { conflicted.add(module2); foundConflictedModule = true; cModule.setModuleName(cModule.getModuleName() + cModule.getModuleType().toString());
@Override public int hashCode() { return toString().hashCode(); }
/** * Lookup module by uri. * * @return a bundle descriptor in this application identified by uri * or null if not found. */ public Collection<ModuleDescriptor<BundleDescriptor>> getModuleDescriptorsByType(ArchiveType type) { if (type==null) { throw new IllegalArgumentException("type cannot be null"); } LinkedList<ModuleDescriptor<BundleDescriptor>> results = new LinkedList<ModuleDescriptor<BundleDescriptor>>(); for (ModuleDescriptor<BundleDescriptor> aModule : getModules()) { if (type.equals(aModule.getModuleType())) { results.add(aModule); } } return results; }
/** * * This API is used to help determine if the sniffer should recognize * the current archive. * If the sniffer does not support the archive type associated with * the current deployment, the sniffer should not recognize the archive. * * @param archiveType the archive type to check * @return whether the sniffer supports the archive type * */ public boolean supportsArchiveType(ArchiveType archiveType) { if (archiveType.equals(warType)) { return true; } return false; }