@Override public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); deploymentUnit.putAttachment(attachmentKey, descriptorPropertyReplacement); }
public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); CompositePropertyResolver propertyResolver = new CompositePropertyResolver(deploymentUnit.getAttachment(Attachments.DEPLOYMENT_PROPERTY_RESOLVERS)); deploymentUnit.putAttachment(Attachments.FINAL_PROPERTY_RESOLVER, propertyResolver); deploymentUnit.putAttachment(Attachments.FINAL_PROPERTY_REPLACER, PropertyReplacers.resolvingReplacer(propertyResolver)); }
@Override public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); final List<EEModuleDescription> descriptions = new ArrayList<EEModuleDescription>(); for (final DeploymentUnit visibleDeployment : deploymentUnit.getAttachmentList(org.jboss.as.server.deployment.Attachments.ACCESSIBLE_SUB_DEPLOYMENTS)) { final EEModuleDescription description = visibleDeployment.getAttachment(Attachments.EE_MODULE_DESCRIPTION); if (description != null) { descriptions.add(description); } } final EEApplicationClasses classes = new EEApplicationClasses(descriptions); deploymentUnit.putAttachment(Attachments.EE_APPLICATION_CLASSES_DESCRIPTION, classes); }
public static void setType(final DeploymentType deploymentType, final DeploymentUnit deploymentUnit) { deploymentUnit.putAttachment(Attachments.DEPLOYMENT_TYPE, deploymentType); final ResourceRoot resourceRoot = deploymentUnit.getAttachment(org.jboss.as.server.deployment.Attachments.DEPLOYMENT_ROOT); if (resourceRoot != null) { resourceRoot.putAttachment(Attachments.DEPLOYMENT_TYPE, deploymentType); } }
return deploymentUnit.getAttachment(BatchAttachments.JOB_XML_RESOLVER); final Module module = deploymentUnit.getAttachment(Attachments.MODULE); final ClassLoader classLoader = module.getClassLoader(); WildFlyJobXmlResolver resolver; deploymentUnit.putAttachment(BatchAttachments.JOB_XML_RESOLVER, resolver); } else { resolver = create(classLoader, deploymentUnit.getAttachmentList(Attachments.RESOURCE_ROOTS)); } else { resolver = create(classLoader, Collections.singletonList(deploymentUnit.getAttachment(Attachments.DEPLOYMENT_ROOT))); deploymentUnit.putAttachment(BatchAttachments.JOB_XML_RESOLVER, resolver); subDeployment.putAttachment(BatchAttachments.JOB_XML_RESOLVER, toCopy); WildFlyJobXmlResolver.merge(resolver, toCopy);
public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); final String deploymentUnitName = deploymentUnit.getName(); final String moduleName; if (deploymentUnitName.endsWith(".war") || deploymentUnitName.endsWith(".jar") || deploymentUnitName.endsWith(".ear") || deploymentUnitName.endsWith(".rar")) { moduleName = deploymentUnitName.substring(0, deploymentUnitName.length() - 4); } else { moduleName = deploymentUnitName; } final String appName; final String earApplicationName = deploymentUnit.getAttachment(Attachments.EAR_APPLICATION_NAME); //the ear application name takes into account the name set in application.xml //if this is non-null this is always the one we want to use if(earApplicationName != null) { appName = earApplicationName; } else { //an appname of null means use the module name appName = null; } deploymentUnit.putAttachment(Attachments.EE_MODULE_DESCRIPTION, new EEModuleDescription(appName, moduleName, earApplicationName, appClient)); }
public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); final EEModuleDescription moduleDescription = deploymentUnit.getAttachment(EE_MODULE_DESCRIPTION); if(moduleDescription == null) { return; .install(); deploymentUnit.putAttachment(COMPONENT_REGISTRY, componentRegistry); if (deploymentUnit.getAttachment(Attachments.DEPLOYMENT_TYPE) == DeploymentType.EAR) { deploymentUnit.putAttachment(org.jboss.as.ee.component.Attachments.EE_APPLICATION_DESCRIPTION, applicationDescription); applicationDescription.addMessageDestination(messageDestination.getKey(), messageDestination.getValue(), deploymentUnit.getAttachment(org.jboss.as.server.deployment.Attachments.DEPLOYMENT_ROOT).getRoot()); subdeployment.putAttachment(EE_APPLICATION_DESCRIPTION, applicationDescription); deploymentUnit.putAttachment(org.jboss.as.ee.component.Attachments.EE_APPLICATION_DESCRIPTION, applicationDescription);
@Override public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); deploymentUnit.putAttachment(attachmentKey, annotationPropertyReplacement); }
protected static EjbJarDescription getEjbJarDescription(final DeploymentUnit deploymentUnit) { EjbJarDescription ejbJarDescription = deploymentUnit.getAttachment(EjbDeploymentAttachmentKeys.EJB_JAR_DESCRIPTION); final EEApplicationClasses applicationClassesDescription = deploymentUnit.getAttachment(org.jboss.as.ee.component.Attachments.EE_APPLICATION_CLASSES_DESCRIPTION); if (ejbJarDescription == null) { final EEModuleDescription moduleDescription = deploymentUnit.getAttachment(org.jboss.as.ee.component.Attachments.EE_MODULE_DESCRIPTION); ejbJarDescription = new EjbJarDescription(moduleDescription, deploymentUnit.getName().endsWith(".war")); deploymentUnit.putAttachment(EjbDeploymentAttachmentKeys.EJB_JAR_DESCRIPTION, ejbJarDescription); } return ejbJarDescription; }
@Override public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); final Module module = deploymentUnit.getAttachment(Attachments.MODULE); final EEModuleDescription moduleDescription = deploymentUnit.getAttachment(org.jboss.as.ee.component.Attachments.EE_MODULE_DESCRIPTION); if(module == null || moduleDescription == null) { return; } final LazyValidatorFactory factory = new LazyValidatorFactory(module.getClassLoader()); deploymentUnit.putAttachment(BeanValidationAttachments.VALIDATOR_FACTORY, factory); bindFactoryToJndi(factory,deploymentUnit,phaseContext,moduleDescription); }
@Override public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); bdaMap.put(handler.deploymentResourceRoot, bda); deploymentUnit.putAttachment(WeldAttachments.DEPLOYMENT_ROOT_BEAN_DEPLOYMENT_ARCHIVE, bdaMap.get(handler.deploymentResourceRoot)); id = bda.getId(); } else { id = deploymentUnit.getAttachment(WeldAttachments.DEPLOYMENT_ROOT_BEAN_DEPLOYMENT_ARCHIVE).getId(); deploymentUnit.putAttachment(WeldAttachments.BEAN_DEPLOYMENT_MODULE, bdm);
@Override public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { // add the external contexts to every DU attachments phaseContext.getDeploymentUnit().putAttachment(Attachments.EXTERNAL_CONTEXTS, externalContexts); }
public static WeldPortableExtensions getPortableExtensions(final DeploymentUnit deploymentUnit) { if (deploymentUnit.getParent() == null) { WeldPortableExtensions pes = deploymentUnit.getAttachment(WeldPortableExtensions.ATTACHMENT_KEY); if (pes == null) { deploymentUnit.putAttachment(ATTACHMENT_KEY, pes = new WeldPortableExtensions()); } return pes; } else { return getPortableExtensions(deploymentUnit.getParent()); } }
/** * Process a deployment for iron-jacamar.xml files. Will parse the xml file * and attach metadata discovered during processing. * * @param phaseContext the deployment unit context * @throws DeploymentUnitProcessingException */ @Override public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); final ResourceRoot resourceRoot = deploymentUnit.getAttachment(Attachments.DEPLOYMENT_ROOT); final VirtualFile deploymentRoot = resourceRoot.getRoot(); final boolean resolveProperties = Util.shouldResolveJBoss(deploymentUnit); IronJacamarXmlDescriptor xmlDescriptor = process(deploymentRoot, resolveProperties); if (xmlDescriptor != null) { deploymentUnit.putAttachment(IronJacamarXmlDescriptor.ATTACHMENT_KEY, xmlDescriptor); } }
@Override public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); ResourceRoot deploymentRoot = deploymentUnit.getAttachment(Attachments.DEPLOYMENT_ROOT); if (deploymentRoot == null) { return; deploymentUnit.putAttachment(WeldAttachments.CLASSES_RESOURCE_ROOT, resourceRoot); } else { VirtualFile beansXml = resourceRoot.getRoot().getChild(META_INF_BEANS_XML); deploymentUnit.putAttachment(ExplicitBeanArchiveMetadataContainer.ATTACHMENT_KEY, deploymentMetadata);
private void installWebsockets(final DeploymentPhaseContext phaseContext, final WebSocketDeploymentInfo webSocketDeploymentInfo) { DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); deploymentUnit.putAttachment(UndertowAttachments.WEB_SOCKET_DEPLOYMENT_INFO, webSocketDeploymentInfo); }
private void handleInfoFile(DeploymentUnit deploymentUnit, Module module) { final List<PredicatedHandler> handlerWrappers = new ArrayList<>(); ClassLoader oldCl = Thread.currentThread().getContextClassLoader(); try { ResourceRoot root = deploymentUnit.getAttachment(Attachments.DEPLOYMENT_ROOT); VirtualFile config = root.getRoot().getChild(WEB_INF); try { if (config.exists()) { handlerWrappers.addAll(PredicatedHandlersParser.parse(config.openStream(), module.getClassLoader())); } Enumeration<URL> paths = module.getClassLoader().getResources(META_INF); while (paths.hasMoreElements()) { URL path = paths.nextElement(); handlerWrappers.addAll(PredicatedHandlersParser.parse(path.openStream(), module.getClassLoader())); } } catch (IOException e) { throw new RuntimeException(e); } if (!handlerWrappers.isEmpty()) { deploymentUnit.putAttachment(PREDICATED_HANDLERS, handlerWrappers); } } finally { Thread.currentThread().setContextClassLoader(oldCl); } }
@Override public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); if(deploymentUnit.getParent() == null) { final EEResourceReferenceProcessorRegistry registry = new EEResourceReferenceProcessorRegistry(); registry.registerResourceReferenceProcessor(ContextServiceResourceReferenceProcessor.INSTANCE); registry.registerResourceReferenceProcessor(ManagedExecutorServiceResourceReferenceProcessor.INSTANCE); registry.registerResourceReferenceProcessor(ManagedScheduledExecutorServiceResourceReferenceProcessor.INSTANCE); registry.registerResourceReferenceProcessor(ManagedThreadFactoryResourceReferenceProcessor.INSTANCE); deploymentUnit.putAttachment(Attachments.RESOURCE_REFERENCE_PROCESSOR_REGISTRY, registry); } else{ deploymentUnit.putAttachment(Attachments.RESOURCE_REFERENCE_PROCESSOR_REGISTRY, deploymentUnit.getParent().getAttachment(Attachments.RESOURCE_REFERENCE_PROCESSOR_REGISTRY)); } }
@Override public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); if (!DeploymentTypeMarker.isType(DeploymentType.WAR, deploymentUnit)) { return; // Skip non web deployments final WarMetaData warMetaData = deploymentUnit.getAttachment(WarMetaData.ATTACHMENT_KEY); if (warMetaData == null || warMetaData.getMergedJBossWebMetaData() == null) { return; TldsMetaData tldsMetaData = deploymentUnit.getAttachment(TldsMetaData.ATTACHMENT_KEY); if (tldsMetaData == null) { tldsMetaData = new TldsMetaData(); deploymentUnit.putAttachment(TldsMetaData.ATTACHMENT_KEY, tldsMetaData); final List<TldMetaData> uniqueTlds = new ArrayList<>(); final VirtualFile deploymentRoot = deploymentUnit.getAttachment(Attachments.DEPLOYMENT_ROOT).getRoot(); final List<VirtualFile> testRoots = new ArrayList<VirtualFile>(); testRoots.add(deploymentRoot);
@Override public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { phaseContext.getDeploymentUnit().putAttachment(UndertowAttachments.DEFAULT_SECURITY_DOMAIN, defaultSecurityDomain); }