//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET: //ORIGINAL LINE: public void deploy(org.jboss.as.server.deployment.DeploymentPhaseContext phaseContext) throws org.jboss.as.server.deployment.DeploymentUnitProcessingException public virtual void deploy(DeploymentPhaseContext phaseContext) { //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final org.jboss.as.server.deployment.DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); DeploymentUnit deploymentUnit = phaseContext.DeploymentUnit; if (deploymentUnit.Parent == null) { //The deployment unit has no parent so it is a simple war or an ear. ModuleLoader moduleLoader = Module.BootModuleLoader; //If it is a simpleWar and marked with process application we have to add the dependency bool isProcessApplicationWarOrEar = ProcessApplicationAttachments.isProcessApplication(deploymentUnit); AttachmentList <DeploymentUnit> subdeployments = deploymentUnit.getAttachment(Attachments.SUB_DEPLOYMENTS); //Is the list of sub deployments empty the deployment unit is a war file. //In cases of war files we have nothing todo. if (subdeployments != null) { //The deployment unit contains sub deployments which means the deployment unit is an ear. //We have to check whether sub deployments are process applications or not. bool subDeploymentIsProcessApplication = false; foreach (DeploymentUnit subDeploymentUnit in subdeployments) { if (ProcessApplicationAttachments.isProcessApplication(subDeploymentUnit)) { subDeploymentIsProcessApplication = true; break; } } //If one sub deployment is a process application then we add to all the dependency //Also we have to add the dependency to the current deployment unit which is an ear if (subDeploymentIsProcessApplication) { foreach (DeploymentUnit subDeploymentUnit in subdeployments) { //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final org.jboss.as.server.deployment.module.ModuleSpecification moduleSpecification = subDeploymentUnit.getAttachment(org.jboss.as.server.deployment.Attachments.MODULE_SPECIFICATION); ModuleSpecification moduleSpecification = subDeploymentUnit.getAttachment(Attachments.MODULE_SPECIFICATION); addSystemDependencies(moduleLoader, moduleSpecification); } //An ear is not marked as process application but also needs the dependency isProcessApplicationWarOrEar = true; } } if (isProcessApplicationWarOrEar) { //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final org.jboss.as.server.deployment.module.ModuleSpecification moduleSpecification = deploymentUnit.getAttachment(org.jboss.as.server.deployment.Attachments.MODULE_SPECIFICATION); ModuleSpecification moduleSpecification = deploymentUnit.getAttachment(Attachments.MODULE_SPECIFICATION); addSystemDependencies(moduleLoader, moduleSpecification); } } // install the pa-module service ModuleIdentifier identifyer = deploymentUnit.getAttachment(Attachments.MODULE_IDENTIFIER); string moduleName = identifyer.ToString(); ProcessApplicationModuleService processApplicationModuleService = new ProcessApplicationModuleService(); ServiceName serviceName = ServiceNames.forProcessApplicationModuleService(moduleName); phaseContext.ServiceTarget.addService(serviceName, processApplicationModuleService).addDependency(phaseContext.PhaseServiceName).setInitialMode(Mode.ACTIVE).install(); }
//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET: //ORIGINAL LINE: private void addSystemDependency(org.jboss.modules.ModuleLoader moduleLoader, final org.jboss.as.server.deployment.module.ModuleSpecification moduleSpecification, org.jboss.modules.ModuleIdentifier dependency) private void addSystemDependency(ModuleLoader moduleLoader, ModuleSpecification moduleSpecification, ModuleIdentifier dependency) { moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, dependency, false, false, false, false)); }