예제 #1
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();
                }
            }
        }
예제 #2
0
 public OperationAnonymousInnerClass(ProcessApplicationDeploymentService outerInstance, ProcessApplicationDeploymentBuilder deploymentBuilder)
 {
     this.outerInstance     = outerInstance;
     this.deploymentBuilder = deploymentBuilder;
 }