Пример #1
0
        public static void initializeServiceBuilder(ManagedProcessEngineMetadata processEngineConfiguration, MscManagedProcessEngineController service, ServiceBuilder <ProcessEngine> serviceBuilder, string jobExecutorName)
        {
            ContextNames.BindInfo datasourceBindInfo = ContextNames.bindInfoFor(processEngineConfiguration.DatasourceJndiName);
            serviceBuilder.addDependency(ServiceName.JBOSS.append("txn").append("TransactionManager"), typeof(TransactionManager), service.TransactionManagerInjector).addDependency(datasourceBindInfo.BinderServiceName, typeof(DataSourceReferenceFactoryService), service.DatasourceBinderServiceInjector).addDependency(ServiceNames.forMscRuntimeContainerDelegate(), typeof(MscRuntimeContainerDelegate), service.RuntimeContainerDelegateInjector).addDependency(ServiceNames.forMscRuntimeContainerJobExecutorService(jobExecutorName), typeof(MscRuntimeContainerJobExecutor), service.MscRuntimeContainerJobExecutorInjector).addDependency(ServiceNames.forMscExecutorService()).InitialMode = Mode.ACTIVE;

            if (processEngineConfiguration.Default)
            {
                serviceBuilder.addAliases(ServiceNames.forDefaultProcessEngine());
            }

            JBossCompatibilityExtension.addServerExecutorDependency(serviceBuilder, service.ExecutorInjector, false);
        }
Пример #2
0
        public const int PRIORITY = 0x0000;   // this can happen at the beginning of the phase

//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: @Override public void deploy(org.jboss.as.server.deployment.DeploymentPhaseContext phaseContext) throws org.jboss.as.server.deployment.DeploymentUnitProcessingException
        public override 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 (!ProcessApplicationAttachments.isProcessApplication(deploymentUnit))
            {
                return;
            }

//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final org.jboss.as.ee.component.ComponentDescription paComponent = getProcessApplicationComponent(deploymentUnit);
            ComponentDescription paComponent = getProcessApplicationComponent(deploymentUnit);
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final org.jboss.msc.service.ServiceName paViewServiceName = getProcessApplicationViewServiceName(paComponent);
            ServiceName paViewServiceName = getProcessApplicationViewServiceName(paComponent);

            Module module = deploymentUnit.getAttachment(Attachments.MODULE);
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final String moduleName = module.getIdentifier().toString();
            string moduleName = module.Identifier.ToString();
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final org.jboss.msc.service.ServiceName paStartServiceName = org.camunda.bpm.container.impl.jboss.service.ServiceNames.forProcessApplicationStartService(moduleName);
            ServiceName paStartServiceName = ServiceNames.forProcessApplicationStartService(moduleName);
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final org.jboss.msc.service.ServiceName paStopServiceName = org.camunda.bpm.container.impl.jboss.service.ServiceNames.forProcessApplicationStopService(moduleName);
            ServiceName paStopServiceName = ServiceNames.forProcessApplicationStopService(moduleName);
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final org.jboss.msc.service.ServiceName noViewStartService = org.camunda.bpm.container.impl.jboss.service.ServiceNames.forNoViewProcessApplicationStartService(moduleName);
            ServiceName noViewStartService = ServiceNames.forNoViewProcessApplicationStartService(moduleName);

            IList <ServiceName> deploymentServiceNames = new List <ServiceName>();

            ProcessApplicationStopService paStopService = new ProcessApplicationStopService();
            ServiceBuilder <ProcessApplicationStopService> stopServiceBuilder = phaseContext.ServiceTarget.addService(paStopServiceName, paStopService).addDependency(phaseContext.PhaseServiceName).addDependency(ServiceNames.forBpmPlatformPlugins(), typeof(BpmPlatformPlugins), paStopService.PlatformPluginsInjector).setInitialMode(ServiceController.Mode.ACTIVE);

            if (paViewServiceName != null)
            {
                stopServiceBuilder.addDependency(paViewServiceName, typeof(ComponentView), paStopService.PaComponentViewInjector);
            }
            else
            {
                stopServiceBuilder.addDependency(noViewStartService, typeof(ProcessApplicationInterface), paStopService.NoViewProcessApplication);
            }

            stopServiceBuilder.install();

            // deploy all process archives
            IList <ProcessesXmlWrapper> processesXmlWrappers = ProcessApplicationAttachments.getProcessesXmls(deploymentUnit);

            foreach (ProcessesXmlWrapper processesXmlWrapper in processesXmlWrappers)
            {
                ProcessesXml processesXml = processesXmlWrapper.ProcessesXml;
                foreach (ProcessArchiveXml processArchive in processesXml.ProcessArchives)
                {
                    ServiceName processEngineServiceName = getProcessEngineServiceName(processArchive);
                    IDictionary <string, sbyte[]> deploymentResources = getDeploymentResources(processArchive, deploymentUnit, processesXmlWrapper.ProcessesXmlFile);

                    // add the deployment service for each process archive we deploy.
                    ProcessApplicationDeploymentService deploymentService = new ProcessApplicationDeploymentService(deploymentResources, processArchive, module);
                    string processArachiveName = processArchive.Name;
                    if (string.ReferenceEquals(processArachiveName, null))
                    {
                        // use random name for deployment service if name is null (we cannot ask the process application yet since the component might not be up.
                        processArachiveName = System.Guid.randomUUID().ToString();
                    }
                    ServiceName deploymentServiceName = ServiceNames.forProcessApplicationDeploymentService(deploymentUnit.Name, processArachiveName);
                    ServiceBuilder <ProcessApplicationDeploymentService> serviceBuilder = phaseContext.ServiceTarget.addService(deploymentServiceName, deploymentService).addDependency(phaseContext.PhaseServiceName).addDependency(paStopServiceName).addDependency(processEngineServiceName, typeof(ProcessEngine), deploymentService.ProcessEngineInjector).setInitialMode(ServiceController.Mode.ACTIVE);

                    if (paViewServiceName != null)
                    {
                        // add a dependency on the component start service to make sure we are started after the pa-component (Singleton EJB) has started
                        serviceBuilder.addDependency(paComponent.StartServiceName);
                        serviceBuilder.addDependency(paViewServiceName, typeof(ComponentView), deploymentService.PaComponentViewInjector);
                    }
                    else
                    {
                        serviceBuilder.addDependency(noViewStartService, typeof(ProcessApplicationInterface), deploymentService.NoViewProcessApplication);
                    }

                    JBossCompatibilityExtension.addServerExecutorDependency(serviceBuilder, deploymentService.ExecutorInjector, false);

                    serviceBuilder.install();

                    deploymentServiceNames.Add(deploymentServiceName);
                }
            }

            AnnotationInstance postDeploy  = ProcessApplicationAttachments.getPostDeployDescription(deploymentUnit);
            AnnotationInstance preUndeploy = ProcessApplicationAttachments.getPreUndeployDescription(deploymentUnit);

            // register the managed process application start service
            ProcessApplicationStartService paStartService = new ProcessApplicationStartService(deploymentServiceNames, postDeploy, preUndeploy, module);
            ServiceBuilder <ProcessApplicationStartService> serviceBuilder = phaseContext.ServiceTarget.addService(paStartServiceName, paStartService).addDependency(phaseContext.PhaseServiceName).addDependency(ServiceNames.forDefaultProcessEngine(), typeof(ProcessEngine), paStartService.DefaultProcessEngineInjector).addDependency(ServiceNames.forBpmPlatformPlugins(), typeof(BpmPlatformPlugins), paStartService.PlatformPluginsInjector).addDependencies(deploymentServiceNames).setInitialMode(ServiceController.Mode.ACTIVE);

            if (paViewServiceName != null)
            {
                serviceBuilder.addDependency(paViewServiceName, typeof(ComponentView), paStartService.PaComponentViewInjector);
            }
            else
            {
                serviceBuilder.addDependency(noViewStartService, typeof(ProcessApplicationInterface), paStartService.NoViewProcessApplication);
            }

            serviceBuilder.install();
        }