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())); } } }
phaseContext.addToAttachmentList(org.jboss.as.server.deployment.Attachments.NEXT_PHASE_DEPS, serviceName.append(Phase.INSTALL.name())); final DeploymentUnit prevDeployment = deploymentUnitMap.get(previous.getFileName()); phaseContext.addToAttachmentList(org.jboss.as.server.deployment.Attachments.NEXT_PHASE_DEPS, DeploymentCompleteServiceProcessor.serviceName(prevDeployment.getServiceName()));
@Override public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); CapabilityServiceSupport support = deploymentUnit.getAttachment(Attachments.CAPABILITY_SERVICE_SUPPORT); ServiceName namingStoreServiceName = support.getCapabilityServiceName(NamingService.CAPABILITY_NAME); //this will always be up but we need to make sure the naming service is //not shut down before the deployment is undeployed when the container is shut down phaseContext.addToAttachmentList(Attachments.NEXT_PHASE_DEPS, namingStoreServiceName); List<ServiceName> dependencies = deploymentUnit.getAttachmentList(Attachments.JNDI_DEPENDENCIES); final ServiceName serviceName = serviceName(deploymentUnit.getServiceName()); final ServiceBuilder<?> serviceBuilder = phaseContext.getServiceTarget().addService(serviceName, new RuntimeBindReleaseService()); for (final ServiceName dependency : dependencies) { serviceBuilder.requires(dependency); } if(deploymentUnit.getParent() != null) { for (final ServiceName jndiDependency : deploymentUnit.getParent().getAttachment(Attachments.JNDI_DEPENDENCIES)) { serviceBuilder.requires(jndiDependency); } } serviceBuilder.requires(namingStoreServiceName); serviceBuilder.install(); }
private void processDependencies(final DeploymentPhaseContext phaseContext, final DeploymentUnit deploymentUnit) { final DeploymentDependencies deps = deploymentUnit.getAttachment(DeploymentDependencies.ATTACHMENT_KEY); if (!deps.getDependencies().isEmpty()) { for (final String deployment : deps.getDependencies()) { final ServiceName name = DeploymentCompleteServiceProcessor.serviceName(Services.deploymentUnitName(deployment)); phaseContext.addToAttachmentList(Attachments.NEXT_PHASE_DEPS, name); } } }
private void processDependencies(final DeploymentPhaseContext phaseContext, final DeploymentUnit deploymentUnit) { final DeploymentDependencies deps = deploymentUnit.getAttachment(DeploymentDependencies.ATTACHMENT_KEY); if (!deps.getDependencies().isEmpty()) { for (final String deployment : deps.getDependencies()) { final ServiceName name = DeploymentCompleteServiceProcessor.serviceName(Services.deploymentUnitName(deployment)); phaseContext.addToAttachmentList(Attachments.NEXT_PHASE_DEPS, name); } } }
private void processDependencies(final DeploymentPhaseContext phaseContext, final DeploymentUnit deploymentUnit) { final DeploymentDependencies deps = deploymentUnit.getAttachment(DeploymentDependencies.ATTACHMENT_KEY); if (!deps.getDependencies().isEmpty()) { for (final String deployment : deps.getDependencies()) { final ServiceName name = DeploymentCompleteServiceProcessor.serviceName(Services.deploymentUnitName(deployment)); phaseContext.addToAttachmentList(Attachments.NEXT_PHASE_DEPS, name); } } }
private void processDependencies(final DeploymentPhaseContext phaseContext, final DeploymentUnit deploymentUnit) { final DeploymentDependencies deps = deploymentUnit.getAttachment(DeploymentDependencies.ATTACHMENT_KEY); if (!deps.getDependencies().isEmpty()) { for (final String deployment : deps.getDependencies()) { final ServiceName name = DeploymentCompleteServiceProcessor.serviceName(Services.deploymentUnitName(deployment)); phaseContext.addToAttachmentList(Attachments.NEXT_PHASE_DEPS, name); } } }
@Override public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); final CompositeIndex index = deploymentUnit.getAttachment(Attachments.COMPOSITE_ANNOTATION_INDEX); for (final JaxrsAnnotations annotation : JaxrsAnnotations.values()) { if (!index.getAnnotations(annotation.getDotName()).isEmpty()) { JaxrsDeploymentMarker.mark(deploymentUnit); phaseContext.addToAttachmentList(Attachments.NEXT_PHASE_DEPS, Services.JBOSS_MODULE_INDEX_SERVICE); return; } } }
deploymentUnit.putAttachment(Attachments.EXTENSION_INFORMATION, info); phaseContext.addToAttachmentList(Attachments.NEXT_PHASE_DEPS, Services.JBOSS_DEPLOYMENT_EXTENSION_INDEX);
deploymentUnit.putAttachment(Attachments.EXTENSION_INFORMATION, info); phaseContext.addToAttachmentList(Attachments.NEXT_PHASE_DEPS, Services.JBOSS_DEPLOYMENT_EXTENSION_INDEX);
@Override public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { //this will always be up but we need to make sure the naming service is //not shut down before the deployment is undeployed when the container is shut down phaseContext.addToAttachmentList(Attachments.NEXT_PHASE_DEPS, NamingService.SERVICE_NAME); final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); List<ServiceName> dependencies = deploymentUnit.getAttachmentList(Attachments.JNDI_DEPENDENCIES); final ServiceName serviceName = serviceName(deploymentUnit.getServiceName()); final ServiceBuilder<?> serviceBuilder = phaseContext.getServiceTarget().addService(serviceName, new RuntimeBindReleaseService()); serviceBuilder.addDependencies(dependencies); if(deploymentUnit.getParent() != null) { serviceBuilder.addDependencies(deploymentUnit.getParent().getAttachment(Attachments.JNDI_DEPENDENCIES)); } serviceBuilder.install(); }
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())); } } }
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())); } } }
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 { DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); CapabilityServiceSupport support = deploymentUnit.getAttachment(Attachments.CAPABILITY_SERVICE_SUPPORT); ServiceName namingStoreServiceName = support.getCapabilityServiceName(NamingService.CAPABILITY_NAME); //this will always be up but we need to make sure the naming service is //not shut down before the deployment is undeployed when the container is shut down phaseContext.addToAttachmentList(Attachments.NEXT_PHASE_DEPS, namingStoreServiceName); List<ServiceName> dependencies = deploymentUnit.getAttachmentList(Attachments.JNDI_DEPENDENCIES); final ServiceName serviceName = serviceName(deploymentUnit.getServiceName()); final ServiceBuilder<?> serviceBuilder = phaseContext.getServiceTarget().addService(serviceName, new RuntimeBindReleaseService()); serviceBuilder.addDependencies(dependencies); if(deploymentUnit.getParent() != null) { serviceBuilder.addDependencies(deploymentUnit.getParent().getAttachment(Attachments.JNDI_DEPENDENCIES)); } serviceBuilder.addDependency(namingStoreServiceName); serviceBuilder.install(); }
@Override public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); CapabilityServiceSupport support = deploymentUnit.getAttachment(Attachments.CAPABILITY_SERVICE_SUPPORT); ServiceName namingStoreServiceName = support.getCapabilityServiceName(NamingService.CAPABILITY_NAME); //this will always be up but we need to make sure the naming service is //not shut down before the deployment is undeployed when the container is shut down phaseContext.addToAttachmentList(Attachments.NEXT_PHASE_DEPS, namingStoreServiceName); List<ServiceName> dependencies = deploymentUnit.getAttachmentList(Attachments.JNDI_DEPENDENCIES); final ServiceName serviceName = serviceName(deploymentUnit.getServiceName()); final ServiceBuilder<?> serviceBuilder = phaseContext.getServiceTarget().addService(serviceName, new RuntimeBindReleaseService()); for (final ServiceName dependency : dependencies) { serviceBuilder.requires(dependency); } if(deploymentUnit.getParent() != null) { for (final ServiceName jndiDependency : deploymentUnit.getParent().getAttachment(Attachments.JNDI_DEPENDENCIES)) { serviceBuilder.requires(jndiDependency); } } serviceBuilder.requires(namingStoreServiceName); serviceBuilder.install(); }
/** * The sub-deployment phases run in parallel, ensure that no deployment/sub-deployment moves past * Phase.FIRST_MODULE_USE, until the applications persistence unit services are started. * * Note that some application persistence units will not be created until the Phase.INSTALL, in which case * NEXT_PHASE_DEPS is not needed. */ private static void nextPhaseDependsOnPersistenceUnit(final DeploymentPhaseContext phaseContext, final Platform platform) throws DeploymentUnitProcessingException { final DeploymentUnit topDeploymentUnit = DeploymentUtils.getTopDeploymentUnit(phaseContext.getDeploymentUnit()); final PersistenceUnitsInApplication persistenceUnitsInApplication = topDeploymentUnit.getAttachment(PersistenceUnitsInApplication.PERSISTENCE_UNITS_IN_APPLICATION); for(final PersistenceUnitMetadataHolder holder: persistenceUnitsInApplication.getPersistenceUnitHolders()) { for (final PersistenceUnitMetadata pu : holder.getPersistenceUnits()) { String jpaContainerManaged = pu.getProperties().getProperty(Configuration.JPA_CONTAINER_MANAGED); boolean deployPU = (jpaContainerManaged == null? true : Boolean.parseBoolean(jpaContainerManaged)); if (deployPU) { final ServiceName puServiceName = PersistenceUnitServiceImpl.getPUServiceName(pu); final PersistenceProviderDeploymentHolder persistenceProviderDeploymentHolder = getPersistenceProviderDeploymentHolder(phaseContext.getDeploymentUnit()); final PersistenceProvider provider = lookupProvider(pu, persistenceProviderDeploymentHolder, phaseContext.getDeploymentUnit()); final PersistenceProviderAdaptor adaptor = getPersistenceProviderAdaptor(pu, persistenceProviderDeploymentHolder, phaseContext.getDeploymentUnit(), provider, platform); final boolean twoPhaseBootStrapCapable = (adaptor instanceof TwoPhaseBootstrapCapable) && Configuration.allowTwoPhaseBootstrap(pu); // only add the next phase dependency, if the persistence unit service is starting early. if( Configuration.needClassFileTransformer(pu)) { // wait until the persistence unit service is started before starting the next deployment phase phaseContext.addToAttachmentList(Attachments.NEXT_PHASE_DEPS, twoPhaseBootStrapCapable ? puServiceName.append(FIRST_PHASE) : puServiceName); } } } } }
/** * The sub-deployment phases run in parallel, ensure that no deployment/sub-deployment moves past * Phase.FIRST_MODULE_USE, until the applications persistence unit services are started. * * Note that some application persistence units will not be created until the Phase.INSTALL, in which case * NEXT_PHASE_DEPS is not needed. */ private static void nextPhaseDependsOnPersistenceUnit(final DeploymentPhaseContext phaseContext, final Platform platform) throws DeploymentUnitProcessingException { final DeploymentUnit topDeploymentUnit = DeploymentUtils.getTopDeploymentUnit(phaseContext.getDeploymentUnit()); final PersistenceUnitsInApplication persistenceUnitsInApplication = topDeploymentUnit.getAttachment(PersistenceUnitsInApplication.PERSISTENCE_UNITS_IN_APPLICATION); for(final PersistenceUnitMetadataHolder holder: persistenceUnitsInApplication.getPersistenceUnitHolders()) { for (final PersistenceUnitMetadata pu : holder.getPersistenceUnits()) { String jpaContainerManaged = pu.getProperties().getProperty(Configuration.JPA_CONTAINER_MANAGED); boolean deployPU = (jpaContainerManaged == null? true : Boolean.parseBoolean(jpaContainerManaged)); if (deployPU) { final ServiceName puServiceName = PersistenceUnitServiceImpl.getPUServiceName(pu); final PersistenceProviderDeploymentHolder persistenceProviderDeploymentHolder = getPersistenceProviderDeploymentHolder(phaseContext.getDeploymentUnit()); final PersistenceProvider provider = lookupProvider(pu, persistenceProviderDeploymentHolder, phaseContext.getDeploymentUnit()); final PersistenceProviderAdaptor adaptor = getPersistenceProviderAdaptor(pu, persistenceProviderDeploymentHolder, phaseContext.getDeploymentUnit(), provider, platform); final boolean twoPhaseBootStrapCapable = (adaptor instanceof TwoPhaseBootstrapCapable) && Configuration.allowTwoPhaseBootstrap(pu); // only add the next phase dependency, if the persistence unit service is starting early. if( Configuration.needClassFileTransformer(pu)) { // wait until the persistence unit service is started before starting the next deployment phase phaseContext.addToAttachmentList(Attachments.NEXT_PHASE_DEPS, twoPhaseBootStrapCapable ? puServiceName.append(FIRST_PHASE) : puServiceName); } } } } }
@Override public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); final ResourceRoot deploymentResourceRoot = deploymentUnit.getAttachment(Attachments.DEPLOYMENT_ROOT); final ServiceVerificationHandler serviceVerificationHandler = deploymentUnit.getAttachment(Attachments.SERVICE_VERIFICATION_HANDLER); final ServiceTarget serviceTarget = phaseContext.getServiceTarget(); final List<ResourceRoot> childRoots = deploymentUnit.getAttachmentList(Attachments.RESOURCE_ROOTS); for (final ResourceRoot childRoot : childRoots) { if (childRoot == deploymentResourceRoot || !SubDeploymentMarker.isSubDeployment(childRoot)) { continue; } final Resource resource = DeploymentModelUtils.createSubDeployment(childRoot.getRootName(), deploymentUnit); final ImmutableManagementResourceRegistration registration = deploymentUnit.getAttachment(DeploymentModelUtils.REGISTRATION_ATTACHMENT); final ManagementResourceRegistration mutableRegistration = deploymentUnit.getAttachment(DeploymentModelUtils.MUTABLE_REGISTRATION_ATTACHMENT); final AbstractVaultReader vaultReader = deploymentUnit.getAttachment(Attachments.VAULT_READER_ATTACHMENT_KEY); final SubDeploymentUnitService service = new SubDeploymentUnitService(childRoot, deploymentUnit, registration, mutableRegistration, resource, serviceVerificationHandler, vaultReader); final ResourceRoot parentRoot = deploymentUnit.getAttachment(Attachments.DEPLOYMENT_ROOT); final String relativePath = childRoot.getRoot().getPathNameRelativeTo(parentRoot.getRoot()); final ServiceName serviceName = Services.deploymentUnitName(deploymentUnit.getName(), relativePath); serviceTarget.addService(serviceName, service) .addDependency(Services.JBOSS_DEPLOYMENT_CHAINS, DeployerChains.class, service.getDeployerChainsInjector()) .setInitialMode(ServiceController.Mode.ACTIVE) .install(); phaseContext.addDeploymentDependency(serviceName, Attachments.SUB_DEPLOYMENTS); //we also need a dep on the first phase of the sub deployments phaseContext.addToAttachmentList(Attachments.NEXT_PHASE_DEPS, serviceName.append(ServiceName.of(Phase.STRUCTURE.name()))); } }
@Override public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); final ResourceRoot deploymentResourceRoot = deploymentUnit.getAttachment(Attachments.DEPLOYMENT_ROOT); final ServiceVerificationHandler serviceVerificationHandler = deploymentUnit.getAttachment(Attachments.SERVICE_VERIFICATION_HANDLER); if(deploymentResourceRoot.getRoot().isDirectory()) { ExplodedDeploymentMarker.markAsExplodedDeployment(deploymentUnit); } final ServiceTarget serviceTarget = phaseContext.getServiceTarget(); final List<ResourceRoot> childRoots = deploymentUnit.getAttachmentList(Attachments.RESOURCE_ROOTS); for (final ResourceRoot childRoot : childRoots) { if (childRoot == deploymentResourceRoot || !SubDeploymentMarker.isSubDeployment(childRoot)) { continue; } final Resource resource = DeploymentModelUtils.createSubDeployment(childRoot.getRootName(), deploymentUnit); final ImmutableManagementResourceRegistration registration = deploymentUnit.getAttachment(DeploymentModelUtils.REGISTRATION_ATTACHMENT); final ManagementResourceRegistration mutableRegistration = deploymentUnit.getAttachment(DeploymentModelUtils.MUTABLE_REGISTRATION_ATTACHMENT); final AbstractVaultReader vaultReader = deploymentUnit.getAttachment(Attachments.VAULT_READER_ATTACHMENT_KEY); final SubDeploymentUnitService service = new SubDeploymentUnitService(childRoot, deploymentUnit, registration, mutableRegistration, resource, serviceVerificationHandler, vaultReader); final ServiceName serviceName = Services.deploymentUnitName(deploymentUnit.getName(), childRoot.getRootName()); serviceTarget.addService(serviceName, service) .addDependency(Services.JBOSS_DEPLOYMENT_CHAINS, DeployerChains.class, service.getDeployerChainsInjector()) .setInitialMode(ServiceController.Mode.ACTIVE) .install(); phaseContext.addDeploymentDependency(serviceName, Attachments.SUB_DEPLOYMENTS); //we also need a dep on the first phase of the sub deployments phaseContext.addToAttachmentList(Attachments.NEXT_PHASE_DEPS, serviceName.append(ServiceName.of(Phase.STRUCTURE.name()))); } }