Beispiel #1
0
        protected internal virtual void startTrackingServices()
        {
            processEngineServiceTracker = new ServiceTracker <ProcessEngine>(ServiceNames.forManagedProcessEngines(), processEngines);
            serviceContainer.addListener(processEngineServiceTracker);

            processApplicationServiceTracker = new ServiceTracker <MscManagedProcessApplication>(ServiceNames.forManagedProcessApplications(), processApplications);
            serviceContainer.addListener(processApplicationServiceTracker);
        }
Beispiel #2
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);
        }
Beispiel #3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @SuppressWarnings("unchecked") protected void deployServletProcessApplication(org.camunda.bpm.application.impl.ServletProcessApplication processApplication)
        protected internal virtual void deployServletProcessApplication(ServletProcessApplication processApplication)
        {
            ClassLoader contextClassloader = ClassLoaderUtil.ContextClassloader;
            string      moduleName         = ((ModuleClassLoader)contextClassloader).Module.Identifier.ToString();

            ServiceName serviceName     = ServiceNames.forNoViewProcessApplicationStartService(moduleName);
            ServiceName paModuleService = ServiceNames.forProcessApplicationModuleService(moduleName);

            if (serviceContainer.getService(serviceName) == null)
            {
                ServiceController <ServiceTarget> requiredService = (ServiceController <ServiceTarget>)serviceContainer.getRequiredService(paModuleService);

                NoViewProcessApplicationStartService service = new NoViewProcessApplicationStartService(processApplication.Reference);
                requiredService.Value.addService(serviceName, service).setInitialMode(ServiceController.Mode.ACTIVE).install();
            }
        }
Beispiel #4
0
        // RuntimeContainerDelegate implementation /////////////////////////////

        public virtual void registerProcessEngine(ProcessEngine processEngine)
        {
            if (processEngine == null)
            {
                throw new ProcessEngineException("Cannot register process engine with Msc Runtime Container: process engine is 'null'");
            }

            ServiceName serviceName = ServiceNames.forManagedProcessEngine(processEngine.Name);

            if (serviceContainer.getService(serviceName) == null)
            {
                MscManagedProcessEngine processEngineRegistration = new MscManagedProcessEngine(processEngine);

                // install the service asynchronously.
                childTarget.addService(serviceName, processEngineRegistration).setInitialMode(ServiceController.Mode.ACTIVE).addDependency(ServiceNames.forMscRuntimeContainerDelegate(), typeof(MscRuntimeContainerDelegate), processEngineRegistration.RuntimeContainerDelegateInjector).install();
            }
        }
Beispiel #5
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @SuppressWarnings("unchecked") public void unregisterProcessEngine(org.camunda.bpm.engine.ProcessEngine processEngine)
        public virtual void unregisterProcessEngine(ProcessEngine processEngine)
        {
            if (processEngine == null)
            {
                throw new ProcessEngineException("Cannot unregister process engine with Msc Runtime Container: process engine is 'null'");
            }

            ServiceName serviceName = ServiceNames.forManagedProcessEngine(processEngine.Name);

            // remove the service asynchronously
            ServiceController <ProcessEngine> service = (ServiceController <ProcessEngine>)serviceContainer.getService(serviceName);

            if (service != null && service.Service is MscManagedProcessEngine)
            {
                service.Mode = ServiceController.Mode.REMOVE;
            }
        }
Beispiel #6
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @SuppressWarnings("unchecked") protected MscManagedProcessApplication getManagedProcessApplication(String name)
        protected internal virtual MscManagedProcessApplication getManagedProcessApplication(string name)
        {
            ServiceController <MscManagedProcessApplication> serviceController = (ServiceController <MscManagedProcessApplication>)serviceContainer.getService(ServiceNames.forManagedProcessApplication(name));

            if (serviceController != null)
            {
                return(serviceController.Value);
            }
            else
            {
                return(null);
            }
        }
Beispiel #7
0
 public virtual ProcessEngine getProcessEngine(string name)
 {
     return(getProcessEngineService(ServiceNames.forManagedProcessEngine(name)));
 }
Beispiel #8
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: @Override public void start(org.jboss.msc.service.StartContext context) throws org.jboss.msc.service.StartException
        public override void start(StartContext context)
        {
            ManagedReference reference = null;

            try
            {
                // get the process application component
                ProcessApplicationInterface processApplication = null;
                ComponentView componentView = paComponentViewInjector.OptionalValue;
                if (componentView != null)
                {
                    reference          = componentView.createInstance();
                    processApplication = (ProcessApplicationInterface)reference.Instance;
                }
                else
                {
                    processApplication = noViewProcessApplication.Value;
                }

                // create & populate the process application info object
                processApplicationInfo            = new ProcessApplicationInfoImpl();
                processApplicationInfo.Name       = processApplication.Name;
                processApplicationInfo.Properties = processApplication.Properties;

                referencedProcessEngines = new HashSet <ProcessEngine>();
                IList <ProcessApplicationDeploymentInfo> deploymentInfos = new List <ProcessApplicationDeploymentInfo>();

                foreach (ServiceName deploymentServiceName in deploymentServiceNames)
                {
                    ProcessApplicationDeploymentService value = getDeploymentService(context, deploymentServiceName);
                    referencedProcessEngines.Add(value.ProcessEngineInjector.Value);

                    ProcessApplicationDeployment deployment = value.Deployment;
                    if (deployment != null)
                    {
                        foreach (string deploymentId in deployment.ProcessApplicationRegistration.DeploymentIds)
                        {
                            ProcessApplicationDeploymentInfoImpl deploymentInfo = new ProcessApplicationDeploymentInfoImpl();
                            deploymentInfo.DeploymentId      = deploymentId;
                            deploymentInfo.ProcessEngineName = value.ProcessEngineName;
                            deploymentInfos.Add(deploymentInfo);
                        }
                    }
                }
                processApplicationInfo.DeploymentInfo = deploymentInfos;

                notifyBpmPlatformPlugins(platformPluginsInjector.Value, processApplication);

                if (postDeployDescription != null)
                {
                    invokePostDeploy(processApplication);
                }

                // install the ManagedProcessApplication Service as a child to this service
                // if this service stops (at undeployment) the ManagedProcessApplication service is removed as well.
                ServiceName serviceName = ServiceNames.forManagedProcessApplication(processApplicationInfo.Name);
                MscManagedProcessApplication managedProcessApplication = new MscManagedProcessApplication(processApplicationInfo, processApplication.Reference);
                context.ChildTarget.addService(serviceName, managedProcessApplication).install();
            }
            catch (StartException e)
            {
                throw e;
            }
            catch (Exception e)
            {
                throw new StartException(e);
            }
            finally
            {
                if (reference != null)
                {
                    reference.release();
                }
            }
        }