Esempio n. 1
0
//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET:
//ORIGINAL LINE: private void addSystemDependencies(org.jboss.modules.ModuleLoader moduleLoader, final org.jboss.as.server.deployment.module.ModuleSpecification moduleSpecification)
        private void addSystemDependencies(ModuleLoader moduleLoader, ModuleSpecification moduleSpecification)
        {
            addSystemDependency(moduleLoader, moduleSpecification, MODULE_IDENTIFYER_PROCESS_ENGINE);
            addSystemDependency(moduleLoader, moduleSpecification, MODULE_IDENTIFYER_XML_MODEL);
            addSystemDependency(moduleLoader, moduleSpecification, MODULE_IDENTIFYER_BPMN_MODEL);
            addSystemDependency(moduleLoader, moduleSpecification, MODULE_IDENTIFYER_CMMN_MODEL);
            addSystemDependency(moduleLoader, moduleSpecification, MODULE_IDENTIFYER_DMN_MODEL);
            addSystemDependency(moduleLoader, moduleSpecification, MODULE_IDENTIFYER_SPIN);
            addSystemDependency(moduleLoader, moduleSpecification, MODULE_IDENTIFYER_CONNECT);
            addSystemDependency(moduleLoader, moduleSpecification, MODULE_IDENTIFYER_ENGINE_DMN);
        }
Esempio n. 2
0
//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();
        }
Esempio n. 3
0
//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));
        }