示例#1
0
	  public override void performOperationStep(DeploymentOperation operationContext)
	  {

//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final org.camunda.bpm.application.AbstractProcessApplication processApplication = operationContext.getAttachment(PROCESS_APPLICATION);
		AbstractProcessApplication processApplication = operationContext.getAttachment(PROCESS_APPLICATION);
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final java.util.Map<java.net.URL, org.camunda.bpm.application.impl.metadata.spi.ProcessesXml> processesXmls = operationContext.getAttachment(PROCESSES_XML_RESOURCES);
		IDictionary<URL, ProcessesXml> processesXmls = operationContext.getAttachment(PROCESSES_XML_RESOURCES);
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final java.util.Map<String, org.camunda.bpm.container.impl.deployment.util.DeployedProcessArchive> processArchiveDeploymentMap = operationContext.getAttachment(PROCESS_ARCHIVE_DEPLOYMENT_MAP);
		IDictionary<string, DeployedProcessArchive> processArchiveDeploymentMap = operationContext.getAttachment(PROCESS_ARCHIVE_DEPLOYMENT_MAP);
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final org.camunda.bpm.container.impl.spi.PlatformServiceContainer serviceContainer = operationContext.getServiceContainer();
		PlatformServiceContainer serviceContainer = operationContext.ServiceContainer;

		ProcessApplicationInfoImpl processApplicationInfo = createProcessApplicationInfo(processApplication, processArchiveDeploymentMap);

		// create service
		JmxManagedProcessApplication mbean = new JmxManagedProcessApplication(processApplicationInfo, processApplication.Reference);
		mbean.ProcessesXmls = new List<ProcessesXml>(processesXmls.Values);
		mbean.DeploymentMap = processArchiveDeploymentMap;

		// start service
		serviceContainer.startService(ServiceTypes.PROCESS_APPLICATION, processApplication.Name, mbean);

		notifyBpmPlatformPlugins(serviceContainer, processApplication);
	  }
示例#2
0
        public override void performOperationStep(DeploymentOperation operationContext)
        {
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final org.camunda.bpm.container.impl.spi.PlatformServiceContainer serviceContainer = operationContext.getServiceContainer();
            PlatformServiceContainer serviceContainer = operationContext.ServiceContainer;

            JobExecutorXml jobExecutorXml = getJobExecutorXml(operationContext);

            int  queueSize     = getQueueSize(jobExecutorXml);
            int  corePoolSize  = getCorePoolSize(jobExecutorXml);
            int  maxPoolSize   = getMaxPoolSize(jobExecutorXml);
            long keepAliveTime = getKeepAliveTime(jobExecutorXml);

            // initialize Queue & Executor services
            BlockingQueue <ThreadStart> threadPoolQueue = new ArrayBlockingQueue <ThreadStart>(queueSize);

            ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(corePoolSize, maxPoolSize, keepAliveTime, TimeUnit.MILLISECONDS, threadPoolQueue);

            threadPoolExecutor.RejectedExecutionHandler = new ThreadPoolExecutor.AbortPolicy();

            // construct the service for the thread pool
            JmxManagedThreadPool managedThreadPool = new JmxManagedThreadPool(threadPoolQueue, threadPoolExecutor);

            // install the service into the container
            serviceContainer.startService(ServiceTypes.BPM_PLATFORM, RuntimeContainerDelegateImpl.SERVICE_NAME_EXECUTOR, managedThreadPool);
        }
示例#3
0
        public override void performOperationStep(DeploymentOperation operationContext)
        {
            BpmPlatformXml bpmPlatformXml = operationContext.getAttachment(Attachments.BPM_PLATFORM_XML);

            checkConfiguration(bpmPlatformXml.JobExecutor);

//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final org.camunda.bpm.container.impl.spi.PlatformServiceContainer serviceContainer = operationContext.getServiceContainer();
            PlatformServiceContainer serviceContainer = operationContext.ServiceContainer;

            serviceContainer.startService(ServiceTypes.BPM_PLATFORM, RuntimeContainerDelegateImpl.SERVICE_NAME_EXECUTOR, new JcaExecutorServiceDelegate(executorService));
        }
示例#4
0
        public override void performOperationStep(DeploymentOperation operationContext)
        {
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final org.camunda.bpm.container.impl.spi.PlatformServiceContainer serviceContainer = operationContext.getServiceContainer();
            PlatformServiceContainer serviceContainer = operationContext.ServiceContainer;
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final org.camunda.bpm.application.AbstractProcessApplication processApplication = operationContext.getAttachment(PROCESS_APPLICATION);
            AbstractProcessApplication processApplication = operationContext.getAttachment(PROCESS_APPLICATION);

            ClassLoader configurationClassloader = null;

            if (processApplication != null)
            {
                configurationClassloader = processApplication.ProcessApplicationClassloader;
            }
            else
            {
                configurationClassloader = typeof(ProcessEngineConfiguration).ClassLoader;
            }

            string configurationClassName = jobAcquisitionXml.JobExecutorClassName;

            if (string.ReferenceEquals(configurationClassName, null) || configurationClassName.Length == 0)
            {
//JAVA TO C# CONVERTER WARNING: The .NET Type.FullName property will not always yield results identical to the Java Class.getName method:
                configurationClassName = typeof(RuntimeContainerJobExecutor).FullName;
            }

            // create & instantiate the job executor class
            Type        jobExecutorClass = loadJobExecutorClass(configurationClassloader, configurationClassName);
            JobExecutor jobExecutor      = instantiateJobExecutor(jobExecutorClass);

            // apply properties
            IDictionary <string, string> properties = jobAcquisitionXml.Properties;

            PropertyHelper.applyProperties(jobExecutor, properties);

            // construct service for job executor
            JmxManagedJobExecutor jmxManagedJobExecutor = new JmxManagedJobExecutor(jobExecutor);

            // deploy the job executor service into the container
            serviceContainer.startService(ServiceTypes.JOB_EXECUTOR, jobAcquisitionXml.Name, jmxManagedJobExecutor);
        }
示例#5
0
        public override void performOperationStep(DeploymentOperation operationContext)
        {
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final org.camunda.bpm.container.impl.spi.PlatformServiceContainer serviceContainer = operationContext.getServiceContainer();
            PlatformServiceContainer serviceContainer = operationContext.ServiceContainer;
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final org.camunda.bpm.application.AbstractProcessApplication processApplication = operationContext.getAttachment(PROCESS_APPLICATION);
            AbstractProcessApplication processApplication = operationContext.getAttachment(PROCESS_APPLICATION);

            ClassLoader classLoader = null;

            if (processApplication != null)
            {
                classLoader = processApplication.ProcessApplicationClassloader;
            }

            string configurationClassName = processEngineXml.ConfigurationClass;

            if (string.ReferenceEquals(configurationClassName, null) || configurationClassName.Length == 0)
            {
//JAVA TO C# CONVERTER WARNING: The .NET Type.FullName property will not always yield results identical to the Java Class.getName method:
                configurationClassName = typeof(StandaloneProcessEngineConfiguration).FullName;
            }

            // create & instantiate configuration class
            Type configurationClass = loadClass(configurationClassName, classLoader, typeof(ProcessEngineConfigurationImpl));
            ProcessEngineConfigurationImpl configuration = createInstance(configurationClass);

            // set UUid generator
            // TODO: move this to configuration and use as default?
            ProcessEngineConfigurationImpl configurationImpl = configuration;

            configurationImpl.IdGenerator = new StrongUuidGenerator();

            // set configuration values
            string name = processEngineXml.Name;

            configuration.ProcessEngineName = name;

            string datasourceJndiName = processEngineXml.Datasource;

            configuration.DataSourceJndiName = datasourceJndiName;

            // apply properties
            IDictionary <string, string> properties = processEngineXml.Properties;

            setJobExecutorActivate(configuration, properties);
            PropertyHelper.applyProperties(configuration, properties);

            // instantiate plugins:
            configurePlugins(configuration, processEngineXml, classLoader);

            if (!string.ReferenceEquals(processEngineXml.JobAcquisitionName, null) && processEngineXml.JobAcquisitionName.Length > 0)
            {
                JobExecutor jobExecutor = getJobExecutorService(serviceContainer);
                ensureNotNull("Cannot find referenced job executor with name '" + processEngineXml.JobAcquisitionName + "'", "jobExecutor", jobExecutor);

                // set JobExecutor on process engine
                configurationImpl.JobExecutor = jobExecutor;
            }

            // start the process engine inside the container.
            JmxManagedProcessEngine managedProcessEngineService = createProcessEngineControllerInstance(configuration);

            serviceContainer.startService(ServiceTypes.PROCESS_ENGINE, configuration.ProcessEngineName, managedProcessEngineService);
        }