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(DeploymentPhaseContext context) throws DeploymentUnitProcessingException { DeploymentUnit unit = context.getDeploymentUnit(); if (unit.getParent() == null) { SingletonPolicy policy = context.getAttachment(POLICY_KEY); if (policy != null) { CapabilityServiceSupport support = unit.getAttachment(Attachments.CAPABILITY_SERVICE_SUPPORT); // Ideally, we would just install the next phase using the singleton policy, however deployment unit phases do not currently support restarts // Restart the deployment using the attached phase builder, but only if a builder was not already attached if (unit.putAttachment(Attachments.DEPLOYMENT_UNIT_PHASE_BUILDER, new SingletonDeploymentUnitPhaseBuilder(support, policy)) == null) { SingletonLogger.ROOT_LOGGER.singletonDeploymentDetected(policy); ServiceController<?> controller = context.getServiceRegistry().getRequiredService(unit.getServiceName()); controller.addListener(this); controller.setMode(Mode.NEVER); } } } }
@Override public void deploy(DeploymentPhaseContext context) throws DeploymentUnitProcessingException { AuthenticationContext authenticationContext = context.getAttachment(AUTHENTICATION_CONTEXT_KEY); if (authenticationContext != null) { AuthenticationContext.getContextManager().setClassLoaderDefault( context.getDeploymentUnit().getAttachment(MODULE).getClassLoader(), authenticationContext); } }
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(DeploymentPhaseContext context) throws DeploymentUnitProcessingException { DeploymentUnit unit = context.getDeploymentUnit(); if (unit.getParent() == null) { SingletonPolicy policy = context.getAttachment(POLICY_KEY); if (policy != null) { CapabilityServiceSupport support = unit.getAttachment(Attachments.CAPABILITY_SERVICE_SUPPORT); // Ideally, we would just install the next phase using the singleton policy, however deployment unit phases do not currently support restarts // Restart the deployment using the attached phase builder, but only if a builder was not already attached if (unit.putAttachment(Attachments.DEPLOYMENT_UNIT_PHASE_BUILDER, new SingletonDeploymentUnitPhaseBuilder(support, policy)) == null) { SingletonLogger.ROOT_LOGGER.singletonDeploymentDetected(policy); ServiceController<?> controller = context.getServiceRegistry().getRequiredService(unit.getServiceName()); controller.addListener(this); controller.setMode(Mode.NEVER); } } } }
phaseServiceBuilder.addDependency(context.getController().getName()); final List<ServiceName> nextPhaseDeps = processorContext.getAttachment(Attachments.NEXT_PHASE_DEPS); if (nextPhaseDeps != null) { phaseServiceBuilder.addDependencies(nextPhaseDeps); final List<AttachableDependency> nextPhaseAttachableDeps = processorContext.getAttachment(Attachments.NEXT_PHASE_ATTACHABLE_DEPS); if (nextPhaseAttachableDeps != null) { for (AttachableDependency attachableDep : nextPhaseAttachableDeps) {
phaseServiceBuilder.requires(context.getController().getName()); final List<ServiceName> nextPhaseDeps = processorContext.getAttachment(Attachments.NEXT_PHASE_DEPS); if (nextPhaseDeps != null) { for (final ServiceName nextPhaseDep : nextPhaseDeps) { final List<AttachableDependency> nextPhaseAttachableDeps = processorContext.getAttachment(Attachments.NEXT_PHASE_ATTACHABLE_DEPS); if (nextPhaseAttachableDeps != null) { for (AttachableDependency attachableDep : nextPhaseAttachableDeps) {
phaseServiceBuilder.requires(context.getController().getName()); final List<ServiceName> nextPhaseDeps = processorContext.getAttachment(Attachments.NEXT_PHASE_DEPS); if (nextPhaseDeps != null) { for (final ServiceName nextPhaseDep : nextPhaseDeps) { final List<AttachableDependency> nextPhaseAttachableDeps = processorContext.getAttachment(Attachments.NEXT_PHASE_ATTACHABLE_DEPS); if (nextPhaseAttachableDeps != null) { for (AttachableDependency attachableDep : nextPhaseAttachableDeps) {
phaseServiceBuilder.addDependency(context.getController().getName()); final List<ServiceName> nextPhaseDeps = processorContext.getAttachment(Attachments.NEXT_PHASE_DEPS); if (nextPhaseDeps != null) { phaseServiceBuilder.addDependencies(nextPhaseDeps); final List<AttachableDependency> nextPhaseAttachableDeps = processorContext.getAttachment(Attachments.NEXT_PHASE_ATTACHABLE_DEPS); if (nextPhaseAttachableDeps != null) { for (AttachableDependency attachableDep : nextPhaseAttachableDeps) {