Пример #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.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(Attachments.PROCESS_APPLICATION);
            AbstractProcessApplication processApplication = operationContext.getAttachment(Attachments.PROCESS_APPLICATION);
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final org.camunda.bpm.container.impl.jmx.services.JmxManagedProcessApplication deployedProcessApplication = serviceContainer.getService(org.camunda.bpm.container.impl.spi.ServiceTypes.PROCESS_APPLICATION, processApplication.getName());
            JmxManagedProcessApplication deployedProcessApplication = serviceContainer.getService(ServiceTypes.PROCESS_APPLICATION, processApplication.Name);

            ensureNotNull("Cannot find process application with name " + processApplication.Name, "deployedProcessApplication", deployedProcessApplication);

            IDictionary <string, DeployedProcessArchive> deploymentMap = deployedProcessApplication.ProcessArchiveDeploymentMap;

            if (deploymentMap != null)
            {
                IList <ProcessesXml> processesXmls = deployedProcessApplication.ProcessesXmls;
                foreach (ProcessesXml processesXml in processesXmls)
                {
                    foreach (ProcessArchiveXml parsedProcessArchive in processesXml.ProcessArchives)
                    {
                        DeployedProcessArchive deployedProcessArchive = deploymentMap[parsedProcessArchive.Name];
                        if (deployedProcessArchive != null)
                        {
                            operationContext.addStep(new UndeployProcessArchiveStep(deployedProcessApplication, parsedProcessArchive, deployedProcessArchive.ProcessEngineName));
                        }
                    }
                }
            }
        }
Пример #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)
        {
//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 java.util.Map<String, org.camunda.bpm.container.impl.deployment.util.DeployedProcessArchive> processArchiveDeploymentMap = deployedProcessApplication.getProcessArchiveDeploymentMap();
            IDictionary <string, DeployedProcessArchive> processArchiveDeploymentMap = deployedProcessApplication.ProcessArchiveDeploymentMap;
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final org.camunda.bpm.container.impl.deployment.util.DeployedProcessArchive deployedProcessArchive = processArchiveDeploymentMap.get(processArchive.getName());
            DeployedProcessArchive deployedProcessArchive = processArchiveDeploymentMap[processArchive.Name];
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final org.camunda.bpm.engine.ProcessEngine processEngine = serviceContainer.getServiceValue(org.camunda.bpm.container.impl.spi.ServiceTypes.PROCESS_ENGINE, processEngineName);
            ProcessEngine processEngine = serviceContainer.getServiceValue(ServiceTypes.PROCESS_ENGINE, processEngineName);

            // unregrister with the process engine.
            processEngine.ManagementService.unregisterProcessApplication(deployedProcessArchive.AllDeploymentIds, true);

            // delete the deployment if not disabled
            if (PropertyHelper.getBooleanProperty(processArchive.Properties, org.camunda.bpm.application.impl.metadata.spi.ProcessArchiveXml_Fields.PROP_IS_DELETE_UPON_UNDEPLOY, false))
            {
                if (processEngine != null)
                {
                    // always cascade & skip custom listeners
                    deleteDeployment(deployedProcessArchive.PrimaryDeploymentId, processEngine.RepositoryService);
                }
            }
        }
Пример #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.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);
	  }
Пример #5
0
        public override void cancelOperationStep(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(Attachments.PROCESS_APPLICATION);
            AbstractProcessApplication processApplication = operationContext.getAttachment(Attachments.PROCESS_APPLICATION);

            ProcessEngine processEngine = getProcessEngine(serviceContainer, processApplication.DefaultDeployToEngineName);

            // if a registration was performed, remove it.
            if (deployment != null && deployment.ProcessApplicationRegistration != null)
            {
                processEngine.ManagementService.unregisterProcessApplication(deployment.ProcessApplicationRegistration.DeploymentIds, true);
            }

            // delete deployment if we were able to create one AND if
            // isDeleteUponUndeploy is set.
            if (deployment != null && PropertyHelper.getBooleanProperty(processArchive.Properties, org.camunda.bpm.application.impl.metadata.spi.ProcessArchiveXml_Fields.PROP_IS_DELETE_UPON_UNDEPLOY, false))
            {
                if (processEngine != null)
                {
                    processEngine.RepositoryService.deleteDeployment(deployment.Id, true);
                }
            }
        }
Пример #6
0
//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET:
//ORIGINAL LINE: protected org.camunda.bpm.engine.impl.jobexecutor.JobExecutor getJobExecutorService(final org.camunda.bpm.container.impl.spi.PlatformServiceContainer serviceContainer)
        protected internal virtual JobExecutor getJobExecutorService(PlatformServiceContainer serviceContainer)
        {
            // lookup container managed job executor
            string      jobAcquisitionName = processEngineXml.JobAcquisitionName;
            JobExecutor jobExecutor        = serviceContainer.getServiceValue(ServiceTypes.JOB_EXECUTOR, jobAcquisitionName);

            return(jobExecutor);
        }
Пример #7
0
        public static ProcessEngine getDefaultProcessEngine(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;

            return(serviceContainer.getServiceValue(ServiceTypes.PROCESS_ENGINE, "default"));
        }
Пример #8
0
 /// <summary>
 /// Stops a process engine, failures are logged but no exceptions are thrown.
 ///
 /// </summary>
 private void stopProcessEngine(string serviceName, PlatformServiceContainer serviceContainer)
 {
     try
     {
         serviceContainer.stopService(serviceName);
     }
     catch (Exception e)
     {
         LOG.exceptionWhileStopping("Process Engine", serviceName, e);
     }
 }
Пример #9
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;
            ISet <string>            serviceNames     = serviceContainer.getServiceNames(ServiceTypes.PROCESS_ENGINE);

            foreach (string serviceName in serviceNames)
            {
                stopProcessEngine(serviceName, serviceContainer);
            }
        }
Пример #10
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;
            IList <JmxManagedProcessApplication> processApplicationsReferences = serviceContainer.getServiceValuesByType(ServiceTypes.PROCESS_APPLICATION);

            foreach (JmxManagedProcessApplication processApplication in processApplicationsReferences)
            {
                stopProcessApplication(processApplication.ProcessApplicationReference);
            }
        }
Пример #11
0
	  protected internal virtual void notifyBpmPlatformPlugins(PlatformServiceContainer serviceContainer, AbstractProcessApplication processApplication)
	  {
		JmxManagedBpmPlatformPlugins plugins = serviceContainer.getService(ServiceTypes.BPM_PLATFORM, RuntimeContainerDelegateImpl.SERVICE_NAME_PLATFORM_PLUGINS);

		if (plugins != null)
		{
		  foreach (BpmPlatformPlugin plugin in plugins.Value.Plugins)
		  {
			plugin.postProcessApplicationDeploy(processApplication);
		  }
		}
	  }
Пример #12
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));
        }
Пример #13
0
        public static ProcessApplicationInfo getProcessApplicationInfo(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(org.camunda.bpm.container.impl.deployment.Attachments.PROCESS_APPLICATION);
            AbstractProcessApplication processApplication = operationContext.getAttachment(Attachments.PROCESS_APPLICATION);

            JmxManagedProcessApplication managedPa = serviceContainer.getServiceValue(ServiceTypes.PROCESS_APPLICATION, processApplication.Name);

            return(managedPa.ProcessApplicationInfo);
        }
Пример #14
0
        protected internal virtual void stopProcessEngine(string processEngineName, 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;

            try
            {
                serviceContainer.stopService(ServiceTypes.PROCESS_ENGINE, processEngineName);
            }
            catch (Exception e)
            {
                LOG.exceptionWhileStopping("Process Engine", processEngineName, e);
            }
        }
Пример #15
0
//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET:
//ORIGINAL LINE: protected org.camunda.bpm.engine.ProcessEngine getProcessEngine(final org.camunda.bpm.container.impl.spi.PlatformServiceContainer serviceContainer, String defaultDeployToProcessEngineName)
        protected internal virtual ProcessEngine getProcessEngine(PlatformServiceContainer serviceContainer, string defaultDeployToProcessEngineName)
        {
            string processEngineName = processArchive.ProcessEngineName;

            if (!string.ReferenceEquals(processEngineName, null))
            {
                ProcessEngine processEngine = serviceContainer.getServiceValue(ServiceTypes.PROCESS_ENGINE, processEngineName);
                ensureNotNull("Cannot deploy process archive '" + processArchive.Name + "' to process engine '" + processEngineName + "' no such process engine exists", "processEngine", processEngine);
                return(processEngine);
            }
            else
            {
                ProcessEngine processEngine = serviceContainer.getServiceValue(ServiceTypes.PROCESS_ENGINE, defaultDeployToProcessEngineName);
                ensureNotNull("Cannot deploy process archive '" + processArchive.Name + "' to default process: no such process engine exists", "processEngine", processEngine);
                return(processEngine);
            }
        }
Пример #16
0
        public static IList <ProcessEngine> getProcessEngines(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.ProcessApplicationInfo processApplicationInfo = getProcessApplicationInfo(operationContext);
            ProcessApplicationInfo processApplicationInfo = getProcessApplicationInfo(operationContext);

            IList <ProcessEngine> processEngines = new List <ProcessEngine>();

            foreach (ProcessApplicationDeploymentInfo deploymentInfo in processApplicationInfo.DeploymentInfo)
            {
                string processEngineName = deploymentInfo.ProcessEngineName;
                processEngines.Add((ProcessEngine)serviceContainer.getServiceValue(ServiceTypes.PROCESS_ENGINE, processEngineName));
            }

            return(processEngines);
        }
Пример #17
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);
        }
Пример #18
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;

            ISet <string> jobExecutorServiceNames = serviceContainer.getServiceNames(ServiceTypes.JOB_EXECUTOR);

            foreach (string serviceName in jobExecutorServiceNames)
            {
                try
                {
                    serviceContainer.stopService(serviceName);
                }
                catch (Exception e)
                {
                    LOG.exceptionWhileStopping("Job Executor Service", serviceName, e);
                }
            }
        }
Пример #19
0
        public virtual void stop(PlatformServiceContainer mBeanServiceContainer)
        {
            // clear the queue
            threadPoolQueue.clear();

            // Ask the thread pool to finish and exit
            threadPoolExecutor.shutdown();

            // Waits for 1 minute to finish all currently executing jobs
            try
            {
                if (!threadPoolExecutor.awaitTermination(60L, TimeUnit.SECONDS))
                {
                    LOG.timeoutDuringShutdownOfThreadPool(60, TimeUnit.SECONDS);
                }
            }
            catch (InterruptedException e)
            {
                LOG.interruptedWhileShuttingDownThreadPool(e);
            }
        }
Пример #20
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(Attachments.PROCESS_APPLICATION);
            AbstractProcessApplication processApplication = operationContext.getAttachment(Attachments.PROCESS_APPLICATION);
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final org.camunda.bpm.container.impl.jmx.services.JmxManagedProcessApplication deployedProcessApplication = serviceContainer.getService(org.camunda.bpm.container.impl.spi.ServiceTypes.PROCESS_APPLICATION, processApplication.getName());
            JmxManagedProcessApplication deployedProcessApplication = serviceContainer.getService(ServiceTypes.PROCESS_APPLICATION, processApplication.Name);

            ensureNotNull("Cannot find process application with name " + processApplication.Name, "deployedProcessApplication", deployedProcessApplication);

            IList <ProcessesXml> processesXmls = deployedProcessApplication.ProcessesXmls;

            foreach (ProcessesXml processesXml in processesXmls)
            {
                stopProcessEngines(processesXml.ProcessEngines, operationContext);
            }
        }
Пример #21
0
        private void CreateWorkingContextHierarchy()
        {
            m_BusinessLogicApplicationContext = new WorkingContext(false,
                                                                   WorkingContextEnvironment.Application,
                                                                   AppId,
                                                                   "Project"
                                                                   );

            m_BusinessLogicApplicationContext.ConstructServiceEvent           += m_BusinessLogicApplicationContext_ConstructServiceEvent;
            m_BusinessLogicApplicationContext.ServiceLoadedEvent              += m_BusinessLogicApplicationContext_ServiceLoadedEvent;
            m_BusinessLogicApplicationContext.ServiceAddedEvent               += m_BusinessLogicApplicationContext_ServiceAddedEvent;
            m_BusinessLogicApplicationContext.WorkingContextChildCreatedEvent += M_BusinessLogicApplicationContext_WorkingContextChildCreatedEvent;

            m_BusinessLogicApplicationContext.AutoLoadDlcs();

            WorkingContextProxy      wcp = new WorkingContextProxy(m_BusinessLogicApplicationContext);
            PlatformServiceContainer psc = wcp.PlatformServiceContainer;

            m_ViewApplicationContext = new WorkingContext(true,
                                                          WorkingContextEnvironment.Application,
                                                          AppId,
                                                          "Project"
                                                          );
            m_ViewApplicationContext.SiblingInBusinessLogicContext = m_BusinessLogicApplicationContext;

            m_ViewApplicationContext.ConstructServiceEvent += M_ViewApplicationContext_ConstructServiceEvent;
            m_ViewApplicationContext.ServiceLoadedEvent    += M_ViewApplicationContext_ServiceLoadedEvent;
            m_ViewApplicationContext.ServiceAddedEvent     += M_ViewApplicationContext_ServiceAddedEvent;
            m_ViewApplicationContext.AutoLoadDlcs();



            PersistenceWorkingContext = new WorkingContext(m_ViewApplicationContext,
                                                           WorkingContextEnvironment.Persistence);

            PrimaryProjectUiWorkingContextManagerProxy = m_ViewApplicationContext.GetPrimaryProjectUiWorkingContextManagerProxy();
            PrimaryProjectManagerProxy =
                PrimaryProjectUiWorkingContextManagerProxy.PrimaryProjectManager;
        }
Пример #22
0
 public virtual void start(PlatformServiceContainer mBeanServiceContainer)
 {
     // nothing to do
 }
Пример #23
0
 public DeploymentOperationBuilder(PlatformServiceContainer container, string name)
 {
     this.container = container;
     this.name      = name;
 }
Пример #24
0
 public virtual void stop(PlatformServiceContainer container)
 {
     // this one has no lifecycle support
 }
Пример #25
0
 public DeploymentOperation(string name, PlatformServiceContainer container, IList <DeploymentOperationStep> steps)
 {
     this.name             = name;
     this.serviceContainer = container;
     this.steps            = steps;
 }
Пример #26
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(Attachments.PROCESS_APPLICATION);
            AbstractProcessApplication processApplication = operationContext.getAttachment(Attachments.PROCESS_APPLICATION);
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final ClassLoader processApplicationClassloader = processApplication.getProcessApplicationClassloader();
            ClassLoader processApplicationClassloader = processApplication.ProcessApplicationClassloader;

            ProcessEngine processEngine = getProcessEngine(serviceContainer, processApplication.DefaultDeployToEngineName);

            // start building deployment map
            IDictionary <string, sbyte[]> deploymentMap = new Dictionary <string, sbyte[]>();

            // add all processes listed in the processes.xml
            IList <string> listedProcessResources = processArchive.ProcessResourceNames;

            foreach (string processResource in listedProcessResources)
            {
                Stream resourceAsStream = null;
                try
                {
                    resourceAsStream = processApplicationClassloader.getResourceAsStream(processResource);
                    sbyte[] bytes = IoUtil.readInputStream(resourceAsStream, processResource);
                    deploymentMap[processResource] = bytes;
                }
                finally
                {
                    IoUtil.closeSilently(resourceAsStream);
                }
            }

            // scan for additional process definitions if not turned off
            if (PropertyHelper.getBooleanProperty(processArchive.Properties, org.camunda.bpm.application.impl.metadata.spi.ProcessArchiveXml_Fields.PROP_IS_SCAN_FOR_PROCESS_DEFINITIONS, true))
            {
                string   paResourceRoot             = processArchive.Properties[org.camunda.bpm.application.impl.metadata.spi.ProcessArchiveXml_Fields.PROP_RESOURCE_ROOT_PATH];
                string[] additionalResourceSuffixes = StringUtil.Split(processArchive.Properties[org.camunda.bpm.application.impl.metadata.spi.ProcessArchiveXml_Fields.PROP_ADDITIONAL_RESOURCE_SUFFIXES], org.camunda.bpm.application.impl.metadata.spi.ProcessArchiveXml_Fields.PROP_ADDITIONAL_RESOURCE_SUFFIXES_SEPARATOR);
//JAVA TO C# CONVERTER TODO TASK: There is no .NET Dictionary equivalent to the Java 'putAll' method:
                deploymentMap.putAll(findResources(processApplicationClassloader, paResourceRoot, additionalResourceSuffixes));
            }

            // perform process engine deployment
            RepositoryService repositoryService = processEngine.RepositoryService;
            ProcessApplicationDeploymentBuilder deploymentBuilder = repositoryService.createDeployment(processApplication.Reference);

            // set the name for the deployment
            string deploymentName = processArchive.Name;

            if (string.ReferenceEquals(deploymentName, null) || deploymentName.Length == 0)
            {
                deploymentName = processApplication.Name;
            }
            deploymentBuilder.name(deploymentName);

            // set the tenant id for the deployment
            string tenantId = processArchive.TenantId;

            if (!string.ReferenceEquals(tenantId, null) && tenantId.Length > 0)
            {
                deploymentBuilder.tenantId(tenantId);
            }

            // enable duplicate filtering
            deploymentBuilder.enableDuplicateFiltering(PropertyHelper.getBooleanProperty(processArchive.Properties, org.camunda.bpm.application.impl.metadata.spi.ProcessArchiveXml_Fields.PROP_IS_DEPLOY_CHANGED_ONLY, false));

            if (PropertyHelper.getBooleanProperty(processArchive.Properties, org.camunda.bpm.application.impl.metadata.spi.ProcessArchiveXml_Fields.PROP_IS_RESUME_PREVIOUS_VERSIONS, true))
            {
                enableResumingOfPreviousVersions(deploymentBuilder);
            }

            // add all resources obtained through the processes.xml and through scanning
            foreach (KeyValuePair <string, sbyte[]> deploymentResource in deploymentMap.SetOfKeyValuePairs())
            {
                deploymentBuilder.addInputStream(deploymentResource.Key, new MemoryStream(deploymentResource.Value));
            }

            // allow the process application to add additional resources to the deployment
            processApplication.createDeployment(processArchive.Name, deploymentBuilder);

            ICollection <string> deploymentResourceNames = deploymentBuilder.ResourceNames;

            if (deploymentResourceNames.Count > 0)
            {
                LOG.deploymentSummary(deploymentResourceNames, deploymentName);

                // perform the process engine deployment
                deployment = deploymentBuilder.deploy();

                // add attachment
                IDictionary <string, DeployedProcessArchive> processArchiveDeploymentMap = operationContext.getAttachment(Attachments.PROCESS_ARCHIVE_DEPLOYMENT_MAP);
                if (processArchiveDeploymentMap == null)
                {
                    processArchiveDeploymentMap = new Dictionary <string, DeployedProcessArchive>();
                    operationContext.addAttachment(Attachments.PROCESS_ARCHIVE_DEPLOYMENT_MAP, processArchiveDeploymentMap);
                }
                processArchiveDeploymentMap[processArchive.Name] = new DeployedProcessArchive(deployment);
            }
            else
            {
                LOG.notCreatingPaDeployment(processApplication.Name);
            }
        }
Пример #27
0
 public virtual void stop(PlatformServiceContainer mBeanServiceContainer)
 {
     // no callbacks or initialization in the plugins
 }
Пример #28
0
//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET:
//ORIGINAL LINE: protected org.camunda.bpm.engine.ProcessEngine getProcessEngine(final org.camunda.bpm.container.impl.spi.PlatformServiceContainer serviceContainer)
        protected internal virtual ProcessEngine getProcessEngine(PlatformServiceContainer serviceContainer)
        {
            return(getProcessEngine(serviceContainer, ProcessEngines.NAME_DEFAULT));
        }
Пример #29
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);
        }
Пример #30
0
 public virtual void stop(PlatformServiceContainer mBeanServiceContainer)
 {
 }