public void deploy(VFSDeploymentUnit unit, Module module) throws DeploymentException { // we already used mc scanning or some other mechanism to create repo if (unit.isAttachmentPresent(AnnotationRepository.class)) return; // running this deployer is costly, check if it should be run if (filter != null && filter.accepts(unit) == false) return; if (log.isTraceEnabled()) log.trace("Creating AnnotationRepository for " + unit.getName() + ", module: " + module); visitModule(unit); } }
@Override public void undeploy(VFSDeploymentUnit unit) { log.debug("Removing dynamic class root for " + unit.getName()); try { unit.removeAttachment(DYNAMIC_CLASS_URL_KEY, URL.class); VirtualFile classes = unit.removeAttachment(DYNAMIC_CLASS_KEY, VirtualFile.class); if (classes != null) { unit.removeClassPath(classes); } } finally { try { Closeable closeable = unit.removeAttachment(MOUNT_HANDLE_KEY, Closeable.class); if (closeable != null) { closeable.close(); } } catch (Exception e) { log.warn("Error deleting dynamic class root for " + unit.getName(), e); } } }
@Override public void deploy(VFSDeploymentUnit unit, SwitchYardMetaData metaData) throws DeploymentException { try { parseSwitchYardConfig(metaData); _log.debug("Successfully parsed SwitchYard configuration for deployment unit '" + unit.getName() + "'."); } catch (IOException ioe) { throw new DeploymentException(ioe); } BeanMetaData beanMetaData = createBeanMetaData(unit, metaData); unit.addAttachment(BeanMetaData.class, beanMetaData); }
logger.error("Failure while deploying " + vfsDU.getName(), e);
log.trace("Cannot scan classes, missing AnnotationRepository as attachment: " + unit.getName()); return Collections.emptySet();
String archives = path.getArchives(); log.debugf("Processing classpath: %1s codebase=%2s archives=%3s", unit.getName(), codebase, archives); VirtualFile codebaseFile = unit.getRoot(); if (".".equals(codebase) == false) throw new DeploymentException("No default codebase root for " + codebase + " in " + unit.getName()); URL codeBaseURL = new URL(defaultCodeBaseRoot, codebase); codebaseFile = VFS.getChild(codeBaseURL); throw new DeploymentException("Cannot use classpath without a root: " + unit.getName()); log.debugf("Using codebase as classpath: %1s", unit.getName());
@Override public void deploy(VFSDeploymentUnit unit, JBossWebMetaData metaData) throws DeploymentException { if (!isJSFUnitDeployment(unit)) return; if (disabled) { log.warn(unit.getSimpleName() + " could not be deployed. JSFUnitDeployer disabled from previous errors."); return; } mergeWebXml(metaData); try { addClasspaths(unit); } catch (MalformedURLException e) { throw DeploymentException.rethrowAsDeploymentException("Malformed URL", e); } log.info("Added JSFUnit to " + unit.getName()); }
@Override public void undeploy(VFSDeploymentUnit unit, JBossClientMetaData metaData) log.debug("undeploy " + unit.getName());
/** * Will parse the VirtualFile representing the deployment and parse the SwitchYard configuration xml and extract information from * the archive to create an {@link SwitchYardMetaData} instance that will be returned. */ @Override protected SwitchYardMetaData parse(final VFSDeploymentUnit deploymentUnit, final VirtualFile file, final SwitchYardMetaData metadata) throws Exception { VirtualFile configFile = findSwitchYardConfigFile(file); final String archiveName = deploymentUnit.getSimpleName(); final String deploymentName = getDeploymentName(deploymentUnit); if (!configFile.isFile()) { throw new DeploymentException("Could not find " + SWITCHYARD_DEPLOYMENT_XML); } final SwitchYardMetaData switchYardMetaData = new SwitchYardMetaData(archiveName, deploymentName); _log.debug("Located configuration for deployment unit '" + deploymentUnit.getName() + "' and attached to deployment metadata instance."); switchYardMetaData.setSwitchYardFile(configFile); return switchYardMetaData; }
String name = deploymentUnit.getName(); if (name.endsWith("/"))
String domainName = unit.getName(); if (unit.getName().equals(domainName) == false && name.equals(domainName) == false) log.warn("Overridding jboss-web.xml loader repository name: " + name); classLoadingMetaData.setName(unit.getName()); classLoadingMetaData.setDomain(domainName); if (parentDomain != null)
public void deploy(VFSDeploymentUnit unit) throws DeploymentException { try { VirtualFile classes = VFS.getChild(createHost(unit)); URL dynamicClassRoot = classes.toURL(); Closeable closeable = VFS.mountTemp(classes, tempFileProvider); unit.addAttachment(MOUNT_HANDLE_KEY, closeable); unit.addAttachment(DYNAMIC_CLASS_KEY, classes); unit.addAttachment(DYNAMIC_CLASS_URL_KEY, dynamicClassRoot); unit.prependClassPath(classes); log.debug("Dynamic class root for " + unit.getName() + " is " + dynamicClassRoot); } catch (Exception e) { throw new DeploymentException("Error creating dynamic class root", e); } }
attachmentName = "org.jboss.resource.metadata.ConnectorMetaData"; else throw new IllegalStateException("Expected module types in an EAR are ejb, web, java and connector but got " + module.getType() + " for " + child.getName() + " in " + unit.getName());
throw new DeploymentException("No module in deployment unit's hierarchy: " + unit.getName());
throw new DeploymentException("No module in deployment unit's hierarchy: " + unit.getName());
protected void internalDeploy(VFSDeploymentUnit unit, T deployment, Collection<VirtualFile> wbXml) throws DeploymentException { ClassLoadingMetaData classLoadingMetaData = unit.getAttachment(ClassLoadingMetaData.class); if (classLoadingMetaData != null) return; if (isClassLoadingMetadataPresent(deployment)) return; if (isIsolated(unit, wbXml) == false) return; String domain = getJMXName(deployment, unit) + ",extension=LoaderRepository"; classLoadingMetaData = new ClassLoadingMetaData(); classLoadingMetaData.setName(unit.getName()); classLoadingMetaData.setDomain(domain); classLoadingMetaData.setExportAll(ExportAll.NON_EMPTY); classLoadingMetaData.setImportAll(true); classLoadingMetaData.setVersion(Version.DEFAULT_VERSION); classLoadingMetaData.setJ2seClassLoadingCompliance(false); unit.addAttachment(ClassLoadingMetaData.class, classLoadingMetaData); }