@Override public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); deploymentUnit.putAttachment(attachmentKey, descriptorPropertyReplacement); }
private ServiceName getProfileServiceName(final DeploymentPhaseContext phaseContext) { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); final DeploymentUnit parentDeploymentUnit = deploymentUnit.getParent(); if (parentDeploymentUnit != null) { return parentDeploymentUnit.getAttachment(EjbDeploymentAttachmentKeys.EJB_REMOTING_PROFILE_SERVICE_NAME); } else { return deploymentUnit.getAttachment(EjbDeploymentAttachmentKeys.EJB_REMOTING_PROFILE_SERVICE_NAME); } }
private ServiceName getDiscoveryServiceName(final DeploymentPhaseContext phaseContext) { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); final DeploymentUnit parentDeploymentUnit = deploymentUnit.getParent(); if (parentDeploymentUnit != null) { return DiscoveryService.BASE_NAME.append(parentDeploymentUnit.getName()); } else { return DiscoveryService.BASE_NAME.append(deploymentUnit.getName()); } }
@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); }
@Override public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); final EEModuleDescription eeModuleDescription = deploymentUnit.getAttachment(org.jboss.as.ee.component.Attachments.EE_MODULE_DESCRIPTION); final DeploymentDescriptorEnvironment environment = deploymentUnit.getAttachment(Attachments.MODULE_DEPLOYMENT_DESCRIPTOR_ENVIRONMENT); if (environment != null) { handleMethods(environment, eeModuleDescription, null); } }
/** * Process a deployment for standard ra deployment files. Will parse the xml * file and attach a configuration discovered during processing. * @param phaseContext the deployment unit context * @throws DeploymentUnitProcessingException */ @Override public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final VirtualFile deploymentRoot = phaseContext.getDeploymentUnit().getAttachment(Attachments.DEPLOYMENT_ROOT).getRoot(); process(deploymentRoot); }
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(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); // Only process EJB deployments if (!EjbDeploymentMarker.isEjbDeployment(deploymentUnit)) { return; } final EEModuleDescription eeModuleDescription = deploymentUnit.getAttachment(Attachments.EE_MODULE_DESCRIPTION); final Collection<ComponentDescription> componentDescriptions = eeModuleDescription.getComponentDescriptions(); if (componentDescriptions != null) { for (ComponentDescription componentDescription : componentDescriptions) { // process only EJB session beans if (componentDescription instanceof SessionBeanComponentDescription) { this.setupJNDIBindings((EJBComponentDescription) componentDescription, deploymentUnit); } } } if (appclient) { for (final ComponentDescription component : deploymentUnit.getAttachmentList(Attachments.ADDITIONAL_RESOLVABLE_COMPONENTS)) { this.setupJNDIBindings((EJBComponentDescription) component, deploymentUnit); } } }
final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); final Module module = deploymentUnit.getAttachment(Attachments.MODULE); final ServicesAttachment servicesAttachment = deploymentUnit.getAttachment(Attachments.SERVICES); if (module != null && servicesAttachment != null) { final ModuleClassLoader classLoader = module.getClassLoader(); Integer.valueOf(minorVersion)); String driverName = deploymentUnit.getName(); if ((driverName.contains(".") && ! driverName.endsWith(".jar")) || driverNames.size() != 1) { driverName += "_" + driverClassName + "_" + majorVersion + "_" + minorVersion;
public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); if (deploymentUnit.getParent() != null) { return; } final List<ResourceRoot> resourceRoots = deploymentUnit.getAttachmentList(Attachments.RESOURCE_ROOTS); for (ResourceRoot resourceRoot : resourceRoots) { final VirtualFile rootFile = resourceRoot.getRoot(); if (!SubDeploymentMarker.isSubDeployment(resourceRoot)) { final VirtualFile sarDescriptor = rootFile .getChild(ServiceDeploymentParsingProcessor.SERVICE_DESCRIPTOR_PATH); if (sarDescriptor.exists()) { SubDeploymentMarker.mark(resourceRoot); ModuleRootMarker.mark(resourceRoot); } } } }
public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { if (phaseContext.getAttachment(Attachments.DEPLOYMENT_TYPE) == DeploymentType.EAR) { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); // Make sure the next phase of this EAR depends on this phase of not just the EAR but also all subdeployments for (DeploymentUnit subdeployment : deploymentUnit.getAttachmentList(SUB_DEPLOYMENTS)) { phaseContext.addToAttachmentList(NEXT_PHASE_DEPS, Services.deploymentUnitName(deploymentUnit.getName(), subdeployment.getName(), phaseContext.getPhase())); } } }
@Override public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final List<MessageDestinationInjectionSource> injections = phaseContext.getDeploymentUnit().getAttachmentList(Attachments.MESSAGE_DESTINATIONS); for (final MessageDestinationInjectionSource injection : injections) { injection.resolve(phaseContext); } }
@Override public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); List<ResourceRoot> resourceRoots = DeploymentUtils.allResourceRoots(deploymentUnit); for (ResourceRoot resourceRoot : resourceRoots) { final VirtualFile deploymentRoot = resourceRoot.getRoot(); if (deploymentRoot.getChild("META-INF/services/java.sql.Driver").exists()) { DEPLOYER_JDBC_LOGGER.debugf("SQL driver detected: %s", deploymentUnit.getName()); break; } } }
public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { DeploymentUnit depUnit = phaseContext.getDeploymentUnit(); String depName = depUnit.getName().toLowerCase(Locale.ENGLISH); if (depName.endsWith(WAR_EXTENSION)) { MountExplodedMarker.setMountExploded(depUnit); } }
public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); final DeploymentUnit parent = deploymentUnit.getParent() == null ? deploymentUnit : deploymentUnit.getParent(); if(JsfVersionMarker.isJsfDisabled(deploymentUnit)) { return; } if (WeldDeploymentMarker.isPartOfWeldDeployment(deploymentUnit)) { WeldPortableExtensions extensions = WeldPortableExtensions.getPortableExtensions(parent); extensions.registerExtensionInstance(new JSFPassivatingViewScopedCdiExtension(), parent); } }
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)); }
private ServiceName getEJBClientContextServiceName(final DeploymentPhaseContext phaseContext) { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); final DeploymentUnit parentDeploymentUnit = deploymentUnit.getParent(); // The top level parent deployment unit will have the attachment containing the EJB client context // service name ServiceName serviceName; if (parentDeploymentUnit != null) { serviceName = parentDeploymentUnit.getAttachment(EjbDeploymentAttachmentKeys.EJB_CLIENT_CONTEXT_SERVICE_NAME); } else { serviceName = deploymentUnit.getAttachment(EjbDeploymentAttachmentKeys.EJB_CLIENT_CONTEXT_SERVICE_NAME); } if (serviceName != null) { return serviceName; } return EJBClientContextService.DEFAULT_SERVICE_NAME; }
@Override public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); final EEModuleDescription eeModuleDescription = deploymentUnit.getAttachment(Attachments.EE_MODULE_DESCRIPTION); final CompositeIndex index = deploymentUnit.getAttachment(org.jboss.as.server.deployment.Attachments.COMPOSITE_ANNOTATION_INDEX); final List<AnnotationInstance> aroundInvokes = index.getAnnotations(AROUND_INVOKE_ANNOTATION_NAME); for (AnnotationInstance annotation : aroundInvokes) { processAroundInvoke(eeModuleDescription, annotation.target()); } }
public void resolve(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); final EEApplicationDescription applicationDescription = deploymentUnit.getAttachment(EE_APPLICATION_DESCRIPTION); final ResourceRoot deploymentRoot = deploymentUnit.getAttachment(Attachments.DEPLOYMENT_ROOT); final Set<String> names = applicationDescription.resolveMessageDestination(messageDestinationName, deploymentRoot.getRoot()); if (names.isEmpty()) { error = EeLogger.ROOT_LOGGER.noMessageDestination(messageDestinationName, bindingName); return; } if (names.size() > 1) { error = EeLogger.ROOT_LOGGER.moreThanOneMessageDestination(messageDestinationName, bindingName, names); return; } resolvedLookupName = names.iterator().next(); }
@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); }