예제 #1
0
//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET:
//ORIGINAL LINE: protected org.camunda.bpm.application.impl.ProcessApplicationInfoImpl createProcessApplicationInfo(final org.camunda.bpm.application.AbstractProcessApplication processApplication, final java.util.Map<String, org.camunda.bpm.container.impl.deployment.util.DeployedProcessArchive> processArchiveDeploymentMap)
	  protected internal virtual ProcessApplicationInfoImpl createProcessApplicationInfo(AbstractProcessApplication processApplication, IDictionary<string, DeployedProcessArchive> processArchiveDeploymentMap)
	  {
		// populate process application info
		ProcessApplicationInfoImpl processApplicationInfo = new ProcessApplicationInfoImpl();

		processApplicationInfo.Name = processApplication.Name;
		processApplicationInfo.Properties = processApplication.Properties;

		// create deployment infos
		IList<ProcessApplicationDeploymentInfo> deploymentInfoList = new List<ProcessApplicationDeploymentInfo>();
		if (processArchiveDeploymentMap != null)
		{
		  foreach (KeyValuePair<string, DeployedProcessArchive> deployment in processArchiveDeploymentMap.SetOfKeyValuePairs())
		  {

//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final org.camunda.bpm.container.impl.deployment.util.DeployedProcessArchive deployedProcessArchive = deployment.getValue();
			DeployedProcessArchive deployedProcessArchive = deployment.Value;
			foreach (string deploymentId in deployedProcessArchive.AllDeploymentIds)
			{
			  ProcessApplicationDeploymentInfoImpl deploymentInfo = new ProcessApplicationDeploymentInfoImpl();
			  deploymentInfo.DeploymentId = deploymentId;
			  deploymentInfo.ProcessEngineName = deployedProcessArchive.ProcessEngineName;
			  deploymentInfoList.Add(deploymentInfo);
			}

		  }
		}

		processApplicationInfo.DeploymentInfo = deploymentInfoList;

		return processApplicationInfo;
	  }
예제 #2
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();
                }
            }
        }